Lines Matching full:ep
237 struct encaptab *ep, *tmp; in encap_attach() local
245 ep = malloc(sizeof(*ep), M_NETADDR, mflags); in encap_attach()
246 if (ep == NULL) in encap_attach()
249 ep->proto = cfg->proto; in encap_attach()
250 ep->min_length = cfg->min_length; in encap_attach()
251 ep->exact_match = cfg->exact_match; in encap_attach()
252 ep->arg = arg; in encap_attach()
253 ep->lookup = cfg->exact_match == ENCAP_DRV_LOOKUP ? cfg->lookup: NULL; in encap_attach()
254 ep->check = cfg->exact_match != ENCAP_DRV_LOOKUP ? cfg->check: NULL; in encap_attach()
255 ep->input = cfg->input; in encap_attach()
259 if (tmp->exact_match <= ep->exact_match) in encap_attach()
263 CK_LIST_INSERT_HEAD(head, ep, chain); in encap_attach()
265 CK_LIST_INSERT_BEFORE(tmp, ep, chain); in encap_attach()
267 return (ep); in encap_attach()
273 struct encaptab *ep; in encap_detach() local
276 CK_LIST_FOREACH(ep, head, chain) { in encap_detach()
277 if (ep == cookie) { in encap_detach()
278 CK_LIST_REMOVE(ep, chain); in encap_detach()
281 free(ep, M_NETADDR); in encap_detach()
293 struct encaptab *ep, *match; in encap_input() local
301 CK_LIST_FOREACH(ep, head, chain) { in encap_input()
302 if (ep->proto >= 0 && ep->proto != proto) in encap_input()
304 if (ep->min_length > m->m_pkthdr.len) in encap_input()
306 if (ep->exact_match == ENCAP_DRV_LOOKUP) in encap_input()
307 ret = (*ep->lookup)(m, off, proto, &arg); in encap_input()
309 ret = (*ep->check)(m, off, proto, ep->arg); in encap_input()
313 match = ep; in encap_input()
314 if (ep->exact_match != ENCAP_DRV_LOOKUP) in encap_input()
315 arg = ep->arg; in encap_input()
320 if (ret >= ep->exact_match) in encap_input()