Deleted Added
full compact
in_pcb.h (83366) in_pcb.h (86764)
1/*
2 * Copyright (c) 1982, 1986, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93
1/*
2 * Copyright (c) 1982, 1986, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 17 unchanged lines hidden (view full) ---

26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)in_pcb.h 8.1 (Berkeley) 6/10/93
34 * $FreeBSD: head/sys/netinet/in_pcb.h 83366 2001-09-12 08:38:13Z julian $
34 * $FreeBSD: head/sys/netinet/in_pcb.h 86764 2001-11-22 04:50:44Z jlemon $
35 */
36
37#ifndef _NETINET_IN_PCB_H_
38#define _NETINET_IN_PCB_H_
39
40#include <sys/queue.h>
41
35 */
36
37#ifndef _NETINET_IN_PCB_H_
38#define _NETINET_IN_PCB_H_
39
40#include <sys/queue.h>
41
42
43#include <netinet6/ipsec.h> /* for IPSEC */
44
45#define in6pcb inpcb /* for KAME src sync over BSD*'s */
46#define in6p_sp inp_sp /* for KAME src sync over BSD*'s */
47
48/*
49 * Common structure pcb for internet protocol implementation.
50 * Here are stored pointers to local and foreign host table

--- 11 unchanged lines hidden (view full) ---

62 * by utilize following structure. (At last, same as INRIA)
63 */
64struct in_addr_4in6 {
65 u_int32_t ia46_pad32[3];
66 struct in_addr ia46_addr4;
67};
68
69/*
42#include <netinet6/ipsec.h> /* for IPSEC */
43
44#define in6pcb inpcb /* for KAME src sync over BSD*'s */
45#define in6p_sp inp_sp /* for KAME src sync over BSD*'s */
46
47/*
48 * Common structure pcb for internet protocol implementation.
49 * Here are stored pointers to local and foreign host table

--- 11 unchanged lines hidden (view full) ---

61 * by utilize following structure. (At last, same as INRIA)
62 */
63struct in_addr_4in6 {
64 u_int32_t ia46_pad32[3];
65 struct in_addr ia46_addr4;
66};
67
68/*
69 * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553.
70 * in_conninfo has some extra padding to accomplish this.
71 */
72struct in_endpoints {
73 u_int16_t ie_fport; /* foreign port */
74 u_int16_t ie_lport; /* local port */
75 /* protocol dependent part, local and foreign addr */
76 union {
77 /* foreign host table entry */
78 struct in_addr_4in6 ie46_foreign;
79 struct in6_addr ie6_foreign;
80 } ie_dependfaddr;
81 union {
82 /* local host table entry */
83 struct in_addr_4in6 ie46_local;
84 struct in6_addr ie6_local;
85 } ie_dependladdr;
86#define ie_faddr ie_dependfaddr.ie46_foreign.ia46_addr4
87#define ie_laddr ie_dependladdr.ie46_local.ia46_addr4
88#define ie6_faddr ie_dependfaddr.ie6_foreign
89#define ie6_laddr ie_dependladdr.ie6_local
90};
91
92/*
93 * XXX
94 * At some point struct route should possibly change to:
95 * struct rtentry *rt
96 * struct in_endpoints *ie;
97 */
98struct in_conninfo {
99 u_int8_t inc_flags;
100 u_int8_t inc_len;
101 u_int16_t inc_pad; /* XXX alignment for in_endpoints */
102 /* protocol dependent part; cached route */
103 struct in_endpoints inc_ie;
104 union {
105 /* placeholder for routing entry */
106 struct route inc4_route;
107 struct route_in6 inc6_route;
108 } inc_dependroute;
109};
110#define inc_isipv6 inc_flags /* temp compatability */
111#define inc_fport inc_ie.ie_fport
112#define inc_lport inc_ie.ie_lport
113#define inc_faddr inc_ie.ie_faddr
114#define inc_laddr inc_ie.ie_laddr
115#define inc_route inc_dependroute.inc4_route
116#define inc6_faddr inc_ie.ie6_faddr
117#define inc6_laddr inc_ie.ie6_laddr
118#define inc6_route inc_dependroute.inc6_route
119
120/*
70 * NB: the zone allocator is type-stable EXCEPT FOR THE FIRST TWO LONGS
71 * of the structure. Therefore, it is important that the members in
72 * that position not contain any information which is required to be
73 * stable.
74 */
75struct icmp6_filter;
76
77struct inpcb {
78 LIST_ENTRY(inpcb) inp_hash; /* hash list */
121 * NB: the zone allocator is type-stable EXCEPT FOR THE FIRST TWO LONGS
122 * of the structure. Therefore, it is important that the members in
123 * that position not contain any information which is required to be
124 * stable.
125 */
126struct icmp6_filter;
127
128struct inpcb {
129 LIST_ENTRY(inpcb) inp_hash; /* hash list */
79 u_short inp_fport; /* foreign port */
80 u_short inp_lport; /* local port */
81 LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
82 u_int32_t inp_flow;
83
130 LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
131 u_int32_t inp_flow;
132
84 /* protocol dependent part, local and foreign addr */
85 union {
86 /* foreign host table entry */
87 struct in_addr_4in6 inp46_foreign;
88 struct in6_addr inp6_foreign;
89 } inp_dependfaddr;
90 union {
91 /* local host table entry */
92 struct in_addr_4in6 inp46_local;
93 struct in6_addr inp6_local;
94 } inp_dependladdr;
133 /* local and foreign ports, local and foreign addr */
134 struct in_conninfo inp_inc;
95
96 caddr_t inp_ppcb; /* pointer to per-protocol pcb */
97 struct inpcbinfo *inp_pcbinfo; /* PCB list info */
98 struct socket *inp_socket; /* back pointer to socket */
99 /* list for this PCB's local port */
100 int inp_flags; /* generic IP/datagram flags */
101
135
136 caddr_t inp_ppcb; /* pointer to per-protocol pcb */
137 struct inpcbinfo *inp_pcbinfo; /* PCB list info */
138 struct socket *inp_socket; /* back pointer to socket */
139 /* list for this PCB's local port */
140 int inp_flags; /* generic IP/datagram flags */
141
102 /* protocol dependent part; cached route */
103 union {
104 /* placeholder for routing entry */
105 struct route inp4_route;
106 struct route_in6 inp6_route;
107 } inp_dependroute;
108
109 struct inpcbpolicy *inp_sp; /* for IPSEC */
110 u_char inp_vflag;
111#define INP_IPV4 0x1
112#define INP_IPV6 0x2
113 u_char inp_ip_ttl; /* time to live proto */
114 u_char inp_ip_p; /* protocol proto */
115
116 /* protocol dependent part; options */
117 struct {
118 u_char inp4_ip_tos; /* type of service proto */
119 struct mbuf *inp4_options; /* IP options */
120 struct ip_moptions *inp4_moptions; /* IP multicast options */
121 } inp_depend4;
142 struct inpcbpolicy *inp_sp; /* for IPSEC */
143 u_char inp_vflag;
144#define INP_IPV4 0x1
145#define INP_IPV6 0x2
146 u_char inp_ip_ttl; /* time to live proto */
147 u_char inp_ip_p; /* protocol proto */
148
149 /* protocol dependent part; options */
150 struct {
151 u_char inp4_ip_tos; /* type of service proto */
152 struct mbuf *inp4_options; /* IP options */
153 struct ip_moptions *inp4_moptions; /* IP multicast options */
154 } inp_depend4;
122#define inp_faddr inp_dependfaddr.inp46_foreign.ia46_addr4
123#define inp_laddr inp_dependladdr.inp46_local.ia46_addr4
124#define inp_route inp_dependroute.inp4_route
155#define inp_fport inp_inc.inc_fport
156#define inp_lport inp_inc.inc_lport
157#define inp_faddr inp_inc.inc_faddr
158#define inp_laddr inp_inc.inc_laddr
159#define inp_route inp_inc.inc_route
125#define inp_ip_tos inp_depend4.inp4_ip_tos
126#define inp_options inp_depend4.inp4_options
127#define inp_moptions inp_depend4.inp4_moptions
128 struct {
129 /* IP options */
130 struct mbuf *inp6_options;
131 /* IP6 options for outgoing packets */
132 struct ip6_pktopts *inp6_outputopts;

--- 5 unchanged lines hidden (view full) ---

138 int inp6_cksum;
139 u_short inp6_ifindex;
140 short inp6_hops;
141 u_int8_t inp6_hlim;
142 } inp_depend6;
143 LIST_ENTRY(inpcb) inp_portlist;
144 struct inpcbport *inp_phd; /* head of this list */
145 inp_gen_t inp_gencnt; /* generation count of this instance */
160#define inp_ip_tos inp_depend4.inp4_ip_tos
161#define inp_options inp_depend4.inp4_options
162#define inp_moptions inp_depend4.inp4_moptions
163 struct {
164 /* IP options */
165 struct mbuf *inp6_options;
166 /* IP6 options for outgoing packets */
167 struct ip6_pktopts *inp6_outputopts;

--- 5 unchanged lines hidden (view full) ---

173 int inp6_cksum;
174 u_short inp6_ifindex;
175 short inp6_hops;
176 u_int8_t inp6_hlim;
177 } inp_depend6;
178 LIST_ENTRY(inpcb) inp_portlist;
179 struct inpcbport *inp_phd; /* head of this list */
180 inp_gen_t inp_gencnt; /* generation count of this instance */
146#define in6p_faddr inp_dependfaddr.inp6_foreign
147#define in6p_laddr inp_dependladdr.inp6_local
148#define in6p_route inp_dependroute.inp6_route
181#define in6p_faddr inp_inc.inc6_faddr
182#define in6p_laddr inp_inc.inc6_laddr
183#define in6p_route inp_inc.inc6_route
149#define in6p_ip6_hlim inp_depend6.inp6_hlim
150#define in6p_hops inp_depend6.inp6_hops /* default hop limit */
151#define in6p_ip6_nxt inp_ip_p
152#define in6p_flowinfo inp_flow
153#define in6p_vflag inp_vflag
154#define in6p_options inp_depend6.inp6_options
155#define in6p_outputopts inp_depend6.inp6_outputopts
156#define in6p_moptions inp_depend6.inp6_moptions

--- 149 unchanged lines hidden ---
184#define in6p_ip6_hlim inp_depend6.inp6_hlim
185#define in6p_hops inp_depend6.inp6_hops /* default hop limit */
186#define in6p_ip6_nxt inp_ip_p
187#define in6p_flowinfo inp_flow
188#define in6p_vflag inp_vflag
189#define in6p_options inp_depend6.inp6_options
190#define in6p_outputopts inp_depend6.inp6_outputopts
191#define in6p_moptions inp_depend6.inp6_moptions

--- 149 unchanged lines hidden ---