* Find a hook, which name equals to given service. */
| 498 | * Find a hook, which name equals to given service. |
| 499 | */ |
| 500 | static hook_p |
| 501 | pppoe_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. * |
no test coverage detected