1 --- a/include/iptables_common.h
2 +++ b/include/iptables_common.h
4 #define _IPTABLES_COMMON_H
5 /* Shared definitions between ipv4 and ipv6. */
12 @@ -43,9 +45,9 @@ extern char *lib_dir;
13 extern void init_extensions(void);
16 -#define __be32 u_int32_t
17 -#define __le32 u_int32_t
18 -#define __be16 u_int16_t
19 -#define __le16 u_int16_t
20 +#define __be32 uint32_t
21 +#define __le32 uint32_t
22 +#define __be16 uint16_t
23 +#define __le16 uint16_t
25 #endif /*_IPTABLES_COMMON_H*/
26 --- a/include/netinet/tcp.h
30 - * Copyright (c) 1982, 1986, 1993
31 - * The Regents of the University of California. All rights reserved.
33 - * Redistribution and use in source and binary forms, with or without
34 - * modification, are permitted provided that the following conditions
36 - * 1. Redistributions of source code must retain the above copyright
37 - * notice, this list of conditions and the following disclaimer.
38 - * 2. Redistributions in binary form must reproduce the above copyright
39 - * notice, this list of conditions and the following disclaimer in the
40 - * documentation and/or other materials provided with the distribution.
41 - * 4. Neither the name of the University nor the names of its contributors
42 - * may be used to endorse or promote products derived from this software
43 - * without specific prior written permission.
45 - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
46 - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
47 - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
49 - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
50 - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
51 - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52 - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
53 - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
57 - * @(#)tcp.h 8.1 (Berkeley) 6/10/93
60 -#ifndef _NETINET_TCP_H
61 -#define _NETINET_TCP_H 1
63 -#include <features.h>
66 - * User-settable options (used with setsockopt).
68 -#define TCP_NODELAY 1 /* Don't delay send to coalesce packets */
69 -#define TCP_MAXSEG 2 /* Set maximum segment size */
70 -#define TCP_CORK 3 /* Control sending of partial frames */
71 -#define TCP_KEEPIDLE 4 /* Start keeplives after this period */
72 -#define TCP_KEEPINTVL 5 /* Interval between keepalives */
73 -#define TCP_KEEPCNT 6 /* Number of keepalives before death */
74 -#define TCP_SYNCNT 7 /* Number of SYN retransmits */
75 -#define TCP_LINGER2 8 /* Life time of orphaned FIN-WAIT-2 state */
76 -#define TCP_DEFER_ACCEPT 9 /* Wake up listener only when data arrive */
77 -#define TCP_WINDOW_CLAMP 10 /* Bound advertised window */
78 -#define TCP_INFO 11 /* Information about this connection. */
79 -#define TCP_QUICKACK 12 /* Bock/reenable quick ACKs. */
80 -#define TCP_CONGESTION 13 /* Congestion control algorithm. */
83 -# include <sys/types.h>
86 -typedef u_int32_t tcp_seq;
89 - * Per RFC 793, September, 1981.
93 - u_int16_t th_sport; /* source port */
94 - u_int16_t th_dport; /* destination port */
95 - tcp_seq th_seq; /* sequence number */
96 - tcp_seq th_ack; /* acknowledgement number */
97 -# if __BYTE_ORDER == __LITTLE_ENDIAN
98 - u_int8_t th_x2:4; /* (unused) */
99 - u_int8_t th_off:4; /* data offset */
101 -# if __BYTE_ORDER == __BIG_ENDIAN
102 - u_int8_t th_off:4; /* data offset */
103 - u_int8_t th_x2:4; /* (unused) */
106 -# define TH_FIN 0x01
107 -# define TH_SYN 0x02
108 -# define TH_RST 0x04
109 -# define TH_PUSH 0x08
110 -# define TH_ACK 0x10
111 -# define TH_URG 0x20
112 - u_int16_t th_win; /* window */
113 - u_int16_t th_sum; /* checksum */
114 - u_int16_t th_urp; /* urgent pointer */
117 -# else /* !__FAVOR_BSD */
124 -# if __BYTE_ORDER == __LITTLE_ENDIAN
134 -# elif __BYTE_ORDER == __BIG_ENDIAN
145 -# error "Adjust your <bits/endian.h> defines"
151 -# endif /* __FAVOR_BSD */
155 - TCP_ESTABLISHED = 1,
165 - TCP_CLOSING /* now a valid state */
168 -# define TCPOPT_EOL 0
169 -# define TCPOPT_NOP 1
170 -# define TCPOPT_MAXSEG 2
171 -# define TCPOLEN_MAXSEG 4
172 -# define TCPOPT_WINDOW 3
173 -# define TCPOLEN_WINDOW 3
174 -# define TCPOPT_SACK_PERMITTED 4 /* Experimental */
175 -# define TCPOLEN_SACK_PERMITTED 2
176 -# define TCPOPT_SACK 5 /* Experimental */
177 -# define TCPOPT_TIMESTAMP 8
178 -# define TCPOLEN_TIMESTAMP 10
179 -# define TCPOLEN_TSTAMP_APPA (TCPOLEN_TIMESTAMP+2) /* appendix A */
181 -# define TCPOPT_TSTAMP_HDR \
182 - (TCPOPT_NOP<<24|TCPOPT_NOP<<16|TCPOPT_TIMESTAMP<<8|TCPOLEN_TIMESTAMP)
185 - * Default maximum segment size for TCP.
186 - * With an IP MSS of 576, this is 536,
187 - * but 512 is probably more convenient.
188 - * This should be defined as MIN(512, IP_MSS - sizeof (struct tcpiphdr)).
190 -# define TCP_MSS 512
192 -# define TCP_MAXWIN 65535 /* largest value for (unscaled) window */
194 -# define TCP_MAX_WINSHIFT 14 /* maximum window shift */
196 -# define SOL_TCP 6 /* TCP level */
199 -# define TCPI_OPT_TIMESTAMPS 1
200 -# define TCPI_OPT_SACK 2
201 -# define TCPI_OPT_WSCALE 4
202 -# define TCPI_OPT_ECN 8
203 -# define TCPI_OPT_ECN_SEEN 16
205 -/* Values for tcpi_state. */
209 - TCP_CA_Disorder = 1,
211 - TCP_CA_Recovery = 3,
217 - u_int8_t tcpi_state;
218 - u_int8_t tcpi_ca_state;
219 - u_int8_t tcpi_retransmits;
220 - u_int8_t tcpi_probes;
221 - u_int8_t tcpi_backoff;
222 - u_int8_t tcpi_options;
223 - u_int8_t tcpi_snd_wscale : 4, tcpi_rcv_wscale : 4;
225 - u_int32_t tcpi_rto;
226 - u_int32_t tcpi_ato;
227 - u_int32_t tcpi_snd_mss;
228 - u_int32_t tcpi_rcv_mss;
230 - u_int32_t tcpi_unacked;
231 - u_int32_t tcpi_sacked;
232 - u_int32_t tcpi_lost;
233 - u_int32_t tcpi_retrans;
234 - u_int32_t tcpi_fackets;
237 - u_int32_t tcpi_last_data_sent;
238 - u_int32_t tcpi_last_ack_sent; /* Not remembered, sorry. */
239 - u_int32_t tcpi_last_data_recv;
240 - u_int32_t tcpi_last_ack_recv;
243 - u_int32_t tcpi_pmtu;
244 - u_int32_t tcpi_rcv_ssthresh;
245 - u_int32_t tcpi_rtt;
246 - u_int32_t tcpi_rttvar;
247 - u_int32_t tcpi_snd_ssthresh;
248 - u_int32_t tcpi_snd_cwnd;
249 - u_int32_t tcpi_advmss;
250 - u_int32_t tcpi_reordering;
251 - u_int32_t tcpi_rcv_rtt;
252 - u_int32_t tcpi_rcv_space;
253 - u_int32_t tcpi_total_retrans;
259 -#endif /* netinet/tcp.h */
260 --- a/include/iptables.h
261 +++ b/include/iptables.h
262 @@ -20,7 +20,7 @@ struct ipt_get_revision
264 char name[IPT_FUNCTION_MAXNAMELEN-1];
269 #endif /* IPT_SO_GET_REVISION_MATCH Old kernel source */
271 @@ -39,7 +39,7 @@ struct iptables_match
274 /* Revision of match (0 by default). */
280 @@ -92,7 +92,7 @@ struct iptables_target
283 /* Revision of target (0 by default). */
289 @@ -153,7 +153,7 @@ extern char *mask_to_dotted(const struct
291 extern void parse_hostnetworkmask(const char *name, struct in_addr **addrpp,
292 struct in_addr *maskp, unsigned int *naddrs);
293 -extern u_int16_t parse_protocol(const char *s);
294 +extern uint16_t parse_protocol(const char *s);
296 extern int do_command(int argc, char *argv[], char **table,
297 iptc_handle_t *handle);
298 --- a/lib/dnet_ntop.c
299 +++ b/lib/dnet_ntop.c
304 #include <sys/types.h>
305 #include <netinet/in.h>
309 -static __inline__ u_int16_t dn_ntohs(u_int16_t addr)
310 +static __inline__ uint16_t dn_ntohs(uint16_t addr)
320 - return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8);
321 + return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8);
324 -static __inline__ int do_digit(char *str, u_int16_t *addr, u_int16_t scale, size_t *pos, size_t len, int *started)
325 +static __inline__ int do_digit(char *str, uint16_t *addr, uint16_t scale, size_t *pos, size_t len, int *started)
327 - u_int16_t tmp = *addr / scale;
328 + uint16_t tmp = *addr / scale;
332 @@ -36,7 +37,7 @@ static __inline__ int do_digit(char *str
334 static const char *dnet_ntop1(const struct dn_naddr *dna, char *str, size_t len)
336 - u_int16_t addr, area;
337 + uint16_t addr, area;
341 --- a/lib/dnet_pton.c
342 +++ b/lib/dnet_pton.c
347 #include <sys/types.h>
348 #include <netinet/in.h>
352 -static __inline__ u_int16_t dn_htons(u_int16_t addr)
353 +static __inline__ uint16_t dn_htons(uint16_t addr)
363 - return ((u_int16_t)u.byte[0]) | (((u_int16_t)u.byte[1]) << 8);
364 + return ((uint16_t)u.byte[0]) | (((uint16_t)u.byte[1]) << 8);
368 -static int dnet_num(const char *src, u_int16_t * dst)
369 +static int dnet_num(const char *src, uint16_t * dst)
373 @@ -38,9 +39,9 @@ static int dnet_num(const char *src, u_i
375 static int dnet_pton1(const char *src, struct dn_naddr *dna)
378 - u_int16_t area = 0;
379 - u_int16_t node = 0;
385 pos = dnet_num(src, &area);
386 --- a/include/libiptc/ipt_kernel_headers.h
387 +++ b/include/libiptc/ipt_kernel_headers.h
392 -#if defined(__GLIBC__) && __GLIBC__ == 2
394 #include <netinet/ip.h>
395 #include <netinet/in.h>
396 #include <netinet/ip_icmp.h>