Lines Matching refs:ep

239 	struct encaptab *ep, *tmp;  in encap_attach()  local
247 ep = malloc(sizeof(*ep), M_NETADDR, mflags); in encap_attach()
248 if (ep == NULL) in encap_attach()
251 ep->proto = cfg->proto; in encap_attach()
252 ep->min_length = cfg->min_length; in encap_attach()
253 ep->exact_match = cfg->exact_match; in encap_attach()
254 ep->arg = arg; in encap_attach()
255 ep->lookup = cfg->exact_match == ENCAP_DRV_LOOKUP ? cfg->lookup: NULL; in encap_attach()
256 ep->check = cfg->exact_match != ENCAP_DRV_LOOKUP ? cfg->check: NULL; in encap_attach()
257 ep->input = cfg->input; in encap_attach()
261 if (tmp->exact_match <= ep->exact_match) in encap_attach()
265 CK_LIST_INSERT_HEAD(head, ep, chain); in encap_attach()
267 CK_LIST_INSERT_BEFORE(tmp, ep, chain); in encap_attach()
269 return (ep); in encap_attach()
275 struct encaptab *ep; in encap_detach() local
278 CK_LIST_FOREACH(ep, head, chain) { in encap_detach()
279 if (ep == cookie) { in encap_detach()
280 CK_LIST_REMOVE(ep, chain); in encap_detach()
283 free(ep, M_NETADDR); in encap_detach()
295 struct encaptab *ep, *match; in encap_input() local
303 CK_LIST_FOREACH(ep, head, chain) { in encap_input()
304 if (ep->proto >= 0 && ep->proto != proto) in encap_input()
306 if (ep->min_length > m->m_pkthdr.len) in encap_input()
308 if (ep->exact_match == ENCAP_DRV_LOOKUP) in encap_input()
309 ret = (*ep->lookup)(m, off, proto, &arg); in encap_input()
311 ret = (*ep->check)(m, off, proto, ep->arg); in encap_input()
315 match = ep; in encap_input()
316 if (ep->exact_match != ENCAP_DRV_LOOKUP) in encap_input()
317 arg = ep->arg; in encap_input()
322 if (ret >= ep->exact_match) in encap_input()