Lines Matching defs:no

107 static int objhash_cmp_name(struct named_object *no, const void *name,
814 /* We add rule in the end of chain, no need to update skipto cache */
902 swap_sets_cb(struct namedobj_instance *ni, struct named_object *no,
908 if (no->set == (uint8_t)args->set)
909 no->set = args->new_set;
910 else if (no->set == args->new_set)
911 no->set = (uint8_t)args->set;
916 move_sets_cb(struct namedobj_instance *ni, struct named_object *no,
922 if (no->set == (uint8_t)args->set)
923 no->set = args->new_set;
928 test_sets_cb(struct namedobj_instance *ni, struct named_object *no,
934 if (no->set != (uint8_t)args->set)
937 no->etlv, no->name) != NULL)
950 struct named_object *no;
970 no = ipfw_objhash_lookup_kidx(ni, set);
972 no->ocnt++;
974 no->ocnt = 0;
978 no = ipfw_objhash_lookup_kidx(ni, set);
988 if (no->ocnt != no->refcnt)
991 no->name) != NULL)
996 no = ipfw_objhash_lookup_kidx(ni, set);
997 no->set = new_set;
2079 printf("ipfw: no IPv6 support in kernel\n");
2241 ipfw_export_obj_ntlv(struct named_object *no, ipfw_obj_ntlv *ntlv)
2244 ntlv->head.type = no->etlv;
2246 ntlv->idx = no->kidx;
2247 strlcpy(ntlv->name, no->name, sizeof(ntlv->name));
2260 struct named_object *no;
2263 no = ipfw_objhash_lookup_kidx(ni, kidx);
2264 KASSERT(no != NULL, ("invalid object kernel index passed"));
2270 ipfw_export_obj_ntlv(no, ntlv);
2608 struct named_object *no;
2630 no = rw->find_bykidx(ch, kidx);
2631 if (no == NULL)
2634 val = strtol(no->name, &end, 10);
2666 struct named_object *no;
2680 no = rw->find_bykidx(ch, p->kidx);
2681 KASSERT(no != NULL, ("Ref'd object %d disappeared", p->kidx));
2682 no->refcnt--;
2694 struct named_object *no;
2711 no = rw->find_bykidx(ch, kidx);
2713 KASSERT(no != NULL, ("object id %d not found", kidx));
2714 KASSERT(no->subtype == subtype,
2716 no->subtype, subtype, kidx));
2717 KASSERT(no->refcnt > 0, ("refcount for object %d is %d",
2718 kidx, no->refcnt));
2720 if (no->refcnt == 1 && rw->destroy_object != NULL)
2721 rw->destroy_object(ch, no);
2723 no->refcnt--;
2740 struct named_object *no;
2754 error = rw->find_byname(ch, ti, &no);
2757 if (no == NULL) {
2770 if (ti->type != no->subtype)
2774 no->refcnt++;
2775 rw->update(cmd, no->kidx);
2920 * according to their idx field and there has to be no duplicates.
2969 * there are no duplicates.
3352 struct named_object *no, void *arg)
3361 ipfw_export_obj_ntlv(no, ntlv);
4392 objhash_cmp_name(struct named_object *no, const void *name, uint32_t set)
4395 if ((strcmp(no->name, (const char *)name) == 0) && (no->set == set))
4414 struct named_object *no;
4419 TAILQ_FOREACH(no, &ni->names[hash], nn_next) {
4420 if (ni->cmp_f(no, name, set) == 0)
4421 return (no);
4513 struct named_object *no;
4518 TAILQ_FOREACH(no, &ni->names[hash], nn_next) {
4519 if (ni->cmp_f(no, name, set) == 0 &&
4520 no->etlv == (uint16_t)type)
4521 return (no);
4530 struct named_object *no;
4535 TAILQ_FOREACH(no, &ni->values[hash], nv_next) {
4536 if (no->kidx == kidx)
4537 return (no);
4555 ipfw_objhash_add(struct namedobj_instance *ni, struct named_object *no)
4559 hash = ni->hash_f(ni, no->name, no->set) % ni->nn_size;
4560 TAILQ_INSERT_HEAD(&ni->names[hash], no, nn_next);
4562 hash = objhash_hash_idx(ni, no->kidx);
4563 TAILQ_INSERT_HEAD(&ni->values[hash], no, nv_next);
4569 ipfw_objhash_del(struct namedobj_instance *ni, struct named_object *no)
4573 hash = ni->hash_f(ni, no->name, no->set) % ni->nn_size;
4574 TAILQ_REMOVE(&ni->names[hash], no, nn_next);
4576 hash = objhash_hash_idx(ni, no->kidx);
4577 TAILQ_REMOVE(&ni->values[hash], no, nv_next);
4592 struct named_object *no;
4598 TAILQ_FOREACH(no, &ni->names[i], nn_next) {
4599 if (no->etlv == type)
4613 struct named_object *no, *no_tmp;
4617 TAILQ_FOREACH_SAFE(no, &ni->names[i], nn_next, no_tmp) {
4618 ret = f(ni, no, arg);
4634 struct named_object *no, *no_tmp;
4638 TAILQ_FOREACH_SAFE(no, &ni->names[i], nn_next, no_tmp) {
4639 if (no->etlv != type)
4641 ret = f(ni, no, arg);