Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 34377
Collapse All | Expand All

(-)iproute2.orig/Makefile (-8 / +8 lines)
Lines 18-31 Link Here
18
#options for ipx
18
#options for ipx
19
ADDLIB+=ipx_ntop.o ipx_pton.o
19
ADDLIB+=ipx_ntop.o ipx_pton.o
20
20
21
ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h))
21
#ifeq ($(LIBC_INCLUDE)/socketbits.h,$(wildcard $(LIBC_INCLUDE)/socketbits.h))
22
  ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h))
22
#  ifeq ($(LIBC_INCLUDE)/net/if_packet.h,$(wildcard $(LIBC_INCLUDE)/net/if_packet.h))
23
    GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
23
#    GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
24
  endif
24
#  endif
25
endif
25
#endif
26
ifeq ($(LIBC_INCLUDE)/bits/socket.h,$(wildcard $(LIBC_INCLUDE)/bits/socket.h))
26
#ifeq ($(LIBC_INCLUDE)/bits/socket.h,$(wildcard $(LIBC_INCLUDE)/bits/socket.h))
27
  GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
27
#  GLIBCFIX=-I../include-glibc -include ../include-glibc/glibc-bugs.h
28
endif
28
#endif
29
29
30
CC = gcc
30
CC = gcc
31
CCOPTS = -D_GNU_SOURCE -O2 -pipe -mschedule=8000 -Wstrict-prototypes -Wall -g
31
CCOPTS = -D_GNU_SOURCE -O2 -pipe -mschedule=8000 -Wstrict-prototypes -Wall -g
(-)iproute2.orig/doc/api-ip6-flowlabels.tex (-6 / +6 lines)
Lines 207-213 Link Here
207
    if (c->cmsg_level != SOL_IPV6 ||
207
    if (c->cmsg_level != SOL_IPV6 ||
208
      c->cmsg_type != IPV6_FLOWINFO)
208
      c->cmsg_type != IPV6_FLOWINFO)
209
        continue;
209
        continue;
210
    ((struct sockaddr_in6*)addr)->sin6_flowinfo = *(__u32*)CMSG_DATA(c);
210
    ((struct sockaddr_in6*)addr)->sin6_flowinfo = *(uint32_t*)CMSG_DATA(c);
211
  }
211
  }
212
  return cc;
212
  return cc;
213
}
213
}
Lines 269-281 Link Here
269
struct in6_flowlabel_req
269
struct in6_flowlabel_req
270
{
270
{
271
        struct in6_addr flr_dst;
271
        struct in6_addr flr_dst;
272
        __u32           flr_label;
272
        uint32_t           flr_label;
273
        __u8            flr_action;
273
        uint8_t            flr_action;
274
        __u8            flr_share;
274
        uint8_t            flr_share;
275
        __u16           flr_flags;
275
        __u16           flr_flags;
276
        __u16           flr_expires;
276
        __u16           flr_expires;
277
        __u16           flr_linger;
277
        __u16           flr_linger;
278
        __u32         __flr_reserved;
278
        uint32_t         __flr_reserved;
279
        /* Options in format of IPV6_PKTOPTIONS */
279
        /* Options in format of IPV6_PKTOPTIONS */
280
};
280
};
281
\end{verbatim}
281
\end{verbatim}
Lines 344-350 Link Here
344
private flow label.
344
private flow label.
345
345
346
\begin{verbatim}
346
\begin{verbatim}
347
int get_flow_label(int fd, struct sockaddr_in6 *dst, __u32 fl)
347
int get_flow_label(int fd, struct sockaddr_in6 *dst, uint32_t fl)
348
{
348
{
349
        int on = 1;
349
        int on = 1;
350
        struct in6_flowlabel_req freq;
350
        struct in6_flowlabel_req freq;
(-)iproute2.orig/include/libnetlink.h (-4 / +4 lines)
Lines 10-17 Link Here
10
	int			fd;
10
	int			fd;
11
	struct sockaddr_nl	local;
11
	struct sockaddr_nl	local;
12
	struct sockaddr_nl	peer;
12
	struct sockaddr_nl	peer;
13
	__u32			seq;
13
	uint32_t			seq;
14
	__u32			dump;
14
	uint32_t			dump;
15
};
15
};
16
16
17
extern int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions);
17
extern int rtnl_open(struct rtnl_handle *rth, unsigned subscriptions);
Lines 30-38 Link Here
30
extern int rtnl_send(struct rtnl_handle *rth, char *buf, int);
30
extern int rtnl_send(struct rtnl_handle *rth, char *buf, int);
31
31
32
32
33
extern int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data);
33
extern int addattr32(struct nlmsghdr *n, int maxlen, int type, uint32_t data);
34
extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen);
34
extern int addattr_l(struct nlmsghdr *n, int maxlen, int type, void *data, int alen);
35
extern int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data);
35
extern int rta_addattr32(struct rtattr *rta, int maxlen, int type, uint32_t data);
36
extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, int alen);
36
extern int rta_addattr_l(struct rtattr *rta, int maxlen, int type, void *data, int alen);
37
37
38
extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
38
extern int parse_rtattr(struct rtattr *tb[], int max, struct rtattr *rta, int len);
(-)iproute2.orig/include/linux/pkt_sched.h (-71 / +71 lines)
Lines 29-43 Link Here
29
29
30
struct tc_stats
30
struct tc_stats
31
{
31
{
32
	__u64	bytes;			/* NUmber of enqueues bytes */
32
	uint64_t	bytes;			/* NUmber of enqueues bytes */
33
	__u32	packets;		/* Number of enqueued packets	*/
33
	uint32_t	packets;		/* Number of enqueued packets	*/
34
	__u32	drops;			/* Packets dropped because of lack of resources */
34
	uint32_t	drops;			/* Packets dropped because of lack of resources */
35
	__u32	overlimits;		/* Number of throttle events when this
35
	uint32_t	overlimits;		/* Number of throttle events when this
36
					 * flow goes out of allocated bandwidth */
36
					 * flow goes out of allocated bandwidth */
37
	__u32	bps;			/* Current flow byte rate */
37
	uint32_t	bps;			/* Current flow byte rate */
38
	__u32	pps;			/* Current flow packet rate */
38
	uint32_t	pps;			/* Current flow packet rate */
39
	__u32	qlen;
39
	uint32_t	qlen;
40
	__u32	backlog;
40
	uint32_t	backlog;
41
#ifdef __KERNEL__
41
#ifdef __KERNEL__
42
	spinlock_t *lock;
42
	spinlock_t *lock;
43
#endif
43
#endif
Lines 83-96 Link Here
83
	unsigned short	feature;
83
	unsigned short	feature;
84
	short		addend;
84
	short		addend;
85
	unsigned short	mpu;
85
	unsigned short	mpu;
86
	__u32		rate;
86
	uint32_t		rate;
87
};
87
};
88
88
89
/* FIFO section */
89
/* FIFO section */
90
90
91
struct tc_fifo_qopt
91
struct tc_fifo_qopt
92
{
92
{
93
	__u32	limit;	/* Queue length: bytes for bfifo, packets for pfifo */
93
	uint32_t	limit;	/* Queue length: bytes for bfifo, packets for pfifo */
94
};
94
};
95
95
96
/* PRIO section */
96
/* PRIO section */
Lines 100-106 Link Here
100
struct tc_prio_qopt
100
struct tc_prio_qopt
101
{
101
{
102
	int	bands;			/* Number of bands */
102
	int	bands;			/* Number of bands */
103
	__u8	priomap[TC_PRIO_MAX+1];	/* Map: logical priority -> PRIO band */
103
	uint8_t	priomap[TC_PRIO_MAX+1];	/* Map: logical priority -> PRIO band */
104
};
104
};
105
105
106
/* CSZ section */
106
/* CSZ section */
Lines 110-116 Link Here
110
	int		flows;		/* Maximal number of guaranteed flows */
110
	int		flows;		/* Maximal number of guaranteed flows */
111
	unsigned char	R_log;		/* Fixed point position for round number */
111
	unsigned char	R_log;		/* Fixed point position for round number */
112
	unsigned char	delta_log;	/* Log of maximal managed time interval */
112
	unsigned char	delta_log;	/* Log of maximal managed time interval */
113
	__u8		priomap[TC_PRIO_MAX+1];	/* Map: logical priority -> CSZ band */
113
	uint8_t		priomap[TC_PRIO_MAX+1];	/* Map: logical priority -> CSZ band */
114
};
114
};
115
115
116
struct tc_csz_copt
116
struct tc_csz_copt
Lines 118-126 Link Here
118
	struct tc_ratespec slice;
118
	struct tc_ratespec slice;
119
	struct tc_ratespec rate;
119
	struct tc_ratespec rate;
120
	struct tc_ratespec peakrate;
120
	struct tc_ratespec peakrate;
121
	__u32		limit;
121
	uint32_t		limit;
122
	__u32		buffer;
122
	uint32_t		buffer;
123
	__u32		mtu;
123
	uint32_t		mtu;
124
};
124
};
125
125
126
enum
126
enum
Lines 137-145 Link Here
137
{
137
{
138
	struct tc_ratespec rate;
138
	struct tc_ratespec rate;
139
	struct tc_ratespec peakrate;
139
	struct tc_ratespec peakrate;
140
	__u32		limit;
140
	uint32_t		limit;
141
	__u32		buffer;
141
	uint32_t		buffer;
142
	__u32		mtu;
142
	uint32_t		mtu;
143
};
143
};
144
144
145
enum
145
enum
Lines 161-167 Link Here
161
{
161
{
162
	unsigned	quantum;	/* Bytes per round allocated to flow */
162
	unsigned	quantum;	/* Bytes per round allocated to flow */
163
	int		perturb_period;	/* Period of hash perturbation */
163
	int		perturb_period;	/* Period of hash perturbation */
164
	__u32		limit;		/* Maximal packets in queue */
164
	uint32_t		limit;		/* Maximal packets in queue */
165
	unsigned	divisor;	/* Hash divisor  */
165
	unsigned	divisor;	/* Hash divisor  */
166
	unsigned	flows;		/* Maximal number of flows  */
166
	unsigned	flows;		/* Maximal number of flows  */
167
};
167
};
Lines 186-194 Link Here
186
186
187
struct tc_red_qopt
187
struct tc_red_qopt
188
{
188
{
189
	__u32		limit;		/* HARD maximal queue length (bytes)	*/
189
	uint32_t		limit;		/* HARD maximal queue length (bytes)	*/
190
	__u32		qth_min;	/* Min average length threshold (bytes) */
190
	uint32_t		qth_min;	/* Min average length threshold (bytes) */
191
	__u32		qth_max;	/* Max average length threshold (bytes) */
191
	uint32_t		qth_max;	/* Max average length threshold (bytes) */
192
	unsigned char   Wlog;		/* log(W)		*/
192
	unsigned char   Wlog;		/* log(W)		*/
193
	unsigned char   Plog;		/* log(P_max/(qth_max-qth_min))	*/
193
	unsigned char   Plog;		/* log(P_max/(qth_max-qth_min))	*/
194
	unsigned char   Scell_log;	/* cell size for idle damping */
194
	unsigned char   Scell_log;	/* cell size for idle damping */
Lines 198-207 Link Here
198
198
199
struct tc_red_xstats
199
struct tc_red_xstats
200
{
200
{
201
	__u32           early;          /* Early drops */
201
	uint32_t           early;          /* Early drops */
202
	__u32           pdrop;          /* Drops due to queue limits */
202
	uint32_t           pdrop;          /* Drops due to queue limits */
203
	__u32           other;          /* Drops due to drop() calls */
203
	uint32_t           other;          /* Drops due to drop() calls */
204
	__u32           marked;         /* Marked packets */
204
	uint32_t           marked;         /* Marked packets */
205
};
205
};
206
206
207
/* GRED section */
207
/* GRED section */
Lines 219-251 Link Here
219
#define TCA_SET_OFF TCA_GRED_PARMS
219
#define TCA_SET_OFF TCA_GRED_PARMS
220
struct tc_gred_qopt
220
struct tc_gred_qopt
221
{
221
{
222
       __u32           limit;          /* HARD maximal queue length (bytes)    
222
       uint32_t           limit;          /* HARD maximal queue length (bytes)    
223
*/
223
*/
224
       __u32           qth_min;        /* Min average length threshold (bytes) 
224
       uint32_t           qth_min;        /* Min average length threshold (bytes) 
225
*/
225
*/
226
       __u32           qth_max;        /* Max average length threshold (bytes) 
226
       uint32_t           qth_max;        /* Max average length threshold (bytes) 
227
*/
227
*/
228
       __u32           DP;             /* upto 2^32 DPs */
228
       uint32_t           DP;             /* upto 2^32 DPs */
229
       __u32           backlog;        
229
       uint32_t           backlog;        
230
       __u32           qave;   
230
       uint32_t           qave;   
231
       __u32           forced; 
231
       uint32_t           forced; 
232
       __u32           early;  
232
       uint32_t           early;  
233
       __u32           other;  
233
       uint32_t           other;  
234
       __u32           pdrop;  
234
       uint32_t           pdrop;  
235
235
236
       unsigned char   Wlog;           /* log(W)               */
236
       unsigned char   Wlog;           /* log(W)               */
237
       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */
237
       unsigned char   Plog;           /* log(P_max/(qth_max-qth_min)) */
238
       unsigned char   Scell_log;      /* cell size for idle damping */
238
       unsigned char   Scell_log;      /* cell size for idle damping */
239
       __u8            prio;		/* prio of this VQ */
239
       uint8_t            prio;		/* prio of this VQ */
240
       __u32	packets;
240
       uint32_t	packets;
241
       __u32	bytesin;
241
       uint32_t	bytesin;
242
};
242
};
243
/* gred setup */
243
/* gred setup */
244
struct tc_gred_sopt
244
struct tc_gred_sopt
245
{
245
{
246
       __u32           DPs;
246
       uint32_t           DPs;
247
       __u32           def_DP;
247
       uint32_t           def_DP;
248
       __u8            grio;
248
       uint8_t            grio;
249
};
249
};
250
250
251
/* HTB section */
251
/* HTB section */
Lines 257-277 Link Here
257
{
257
{
258
	struct tc_ratespec 	rate;
258
	struct tc_ratespec 	rate;
259
	struct tc_ratespec 	ceil;
259
	struct tc_ratespec 	ceil;
260
	__u32	buffer;
260
	uint32_t	buffer;
261
	__u32	cbuffer;
261
	uint32_t	cbuffer;
262
	__u32	quantum;
262
	uint32_t	quantum;
263
	__u32	level;		/* out only */
263
	uint32_t	level;		/* out only */
264
	__u32	prio;
264
	uint32_t	prio;
265
};
265
};
266
struct tc_htb_glob
266
struct tc_htb_glob
267
{
267
{
268
	__u32 version;		/* to match HTB/TC */
268
	uint32_t version;		/* to match HTB/TC */
269
    	__u32 rate2quantum;	/* bps->quantum divisor */
269
    	uint32_t rate2quantum;	/* bps->quantum divisor */
270
    	__u32 defcls;		/* default class number */
270
    	uint32_t defcls;		/* default class number */
271
	__u32 debug;		/* debug flags */
271
	uint32_t debug;		/* debug flags */
272
272
273
	/* stats */
273
	/* stats */
274
	__u32 direct_pkts; /* count of non shapped packets */
274
	uint32_t direct_pkts; /* count of non shapped packets */
275
};
275
};
276
enum
276
enum
277
{
277
{
Lines 283-293 Link Here
283
};
283
};
284
struct tc_htb_xstats
284
struct tc_htb_xstats
285
{
285
{
286
	__u32 lends;
286
	uint32_t lends;
287
	__u32 borrows;
287
	uint32_t borrows;
288
	__u32 giants;	/* too big packets (rate will not be accurate) */
288
	uint32_t giants;	/* too big packets (rate will not be accurate) */
289
	__u32 tokens;
289
	uint32_t tokens;
290
	__u32 ctokens;
290
	uint32_t ctokens;
291
};
291
};
292
292
293
/* CBQ section */
293
/* CBQ section */
Lines 310-319 Link Here
310
#define TCF_CBQ_LSS_MINIDLE	8
310
#define TCF_CBQ_LSS_MINIDLE	8
311
#define TCF_CBQ_LSS_OFFTIME	0x10
311
#define TCF_CBQ_LSS_OFFTIME	0x10
312
#define TCF_CBQ_LSS_AVPKT	0x20
312
#define TCF_CBQ_LSS_AVPKT	0x20
313
	__u32		maxidle;
313
	uint32_t		maxidle;
314
	__u32		minidle;
314
	uint32_t		minidle;
315
	__u32		offtime;
315
	uint32_t		offtime;
316
	__u32		avpkt;
316
	uint32_t		avpkt;
317
};
317
};
318
318
319
struct tc_cbq_wrropt
319
struct tc_cbq_wrropt
Lines 322-329 Link Here
322
	unsigned char	priority;
