Lines Matching refs:hi
218 static void hook_int_free(hook_int_t *hi, netstackid_t);
232 hook_int_t *hi);
818 hook_int_t *hi; in hook_run() local
834 TAILQ_FOREACH(hi, &hei->hei_head, hi_entry) { in hook_run()
835 ASSERT(hi->hi_hook.h_func != NULL); in hook_run()
839 hook_int_t *, hi); in hook_run()
840 rval = (*hi->hi_hook.h_func)(token, info, hi->hi_hook.h_arg); in hook_run()
844 hook_int_t *, hi, in hook_run()
846 hi->hi_kstats.hook_hits.value.ui64++; in hook_run()
858 hook_int_t *, hi); in hook_run()
1878 hook_int_t *hi, *new; in hook_register() local
1918 hi = hook_find(hei, h); in hook_register()
1919 if (hi != NULL) { in hook_register()
1975 hook_int_t *hi; in hook_insert() local
1990 TAILQ_FOREACH(hi, head, hi_entry) { in hook_insert()
1991 hih = &hi->hi_hook; in hook_insert()
1995 TAILQ_INSERT_BEFORE(hi, new, hi_entry); in hook_insert()
2001 before = hi; in hook_insert()
2012 hi = TAILQ_FIRST(head); in hook_insert()
2013 if ((hi != NULL) && (hi->hi_hook.h_hint == HH_FIRST)) in hook_insert()
2019 hi = TAILQ_LAST(head, hook_int_head); in hook_insert()
2020 if ((hi != NULL) && (hi->hi_hook.h_hint == HH_LAST)) in hook_insert()
2026 hi = hook_find_byname(head, (char *)new->hi_hook.h_hintvalue); in hook_insert()
2027 if (hi == NULL) in hook_insert()
2030 if (hi->hi_hook.h_hint == HH_FIRST) in hook_insert()
2033 TAILQ_INSERT_BEFORE(hi, new, hi_entry); in hook_insert()
2037 hi = hook_find_byname(head, (char *)new->hi_hook.h_hintvalue); in hook_insert()
2038 if (hi == NULL) in hook_insert()
2041 if (hi->hi_hook.h_hint == HH_LAST) in hook_insert()
2044 TAILQ_INSERT_AFTER(head, hi, new, hi_entry); in hook_insert()
2068 hook_int_t *hi; in hook_insert_plain() local
2070 hi = TAILQ_FIRST(head); in hook_insert_plain()
2071 if (hi != NULL) { in hook_insert_plain()
2072 if (hi->hi_hook.h_hint == HH_LAST) { in hook_insert_plain()
2073 TAILQ_INSERT_BEFORE(hi, new, hi_entry); in hook_insert_plain()
2101 hook_int_t *hi; in hook_insert_afterbefore() local
2114 TAILQ_FOREACH(hi, head, hi_entry) { in hook_insert_afterbefore()
2115 h = &hi->hi_hook; in hook_insert_afterbefore()
2125 TAILQ_INSERT_AFTER(head, hi, new, hi_entry); in hook_insert_afterbefore()
2131 TAILQ_INSERT_BEFORE(hi, new, hi_entry); in hook_insert_afterbefore()
2139 TAILQ_INSERT_AFTER(head, hi, new, hi_entry); in hook_insert_afterbefore()
2145 TAILQ_INSERT_BEFORE(hi, new, hi_entry); in hook_insert_afterbefore()
2170 hook_int_t *hi; in hook_unregister() local
2187 hi = hook_find(hei, h); in hook_unregister()
2188 if (hi == NULL) { in hook_unregister()
2202 TAILQ_REMOVE(&hei->hei_head, hi, hi_entry); in hook_unregister()
2227 hook_int_free(hi, hfi->hfi_stack->hks_netstackid); in hook_unregister()
2247 hook_int_t *hi; in hook_find_byname() local
2249 TAILQ_FOREACH(hi, head, hi_entry) { in hook_find_byname()
2250 if (strcmp(hi->hi_hook.h_name, name) == 0) in hook_find_byname()
2251 return (hi); in hook_find_byname()
2343 hook_init_kstats(hook_family_int_t *hfi, hook_event_int_t *hei, hook_int_t *hi) in hook_init_kstats() argument
2361 hi->hi_ksname = (char *)kmem_zalloc(kslen, KM_SLEEP); in hook_init_kstats()
2362 (void) snprintf(hi->hi_ksname, kslen, "%s/%s", in hook_init_kstats()
2366 hi->hi_kstatp = kstat_create_netstack(hi->hi_ksname, 0, in hook_init_kstats()
2367 hi->hi_hook.h_name, "hook", KSTAT_TYPE_NAMED, in hook_init_kstats()
2368 sizeof (hi->hi_kstats) / sizeof (kstat_named_t), in hook_init_kstats()
2372 bcopy(&template, &hi->hi_kstats, sizeof (template)); in hook_init_kstats()
2373 hi->hi_kstats.hook_version.value.i32 = hi->hi_hook.h_version; in hook_init_kstats()
2374 hi->hi_kstats.hook_flags.value.ui32 = hi->hi_hook.h_flags; in hook_init_kstats()
2375 hi->hi_kstats.hook_hint.value.i32 = hi->hi_hook.h_hint; in hook_init_kstats()
2376 hi->hi_kstats.hook_position.value.i32 = 0; in hook_init_kstats()
2377 hi->hi_kstats.hook_hits.value.ui64 = 0; in hook_init_kstats()
2379 switch (hi->hi_hook.h_hint) { in hook_init_kstats()
2382 kstat_named_setstr(&(hi->hi_kstats.hook_hintvalue), in hook_init_kstats()
2383 (const char *)hi->hi_hook.h_hintvalue); in hook_init_kstats()
2386 kstat_named_setstr(&(hi->hi_kstats.hook_hintvalue), in hook_init_kstats()
2391 if (hi->hi_kstatp != NULL) { in hook_init_kstats()
2392 hi->hi_kstatp->ks_data = (void *)&hi->hi_kstats; in hook_init_kstats()
2393 hi->hi_kstatp->ks_private = in hook_init_kstats()
2395 hi->hi_kstatp->ks_data_size += in hook_init_kstats()
2396 KSTAT_NAMED_STR_BUFLEN(&(hi->hi_kstats.hook_hintvalue)) + 1; in hook_init_kstats()
2398 kstat_install(hi->hi_kstatp); in hook_init_kstats()
2415 hook_int_free(hook_int_t *hi, netstackid_t stackid) in hook_int_free() argument
2419 ASSERT(hi != NULL); in hook_int_free()
2422 if (hi->hi_hook.h_name != NULL) { in hook_int_free()
2423 kmem_free(hi->hi_hook.h_name, strlen(hi->hi_hook.h_name) + 1); in hook_int_free()
2425 if (hi->hi_ksname != NULL) { in hook_int_free()
2426 kmem_free(hi->hi_ksname, strlen(hi->hi_ksname) + 1); in hook_int_free()
2430 switch (hi->hi_hook.h_hint) { in hook_int_free()
2433 len = strlen((char *)hi->hi_hook.h_hintvalue); in hook_int_free()
2435 kmem_free((void *)hi->hi_hook.h_hintvalue, len + 1); in hook_int_free()
2441 if (hi->hi_kstatp != NULL) in hook_int_free()
2442 kstat_delete_netstack(hi->hi_kstatp, stackid); in hook_int_free()
2445 kmem_free(hi, sizeof (*hi)); in hook_int_free()