FreeBSD/sys/netpfil/ipfw/ip_fw_sockopt.c
/*
 * Find named object by name, considering also its TLV type.
 */
Find named object by name, considering also its TLV type.
Find named object by name considering also its TLV type .
struct named_object *
ipfw_objhash_lookup_name_type(struct namedobj_instance *ni, uint32_t set,
    uint32_t type, const char *name)
{
	struct named_object *no;
	uint32_t hash;
	hash = ni->hash_f(ni, name, set) % ni->nn_size;
	TAILQ_FOREACH(no, &ni->names[hash], nn_next) {
		if (ni->cmp_f(no, name, set) == 0 &&
		    no->etlv == (uint16_t)type)
			return (no);
	}
	return (NULL);
}
struct named_object * ipfw_objhash_lookup_name_type ( struct namedobj_instance * ni , uint32_t set , uint32_t type , const char * name ) { struct named_object * no ; uint32_t hash ; hash = ni -> hash_f ( ni , name , set ) % ni -> nn_size ; TAILQ_FOREACH ( no , & ni -> names [ hash ] , nn_next ) { if ( ni -> cmp_f ( no , name , set ) == 0 && no -> etlv == ( uint16_t ) type ) return ( no ) ; } return ( NULL ) ; }
Find named object by name, considering also its TLV type.
Find named object by name considering also its TLV type .