+
+/*
+ * This is a copy of the inpcb as it shipped in Panther. This structure
+ * is filled out in a copy function. This allows the inpcb to change
+ * without breaking userland tools.
+ *
+ * CAUTION: Many fields may not be filled out. Fewer may be filled out
+ * in the future. Code defensively.
+ */
+#ifdef KERNEL_PRIVATE
+struct inpcb_compat {
+#else
+struct inpcbinfo;
+struct inpcbport;
+struct mbuf;
+struct ip6_pktopts;
+struct ip6_moptions;
+struct icmp6_filter;
+struct inpcbpolicy;
+
+struct inpcb {
+#endif /* KERNEL_PRIVATE */
+ LIST_ENTRY(inpcb) inp_hash; /* hash list */
+ struct in_addr reserved1; /* APPLE reserved: inp_faddr defined in protcol indep. part */
+ struct in_addr reserved2; /* APPLE reserved */
+ u_short inp_fport; /* foreign port */
+ u_short inp_lport; /* local port */
+ LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
+ caddr_t inp_ppcb; /* pointer to per-protocol pcb */
+ struct inpcbinfo *inp_pcbinfo; /* PCB list info */
+ void* inp_socket; /* back pointer to socket */
+ u_char nat_owner; /* Used to NAT TCP/UDP traffic */
+ u_long nat_cookie; /* Cookie stored and returned to NAT */
+ LIST_ENTRY(inpcb) inp_portlist; /* list for this PCB's local port */
+ struct inpcbport *inp_phd; /* head of this list */
+ inp_gen_t inp_gencnt; /* generation count of this instance */
+ int inp_flags; /* generic IP/datagram flags */
+ u_int32_t inp_flow;
+
+ u_char inp_vflag;
+
+ u_char inp_ip_ttl; /* time to live proto */
+ u_char inp_ip_p; /* protocol proto */
+ /* protocol dependent part */
+ union {
+ /* foreign host table entry */
+ struct in_addr_4in6 inp46_foreign;
+ struct in6_addr inp6_foreign;
+ } inp_dependfaddr;
+ union {
+ /* local host table entry */
+ struct in_addr_4in6 inp46_local;
+ struct in6_addr inp6_local;
+ } inp_dependladdr;
+ union {
+ /* placeholder for routing entry */
+ u_char inp4_route[20];
+ u_char inp6_route[32];
+ } inp_dependroute;
+ struct {
+ /* type of service proto */
+ u_char inp4_ip_tos;
+ /* IP options */
+ struct mbuf *inp4_options;
+ /* IP multicast options */
+ struct ip_moptions *inp4_moptions;
+ } inp_depend4;
+
+ struct {
+ /* IP options */
+ struct mbuf *inp6_options;
+ u_int8_t inp6_hlim;
+ u_int8_t unused_uint8_1;
+ ushort unused_uint16_1;
+ /* IP6 options for outgoing packets */
+ struct ip6_pktopts *inp6_outputopts;
+ /* IP multicast options */
+ struct ip6_moptions *inp6_moptions;
+ /* ICMPv6 code type filter */
+ struct icmp6_filter *inp6_icmp6filt;
+ /* IPV6_CHECKSUM setsockopt */
+ int inp6_cksum;
+ u_short inp6_ifindex;
+ short inp6_hops;
+ } inp_depend6;
+
+ int hash_element; /* Array index of pcb's hash list */
+ caddr_t inp_saved_ppcb; /* place to save pointer while cached */
+ struct inpcbpolicy *inp_sp;
+ u_long reserved[3]; /* For future use */
+};
+