| 299 | } |
| 300 | |
| 301 | struct protosw * |
| 302 | pffindproto(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 |
no test coverage detected