322
	unsigned char	priority;
323
	unsigned char	cpriority;
323
	unsigned char	cpriority;
324
	unsigned char	__reserved;
324
	unsigned char	__reserved;
325
	__u32		allot;
325
	uint32_t		allot;
326
	__u32		weight;
326
	uint32_t		weight;
327
};
327
};
328
328
329
struct tc_cbq_ovl
329
struct tc_cbq_ovl
Lines 335-341 Link Here
335
#define	TC_CBQ_OVL_DROP		3
335
#define	TC_CBQ_OVL_DROP		3
336
#define	TC_CBQ_OVL_RCLASSIC	4
336
#define	TC_CBQ_OVL_RCLASSIC	4
337
	unsigned char	priority2;
337
	unsigned char	priority2;
338
	__u32		penalty;
338
	uint32_t		penalty;
339
};
339
};
340
340
341
struct tc_cbq_police
341
struct tc_cbq_police
Lines 347-363 Link Here
347
347
348
struct tc_cbq_fopt
348
struct tc_cbq_fopt
349
{
349
{
350
	__u32		split;
350
	uint32_t		split;
351
	__u32		defmap;
351
	uint32_t		defmap;
352
	__u32		defchange;
352
	uint32_t		defchange;
353
};
353
};
354
354
355
struct tc_cbq_xstats
355
struct tc_cbq_xstats
356
{
356
{
357
	__u32		borrows;
357
	uint32_t		borrows;
358
	__u32		overactions;
358
	uint32_t		overactions;
359
	__s32		avgidle;
359
	int32_t		avgidle;
360
	__s32		undertime;
360
	int32_t		undertime;
361
};
361
};
362
362
363
enum
363
enum
(-)iproute2.orig/include/rt_names.h (-2 / +2 lines)
Lines 9-16 Link Here
9
int rtnl_rtprot_a2n(int *id, char *arg);
9
int rtnl_rtprot_a2n(int *id, char *arg);
10
int rtnl_rtscope_a2n(int *id, char *arg);
10
int rtnl_rtscope_a2n(int *id, char *arg);
11
int rtnl_rttable_a2n(int *id, char *arg);
11
int rtnl_rttable_a2n(int *id, char *arg);
12
int rtnl_rtrealm_a2n(__u32 *id, char *arg);
12
int rtnl_rtrealm_a2n(int *id, char *arg);
13
int rtnl_dsfield_a2n(__u32 *id, char *arg);
13
int rtnl_dsfield_a2n(int *id, char *arg);
14
14
15
const char *inet_proto_n2a(int proto, char *buf, int len);
15
const char *inet_proto_n2a(int proto, char *buf, int len);
16
int inet_proto_a2n(char *buf);
16
int inet_proto_a2n(char *buf);
(-)iproute2.orig/include/rtm_map.h (-1 / +1 lines)
Lines 4-10 Link Here
4
char *rtnl_rtntype_n2a(int id, char *buf, int len);
4
char *rtnl_rtntype_n2a(int id, char *buf, int len);
5
int rtnl_rtntype_a2n(int *id, char *arg);
5
int rtnl_rtntype_a2n(int *id, char *arg);
6
6
7
int get_rt_realms(__u32 *realms, char *arg);
7
int get_rt_realms(uint32_t *realms, char *arg);
8
8
9
9
10
#endif /* __RTM_MAP_H__ */
10
#endif /* __RTM_MAP_H__ */
(-)iproute2.orig/include/utils.h (-6 / +6 lines)
Lines 32-41 Link Here
32
32
33
typedef struct
33
typedef struct
34
{
34
{
35
	__u8 family;
35
	uint8_t family;
36
	__u8 bytelen;
36
	uint8_t bytelen;
37
	__s16 bitlen;
37
	__s16 bitlen;
38
	__u32 data[4];
38
	uint32_t data[4];
39
} inet_prefix;
39
} inet_prefix;
40
40
41
#define DN_MAXADDL 20
41
#define DN_MAXADDL 20
Lines 56-62 Link Here
56
	u_int8_t  ipx_node[IPX_NODE_LEN];
56
	u_int8_t  ipx_node[IPX_NODE_LEN];
57
};
57
};
58
58
59
extern __u32 get_addr32(char *name);
59
extern uint32_t get_addr32(char *name);
60
extern int get_addr_1(inet_prefix *dst, char *arg, int family);
60
extern int get_addr_1(inet_prefix *dst, char *arg, int family);
61
extern int get_prefix_1(inet_prefix *dst, char *arg, int family);
61
extern int get_prefix_1(inet_prefix *dst, char *arg, int family);
62
extern int get_addr(inet_prefix *dst, char *arg, int family);
62
extern int get_addr(inet_prefix *dst, char *arg, int family);
Lines 67-76 Link Here
67
#define get_byte get_u8
67
#define get_byte get_u8
68
#define get_ushort get_u16
68
#define get_ushort get_u16
69
#define get_short get_s16
69
#define get_short get_s16
70
extern int get_u32(__u32 *val, char *arg, int base);
70
extern int get_u32(uint32_t *val, char *arg, int base);
71
extern int get_u16(__u16 *val, char *arg, int base);
71
extern int get_u16(__u16 *val, char *arg, int base);
72
extern int get_s16(__s16 *val, char *arg, int base);
72
extern int get_s16(__s16 *val, char *arg, int base);
73
extern int get_u8(__u8 *val, char *arg, int base);
73
extern int get_u8(uint8_t *val, char *arg, int base);
74
extern int get_s8(__s8 *val, char *arg, int base);
74
extern int get_s8(__s8 *val, char *arg, int base);
75
75
76
extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
76
extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
(-)iproute2.orig/include-glibc/bits/socket.h (-3 / +3 lines)
Lines 252-260 Link Here
252
252
253
struct ucred
253
struct ucred
254
{
254
{
255
	__u32	pid;
255
	uint32_t	pid;
256
	__u32	uid;
256
	uint32_t	uid;
257
	__u32	gid;
257
	uint32_t	gid;
258
};
258
};
259
259
260
260
(-)iproute2.orig/include-glibc/glibc-bugs.h (-1 / +1 lines)
Lines 13-19 Link Here
13
#include <linux/types.h>
13
#include <linux/types.h>
14
14
15
typedef __u16 in_port_t;
15
typedef __u16 in_port_t;
16
typedef __u32 in_addr_t;
16
typedef uint32_t in_addr_t;
17
17
18
#endif
18
#endif
19
19
(-)iproute2.orig/include-glibc/socketbits.h (-3 / +3 lines)
Lines 252-260 Link Here
252
252
253
struct ucred
253
struct ucred
254
{
254
{
255
	__u32	pid;
255
	uint32_t	pid;
256
	__u32	uid;
256
	uint32_t	uid;
257
	__u32	gid;
257
	uint32_t	gid;
258
};
258
};
259
259
260
260
(-)iproute2.orig/ip/ipaddress.c (-3 / +3 lines)
Lines 12-17 Link Here
12
 *	Laszlo Valko <valko@linux.karinthy.hu> 990223: address label must be zero terminated
12
 *	Laszlo Valko <valko@linux.karinthy.hu> 990223: address label must be zero terminated
13
 */
13
 */
14
14
15
#include <netinet/in.h>
16
#include <arpa/inet.h>
15
#include <stdio.h>
17
#include <stdio.h>
16
#include <stdlib.h>
18
#include <stdlib.h>
17
#include <unistd.h>
19
#include <unistd.h>
Lines 23-30 Link Here
23
#include <linux/netdevice.h>
25
#include <linux/netdevice.h>
24
#include <linux/if_arp.h>
26
#include <linux/if_arp.h>
25
#include <linux/sockios.h>
27
#include <linux/sockios.h>
26
#include <netinet/in.h>
27
#include <arpa/inet.h>
28
#include <string.h>
28
#include <string.h>
29
#include <fnmatch.h>
29
#include <fnmatch.h>
30
30
Lines 722-728 Link Here
722
int default_scope(inet_prefix *lcl)
722
int default_scope(inet_prefix *lcl)
723
{
723
{
724
	if (lcl->family == AF_INET) {
724
	if (lcl->family == AF_INET) {
725
		if (lcl->bytelen >= 1 && *(__u8*)&lcl->data == 127)
725
		if (lcl->bytelen >= 1 && *(uint8_t*)&lcl->data == 127)
726
			return RT_SCOPE_HOST;
726
			return RT_SCOPE_HOST;
727
	}
727
	}
728
	return 0;
728
	return 0;
(-)iproute2.orig/ip/iplink.c (-3 / +3 lines)
Lines 77-83 Link Here
77
	return -1;
77
	return -1;
78
}
78
}
79
79
80
static int do_chflags(char *dev, __u32 flags, __u32 mask)
80
static int do_chflags(char *dev, uint32_t flags, uint32_t mask)
81
{
81
{
82
	struct ifreq ifr;
82
	struct ifreq ifr;
83
	int fd;
83
	int fd;
Lines 248-255 Link Here
248
static int do_set(int argc, char **argv)
248
static int do_set(int argc, char **argv)
249
{
249
{
250
	char *dev = NULL;
250
	char *dev = NULL;
251
	__u32 mask = 0;
251
	uint32_t mask = 0;
252
	__u32 flags = 0;
252
	uint32_t flags = 0;
253
	int qlen = -1;
253
	int qlen = -1;
254
	int mtu = -1;
254
	int mtu = -1;
255
	char *newaddr = NULL;
255
	char *newaddr = NULL;
(-)iproute2.orig/ip/ipmaddr.c (-3 / +3 lines)
Lines 10-15 Link Here
10
 *
10
 *
11
 */
11
 */
12
12
13
#include <netinet/in.h>
14
#include <arpa/inet.h>
13
#include <stdio.h>
15
#include <stdio.h>
14
#include <stdlib.h>
16
#include <stdlib.h>
15
#include <unistd.h>
17
#include <unistd.h>
Lines 21-28 Link Here
21
#include <linux/if.h>
23
#include <linux/if.h>
22
#include <linux/if_arp.h>
24
#include <linux/if_arp.h>
23
#include <linux/sockios.h>
25
#include <linux/sockios.h>
24
#include <netinet/in.h>
25
#include <arpa/inet.h>
26
#include <string.h>
26
#include <string.h>
27
27
28
#include "rt_names.h"
28
#include "rt_names.h"
Lines 144-150 Link Here
144
		if (filter.dev && strcmp(filter.dev, m.name))
144
		if (filter.dev && strcmp(filter.dev, m.name))
145
			continue;
145
			continue;
146
146
147
		sscanf(buf, "%08x%d", (__u32*)&m.addr.data, &m.users);
147
		sscanf(buf, "%08x%d", (uint32_t*)&m.addr.data, &m.users);
148
148
149
		ma = malloc(sizeof(m));
149
		ma = malloc(sizeof(m));
150
		memcpy(ma, &m, sizeof(m));
150
		memcpy(ma, &m, sizeof(m));
(-)iproute2.orig/ip/ipmonitor.c (-2 / +2 lines)
Lines 56-63 Link Here
56
	}
56
	}
57
	if (n->nlmsg_type == 15) {
57
	if (n->nlmsg_type == 15) {
58
		char *tstr;
58
		char *tstr;
59
		time_t secs = ((__u32*)NLMSG_DATA(n))[0];
59
		time_t secs = ((uint32_t*)NLMSG_DATA(n))[0];
60
		long usecs = ((__u32*)NLMSG_DATA(n))[1];
60
		long usecs = ((uint32_t*)NLMSG_DATA(n))[1];
61
		tstr = asctime(localtime(&secs));
61
		tstr = asctime(localtime(&secs));
62
		tstr[strlen(tstr)-1] = 0;
62
		tstr[strlen(tstr)-1] = 0;
63
		fprintf(fp, "Timestamp: %s %lu us\n", tstr, usecs);
63
		fprintf(fp, "Timestamp: %s %lu us\n", tstr, usecs);
(-)iproute2.orig/ip/ipmroute.c (-2 / +2 lines)
Lines 10-15 Link Here
10
 *
10
 *
11
 */
11
 */
12
12
13
#include <netinet/in.h>
14
#include <arpa/inet.h>
13
#include <stdio.h>
15
#include <stdio.h>
14
#include <stdlib.h>
16
#include <stdlib.h>
15
#include <unistd.h>
17
#include <unistd.h>
Lines 21-28 Link Here
21
#include <linux/if.h>
23
#include <linux/if.h>
22
#include <linux/if_arp.h>
24
#include <linux/if_arp.h>
23
#include <linux/sockios.h>
25
#include <linux/sockios.h>
24
#include <netinet/in.h>
25
#include <arpa/inet.h>
26
#include <string.h>
26
#include <string.h>
27
27
28
#include "utils.h"
28
#include "utils.h"
(-)iproute2.orig/ip/ipneigh.c (-2 / +2 lines)
Lines 86-92 Link Here
86
	return 0;
86
	return 0;
87
}
87
}
88
88
89
char * nud_state_n2a(__u8 state, char *buf, int len)
89
char * nud_state_n2a(uint8_t state, char *buf, int len)
90
{
90
{
91
	switch (state) {
91
	switch (state) {
92
	case NUD_NONE:	
92
	case NUD_NONE:	
Lines 193-199 Link Here
193
	addattr_l(&req.n, sizeof(req), NDA_DST, &dst.data, dst.bytelen);
193
	addattr_l(&req.n, sizeof(req), NDA_DST, &dst.data, dst.bytelen);
194
194
195
	if (lla && strcmp(lla, "null")) {
195
	if (lla && strcmp(lla, "null")) {
196
		__u8 llabuf[16];
196
		uint8_t llabuf[16];
197
		int l;
197
		int l;
198
198
199
		l = ll_addr_a2n(llabuf, sizeof(llabuf), lla);
199
		l = ll_addr_a2n(llabuf, sizeof(llabuf), lla);
(-)iproute2.orig/ip/iproute.c (-12 / +12 lines)
Lines 233-241 Link Here
233
	if (filter.rprefsrc.family && inet_addr_match(&prefsrc, &filter.rprefsrc, filter.rprefsrc.bitlen))
233
	if (filter.rprefsrc.family && inet_addr_match(&prefsrc, &filter.rprefsrc, filter.rprefsrc.bitlen))
234
		return 0;
234
		return 0;
235
	if (filter.realmmask) {
235
	if (filter.realmmask) {
236
		__u32 realms = 0;
236
		uint32_t realms = 0;
237
		if (tb[RTA_FLOW])
237
		if (tb[RTA_FLOW])
238
			realms = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
238
			realms = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]);
239
		if ((realms^filter.realm)&filter.realmmask)
239
		if ((realms^filter.realm)&filter.realmmask)
240
			return 0;
240
			return 0;
241
	}
241
	}
Lines 354-360 Link Here
354
				    abuf, sizeof(abuf)));
354
				    abuf, sizeof(abuf)));
355
	}
355
	}
356
	if (tb[RTA_PRIORITY])
356
	if (tb[RTA_PRIORITY])
357
		fprintf(fp, " metric %d ", *(__u32*)RTA_DATA(tb[RTA_PRIORITY]));
357
		fprintf(fp, " metric %d ", *(uint32_t*)RTA_DATA(tb[RTA_PRIORITY]));
358
	if (r->rtm_flags & RTNH_F_DEAD)
358
	if (r->rtm_flags & RTNH_F_DEAD)
359
		fprintf(fp, "dead ");
359
		fprintf(fp, "dead ");
360
	if (r->rtm_flags & RTNH_F_ONLINK)
360
	if (r->rtm_flags & RTNH_F_ONLINK)
Lines 367-374 Link Here
367
		fprintf(fp, "notify ");
367
		fprintf(fp, "notify ");
368
368
369
	if (tb[RTA_FLOW] && filter.realmmask != ~0U) {
369
	if (tb[RTA_FLOW] && filter.realmmask != ~0U) {
370
		__u32 to = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
370
		uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]);
371
		__u32 from = to>>16;
371
		uint32_t from = to>>16;
372
		to &= 0xFFFF;
372
		to &= 0xFFFF;
373
		fprintf(fp, "realm%s ", from ? "s" : "");
373
		fprintf(fp, "realm%s ", from ? "s" : "");
374
		if (from) {
374
		if (from) {
Lines 379-385 Link Here
379
			rtnl_rtrealm_n2a(to, b1, sizeof(b1)));
379
			rtnl_rtrealm_n2a(to, b1, sizeof(b1)));
380
	}
380
	}
