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

Function in_pcbtoxinpcb

freebsd/netinet/in_pcb.c:3123–3147  ·  view source on GitHub ↗

* Create an external-format (``xinpcb'') structure using the information in * the kernel-format in_pcb structure pointed to by inp. This is done to * reduce the spew of irrelevant information over this interface, to isolate * user code from changes in the kernel structure, and potentially to provide * information-hiding if we decide that some of this information should be * hidden from users

Source from the content-addressed store, hash-verified

3121 * hidden from users.
3122 */
3123void
3124in_pcbtoxinpcb(const struct inpcb *inp, struct xinpcb *xi)
3125{
3126
3127 bzero(xi, sizeof(*xi));
3128 xi->xi_len = sizeof(struct xinpcb);
3129 if (inp->inp_socket)
3130 sotoxsocket(inp->inp_socket, &xi->xi_socket);
3131 bcopy(&inp->inp_inc, &xi->inp_inc, sizeof(struct in_conninfo));
3132 xi->inp_gencnt = inp->inp_gencnt;
3133 xi->inp_ppcb = (uintptr_t)inp->inp_ppcb;
3134 xi->inp_flow = inp->inp_flow;
3135 xi->inp_flowid = inp->inp_flowid;
3136 xi->inp_flowtype = inp->inp_flowtype;
3137 xi->inp_flags = inp->inp_flags;
3138 xi->inp_flags2 = inp->inp_flags2;
3139 xi->inp_rss_listen_bucket = inp->inp_rss_listen_bucket;
3140 xi->in6p_cksum = inp->in6p_cksum;
3141 xi->in6p_hops = inp->in6p_hops;
3142 xi->inp_ip_tos = inp->inp_ip_tos;
3143 xi->inp_vflag = inp->inp_vflag;
3144 xi->inp_ip_ttl = inp->inp_ip_ttl;
3145 xi->inp_ip_p = inp->inp_ip_p;
3146 xi->inp_ip_minttl = inp->inp_ip_minttl;
3147}
3148
3149#ifdef DDB
3150static void

Callers 4

udp_pcblistFunction · 0.85
div_pcblistFunction · 0.85
tcp_inptoxtpFunction · 0.85
rip_pcblistFunction · 0.85

Calls 2

bzeroFunction · 0.85
sotoxsocketFunction · 0.50

Tested by

no test coverage detected