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

Function udp_set_kernel_tunneling

freebsd/netinet/udp_usrreq.c:1591–1613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1589#endif /* INET */
1590
1591int
1592udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx)
1593{
1594 struct inpcb *inp;
1595 struct udpcb *up;
1596
1597 KASSERT(so->so_type == SOCK_DGRAM,
1598 ("udp_set_kernel_tunneling: !dgram"));
1599 inp = sotoinpcb(so);
1600 KASSERT(inp != NULL, ("udp_set_kernel_tunneling: inp == NULL"));
1601 INP_WLOCK(inp);
1602 up = intoudpcb(inp);
1603 if ((up->u_tun_func != NULL) ||
1604 (up->u_icmp_func != NULL)) {
1605 INP_WUNLOCK(inp);
1606 return (EBUSY);
1607 }
1608 up->u_tun_func = f;
1609 up->u_icmp_func = i;
1610 up->u_tun_ctx = ctx;
1611 INP_WUNLOCK(inp);
1612 return (0);
1613}
1614
1615#ifdef INET
1616static int

Callers 4

sctp_over_udp_startFunction · 0.85
in_gre_setup_socketFunction · 0.85
in6_gre_setup_socketFunction · 0.85
vxlan_socket_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected