Changeset View
Changeset View
Standalone View
Standalone View
sys/netpfil/ipfilter/netinet/ip_htable.c
| Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
| typedef struct ipf_htable_softc_s { | typedef struct ipf_htable_softc_s { | ||||
| u_long ipht_nomem[LOOKUP_POOL_SZ]; | u_long ipht_nomem[LOOKUP_POOL_SZ]; | ||||
| u_long ipf_nhtables[LOOKUP_POOL_SZ]; | u_long ipf_nhtables[LOOKUP_POOL_SZ]; | ||||
| u_long ipf_nhtnodes[LOOKUP_POOL_SZ]; | u_long ipf_nhtnodes[LOOKUP_POOL_SZ]; | ||||
| iphtable_t *ipf_htables[LOOKUP_POOL_SZ]; | iphtable_t *ipf_htables[LOOKUP_POOL_SZ]; | ||||
| iphtent_t *ipf_node_explist; | iphtent_t *ipf_node_explist; | ||||
| ipftunable_t *ipf_htable_tune; | ipftunable_t *ipf_htable_tune; | ||||
| u_int ipf_htable_size_max; | |||||
| } ipf_htable_softc_t; | } ipf_htable_softc_t; | ||||
| ipf_lookup_t ipf_htable_backend = { | ipf_lookup_t ipf_htable_backend = { | ||||
| IPLT_HASH, | IPLT_HASH, | ||||
| ipf_htable_soft_create, | ipf_htable_soft_create, | ||||
| ipf_htable_soft_destroy, | ipf_htable_soft_destroy, | ||||
| ipf_htable_soft_init, | ipf_htable_soft_init, | ||||
| ipf_htable_soft_fini, | ipf_htable_soft_fini, | ||||
| Show All 11 Lines | ipf_lookup_t ipf_htable_backend = { | ||||
| ipf_htable_select_add_ref, | ipf_htable_select_add_ref, | ||||
| NULL, | NULL, | ||||
| ipf_htable_expire, | ipf_htable_expire, | ||||
| NULL | NULL | ||||
| }; | }; | ||||
| static ipftuneable_t ipf_htable_tunables[] = { | static ipftuneable_t ipf_htable_tunables[] = { | ||||
| { { (void *)offsetof(ipf_htable_softc_t, ipf_htable_size_max) }, | |||||
| "htable_size_max", 1, 0x7fffffff, | |||||
| stsizeof(ipf_htable_softc_t, ipf_htable_size_max), | |||||
| 0, NULL, NULL }, | |||||
| { { NULL }, | { { NULL }, | ||||
| NULL, | NULL, | ||||
| 0, | 0, | ||||
| 0, NULL, NULL } | 0, NULL, NULL } | ||||
| }; | }; | ||||
| /* ------------------------------------------------------------------------ */ | /* ------------------------------------------------------------------------ */ | ||||
| Show All 22 Lines | ipf_htable_soft_create(ipf_main_softc_t *softc) | ||||
| if (softh->ipf_htable_tune == NULL) { | if (softh->ipf_htable_tune == NULL) { | ||||
| ipf_soft_destroy(softc, softh); | ipf_soft_destroy(softc, softh); | ||||
| return (NULL); | return (NULL); | ||||
| } | } | ||||
| if (ipf_tune_array_link(softc, softh->ipf_htable_tune) == -1) { | if (ipf_tune_array_link(softc, softh->ipf_htable_tune) == -1) { | ||||
| ipf_soft_destroy(softc, softh); | ipf_soft_destroy(softc, softh); | ||||
| return (NULL); | return (NULL); | ||||
| } | } | ||||
| softh->ipf_htable_size_max = IPHTABLE_MAX_SIZE; | |||||
| return (softh); | return (softh); | ||||
| } | } | ||||
| /* ------------------------------------------------------------------------ */ | /* ------------------------------------------------------------------------ */ | ||||
| /* Function: ipf_htable_soft_destroy */ | /* Function: ipf_htable_soft_destroy */ | ||||
| /* Returns: Nil */ | /* Returns: Nil */ | ||||
| ▲ Show 20 Lines • Show All 1,229 Lines • Show Last 20 Lines | |||||