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

Function pffindproto

freebsd/kern/uipc_domain.c:301–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301struct protosw *
302pffindproto(int family, int protocol, int type)
303{
304 struct domain *dp;
305 struct protosw *pr;
306 struct protosw *maybe;
307
308 maybe = NULL;
309 if (family == 0)
310 return (NULL);
311
312 dp = pffinddomain(family);
313 if (dp == NULL)
314 return (NULL);
315
316 for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) {
317 if ((pr->pr_protocol == protocol) && (pr->pr_type == type))
318 return (pr);
319
320 if (type == SOCK_RAW && pr->pr_type == SOCK_RAW &&
321 pr->pr_protocol == 0 && maybe == NULL)
322 maybe = pr;
323 }
324 return (maybe);
325}
326
327/*
328 * The caller must make sure that the new protocol is fully set up and ready to

Callers 7

ip_initFunction · 0.85
ipproto_registerFunction · 0.85
ipproto_unregisterFunction · 0.85
ip6_initFunction · 0.85
ip6proto_registerFunction · 0.85
ip6proto_unregisterFunction · 0.85
socreateFunction · 0.85

Calls 1

pffinddomainFunction · 0.85

Tested by

no test coverage detected