* 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
| 3121 | * hidden from users. |
| 3122 | */ |
| 3123 | void |
| 3124 | in_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 |
| 3150 | static void |
no test coverage detected