MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pppoe_find_svc

Function pppoe_find_svc

freebsd/netgraph/ng_pppoe.c:500–515  ·  view source on GitHub ↗

* Find a hook, which name equals to given service. */

Source from the content-addressed store, hash-verified

498 * Find a hook, which name equals to given service.
499 */
500static hook_p
501pppoe_find_svc(node_p node, const char *svc_name, int svc_len)
502{
503 const priv_p privp = NG_NODE_PRIVATE(node);
504 sessp sp;
505
506 LIST_FOREACH(sp, &privp->listeners, sessions) {
507 negp neg = sp->neg;
508
509 if (neg->service_len == svc_len &&
510 strncmp(svc_name, neg->service.data, svc_len) == 0)
511 return (sp->hook);
512 }
513
514 return (NULL);
515}
516
517/**************************************************************************
518 * Routines to find a particular session that matches an incoming packet. *

Callers 1

ng_pppoe_rcvmsgFunction · 0.85

Calls 1

strncmpFunction · 0.85

Tested by

no test coverage detected