381
	if ((r->rtm_flags&RTM_F_CLONED) && r->rtm_family == AF_INET) {
381
	if ((r->rtm_flags&RTM_F_CLONED) && r->rtm_family == AF_INET) {
382
		__u32 flags = r->rtm_flags&~0xFFFF;
382
		uint32_t flags = r->rtm_flags&~0xFFFF;
383
		int first = 1;
383
		int first = 1;
384
384
385
		fprintf(fp, "%s    cache ", _SL_);
385
		fprintf(fp, "%s    cache ", _SL_);
Lines 696-702 Link Here
696
			req.r.rtm_src_len = addr.bitlen;
696
			req.r.rtm_src_len = addr.bitlen;
697
		} else if (strcmp(*argv, "tos") == 0 ||
697
		} else if (strcmp(*argv, "tos") == 0 ||
698
			   matches(*argv, "dsfield") == 0) {
698
			   matches(*argv, "dsfield") == 0) {
699
			__u32 tos;
699
			uint32_t tos;
700
			NEXT_ARG();
700
			NEXT_ARG();
701
			if (rtnl_dsfield_a2n(&tos, *argv))
701
			if (rtnl_dsfield_a2n(&tos, *argv))
702
				invarg("\"tos\" value is invalid\n", *argv);
702
				invarg("\"tos\" value is invalid\n", *argv);
Lines 704-710 Link Here
704
		} else if (matches(*argv, "metric") == 0 ||
704
		} else if (matches(*argv, "metric") == 0 ||
705
			   matches(*argv, "priority") == 0 ||
705
			   matches(*argv, "priority") == 0 ||
706
			   matches(*argv, "preference") == 0) {
706
			   matches(*argv, "preference") == 0) {
707
			__u32 metric;
707
			uint32_t metric;
708
			NEXT_ARG();
708
			NEXT_ARG();
709
			if (get_u32(&metric, *argv, 0))
709
			if (get_u32(&metric, *argv, 0))
710
				invarg("\"metric\" value is invalid\n", *argv);
710
				invarg("\"metric\" value is invalid\n", *argv);
Lines 801-807 Link Here
801
				invarg("\"ssthresh\" value is invalid\n", *argv);
801
				invarg("\"ssthresh\" value is invalid\n", *argv);
802
			rta_addattr32(mxrta, sizeof(mxbuf), RTAX_SSTHRESH, win);
802
			rta_addattr32(mxrta, sizeof(mxbuf), RTAX_SSTHRESH, win);
803
		} else if (matches(*argv, "realms") == 0) {
803
		} else if (matches(*argv, "realms") == 0) {
804
			__u32 realm;
804
			uint32_t realm;
805
			NEXT_ARG();
805
			NEXT_ARG();
806
			if (get_rt_realms(&realm, *argv))
806
			if (get_rt_realms(&realm, *argv))
807
				invarg("\"realm\" value is invalid\n", *argv);
807
				invarg("\"realm\" value is invalid\n", *argv);
Lines 1003-1009 Link Here
1003
			filter.tb = -1;
1003
			filter.tb = -1;
1004
		} else if (strcmp(*argv, "tos") == 0 ||
1004
		} else if (strcmp(*argv, "tos") == 0 ||
1005
			   matches(*argv, "dsfield") == 0) {
1005
			   matches(*argv, "dsfield") == 0) {
1006
			__u32 tos;
1006
			uint32_t tos;
1007
			NEXT_ARG();
1007
			NEXT_ARG();
1008
			if (rtnl_dsfield_a2n(&tos, *argv))
1008
			if (rtnl_dsfield_a2n(&tos, *argv))
1009
				invarg("TOS value is invalid\n", *argv);
1009
				invarg("TOS value is invalid\n", *argv);
Lines 1052-1058 Link Here
1052
			NEXT_ARG();
1052
			NEXT_ARG();
1053
			get_prefix(&filter.rprefsrc, *argv, do_ipv6);
1053
			get_prefix(&filter.rprefsrc, *argv, do_ipv6);
1054
		} else if (matches(*argv, "realms") == 0) {
1054
		} else if (matches(*argv, "realms") == 0) {
1055
			__u32 realm;
1055
			uint32_t realm;
1056
			NEXT_ARG();
1056
			NEXT_ARG();
1057
			if (get_rt_realms(&realm, *argv))
1057
			if (get_rt_realms(&realm, *argv))
1058
				invarg("invalid realms\n", *argv);
1058
				invarg("invalid realms\n", *argv);
Lines 1231-1237 Link Here
1231
	while (argc > 0) {
1231
	while (argc > 0) {
1232
		if (strcmp(*argv, "tos") == 0 ||
1232
		if (strcmp(*argv, "tos") == 0 ||
1233
		    matches(*argv, "dsfield") == 0) {
1233
		    matches(*argv, "dsfield") == 0) {
1234
			__u32 tos;
1234
			uint32_t tos;
1235
			NEXT_ARG();
1235
			NEXT_ARG();
1236
			if (rtnl_dsfield_a2n(&tos, *argv))
1236
			if (rtnl_dsfield_a2n(&tos, *argv))
1237
				invarg("TOS value is invalid\n", *argv);
1237
				invarg("TOS value is invalid\n", *argv);
(-)iproute2.orig/ip/iprule.c (-7 / +7 lines)
Lines 120-126 Link Here
120
		fprintf(fp, "tos %s ", rtnl_dsfield_n2a(r->rtm_tos, b1, sizeof(b1)));
120
		fprintf(fp, "tos %s ", rtnl_dsfield_n2a(r->rtm_tos, b1, sizeof(b1)));
121
	}
121
	}
122
	if (tb[RTA_PROTOINFO]) {
122
	if (tb[RTA_PROTOINFO]) {
123
		fprintf(fp, "fwmark %8x ", *(__u32*)RTA_DATA(tb[RTA_PROTOINFO]));
123
		fprintf(fp, "fwmark %8x ", *(uint32_t*)RTA_DATA(tb[RTA_PROTOINFO]));
124
	}
124
	}
125
125
126
	if (tb[RTA_IIF]) {
126
	if (tb[RTA_IIF]) {
Lines 131-138 Link Here
131
		fprintf(fp, "lookup %s ", rtnl_rttable_n2a(r->rtm_table, b1, sizeof(b1)));
131
		fprintf(fp, "lookup %s ", rtnl_rttable_n2a(r->rtm_table, b1, sizeof(b1)));
132
132
133
	if (tb[RTA_FLOW]) {
133
	if (tb[RTA_FLOW]) {
134
		__u32 to = *(__u32*)RTA_DATA(tb[RTA_FLOW]);
134
		uint32_t to = *(uint32_t*)RTA_DATA(tb[RTA_FLOW]);
135
		__u32 from = to>>16;
135
		uint32_t from = to>>16;
136
		to &= 0xFFFF;
136
		to &= 0xFFFF;
137
		if (from) {
137
		if (from) {
138
			fprintf(fp, "realms %s/",
138
			fprintf(fp, "realms %s/",
Lines 231-255 Link Here
231
		} else if (matches(*argv, "preference") == 0 ||
231
		} else if (matches(*argv, "preference") == 0 ||
232
			   matches(*argv, "order") == 0 ||
232
			   matches(*argv, "order") == 0 ||
233
			   matches(*argv, "priority") == 0) {
233
			   matches(*argv, "priority") == 0) {
234
			__u32 pref;
234
			uint32_t pref;
235
			NEXT_ARG();
235
			NEXT_ARG();
236
			if (get_u32(&pref, *argv, 0))
236
			if (get_u32(&pref, *argv, 0))
237
				invarg("preference value is invalid\n", *argv);
237
				invarg("preference value is invalid\n", *argv);
238
			addattr32(&req.n, sizeof(req), RTA_PRIORITY, pref);
238
			addattr32(&req.n, sizeof(req), RTA_PRIORITY, pref);
239
		} else if (strcmp(*argv, "tos") == 0) {
239
		} else if (strcmp(*argv, "tos") == 0) {
240
			__u32 tos;
240
			uint32_t tos;
241
			NEXT_ARG();
241
			NEXT_ARG();
242
			if (rtnl_dsfield_a2n(&tos, *argv))
242
			if (rtnl_dsfield_a2n(&tos, *argv))
243
				invarg("TOS value is invalid\n", *argv);
243
				invarg("TOS value is invalid\n", *argv);
244
			req.r.rtm_tos = tos;
244
			req.r.rtm_tos = tos;
245
		} else if (strcmp(*argv, "fwmark") == 0) {
245
		} else if (strcmp(*argv, "fwmark") == 0) {
246
			__u32 fwmark;
246
			uint32_t fwmark;
247
			NEXT_ARG();
247
			NEXT_ARG();
248
			if (get_u32(&fwmark, *argv, 16))
248
			if (get_u32(&fwmark, *argv, 16))
249
				invarg("fwmark value is invalid\n", *argv);
249
				invarg("fwmark value is invalid\n", *argv);
250
			addattr32(&req.n, sizeof(req), RTA_PROTOINFO, fwmark);
250
			addattr32(&req.n, sizeof(req), RTA_PROTOINFO, fwmark);
251
		} else if (matches(*argv, "realms") == 0) {
251
		} else if (matches(*argv, "realms") == 0) {
252
			__u32 realm;
252
			uint32_t realm;
253
			NEXT_ARG();
253
			NEXT_ARG();
254
			if (get_rt_realms(&realm, *argv))
254
			if (get_rt_realms(&realm, *argv))
255
				invarg("invalid realms\n", *argv);
255
				invarg("invalid realms\n", *argv);
(-)iproute2.orig/ip/iptunnel.c (-3 / +3 lines)
Lines 16-21 Link Here
16
 * Phil Karn <karn@ka9q.ampr.org>	990408:	"pmtudisc" flag
16
 * Phil Karn <karn@ka9q.ampr.org>	990408:	"pmtudisc" flag
17
 */
17
 */
18
18
19
#include <netinet/ip.h>
20
#include <arpa/inet.h>
19
#include <stdio.h>
21
#include <stdio.h>
20
#include <stdlib.h>
22
#include <stdlib.h>
21
#include <string.h>
23
#include <string.h>
Lines 27-34 Link Here
27
#include <linux/if.h>
29
#include <linux/if.h>
28
#include <linux/if_arp.h>
30
#include <linux/if_arp.h>
29
#include <netinet/in.h>
31
#include <netinet/in.h>
30
#include <netinet/ip.h>
31
#include <arpa/inet.h>
32
#include <linux/if_tunnel.h>
32
#include <linux/if_tunnel.h>
33
33
34
#include "rt_names.h"
34
#include "rt_names.h"
Lines 283-289 Link Here
283
			}
283
			}
284
		} else if (strcmp(*argv, "tos") == 0 ||
284
		} else if (strcmp(*argv, "tos") == 0 ||
285
			   matches(*argv, "dsfield") == 0) {
285
			   matches(*argv, "dsfield") == 0) {
286
			__u32 uval;
286
			uint32_t uval;
287
			NEXT_ARG();
287
			NEXT_ARG();
288
			if (strcmp(*argv, "inherit") != 0) {
288
			if (strcmp(*argv, "inherit") != 0) {
289
				if (rtnl_dsfield_a2n(&uval, *argv))
289
				if (rtnl_dsfield_a2n(&uval, *argv))
(-)iproute2.orig/ip/rtacct.c (-3 / +3 lines)
Lines 26-32 Link Here
26
{
26
{
27
	int i;
27
	int i;
28
	int fd;
28
	int fd;
29
	__u32 buffer[256*4];
29
	int buffer[256*4];
30
	char b1[64];
30
	char b1[64];
31
	int rlist[argc];
31
	int rlist[argc];
32
	int rhwm = 0;
32
	int rhwm = 0;
Lines 66-72 Link Here
66
66
67
	if (rhwm == 0) {
67
	if (rhwm == 0) {
68
		for (i=0; i<256; i++) {
68
		for (i=0; i<256; i++) {
69
			__u32 *p = &buffer[i*4];
69
			int *p = &buffer[i*4];
70
70
71
			if (!p[0] && !p[1] && !p[2] && !p[3])
71
			if (!p[0] && !p[1] && !p[2] && !p[3])
72
				continue;
72
				continue;
Lines 84-90 Link Here
84
		int k;
84
		int k;
85
85
86
		for (k=0; k<rhwm; k++) {
86
		for (k=0; k<rhwm; k++) {
87
			__u32 *p;
87
			int *p;
88
88
89
			i = rlist[k];
89
			i = rlist[k];
90
			p = &buffer[i*4];
90
			p = &buffer[i*4];
(-)iproute2.orig/ip/rtm_map.c (-2 / +2 lines)
Lines 93-101 Link Here
93
	return 0;
93
	return 0;
94
}
94
}
95
95
96
int get_rt_realms(__u32 *realms, char *arg)
96
int get_rt_realms(uint32_t *realms, char *arg)
97
{
97
{
98
	__u32 realm = 0;
98
	uint32_t realm = 0;
99
	char *p = strchr(arg, '/');
99
	char *p = strchr(arg, '/');
100
100
101
	*realms = 0;
101
	*realms = 0;
(-)iproute2.orig/ip/rtmon.c (-2 / +2 lines)
Lines 41-48 Link Here
41
	n1->nlmsg_pid = 0;
41
	n1->nlmsg_pid = 0;
42
	n1->nlmsg_len = NLMSG_LENGTH(4*2);
42
	n1->nlmsg_len = NLMSG_LENGTH(4*2);
43
	gettimeofday(&tv, NULL);
43
	gettimeofday(&tv, NULL);
44
	((__u32*)NLMSG_DATA(n1))[0] = tv.tv_sec;
44
	((uint32_t*)NLMSG_DATA(n1))[0] = tv.tv_sec;
45
	((__u32*)NLMSG_DATA(n1))[1] = tv.tv_usec;
45
	((uint32_t*)NLMSG_DATA(n1))[1] = tv.tv_usec;
46
	fwrite((void*)n1, 1, NLMSG_ALIGN(n1->nlmsg_len), fp);
46
	fwrite((void*)n1, 1, NLMSG_ALIGN(n1->nlmsg_len), fp);
47
}
47
}
48
48
(-)iproute2.orig/lib/inet_proto.c (-1 / +1 lines)
Lines 52-58 Link Here
52
		return icache;
52
		return icache;
53
53
54
	if (buf[0] >= '0' && buf[0] <= '9') {
54
	if (buf[0] >= '0' && buf[0] <= '9') {
55
		__u8 ret;
55
		uint8_t ret;
56
		if (get_u8(&ret, buf, 10))
56
		if (get_u8(&ret, buf, 10))
57
			return -1;
57
			return -1;
58
		return ret;
58
		return ret;
(-)iproute2.orig/lib/libnetlink.c (-2 / +2 lines)
Lines 448-454 Link Here
448
	}
448
	}
449
}
449
}
450
450
451
int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data)
451
int addattr32(struct nlmsghdr *n, int maxlen, int type, uint32_t data)
452
{
452
{
453
	int len = RTA_LENGTH(4);
453
	int len = RTA_LENGTH(4);
454
	struct rtattr *rta;
454
	struct rtattr *rta;
Lines 477-483 Link Here
477
	return 0;
477
	return 0;
478
}
478
}
479
479
480
int rta_addattr32(struct rtattr *rta, int maxlen, int type, __u32 data)
480
int rta_addattr32(struct rtattr *rta, int maxlen, int type, uint32_t data)
481
{
481
{
482
	int len = RTA_LENGTH(4);
482
	int len = RTA_LENGTH(4);
483
	struct rtattr *subrta;
483
	struct rtattr *subrta;
(-)iproute2.orig/lib/ll_addr.c (-2 / +2 lines)
Lines 9-14 Link Here
9
 * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
9
 * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10
 */
10
 */
11
11
12
#include <netinet/in.h>
13
#include <arpa/inet.h>
12
#include <stdio.h>
14
#include <stdio.h>
13
#include <stdlib.h>
15
#include <stdlib.h>
14
#include <unistd.h>
16
#include <unistd.h>
Lines 20-27 Link Here
20
#include <linux/netdevice.h>
22
#include <linux/netdevice.h>
21
#include <linux/if_arp.h>
23
#include <linux/if_arp.h>
22
#include <linux/sockios.h>
24
#include <linux/sockios.h>
23
#include <netinet/in.h>
24
#include <arpa/inet.h>
25
#include <string.h>
25
#include <string.h>
26
26
27
#include "utils.h"
27
#include "utils.h"
(-)iproute2.orig/lib/ll_proto.c (-2 / +2 lines)
Lines 9-14 Link Here
9
 * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
9
 * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10
 */
10
 */
11
11
12
#include <netinet/in.h>
13
#include <arpa/inet.h>
12
#include <stdio.h>
14
#include <stdio.h>
13
#include <stdlib.h>
15
#include <stdlib.h>
14
#include <unistd.h>
16
#include <unistd.h>
Lines 20-27 Link Here
20
#include <linux/netdevice.h>
22
#include <linux/netdevice.h>
21
#include <linux/if_arp.h>
23
#include <linux/if_arp.h>
22
#include <linux/sockios.h>
24
#include <linux/sockios.h>
23
#include <netinet/in.h>
24
#include <arpa/inet.h>
25
#include <string.h>
25
#include <string.h>
26
26
27
#include "utils.h"
27
#include "utils.h"
(-)iproute2.orig/lib/ll_types.c (-2 / +2 lines)
Lines 9-14 Link Here
9
 * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
9
 * Authors:	Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru>
10
 */
10
 */
11
11
12
#include <netinet/in.h>
13
#include <arpa/inet.h>
12
#include <stdio.h>
14
#include <stdio.h>
13
#include <stdlib.h>
15
#include <stdlib.h>
14
#include <unistd.h>
16
#include <unistd.h>
Lines 20-27 Link Here
20
#include <linux/netdevice.h>
22
#include <linux/netdevice.h>
21
#include <linux/if_arp.h>
23
#include <linux/if_arp.h>
22
#include <linux/sockios.h>
24
#include <linux/sockios.h>
23
#include <netinet/in.h>
24
#include <arpa/inet.h>
25
#include <string.h>
25
#include <string.h>
26
26
27
char * ll_type_n2a(int type, char *buf, int len)
27
char * ll_type_n2a(int type, char *buf, int len)
(-)iproute2.orig/lib/rt_names.c (-5 / +5 lines)
Lines 95-101 Link Here
95
	return buf;
95
	return buf;
96
}
96
}
97
97
98
int rtnl_rtprot_a2n(__u32 *id, char *arg)
98
int rtnl_rtprot_a2n(int *id, char *arg)
99
{
99
{
100
	static char *cache = NULL;
100
	static char *cache = NULL;
101
	static unsigned long res;
101
	static unsigned long res;
Lines 162-168 Link Here
162
	return buf;
162
	return buf;
163
}
163
}
164
164
165
int rtnl_rtscope_a2n(__u32 *id, char *arg)
165
int rtnl_rtscope_a2n(int *id, char *arg)
166
{
166
{
167
	static char *cache = NULL;
167
	static char *cache = NULL;
168
	static unsigned long res;
168
	static unsigned long res;
Lines 226-232 Link Here
226
}
226
}
227
227
228
228
229
int rtnl_rtrealm_a2n(__u32 *id, char *arg)
229
int rtnl_rtrealm_a2n(int *id, char *arg)
230
{
230
{
231
	static char *cache = NULL;
231
	static char *cache = NULL;
232
	static unsigned long res;
232
	static unsigned long res;
Lines 291-297 Link Here
291
	return buf;
291
	return buf;
292
}
292
}
293
293
294
int rtnl_rttable_a2n(__u32 *id, char *arg)
294
int rtnl_rttable_a2n(int *id, char *arg)
295
{
295
{
296
	static char *cache = NULL;
296
	static char *cache = NULL;
297
	static unsigned long res;
297
	static unsigned long res;
Lines 354-360 Link Here
354
}
354
}
355
355
356
356
357
int rtnl_dsfield_a2n(__u32 *id, char *arg)
357
int rtnl_dsfield_a2n(int *id, char *arg)
358
{
358
{
359
	static char *cache = NULL;
359
	static char *cache = NULL;
360
	static unsigned long res;
360
	static unsigned long res;
(-)iproute2.orig/lib/utils.c (-7 / +7 lines)
Lines 57-63 Link Here
57
	return 0;
57
	return 0;
58
}
58
}
59
59
60
int get_u32(__u32 *val, char *arg, int base)
60
int get_u32(uint32_t *val, char *arg, int base)
61
{
61
{
62
	unsigned long res;
62
	unsigned long res;
63
	char *ptr;
63
	char *ptr;
Lines 85-91 Link Here
85
	return 0;
85
	return 0;
86
}
86
}
87
87
88
int get_u8(__u8 *val, char *arg, int base)
88
int get_u8(uint8_t *val, char *arg, int base)
89
{
89
{
90
	unsigned long res;
90
	unsigned long res;
91
	char *ptr;
91
	char *ptr;
Lines 258-264 Link Here
258
	return 0;
258
	return 0;
259
}
259
}
260
260
261
__u32 get_addr32(char *name)
261
uint32_t get_addr32(char *name)
262
{
262
{
263
	inet_prefix addr;
263
	inet_prefix addr;
264
	if (get_addr_1(&addr, name, AF_INET)) {
264
	if (get_addr_1(&addr, name, AF_INET)) {
Lines 302-309 Link Here
302
302
303
int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits)
303
int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits)
304
{
304
{
305
	__u32 *a1 = a->data;
305
	uint32_t *a1 = a->data;
306
	__u32 *a2 = b->data;
306
	uint32_t *a2 = b->data;
307
	int words = bits >> 0x05;
307
	int words = bits >> 0x05;
308
308
309
	bits &= 0x1f;
309
	bits &= 0x1f;
Lines 313-320 Link Here
313
			return -1;
313
			return -1;
314
314
315
	if (bits) {
315
	if (bits) {
316
		__u32 w1, w2;
316
		uint32_t w1, w2;
317
		__u32 mask;
317
		uint32_t mask;
318
318
319
		w1 = a1[words];
319
		w1 = a1[words];
320
		w2 = a2[words];
320
		w2 = a2[words];
(-)iproute2.orig/tc/f_fw.c (-2 / +2 lines)
Lines 84-90 Link Here
84
	return 0;
84
	return 0;
85
}
85
}
86
86
87
static int fw_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 handle)
87
static int fw_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, uint32_t handle)
88
{
88
{
89
	struct rtattr *tb[TCA_FW_MAX+1];
89
	struct rtattr *tb[TCA_FW_MAX+1];
90
90
Lines 100-106 Link Here
100
100
101
	if (tb[TCA_FW_CLASSID]) {
101
	if (tb[TCA_FW_CLASSID]) {
102
		SPRINT_BUF(b1);
102
		SPRINT_BUF(b1);
103
		fprintf(f, "classid %s ", sprint_tc_classid(*(__u32*)RTA_DATA(tb[TCA_FW_CLASSID]), b1));
103
		fprintf(f, "classid %s ", sprint_tc_classid(*(uint32_t*)RTA_DATA(tb[TCA_FW_CLASSID]), b1));
104
	}
104
	}
105
105
106
	if (tb[TCA_FW_POLICE])
106
	if (tb[TCA_FW_POLICE])
(-)iproute2.orig/tc/f_route.c (-9 / +9 lines)
Lines 39-46 Link Here
39
	struct tc_police tp;
39
	struct tc_police tp;
40
	struct tcmsg *t = NLMSG_DATA(n);
40
	struct tcmsg *t = NLMSG_DATA(n);
41
	struct rtattr *tail;
41
	struct rtattr *tail;
42
	__u32 fh = 0xFFFF8000;
42
	uint32_t fh = 0xFFFF8000;
43
	__u32 order = 0;
43
	uint32_t order = 0;
44
44
45
	memset(&tp, 0, sizeof(tp));
45
	memset(&tp, 0, sizeof(tp));
46
46
Lines 59-65 Link Here
59
59
60
	while (argc > 0) {
60
	while (argc > 0) {
61
		if (matches(*argv, "to") == 0) {
61
		if (matches(*argv, "to") == 0) {
62
			__u32 id;
62
			uint32_t id;
63
			NEXT_ARG();
63
			NEXT_ARG();
64
			if (rtnl_rtrealm_a2n(&id, *argv)) {
64
			if (rtnl_rtrealm_a2n(&id, *argv)) {
65
				fprintf(stderr, "Illegal \"to\"\n");
65
				fprintf(stderr, "Illegal \"to\"\n");
Lines 69-75 Link Here
69
			fh &= ~0x80FF;
69
			fh &= ~0x80FF;
70
			fh |= id&0xFF;
70
			fh |= id&0xFF;
71
		} else if (matches(*argv, "from") == 0) {
71
		} else if (matches(*argv, "from") == 0) {
72
			__u32 id;
72
			uint32_t id;
73
			NEXT_ARG();
73
			NEXT_ARG();
74
			if (rtnl_rtrealm_a2n(&id, *argv)) {
74
			if (rtnl_rtrealm_a2n(&id, *argv)) {
75
				fprintf(stderr, "Illegal \"from\"\n");
75
				fprintf(stderr, "Illegal \"from\"\n");
Lines 80-86 Link Here
80
			fh |= id<<16;
80
			fh |= id<<16;
81
		} else if (matches(*argv, "fromif") == 0) {
81
		} else if (matches(*argv, "fromif") == 0) {
82
			struct rtnl_handle rth;
82
			struct rtnl_handle rth;
83
			__u32 id;
83
			uint32_t id;
84
			NEXT_ARG();
84
			NEXT_ARG();
85
			if (rtnl_open(&rth, 0) == 0) {
85
			if (rtnl_open(&rth, 0) == 0) {
86
				ll_init_map(&rth);
86
				ll_init_map(&rth);
Lines 135-141 Link Here
135
	return 0;
135
	return 0;
136
}
136
}
137
137
138
static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 handle)
138
static int route_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, uint32_t handle)
139
{
139
{
140
	struct rtattr *tb[TCA_ROUTE4_MAX+1];
140
	struct rtattr *tb[TCA_ROUTE4_MAX+1];
141
	SPRINT_BUF(b1);
141
	SPRINT_BUF(b1);
Lines 154-165 Link Here
154
154
155
	if (tb[TCA_ROUTE4_CLASSID]) {
155
	if (tb[TCA_ROUTE4_CLASSID]) {
156
		SPRINT_BUF(b1);
156
		SPRINT_BUF(b1);
157
		fprintf(f, "flowid %s ", sprint_tc_classid(*(__u32*)RTA_DATA(tb[TCA_ROUTE4_CLASSID]), b1));
157
		fprintf(f, "flowid %s ", sprint_tc_classid(*(uint32_t*)RTA_DATA(tb[TCA_ROUTE4_CLASSID]), b1));
158
	}
158
	}
159
	if (tb[TCA_ROUTE4_TO])
159
	if (tb[TCA_ROUTE4_TO])
160
		fprintf(f, "to %s ", rtnl_rtrealm_n2a(*(__u32*)RTA_DATA(tb[TCA_ROUTE4_TO]), b1, sizeof(b1)));
160
		fprintf(f, "to %s ", rtnl_rtrealm_n2a(*(uint32_t*)RTA_DATA(tb[TCA_ROUTE4_TO]), b1, sizeof(b1)));
161
	if (tb[TCA_ROUTE4_FROM])
161
	if (tb[TCA_ROUTE4_FROM])
162
		fprintf(f, "from %s ", rtnl_rtrealm_n2a(*(__u32*)RTA_DATA(tb[TCA_ROUTE4_FROM]), b1, sizeof(b1)));
162
		fprintf(f, "from %s ", rtnl_rtrealm_n2a(*(uint32_t*)RTA_DATA(tb[TCA_ROUTE4_FROM]), b1, sizeof(b1)));
163
	if (tb[TCA_ROUTE4_IIF])
163
	if (tb[TCA_ROUTE4_IIF])
164
		fprintf(f, "fromif %s", ll_index_to_name(*(int*)RTA_DATA(tb[TCA_ROUTE4_IIF])));
164
		fprintf(f, "fromif %s", ll_index_to_name(*(int*)RTA_DATA(tb[TCA_ROUTE4_IIF])));
165
	if (tb[TCA_ROUTE4_POLICE])
165
	if (tb[TCA_ROUTE4_POLICE])
(-)iproute2.orig/tc/f_rsvp.c (-10 / +10 lines)
Lines 54-64 Link Here
54
54
55
		if (dir == 0) {
55
		if (dir == 0) {
56
			/* Source port: u16 at offset 0 */
56
			/* Source port: u16 at offset 0 */
57
			pi->key = htonl(((__u32)tmp)<<16);
57
			pi->key = htonl(((uint32_t)tmp)<<16);
58
			pi->mask = htonl(0xFFFF0000);
58
			pi->mask = htonl(0xFFFF0000);
59
		} else {
59
		} else {
60
			/* Destination port: u16 at offset 2 */
60
			/* Destination port: u16 at offset 2 */
61
			pi->key = htonl(((__u32)tmp));
61
			pi->key = htonl(((uint32_t)tmp));
62
			pi->mask = htonl(0x0000FFFF);
62
			pi->mask = htonl(0x0000FFFF);
63
		}
63
		}
64
		pi->offset = 0;
64
		pi->offset = 0;
Lines 76-82 Link Here
76
76
77
	if (strcmp(*argv, "spi/ah") == 0 ||
77
	if (strcmp(*argv, "spi/ah") == 0 ||
78
	    strcmp(*argv, "gpi/ah") == 0) {
78
	    strcmp(*argv, "gpi/ah") == 0) {
79
		__u32 gpi;
79
		uint32_t gpi;
80
		NEXT_ARG();
80
		NEXT_ARG();
81
		if (get_u32(&gpi, *argv, 0))
81
		if (get_u32(&gpi, *argv, 0))
82
			return -1;
82
			return -1;
Lines 88-94 Link Here
88
		argc--; argv++;
88
		argc--; argv++;
89
	} else if (strcmp(*argv, "spi/esp") == 0 ||
89
	} else if (strcmp(*argv, "spi/esp") == 0 ||
90
		   strcmp(*argv, "gpi/esp") == 0) {
90
		   strcmp(*argv, "gpi/esp") == 0) {
91
		__u32 gpi;
91
		uint32_t gpi;
92
		NEXT_ARG();
92
		NEXT_ARG();
93
		if (get_u32(&gpi, *argv, 0))
93
		if (get_u32(&gpi, *argv, 0))
94
			return -1;
94
			return -1;
Lines 99-105 Link Here
99
			pinfo->protocol = IPPROTO_ESP;
99
			pinfo->protocol = IPPROTO_ESP;
100
		argc--; argv++;
100
		argc--; argv++;
101
	} else if (strcmp(*argv, "flowlabel") == 0) {
101
	} else if (strcmp(*argv, "flowlabel") == 0) {
102
		__u32 flabel;
102
		uint32_t flabel;
103
		NEXT_ARG();
103
		NEXT_ARG();
104
		if (get_u32(&flabel, *argv, 0))
104
		if (get_u32(&flabel, *argv, 0))
105
			return -1;
105
			return -1;
Lines 113-120 Link Here
113
		   strcmp(*argv, "u16") == 0 ||
113
		   strcmp(*argv, "u16") == 0 ||
114
		   strcmp(*argv, "u8") == 0) {
114
		   strcmp(*argv, "u8") == 0) {
115
		int sz = 1;
115
		int sz = 1;
116
		__u32 tmp;
116
		uint32_t tmp;
117
		__u32 mask = 0xff;
117
		uint32_t mask = 0xff;
118
		if (strcmp(*argv, "u32") == 0) {
118
		if (strcmp(*argv, "u32") == 0) {
119
			sz = 4;
119
			sz = 4;
120
			mask = 0xffff;
120
			mask = 0xffff;
Lines 313-319 Link Here
313
	return buf;
313
	return buf;
314
}
314
}
315
315
316
static int rsvp_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 handle)
316
static int rsvp_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, uint32_t handle)
317
{
317
{
318
	int family = strcmp(qu->id, "rsvp") == 0 ? AF_INET : AF_INET6;
318
	int family = strcmp(qu->id, "rsvp") == 0 ? AF_INET : AF_INET6;
319
	struct rtattr *tb[TCA_RSVP_MAX+1];
319
	struct rtattr *tb[TCA_RSVP_MAX+1];
Lines 339-347 Link Here
339
	if (tb[TCA_RSVP_CLASSID]) {
339
	if (tb[TCA_RSVP_CLASSID]) {
340
		SPRINT_BUF(b1);
340
		SPRINT_BUF(b1);
341
		if (!pinfo || pinfo->tunnelhdr == 0)
341
		if (!pinfo || pinfo->tunnelhdr == 0)
342
			fprintf(f, "flowid %s ", sprint_tc_classid(*(__u32*)RTA_DATA(tb[TCA_RSVP_CLASSID]), b1));
342
			fprintf(f, "flowid %s ", sprint_tc_classid(*(uint32_t*)RTA_DATA(tb[TCA_RSVP_CLASSID]), b1));
343
		else
343
		else
344
			fprintf(f, "tunnel %d skip %d ", *(__u32*)RTA_DATA(tb[TCA_RSVP_CLASSID]), pinfo->tunnelhdr);
344
			fprintf(f, "tunnel %d skip %d ", *(uint32_t*)RTA_DATA(tb[TCA_RSVP_CLASSID]), pinfo->tunnelhdr);
345
	} else if (pinfo && pinfo->tunnelhdr)
345
	} else if (pinfo && pinfo->tunnelhdr)
346
		fprintf(f, "tunnel [BAD] skip %d ", pinfo->tunnelhdr);
346
		fprintf(f, "tunnel [BAD] skip %d ", pinfo->tunnelhdr);
347
347
(-)iproute2.orig/tc/f_tcindex.c (-3 / +3 lines)
Lines 93-99 Link Here
93
			    sizeof(value));
93
			    sizeof(value));
94
		}
94
		}
95
		else if (!strcmp(*argv,"classid")) {
95
		else if (!strcmp(*argv,"classid")) {
96
			__u32 handle;
96
			uint32_t handle;
97
97
98
			NEXT_ARG();
98
			NEXT_ARG();
99
			if (get_tc_classid(&handle,*argv)) {
99
			if (get_tc_classid(&handle,*argv)) {
Lines 123-129 Link Here
123
123
124
124
125
static int tcindex_print_opt(struct filter_util *qu, FILE *f,
125
static int tcindex_print_opt(struct filter_util *qu, FILE *f,
126
     struct rtattr *opt, __u32 handle)
126
     struct rtattr *opt, uint32_t handle)
127
{
127
{
128
	struct rtattr *tb[TCA_TCINDEX_MAX+1];
128
	struct rtattr *tb[TCA_TCINDEX_MAX+1];
129
129
Lines 168-174 Link Here
168
	}
168
	}
169
	if (tb[TCA_TCINDEX_CLASSID]) {
169
	if (tb[TCA_TCINDEX_CLASSID]) {
170
		SPRINT_BUF(b1);
170
		SPRINT_BUF(b1);
171
		fprintf(f, "classid %s ",sprint_tc_classid(*(__u32 *)
171
		fprintf(f, "classid %s ",sprint_tc_classid(*(uint32_t *)
172
		    RTA_DATA(tb[TCA_TCINDEX_CLASSID]), b1));
172
		    RTA_DATA(tb[TCA_TCINDEX_CLASSID]), b1));
173
	}
173
	}
174
	if (tb[TCA_TCINDEX_POLICE]) {
174
	if (tb[TCA_TCINDEX_POLICE]) {
(-)iproute2.orig/tc/f_u32.c (-28 / +28 lines)
Lines 38-46 Link Here
38
38
39
#define usage() return(-1)
39
#define usage() return(-1)
40
40
41
int get_u32_handle(__u32 *handle, char *str)
41
int get_u32_handle(uint32_t *handle, char *str)
42
{
42
{
43
	__u32 htid=0, hash=0, nodeid=0;
43
	uint32_t htid=0, hash=0, nodeid=0;
44
	char *tmp = strchr(str, ':');
44
	char *tmp = strchr(str, ':');
45
45
46
	if (tmp == NULL) {
46
	if (tmp == NULL) {
Lines 73-84 Link Here
73
	return 0;
73
	return 0;
74
}
74
}
75
75
76
char * sprint_u32_handle(__u32 handle, char *buf)
76
char * sprint_u32_handle(uint32_t handle, char *buf)
77
{
77
{
78
	int bsize = SPRINT_BSIZE-1;
78
	int bsize = SPRINT_BSIZE-1;
79
	__u32 htid = TC_U32_HTID(handle);
79
	uint32_t htid = TC_U32_HTID(handle);
80
	__u32 hash = TC_U32_HASH(handle);
80
	uint32_t hash = TC_U32_HASH(handle);
81
	__u32 nodeid = TC_U32_NODE(handle);
81
	uint32_t nodeid = TC_U32_NODE(handle);
82
	char *b = buf;
82
	char *b = buf;
83
83
84
	if (handle == 0) {
84
	if (handle == 0) {
Lines 107-113 Link Here
107
	return buf;
107
	return buf;
108
}
108
}
109
109
110
static int pack_key(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, int offmask)
110
static int pack_key(struct tc_u32_sel *sel, uint32_t key, uint32_t mask, int off, int offmask)
111
{
111
{
112
	int i;
112
	int i;
113
	int hwm = sel->nkeys;
113
	int hwm = sel->nkeys;
Lines 116-122 Link Here
116
116
117
	for (i=0; i<hwm; i++) {
117
	for (i=0; i<hwm; i++) {
118
		if (sel->keys[i].off == off && sel->keys[i].offmask == offmask) {
118
		if (sel->keys[i].off == off && sel->keys[i].offmask == offmask) {
119
			__u32 intersect = mask&sel->keys[i].mask;
119
			uint32_t intersect = mask&sel->keys[i].mask;
120
120
121
			if ((key^sel->keys[i].val) & intersect)
121
			if ((key^sel->keys[i].val) & intersect)
122
				return -1;
122
				return -1;
Lines 138-151 Link Here
138
	return 0;
138
	return 0;
139
}
139
}
140
140
141
static int pack_key32(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, int offmask)
141
static int pack_key32(struct tc_u32_sel *sel, uint32_t key, uint32_t mask, int off, int offmask)
142
{
142
{
143
	key = htonl(key);
143
	key = htonl(key);
144
	mask = htonl(mask);
144
	mask = htonl(mask);
145
	return pack_key(sel, key, mask, off, offmask);
145
	return pack_key(sel, key, mask, off, offmask);
146
}
146
}
147
147
148
static int pack_key16(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, int offmask)
148
static int pack_key16(struct tc_u32_sel *sel, uint32_t key, uint32_t mask, int off, int offmask)
149
{
149
{
150
	if (key > 0xFFFF || mask > 0xFFFF)
150
	if (key > 0xFFFF || mask > 0xFFFF)
151
		return -1;
151
		return -1;
Lines 161-167 Link Here
161
	return pack_key(sel, key, mask, off, offmask);
161
	return pack_key(sel, key, mask, off, offmask);
162
}
162
}
163
163
164
static int pack_key8(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, int offmask)
164
static int pack_key8(struct tc_u32_sel *sel, uint32_t key, uint32_t mask, int off, int offmask)
165
{
165
{
166
	if (key > 0xFF || mask > 0xFF)
166
	if (key > 0xFF || mask > 0xFF)
167
		return -1;
167
		return -1;
Lines 218-225 Link Here
218
	int res = -1;
218
	int res = -1;
219
	int argc = *argc_p;
219
	int argc = *argc_p;
220
	char **argv = *argv_p;
220
	char **argv = *argv_p;
221
	__u32 key;
221
	uint32_t key;
222
	__u32 mask;
222
	uint32_t mask;
223
223
224
	if (argc < 2)
224
	if (argc < 2)
225
		return -1;
225
		return -1;
Lines 249-256 Link Here
249
	int res = -1;
249
	int res = -1;
250
	int argc = *argc_p;
250
	int argc = *argc_p;
251
	char **argv = *argv_p;
251
	char **argv = *argv_p;
252
	__u32 key;
252
	uint32_t key;
253
	__u32 mask;
253
	uint32_t mask;
254
254
255
	if (argc < 2)
255
	if (argc < 2)
256
		return -1;
256
		return -1;
Lines 279-286 Link Here
279
	int res = -1;
279
	int res = -1;
280
	int argc = *argc_p;
280
	int argc = *argc_p;
281
	char **argv = *argv_p;
281
	char **argv = *argv_p;
282
	__u32 key;
282
	uint32_t key;
283
	__u32 mask;
283
	uint32_t mask;
284
284
285
	if (argc < 2)
285
	if (argc < 2)
286
		return -1;
286
		return -1;
Lines 314-320 Link Here
314
	int argc = *argc_p;
314
	int argc = *argc_p;
315
	char **argv = *argv_p;
315
	char **argv = *argv_p;
316
	inet_prefix addr;
316
	inet_prefix addr;
317
	__u32 mask;
317
	uint32_t mask;
318
	int offmask = 0;
318
	int offmask = 0;
319
319
320
	if (argc < 1)
320
	if (argc < 1)
Lines 371-377 Link Here
371
			if ((res = pack_key(sel, addr.data[i/32], 0xFFFFFFFF, off+4*(i/32), offmask)) < 0)
371
			if ((res = pack_key(sel, addr.data[i/32], 0xFFFFFFFF, off+4*(i/32), offmask)) < 0)
372
				return -1;
372
				return -1;
373
		} else if (i<plen) {
373
		} else if (i<plen) {
374
			__u32 mask = htonl(0xFFFFFFFF<<(32-(plen-i)));
374
			uint32_t mask = htonl(0xFFFFFFFF<<(32-(plen-i)));
375
			if ((res = pack_key(sel, addr.data[i/32], mask, off+4*(i/32), offmask)) < 0)
375
			if ((res = pack_key(sel, addr.data[i/32], mask, off+4*(i/32), offmask)) < 0)
376
				return -1;
376
				return -1;
377
		}
377
		}
Lines 705-711 Link Here
705
705
706
	while (argc > 0) {
706
	while (argc > 0) {
707
		if (matches(*argv, "mask") == 0) {
707
		if (matches(*argv, "mask") == 0) {
708
			__u32 mask;
708
			uint32_t mask;
709
			NEXT_ARG();
709
			NEXT_ARG();
710
			if (get_u32(&mask, *argv, 16))
710
			if (get_u32(&mask, *argv, 16))
711
				return -1;
711
				return -1;
Lines 739-746 Link Here
739
	struct rtattr *tail;
739
	struct rtattr *tail;
740
	int sel_ok = 0;
740
	int sel_ok = 0;
741
	int sample_ok = 0;
741
	int sample_ok = 0;
742
	__u32 htid = 0;
742
	uint32_t htid = 0;
743
	__u32 order = 0;
743
	uint32_t order = 0;
744
744
745
	memset(&sel, 0, sizeof(sel));
745
	memset(&sel, 0, sizeof(sel));
746
746
Lines 831-837 Link Here
831
			else
831
			else
832
				htid = (handle&0xFFFFF000);
832
				htid = (handle&0xFFFFF000);
833
		} else if (strcmp(*argv, "sample") == 0) {
833
		} else if (strcmp(*argv, "sample") == 0) {
834
			__u32 hash;
834
			uint32_t hash;
835
			struct {
835
			struct {
836
				struct tc_u32_sel sel;
836
				struct tc_u32_sel sel;
837
				struct tc_u32_key keys[4];
837
				struct tc_u32_key keys[4];
Lines 885-891 Link Here
885
	return 0;
885
	return 0;
886
}
886
}
887
887
888
static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 handle)
888
static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, uint32_t handle)
889
{
889
{
890
	struct rtattr *tb[TCA_U32_MAX+1];
890
	struct rtattr *tb[TCA_U32_MAX+1];
891
	struct tc_u32_sel *sel = NULL;
891
	struct tc_u32_sel *sel = NULL;
Lines 913-921 Link Here
913
	}
913
	}
914
914
915
	if (tb[TCA_U32_DIVISOR]) {
915
	if (tb[TCA_U32_DIVISOR]) {
916
		fprintf(f, "ht divisor %d ", *(__u32*)RTA_DATA(tb[TCA_U32_DIVISOR]));
916
		fprintf(f, "ht divisor %d ", *(uint32_t*)RTA_DATA(tb[TCA_U32_DIVISOR]));
917
	} else if (tb[TCA_U32_HASH]) {
917
	} else if (tb[TCA_U32_HASH]) {
918
		__u32 htid = *(__u32*)RTA_DATA(tb[TCA_U32_HASH]);
918
		uint32_t htid = *(uint32_t*)RTA_DATA(tb[TCA_U32_HASH]);
919
		fprintf(f, "key ht %x bkt %x ", TC_U32_USERHTID(htid), TC_U32_HASH(htid));
919
		fprintf(f, "key ht %x bkt %x ", TC_U32_USERHTID(htid), TC_U32_HASH(htid));
920
	} else {
920
	} else {
921
		fprintf(f, "??? ");
921
		fprintf(f, "??? ");
Lines 924-936 Link Here
924
		SPRINT_BUF(b1);
924
		SPRINT_BUF(b1);
925
		fprintf(f, "%sflowid %s ",
925
		fprintf(f, "%sflowid %s ",
926
			!sel || !(sel->flags&TC_U32_TERMINAL) ? "*" : "",
926
			!sel || !(sel->flags&TC_U32_TERMINAL) ? "*" : "",
927
			sprint_tc_classid(*(__u32*)RTA_DATA(tb[TCA_U32_CLASSID]), b1));
927
			sprint_tc_classid(*(uint32_t*)RTA_DATA(tb[TCA_U32_CLASSID]), b1));
928
	} else if (sel && sel->flags&TC_U32_TERMINAL) {
928
	} else if (sel && sel->flags&TC_U32_TERMINAL) {
929
		fprintf(f, "terminal flowid ??? ");
929
		fprintf(f, "terminal flowid ??? ");
930
	}
930
	}
931
	if (tb[TCA_U32_LINK]) {
931
	if (tb[TCA_U32_LINK]) {
932
		SPRINT_BUF(b1);
932
		SPRINT_BUF(b1);
933
		fprintf(f, "link %s ", sprint_u32_handle(*(__u32*)RTA_DATA(tb[TCA_U32_LINK]), b1));
933
		fprintf(f, "link %s ", sprint_u32_handle(*(uint32_t*)RTA_DATA(tb[TCA_U32_LINK]), b1));
934
	}
934
	}
935
	if (tb[TCA_U32_POLICE]) {
935
	if (tb[TCA_U32_POLICE]) {
936
		fprintf(f, "\n");
936
		fprintf(f, "\n");
(-)iproute2.orig/tc/m_police.c (-4 / +4 lines)
Lines 114-122 Link Here
114
	int res = -1;
114
	int res = -1;
115
	int ok=0;
115
	int ok=0;
116
	struct tc_police p;
116
	struct tc_police p;
117
	__u32 rtab[256];
117
	uint32_t rtab[256];
118
	__u32 ptab[256];
118
	uint32_t ptab[256];
119
	__u32 avrate = 0;
119
	uint32_t avrate = 0;
120
	int presult = 0;
120
	int presult = 0;
121
	unsigned buffer=0, mtu=0, mpu=0;
121
	unsigned buffer=0, mtu=0, mpu=0;
122
	int Rcell_log=-1, Pcell_log = -1; 
122
	int Rcell_log=-1, Pcell_log = -1; 
Lines 321-327 Link Here
321
	if (p->peakrate.rate)
321
	if (p->peakrate.rate)
322
		fprintf(f, "peakrate %s ", sprint_rate(p->peakrate.rate, b1));
322
		fprintf(f, "peakrate %s ", sprint_rate(p->peakrate.rate, b1));
323
	if (tb[TCA_POLICE_AVRATE])
323
	if (tb[TCA_POLICE_AVRATE])
324
		fprintf(f, "avrate %s ", sprint_rate(*(__u32*)RTA_DATA(tb[TCA_POLICE_AVRATE]), b1));
324
		fprintf(f, "avrate %s ", sprint_rate(*(uint32_t*)RTA_DATA(tb[TCA_POLICE_AVRATE]), b1));
325
325
326
	return 0;
326
	return 0;
327
}
327
}
(-)iproute2.orig/tc/q_atm.c (-3 / +3 lines)
Lines 55-61 Link Here
55
	struct atm_qos qos;
55
	struct atm_qos qos;
56
	struct atm_sap sap;
56
	struct atm_sap sap;
57
	unsigned char hdr[MAX_HDR_LEN];
57
	unsigned char hdr[MAX_HDR_LEN];
58
	__u32 excess = 0;
58
	uint32_t excess = 0;
59
	struct rtattr *tail;
59
	struct rtattr *tail;
60
	int sndbuf = 0;
60
	int sndbuf = 0;
61
	int hdr_len = -1;
61
	int hdr_len = -1;
Lines 220-231 Link Here
220
		fprintf(f," ");
220
		fprintf(f," ");
221
	}
221
	}
222
	if (tb[TCA_ATM_EXCESS]) {
222
	if (tb[TCA_ATM_EXCESS]) {
223
		__u32 excess;
223
		uint32_t excess;
224
224
225
		if (RTA_PAYLOAD(tb[TCA_ATM_EXCESS]) < sizeof(excess))
225
		if (RTA_PAYLOAD(tb[TCA_ATM_EXCESS]) < sizeof(excess))
226
			fprintf(stderr,"ATM: excess class ID too short\n");
226
			fprintf(stderr,"ATM: excess class ID too short\n");
227
		else {
227
		else {
228
			excess = *(__u32 *) RTA_DATA(tb[TCA_ATM_EXCESS]);
228
			excess = *(uint32_t *) RTA_DATA(tb[TCA_ATM_EXCESS]);
229
			if (!excess) fprintf(f,"excess clp ");
229
			if (!excess) fprintf(f,"excess clp ");
230
			else {
230
			else {
231
				char buf[64];
231
				char buf[64];
(-)iproute2.orig/tc/q_cbq.c (-2 / +2 lines)
Lines 51-57 Link Here
51
{
51
{
52
	struct tc_ratespec r;
52
	struct tc_ratespec r;
53
	struct tc_cbq_lssopt lss;
53
	struct tc_cbq_lssopt lss;
54
	__u32 rtab[256];
54
	uint32_t rtab[256];
55
	unsigned mpu=0, avpkt=0, allot=0;
55
	unsigned mpu=0, avpkt=0, allot=0;
56
	int cell_log=-1; 
56
	int cell_log=-1; 
57
	int ewma_log=-1;
57
	int ewma_log=-1;
Lines 174-180 Link Here
174
	struct tc_cbq_wrropt wrr;
174
	struct tc_cbq_wrropt wrr;
175
	struct tc_cbq_fopt fopt;
175
	struct tc_cbq_fopt fopt;
176
	struct tc_cbq_ovl ovl;
176
	struct tc_cbq_ovl ovl;
177
	__u32 rtab[256];
177
	uint32_t rtab[256];
178
	unsigned mpu=0;
178
	unsigned mpu=0;
179
	int cell_log=-1; 
179
	int cell_log=-1; 
180
	int ewma_log=-1;
180
	int ewma_log=-1;
(-)iproute2.orig/tc/q_dsmark.c (-3 / +3 lines)
Lines 95-101 Link Here
95
   struct nlmsghdr *n)
95
   struct nlmsghdr *n)
96
{
96
{
97
	struct rtattr *tail;
97
	struct rtattr *tail;
98
	__u8 tmp;
98
	uint8_t tmp;
99
	char *end;
99
	char *end;
100
100
101
	tail = (struct rtattr *) (((void *) n)+NLMSG_ALIGN(n->nlmsg_len));
101
	tail = (struct rtattr *) (((void *) n)+NLMSG_ALIGN(n->nlmsg_len));
Lines 143-155 Link Here
143
		if (!RTA_PAYLOAD(tb[TCA_DSMARK_MASK]))
143
		if (!RTA_PAYLOAD(tb[TCA_DSMARK_MASK]))
144
			fprintf(stderr,"dsmark: empty mask\n");
144
			fprintf(stderr,"dsmark: empty mask\n");
145
		else fprintf(f,"mask 0x%02x ",
145
		else fprintf(f,"mask 0x%02x ",
146
			    *(__u8 *) RTA_DATA(tb[TCA_DSMARK_MASK]));
146
			    *(uint8_t *) RTA_DATA(tb[TCA_DSMARK_MASK]));
147
	}
147
	}
148
	if (tb[TCA_DSMARK_VALUE]) {
148
	if (tb[TCA_DSMARK_VALUE]) {
149
		if (!RTA_PAYLOAD(tb[TCA_DSMARK_VALUE]))
149
		if (!RTA_PAYLOAD(tb[TCA_DSMARK_VALUE]))
150
			fprintf(stderr,"dsmark: empty value\n");
150
			fprintf(stderr,"dsmark: empty value\n");
151
		else fprintf(f,"value 0x%02x ",
151
		else fprintf(f,"value 0x%02x ",
152
			    *(__u8 *) RTA_DATA(tb[TCA_DSMARK_VALUE]));
152
			    *(uint8_t *) RTA_DATA(tb[TCA_DSMARK_VALUE]));
153
	}
153
	}
154
	if (tb[TCA_DSMARK_INDICES]) {
154
	if (tb[TCA_DSMARK_INDICES]) {
155
		if (RTA_PAYLOAD(tb[TCA_DSMARK_INDICES]) < sizeof(__u16))
155
		if (RTA_PAYLOAD(tb[TCA_DSMARK_INDICES]) < sizeof(__u16))
(-)iproute2.orig/tc/q_gred.c (-1 / +1 lines)
Lines 125-131 Link Here
125
	double probability = 0.02;
125
	double probability = 0.02;
126
	unsigned rate = 0;
126
	unsigned rate = 0;
127
	int wlog;
127
	int wlog;
128
	__u8 sbuf[256];
128
	uint8_t sbuf[256];
129
	struct rtattr *tail;
129
	struct rtattr *tail;
130
130
131
	memset(&opt, 0, sizeof(opt));
131
	memset(&opt, 0, sizeof(opt));
(-)iproute2.orig/tc/q_htb.c (-1 / +1 lines)
Lines 100-106 Link Here
100
{
100
{
101
	int ok=0;
101
	int ok=0;
102
	struct tc_htb_opt opt;
102
	struct tc_htb_opt opt;
103
	__u32 rtab[256],ctab[256];
103
	uint32_t rtab[256],ctab[256];
104
	unsigned buffer=0,cbuffer=0;
104
	unsigned buffer=0,cbuffer=0;
105
	int cell_log=-1,ccell_log = -1,mtu;
105
	int cell_log=-1,ccell_log = -1,mtu;
106
	struct rtattr *tail;
106
	struct rtattr *tail;
(-)iproute2.orig/tc/q_red.c (-1 / +1 lines)
Lines 43-49 Link Here
43
	unsigned rate = 0;
43
	unsigned rate = 0;
44
	int ecn_ok = 0;
44
	int ecn_ok = 0;
45
	int wlog;
45
	int wlog;
46
	__u8 sbuf[256];
46
	uint8_t sbuf[256];
47
	struct rtattr *tail;
47
	struct rtattr *tail;
48
48
49
	memset(&opt, 0, sizeof(opt));
49
	memset(&opt, 0, sizeof(opt));
(-)iproute2.orig/tc/q_tbf.c (-2 / +2 lines)
Lines 41-48 Link Here
41
{
41
{
42
	int ok=0;
42
	int ok=0;
43
	struct tc_tbf_qopt opt;
43
	struct tc_tbf_qopt opt;
44
	__u32 rtab[256];
44
	uint32_t rtab[256];
45
	__u32 ptab[256];
45
	uint32_t ptab[256];
46
	unsigned buffer=0, mtu=0, mpu=0, latency=0;
46
	unsigned buffer=0, mtu=0, mpu=0, latency=0;
47
	int Rcell_log=-1, Pcell_log = -1; 
47
	int Rcell_log=-1, Pcell_log = -1; 
48
	struct rtattr *tail;
48
	struct rtattr *tail;
(-)iproute2.orig/tc/tc.c (-2 / +2 lines)
Lines 55-61 Link Here
55
	return 0;
55
	return 0;
56
}
56
}
57
57
58
static int print_nofopt(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 fhandle)
58
static int print_nofopt(struct filter_util *qu, FILE *f, struct rtattr *opt, uint32_t fhandle)
59
{
59
{
60
	if (opt && RTA_PAYLOAD(opt))
60
	if (opt && RTA_PAYLOAD(opt))
61
		fprintf(f, "fh %08x [Unknown filter, optlen=%u] ", fhandle, RTA_PAYLOAD(opt));
61
		fprintf(f, "fh %08x [Unknown filter, optlen=%u] ", fhandle, RTA_PAYLOAD(opt));
Lines 66-72 Link Here
66
66
67
static int parse_nofopt(struct filter_util *qu, char *fhandle, int argc, char **argv, struct nlmsghdr *n)
67
static int parse_nofopt(struct filter_util *qu, char *fhandle, int argc, char **argv, struct nlmsghdr *n)
68
{
68
{
69
	__u32 handle;
69
	uint32_t handle;
70
70
71
	if (argc) {
71
	if (argc) {
72
		fprintf(stderr, "Unknown filter \"%s\", hence option \"%s\" is unparsable\n", qu->id, *argv);
72
		fprintf(stderr, "Unknown filter \"%s\", hence option \"%s\" is unparsable\n", qu->id, *argv);
(-)iproute2.orig/tc/tc_class.c (-4 / +4 lines)
Lines 70-76 Link Here
70
				duparg("dev", *argv);
70
				duparg("dev", *argv);
71
			strncpy(d, *argv, sizeof(d)-1);
71
			strncpy(d, *argv, sizeof(d)-1);
72
		} else if (strcmp(*argv, "classid") == 0) {
72
		} else if (strcmp(*argv, "classid") == 0) {
73
			__u32 handle;
73
			uint32_t handle;
74
			NEXT_ARG();
74
			NEXT_ARG();
75
			if (req.t.tcm_handle)
75
			if (req.t.tcm_handle)
76
				duparg("classid", *argv);
76
				duparg("classid", *argv);
Lines 84-90 Link Here
84
			}
84
			}
85
			req.t.tcm_parent = TC_H_ROOT;
85
			req.t.tcm_parent = TC_H_ROOT;
86
		} else if (strcmp(*argv, "parent") == 0) {
86
		} else if (strcmp(*argv, "parent") == 0) {
87
			__u32 handle;
87
			uint32_t handle;
88
			NEXT_ARG();
88
			NEXT_ARG();
89
			if (req.t.tcm_parent)
89
			if (req.t.tcm_parent)
90
				duparg("parent", *argv);
90
				duparg("parent", *argv);
Lines 174-180 Link Here
174
}
174
}
175
175
176
int filter_ifindex;
176
int filter_ifindex;
177
__u32 filter_qdisc;
177
uint32_t filter_qdisc;
178
178
179
int print_class(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
179
int print_class(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
180
{
180
{
Lines 287-293 Link Here
287
			}
287
			}
288
			t.tcm_parent = TC_H_ROOT;
288
			t.tcm_parent = TC_H_ROOT;
289
		} else if (strcmp(*argv, "parent") == 0) {
289
		} else if (strcmp(*argv, "parent") == 0) {
290
			__u32 handle;
290
			uint32_t handle;
291
			if (t.tcm_parent)
291
			if (t.tcm_parent)
292
				duparg("parent", *argv);
292
				duparg("parent", *argv);
293
			NEXT_ARG();
293
			NEXT_ARG();
(-)iproute2.orig/tc/tc_core.c (-3 / +3 lines)
Lines 23-30 Link Here
23
23
24
#include "tc_core.h"
24
#include "tc_core.h"
25
25
26
static __u32 t2us=1;
26
static uint32_t t2us=1;
27
static __u32 us2t=1;
27
static uint32_t us2t=1;
28
static double tick_in_usec = 1;
28
static double tick_in_usec = 1;
29
29
30
long tc_core_usec2tick(long usec)
30
long tc_core_usec2tick(long usec)
Lines 46-52 Link Here
46
   rtab[pkt_len>>cell_log] = pkt_xmit_time
46
   rtab[pkt_len>>cell_log] = pkt_xmit_time
47
 */
47
 */
48
48
49
int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu,
49
int tc_calc_rtable(unsigned bps, uint32_t *rtab, int cell_log, unsigned mtu,
50
		   unsigned mpu)
50
		   unsigned mpu)
51
{
51
{
52
	int i;
52
	int i;
(-)iproute2.orig/tc/tc_core.h (-1 / +1 lines)
Lines 7-13 Link Here
7
long tc_core_usec2tick(long usec);
7
long tc_core_usec2tick(long usec);
8
long tc_core_tick2usec(long tick);
8
long tc_core_tick2usec(long tick);
9
unsigned tc_calc_xmittime(unsigned rate, unsigned size);
9
unsigned tc_calc_xmittime(unsigned rate, unsigned size);
10
int tc_calc_rtable(unsigned bps, __u32 *rtab, int cell_log, unsigned mtu, unsigned mpu);
10
int tc_calc_rtable(unsigned bps, uint32_t *rtab, int cell_log, unsigned mtu, unsigned mpu);
11
11
12
int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
12
int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
13
13
(-)iproute2.orig/tc/tc_filter.c (-11 / +11 lines)
Lines 56-63 Link Here
56
		char   			buf[4096];
56
		char   			buf[4096];
57
	} req;
57
	} req;
58
	struct filter_util *q = NULL;
58
	struct filter_util *q = NULL;
59
	__u32 prio = 0;
59
	uint32_t prio = 0;
60
	__u32 protocol = 0;
60
	uint32_t protocol = 0;
61
	char *fhandle = NULL;
61
	char *fhandle = NULL;
62
	char  d[16];
62
	char  d[16];
63
	char  k[16];
63
	char  k[16];
Lines 87-93 Link Here
87
			}
87
			}
88
			req.t.tcm_parent = TC_H_ROOT;
88
			req.t.tcm_parent = TC_H_ROOT;
89
		} else if (strcmp(*argv, "parent") == 0) {
89
		} else if (strcmp(*argv, "parent") == 0) {
90
			__u32 handle;
90
			uint32_t handle;
91
			NEXT_ARG();
91
			NEXT_ARG();
92
			if (req.t.tcm_parent)
92
			if (req.t.tcm_parent)
93
				duparg("parent", *argv);
93
				duparg("parent", *argv);
Lines 176-185 Link Here
176
	return 0;
176
	return 0;
177
}
177
}
178
178
179
static __u32 filter_parent;
179
static uint32_t filter_parent;
180
static int filter_ifindex;
180
static int filter_ifindex;
181
static __u32 filter_prio;
181
static uint32_t filter_prio;
182
static __u32 filter_protocol;
182
static uint32_t filter_protocol;
183
183
184
int print_filter(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
184
int print_filter(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
185
{
185
{
Lines 224-231 Link Here
224
		}
224
		}
225
	}
225
	}
226
	if (t->tcm_info) {
226
	if (t->tcm_info) {
227
		__u32 protocol = TC_H_MIN(t->tcm_info);
227
		uint32_t protocol = TC_H_MIN(t->tcm_info);
228
		__u32 prio = TC_H_MAJ(t->tcm_info)>>16;
228
		uint32_t prio = TC_H_MAJ(t->tcm_info)>>16;
229
		if (!filter_protocol || filter_protocol != protocol) {
229
		if (!filter_protocol || filter_protocol != protocol) {
230
			if (protocol) {
230
			if (protocol) {
231
				SPRINT_BUF(b1);
231
				SPRINT_BUF(b1);
Lines 267-274 Link Here
267
	struct tcmsg t;
267
	struct tcmsg t;
268
	struct rtnl_handle rth;
268
	struct rtnl_handle rth;
269
	char d[16];
269
	char d[16];
270
	__u32 prio = 0;
270
	uint32_t prio = 0;
271
	__u32 protocol = 0;
271
	uint32_t protocol = 0;
272
	char *fhandle = NULL;
272
	char *fhandle = NULL;
273
273
274
	memset(&t, 0, sizeof(t));
274
	memset(&t, 0, sizeof(t));
Lines 288-294 Link Here
288
			}
288
			}
289
			filter_parent = t.tcm_parent = TC_H_ROOT;
289
			filter_parent = t.tcm_parent = TC_H_ROOT;
290
		} else if (strcmp(*argv, "parent") == 0) {
290
		} else if (strcmp(*argv, "parent") == 0) {
291
			__u32 handle;
291
			uint32_t handle;
292
			NEXT_ARG();
292
			NEXT_ARG();
293
			if (t.tcm_parent)
293
			if (t.tcm_parent)
294
				duparg("parent", *argv);
294
				duparg("parent", *argv);
(-)iproute2.orig/tc/tc_qdisc.c (-2 / +3 lines)
Lines 20-25 Link Here
20
#include <arpa/inet.h>
20
#include <arpa/inet.h>
21
#include <string.h>
21
#include <string.h>
22
#include <math.h>
22
#include <math.h>
23
#include <linux/stddef.h>
23
24
24
#include "utils.h"
25
#include "utils.h"
25
#include "tc_util.h"
26
#include "tc_util.h"
Lines 71-77 Link Here
71
				duparg("dev", *argv);
72
				duparg("dev", *argv);
72
			strncpy(d, *argv, sizeof(d)-1);
73
			strncpy(d, *argv, sizeof(d)-1);
73
		} else if (strcmp(*argv, "handle") == 0) {
74
		} else if (strcmp(*argv, "handle") == 0) {
74
			__u32 handle;
75
			uint32_t handle;
75
			if (req.t.tcm_handle)
76
			if (req.t.tcm_handle)
76
				duparg("handle", *argv);
77
				duparg("handle", *argv);
77
			NEXT_ARG();
78
			NEXT_ARG();
Lines 95-101 Link Here
95
                        q = get_qdisc_kind(k);
96
                        q = get_qdisc_kind(k);
96
#endif
97
#endif
97
		} else if (strcmp(*argv, "parent") == 0) {
98
		} else if (strcmp(*argv, "parent") == 0) {
98
			__u32 handle;
99
			uint32_t handle;
99
			NEXT_ARG();
100
			NEXT_ARG();
100
			if (req.t.tcm_parent)
101
			if (req.t.tcm_parent)
101
				duparg("parent", *argv);
102
				duparg("parent", *argv);
(-)iproute2.orig/tc/tc_red.c (-1 / +1 lines)
Lines 69-75 Link Here
69
   Stab[t>>Scell_log] = -log(1-W) * t/xmit_time
69
   Stab[t>>Scell_log] = -log(1-W) * t/xmit_time
70
 */
70
 */
71
71
72
int tc_red_eval_idle_damping(int Wlog, unsigned avpkt, unsigned bps, __u8 *sbuf)
72
int tc_red_eval_idle_damping(int Wlog, unsigned avpkt, unsigned bps, uint8_t *sbuf)
73
{
73
{
74
	double xmit_time = tc_core_usec2tick(1000000*(double)avpkt/bps);
74
	double xmit_time = tc_core_usec2tick(1000000*(double)avpkt/bps);
75
	double lW = -log(1.0 - 1.0/(1<<Wlog))/xmit_time;
75
	double lW = -log(1.0 - 1.0/(1<<Wlog))/xmit_time;
(-)iproute2.orig/tc/tc_red.h (-1 / +1 lines)
Lines 3-8 Link Here
3
3
4
extern int tc_red_eval_P(unsigned qmin, unsigned qmax, double prob);
4
extern int tc_red_eval_P(unsigned qmin, unsigned qmax, double prob);
5
extern int tc_red_eval_ewma(unsigned qmin, unsigned burst, unsigned avpkt);
5
extern int tc_red_eval_ewma(unsigned qmin, unsigned burst, unsigned avpkt);
6
extern int tc_red_eval_idle_damping(int wlog, unsigned avpkt, unsigned bandwidth, __u8 *sbuf);
6
extern int tc_red_eval_idle_damping(int wlog, unsigned avpkt, unsigned bandwidth, uint8_t *sbuf);
7
7
8
#endif
8
#endif
(-)iproute2.orig/tc/tc_util.c (-14 / +14 lines)
Lines 24-32 Link Here
24
#include "utils.h"
24
#include "utils.h"
25
#include "tc_util.h"
25
#include "tc_util.h"
26
26
27
int get_qdisc_handle(__u32 *h, char *str)
27
int get_qdisc_handle(uint32_t *h, char *str)
28
{
28
{
29
	__u32 maj;
29
	uint32_t maj;
30
	char *p;
30
	char *p;
31
31
32
	maj = TC_H_UNSPEC;
32
	maj = TC_H_UNSPEC;
Lines 43-51 Link Here
43
	return 0;
43
	return 0;
44
}
44
}
45
45
46
int get_tc_classid(__u32 *h, char *str)
46
int get_tc_classid(uint32_t *h, char *str)
47
{
47
{
48
	__u32 maj, min;
48
	uint32_t maj, min;
49
	char *p;
49
	char *p;
50
50
51
	maj = TC_H_ROOT;
51
	maj = TC_H_ROOT;
Lines 75-81 Link Here
75
	return 0;
75
	return 0;
76
}
76
}
77
77
78
int print_tc_classid(char *buf, int len, __u32 h)
78
int print_tc_classid(char *buf, int len, uint32_t h)
79
{
79
{
80
	if (h == TC_H_ROOT)
80
	if (h == TC_H_ROOT)
81
		sprintf(buf, "root");
81
		sprintf(buf, "root");
Lines 90-96 Link Here
90
	return 0;
90
	return 0;
91
}
91
}
92
92
93
char * sprint_tc_classid(__u32 h, char *buf)
93
char * sprint_tc_classid(uint32_t h, char *buf)
94
{
94
{
95
	if (print_tc_classid(buf, SPRINT_BSIZE-1, h))
95
	if (print_tc_classid(buf, SPRINT_BSIZE-1, h))
96
		strcpy(buf, "???");
96
		strcpy(buf, "???");
Lines 154-160 Link Here
154
}
154
}
155
155
156
156
157
int print_rate(char *buf, int len, __u32 rate)
157
int print_rate(char *buf, int len, uint32_t rate)
158
{
158
{
159
	double tmp = (double)rate*8;
159
	double tmp = (double)rate*8;
160
160
Lines 167-173 Link Here
167
	return 0;
167
	return 0;
168
}
168
}
169
169
170
char * sprint_rate(__u32 rate, char *buf)
170
char * sprint_rate(uint32_t rate, char *buf)
171
{
171
{
172
	if (print_rate(buf, SPRINT_BSIZE-1, rate))
172
	if (print_rate(buf, SPRINT_BSIZE-1, rate))
173
		strcpy(buf, "???");
173
		strcpy(buf, "???");
Lines 202-208 Link Here
202
}
202
}
203
203
204
204
205
int print_usecs(char *buf, int len, __u32 usec)
205
int print_usecs(char *buf, int len, uint32_t usec)
206
{
206
{
207
	double tmp = usec;
207
	double tmp = usec;
208
208
Lines 215-221 Link Here
215
	return 0;
215
	return 0;
216
}
216
}
217
217
218
char * sprint_usecs(__u32 usecs, char *buf)
218
char * sprint_usecs(uint32_t usecs, char *buf)
219
{
219
{
220
	if (print_usecs(buf, SPRINT_BSIZE-1, usecs))
220
	if (print_usecs(buf, SPRINT_BSIZE-1, usecs))
221
		strcpy(buf, "???");
221
		strcpy(buf, "???");
Lines 277-283 Link Here
277
	return 0;
277
	return 0;
278
}
278
}
279
279
280
int print_size(char *buf, int len, __u32 sz)
280
int print_size(char *buf, int len, uint32_t sz)
281
{
281
{
282
	double tmp = sz;
282
	double tmp = sz;
283
283
Lines 290-309 Link Here
290
	return 0;
290
	return 0;
291
}
291
}
292
292
293
char * sprint_size(__u32 size, char *buf)
293
char * sprint_size(uint32_t size, char *buf)
294
{
294
{
295
	if (print_size(buf, SPRINT_BSIZE-1, size))
295
	if (print_size(buf, SPRINT_BSIZE-1, size))
296
		strcpy(buf, "???");
296
		strcpy(buf, "???");
297
	return buf;
297
	return buf;
298
}
298
}
299
299
300
int print_qdisc_handle(char *buf, int len, __u32 h)
300
int print_qdisc_handle(char *buf, int len, uint32_t h)
301
{
301
{
302
	snprintf(buf, len, "%x:", TC_H_MAJ(h)>>16);
302
	snprintf(buf, len, "%x:", TC_H_MAJ(h)>>16);
303
	return 0;
303
	return 0;
304
}
304
}
305
305
306
char * sprint_qdisc_handle(__u32 h, char *buf)
306
char * sprint_qdisc_handle(uint32_t h, char *buf)
307
{
307
{
308
	if (print_qdisc_handle(buf, SPRINT_BSIZE-1, h))
308
	if (print_qdisc_handle(buf, SPRINT_BSIZE-1, h))
309
		strcpy(buf, "???");
309
		strcpy(buf, "???");
(-)iproute2.orig/tc/tc_util.h (-14 / +14 lines)
Lines 22-54 Link Here
22
	struct filter_util *next;
22
	struct filter_util *next;
23
	char	id[16];
23
	char	id[16];
24
	int	(*parse_fopt)(struct filter_util *qu, char *fhandle, int argc, char **argv, struct nlmsghdr *n);
24
	int	(*parse_fopt)(struct filter_util *qu, char *fhandle, int argc, char **argv, struct nlmsghdr *n);
25
	int	(*print_fopt)(struct filter_util *qu, FILE *f, struct rtattr *opt, __u32 fhandle);
25
	int	(*print_fopt)(struct filter_util *qu, FILE *f, struct rtattr *opt, uint32_t fhandle);
26
};
26
};
27
27
28
28
29
extern struct qdisc_util *get_qdisc_kind(char *str);
29
extern struct qdisc_util *get_qdisc_kind(char *str);
30
extern struct filter_util *get_filter_kind(char *str);
30
extern struct filter_util *get_filter_kind(char *str);
31
31
32
extern int get_qdisc_handle(__u32 *h, char *str);
32
extern int get_qdisc_handle(uint32_t *h, char *str);
33
extern int get_rate(unsigned *rate, char *str);
33
extern int get_rate(unsigned *rate, char *str);
34
extern int get_size(unsigned *size, char *str);
34
extern int get_size(unsigned *size, char *str);
35
extern int get_size_and_cell(unsigned *size, int *cell_log, char *str);
35
extern int get_size_and_cell(unsigned *size, int *cell_log, char *str);
36
extern int get_usecs(unsigned *usecs, char *str);
36
extern int get_usecs(unsigned *usecs, char *str);
37
extern int print_rate(char *buf, int len, __u32 rate);
37
extern int print_rate(char *buf, int len, uint32_t rate);
38
extern int print_size(char *buf, int len, __u32 size);
38
extern int print_size(char *buf, int len, uint32_t size);
39
extern int print_qdisc_handle(char *buf, int len, __u32 h);
39
extern int print_qdisc_handle(char *buf, int len, uint32_t h);
40
extern int print_usecs(char *buf, int len, __u32 usecs);
40
extern int print_usecs(char *buf, int len, uint32_t usecs);
41
extern char * sprint_rate(__u32 rate, char *buf);
41
extern char * sprint_rate(uint32_t rate, char *buf);
42
extern char * sprint_size(__u32 size, char *buf);
42
extern char * sprint_size(uint32_t size, char *buf);
43
extern char * sprint_qdisc_handle(__u32 h, char *buf);
43
extern char * sprint_qdisc_handle(uint32_t h, char *buf);
44
extern char * sprint_tc_classid(__u32 h, char *buf);
44
extern char * sprint_tc_classid(uint32_t h, char *buf);
45
extern char * sprint_usecs(__u32 usecs, char *buf);
45
extern char * sprint_usecs(uint32_t usecs, char *buf);
46
46
47
extern void print_tcstats(FILE *fp, struct tc_stats *st);
47
extern void print_tcstats(FILE *fp, struct tc_stats *st);
48
48
49
extern int get_tc_classid(__u32 *h, char *str);
49
extern int get_tc_classid(uint32_t *h, char *str);
50
extern int print_tc_classid(char *buf, int len, __u32 h);
50
extern int print_tc_classid(char *buf, int len, uint32_t h);
51
extern char * sprint_tc_classid(__u32 h, char *buf);
51
extern char * sprint_tc_classid(uint32_t h, char *buf);
52
52
53
extern int tc_print_police(FILE *f, struct rtattr *tb);
53
extern int tc_print_police(FILE *f, struct rtattr *tb);
54
extern int parse_police(int *, char ***, int, struct nlmsghdr *);
54
extern int parse_police(int *, char ***, int, struct nlmsghdr *);

Return to bug 34377