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

Function attach_handler

freebsd/netinet/libalias/alias_mod.c:60–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58 TAILQ_HEAD_INITIALIZER(handler_chain);
59
60static int
61attach_handler(struct proto_handler *p)
62{
63 struct proto_handler *b;
64
65 TAILQ_FOREACH(b, &handler_chain, link) {
66 if ((b->pri == p->pri) &&
67 (b->dir == p->dir) &&
68 (b->proto == p->proto))
69 return (EEXIST);
70 if (b->pri > p->pri) {
71 TAILQ_INSERT_BEFORE(b, p, link);
72 return (0);
73 }
74 }
75
76 TAILQ_INSERT_TAIL(&handler_chain, p, link);
77
78 return (0);
79}
80
81int
82LibAliasAttachHandlers(struct proto_handler *p)

Callers 1

LibAliasAttachHandlersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected