aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-02 16:32:16 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-02 16:32:16 +0000
commitace35eeb889757b1d6ebc54fc2c7a9492a00c0c3 (patch)
treed7547e608c12469c8564657f8de5b498640d6dec
parenta71199e0f0b33c25edea6f57dcd0d9517d0d09ac (diff)
downloadbusybox-w32-ace35eeb889757b1d6ebc54fc2c7a9492a00c0c3.tar.gz
busybox-w32-ace35eeb889757b1d6ebc54fc2c7a9492a00c0c3.tar.bz2
busybox-w32-ace35eeb889757b1d6ebc54fc2c7a9492a00c0c3.zip
Remove networking/libiproute/linux/pkt_sched.h
(and networking/libiproute/linux/ since it become empty). Style fixes.
-rw-r--r--coreutils/tail.c2
-rw-r--r--networking/libiproute/ip_parse_common_args.c6
-rw-r--r--networking/libiproute/iptunnel.c45
-rw-r--r--networking/libiproute/linux/pkt_sched.h409
4 files changed, 28 insertions, 434 deletions
diff --git a/coreutils/tail.c b/coreutils/tail.c
index a753a10b7..98fbcc7c4 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -163,7 +163,7 @@ int tail_main(int argc, char **argv)
163 * starting file position may not be the beginning of the file. 163 * starting file position may not be the beginning of the file.
164 * Beware of backing up too far. See example in wc.c. 164 * Beware of backing up too far. See example in wc.c.
165 */ 165 */
166 if (!(count|from_top) && lseek(fds[i], 0, SEEK_END) >= 0) { 166 if (!(count | from_top) && lseek(fds[i], 0, SEEK_END) >= 0) {
167 continue; 167 continue;
168 } 168 }
169 169
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c
index fee6e5e95..64386c9dd 100644
--- a/networking/libiproute/ip_parse_common_args.c
+++ b/networking/libiproute/ip_parse_common_args.c
@@ -35,7 +35,8 @@ void ip_parse_common_args(int *argcp, char ***argvp)
35 char *opt = argv[1]; 35 char *opt = argv[1];
36 36
37 if (strcmp(opt,"--") == 0) { 37 if (strcmp(opt,"--") == 0) {
38 argc--; argv++; 38 argc--;
39 argv++;
39 break; 40 break;
40 } 41 }
41 42
@@ -69,7 +70,8 @@ void ip_parse_common_args(int *argcp, char ***argvp)
69 } else { 70 } else {
70 bb_show_usage(); 71 bb_show_usage();
71 } 72 }
72 argc--; argv++; 73 argc--;
74 argv++;
73 } 75 }
74 _SL_ = oneline ? "\\" : "\n" ; 76 _SL_ = oneline ? "\\" : "\n" ;
75 *argcp = argc; 77 *argcp = argc;
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c
index dbde477a0..a67803ff4 100644
--- a/networking/libiproute/iptunnel.c
+++ b/networking/libiproute/iptunnel.c
@@ -409,46 +409,46 @@ static void print_tunnel(struct ip_tunnel_parm *p)
409 if (p->iph.tos) { 409 if (p->iph.tos) {
410 SPRINT_BUF(b1); 410 SPRINT_BUF(b1);
411 printf(" tos"); 411 printf(" tos");
412 if (p->iph.tos&1) 412 if (p->iph.tos & 1)
413 printf(" inherit"); 413 printf(" inherit");
414 if (p->iph.tos&~1) 414 if (p->iph.tos & ~1)
415 printf("%c%s ", p->iph.tos&1 ? '/' : ' ', 415 printf("%c%s ", p->iph.tos & 1 ? '/' : ' ',
416 rtnl_dsfield_n2a(p->iph.tos&~1, b1, sizeof(b1))); 416 rtnl_dsfield_n2a(p->iph.tos & ~1, b1, sizeof(b1)));
417 } 417 }
418 if (!(p->iph.frag_off&htons(IP_DF))) 418 if (!(p->iph.frag_off & htons(IP_DF)))
419 printf(" nopmtudisc"); 419 printf(" nopmtudisc");
420 420
421 if ((p->i_flags&GRE_KEY) && (p->o_flags&GRE_KEY) && p->o_key == p->i_key) 421 if ((p->i_flags & GRE_KEY) && (p->o_flags & GRE_KEY) && p->o_key == p->i_key)
422 printf(" key %s", s3); 422 printf(" key %s", s3);
423 else if ((p->i_flags|p->o_flags)&GRE_KEY) { 423 else if ((p->i_flags | p->o_flags) & GRE_KEY) {
424 if (p->i_flags&GRE_KEY) 424 if (p->i_flags & GRE_KEY)
425 printf(" ikey %s ", s3); 425 printf(" ikey %s ", s3);
426 if (p->o_flags&GRE_KEY) 426 if (p->o_flags & GRE_KEY)
427 printf(" okey %s ", s4); 427 printf(" okey %s ", s4);
428 } 428 }
429 429
430 if (p->i_flags&GRE_SEQ) 430 if (p->i_flags & GRE_SEQ)
431 printf("%s Drop packets out of sequence.\n", _SL_); 431 printf("%s Drop packets out of sequence.\n", _SL_);
432 if (p->i_flags&GRE_CSUM) 432 if (p->i_flags & GRE_CSUM)
433 printf("%s Checksum in received packet is required.", _SL_); 433 printf("%s Checksum in received packet is required.", _SL_);
434 if (p->o_flags&GRE_SEQ) 434 if (p->o_flags & GRE_SEQ)
435 printf("%s Sequence packets on output.", _SL_); 435 printf("%s Sequence packets on output.", _SL_);
436 if (p->o_flags&GRE_CSUM) 436 if (p->o_flags & GRE_CSUM)
437 printf("%s Checksum output packets.", _SL_); 437 printf("%s Checksum output packets.", _SL_);
438} 438}
439 439
440static int do_tunnels_list(struct ip_tunnel_parm *p) 440static int do_tunnels_list(struct ip_tunnel_parm *p)
441{ 441{
442 char name[IFNAMSIZ]; 442 char name[IFNAMSIZ];
443 unsigned long rx_bytes, rx_packets, rx_errs, rx_drops, 443 unsigned long rx_bytes, rx_packets, rx_errs, rx_drops,
444 rx_fifo, rx_frame, 444 rx_fifo, rx_frame,
445 tx_bytes, tx_packets, tx_errs, tx_drops, 445 tx_bytes, tx_packets, tx_errs, tx_drops,
446 tx_fifo, tx_colls, tx_carrier, rx_multi; 446 tx_fifo, tx_colls, tx_carrier, rx_multi;
447 int type; 447 int type;
448 struct ip_tunnel_parm p1; 448 struct ip_tunnel_parm p1;
449
450 char buf[512]; 449 char buf[512];
451 FILE *fp = fopen("/proc/net/dev", "r"); 450 FILE *fp = fopen("/proc/net/dev", "r");
451
452 if (fp == NULL) { 452 if (fp == NULL) {
453 perror("fopen"); 453 perror("fopen");
454 return -1; 454 return -1;
@@ -459,8 +459,10 @@ static int do_tunnels_list(struct ip_tunnel_parm *p)
459 459
460 while (fgets(buf, sizeof(buf), fp) != NULL) { 460 while (fgets(buf, sizeof(buf), fp) != NULL) {
461 char *ptr; 461 char *ptr;
462 buf[sizeof(buf) - 1] = 0; 462
463 if ((ptr = strchr(buf, ':')) == NULL || 463 /*buf[sizeof(buf) - 1] = 0; - fgets is safe anyway */
464 ptr = strchr(buf, ':');
465 if (ptr == NULL ||
464 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) { 466 (*ptr++ = 0, sscanf(buf, "%s", name) != 1)) {
465 bb_error_msg("wrong format of /proc/net/dev. Sorry"); 467 bb_error_msg("wrong format of /proc/net/dev. Sorry");
466 return -1; 468 return -1;
@@ -541,6 +543,5 @@ int do_iptunnel(int argc, char **argv)
541 } else 543 } else
542 return do_show(0, NULL); 544 return do_show(0, NULL);
543 545
544 bb_error_msg("command \"%s\" is unknown", *argv); 546 bb_error_msg_and_die("command \"%s\" is unknown", *argv);
545 exit(-1);
546} 547}
diff --git a/networking/libiproute/linux/pkt_sched.h b/networking/libiproute/linux/pkt_sched.h
deleted file mode 100644
index 012bb5766..000000000
--- a/networking/libiproute/linux/pkt_sched.h
+++ /dev/null
@@ -1,409 +0,0 @@
1/* vi: set sw=4 ts=4: */
2#ifndef __LINUX_PKT_SCHED_H
3#define __LINUX_PKT_SCHED_H
4
5/* Logical priority bands not depending on specific packet scheduler.
6 Every scheduler will map them to real traffic classes, if it has
7 no more precise mechanism to classify packets.
8
9 These numbers have no special meaning, though their coincidence
10 with obsolete IPv6 values is not occasional :-). New IPv6 drafts
11 preferred full anarchy inspired by diffserv group.
12
13 Note: TC_PRIO_BESTEFFORT does not mean that it is the most unhappy
14 class, actually, as rule it will be handled with more care than
15 filler or even bulk.
16 */
17
18#define TC_PRIO_BESTEFFORT 0
19#define TC_PRIO_FILLER 1
20#define TC_PRIO_BULK 2
21#define TC_PRIO_INTERACTIVE_BULK 4
22#define TC_PRIO_INTERACTIVE 6
23#define TC_PRIO_CONTROL 7
24
25#define TC_PRIO_MAX 15
26
27/* Generic queue statistics, available for all the elements.
28 Particular schedulers may have also their private records.
29 */
30
31struct tc_stats
32{
33 uint64_t bytes; /* Nnmber of enqueued bytes */
34 uint32_t packets; /* Number of enqueued packets */
35 uint32_t drops; /* Packets dropped because of lack of resources */
36 uint32_t overlimits; /* Number of throttle events when this
37 * flow goes out of allocated bandwidth */
38 uint32_t bps; /* Current flow byte rate */
39 uint32_t pps; /* Current flow packet rate */
40 uint32_t qlen;
41 uint32_t backlog;
42#ifdef __KERNEL__
43 spinlock_t *lock;
44#endif
45};
46
47struct tc_estimator
48{
49 char interval;
50 unsigned char ewma_log;
51};
52
53/* "Handles"
54 ---------
55
56 All the traffic control objects have 32bit identifiers, or "handles".
57
58 They can be considered as opaque numbers from user API viewpoint,
59 but actually they always consist of two fields: major and
60 minor numbers, which are interpreted by kernel specially,
61 that may be used by applications, though not recommended.
62
63 F.e. qdisc handles always have minor number equal to zero,
64 classes (or flows) have major equal to parent qdisc major, and
65 minor uniquely identifying class inside qdisc.
66
67 Macros to manipulate handles:
68 */
69
70#define TC_H_MAJ_MASK (0xFFFF0000U)
71#define TC_H_MIN_MASK (0x0000FFFFU)
72#define TC_H_MAJ(h) ((h)&TC_H_MAJ_MASK)
73#define TC_H_MIN(h) ((h)&TC_H_MIN_MASK)
74#define TC_H_MAKE(maj,min) (((maj)&TC_H_MAJ_MASK)|((min)&TC_H_MIN_MASK))
75
76#define TC_H_UNSPEC (0U)
77#define TC_H_ROOT (0xFFFFFFFFU)
78#define TC_H_INGRESS (0xFFFFFFF1U)
79
80struct tc_ratespec
81{
82 unsigned char cell_log;
83 unsigned char __reserved;
84 unsigned short feature;
85 short addend;
86 unsigned short mpu;
87 uint32_t rate;
88};
89
90/* FIFO section */
91
92struct tc_fifo_qopt
93{
94 uint32_t limit; /* Queue length: bytes for bfifo, packets for pfifo */
95};
96
97/* PRIO section */
98
99#define TCQ_PRIO_BANDS 16
100
101struct tc_prio_qopt
102{
103 int bands; /* Number of bands */
104 uint8_t priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
105};
106
107/* CSZ section */
108
109struct tc_csz_qopt
110{
111 int flows; /* Maximal number of guaranteed flows */
112 unsigned char R_log; /* Fixed point position for round number */
113 unsigned char delta_log; /* Log of maximal managed time interval */
114 uint8_t priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> CSZ band */
115};
116
117struct tc_csz_copt
118{
119 struct tc_ratespec slice;
120 struct tc_ratespec rate;
121 struct tc_ratespec peakrate;
122 uint32_t limit;
123 uint32_t buffer;
124 uint32_t mtu;
125};
126
127enum
128{
129 TCA_CSZ_UNSPEC,
130 TCA_CSZ_PARMS,
131 TCA_CSZ_RTAB,
132 TCA_CSZ_PTAB,
133};
134
135/* TBF section */
136
137struct tc_tbf_qopt
138{
139 struct tc_ratespec rate;
140 struct tc_ratespec peakrate;
141 uint32_t limit;
142 uint32_t buffer;
143 uint32_t mtu;
144};
145
146enum
147{
148 TCA_TBF_UNSPEC,
149 TCA_TBF_PARMS,
150 TCA_TBF_RTAB,
151 TCA_TBF_PTAB,
152};
153
154
155/* TEQL section */
156
157/* TEQL does not require any parameters */
158
159/* SFQ section */
160
161struct tc_sfq_qopt
162{
163 unsigned quantum; /* Bytes per round allocated to flow */
164 int perturb_period; /* Period of hash perturbation */
165 uint32_t limit; /* Maximal packets in queue */
166 unsigned divisor; /* Hash divisor */
167 unsigned flows; /* Maximal number of flows */
168};
169
170/*
171 * NOTE: limit, divisor and flows are hardwired to code at the moment.
172 *
173 * limit=flows=128, divisor=1024;
174 *
175 * The only reason for this is efficiency, it is possible
176 * to change these parameters in compile time.
177 */
178
179/* RED section */
180
181enum
182{
183 TCA_RED_UNSPEC,
184 TCA_RED_PARMS,
185 TCA_RED_STAB,
186};
187
188struct tc_red_qopt
189{
190 uint32_t limit; /* HARD maximal queue length (bytes) */
191 uint32_t qth_min; /* Min average length threshold (bytes) */
192 uint32_t qth_max; /* Max average length threshold (bytes) */
193 unsigned char Wlog; /* log(W) */
194 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
195 unsigned char Scell_log; /* cell size for idle damping */
196 unsigned char flags;
197#define TC_RED_ECN 1
198};
199
200struct tc_red_xstats
201{
202 uint32_t early; /* Early drops */
203 uint32_t pdrop; /* Drops due to queue limits */
204 uint32_t other; /* Drops due to drop() calls */
205 uint32_t marked; /* Marked packets */
206};
207
208/* GRED section */
209
210#define MAX_DPs 16
211
212enum
213{
214 TCA_GRED_UNSPEC,
215 TCA_GRED_PARMS,
216 TCA_GRED_STAB,
217 TCA_GRED_DPS,
218};
219
220#define TCA_SET_OFF TCA_GRED_PARMS
221struct tc_gred_qopt
222{
223 uint32_t limit; /* HARD maximal queue length (bytes) */
224 uint32_t qth_min; /* Min average length threshold (bytes) */
225 uint32_t qth_max; /* Max average length threshold (bytes) */
226 uint32_t DP; /* upto 2^32 DPs */
227 uint32_t backlog;
228 uint32_t qave;
229 uint32_t forced;
230 uint32_t early;
231 uint32_t other;
232 uint32_t pdrop;
233
234 unsigned char Wlog; /* log(W) */
235 unsigned char Plog; /* log(P_max/(qth_max-qth_min)) */
236 unsigned char Scell_log; /* cell size for idle damping */
237 uint8_t prio; /* prio of this VQ */
238 uint32_t packets;
239 uint32_t bytesin;
240};
241/* gred setup */
242struct tc_gred_sopt
243{
244 uint32_t DPs;
245 uint32_t def_DP;
246 uint8_t grio;
247};
248
249/* HTB section */
250#define TC_HTB_NUMPRIO 4
251#define TC_HTB_MAXDEPTH 4
252
253struct tc_htb_opt
254{
255 struct tc_ratespec rate;
256 struct tc_ratespec ceil;
257 uint32_t buffer;
258 uint32_t cbuffer;
259 uint32_t quantum; /* out only */
260 uint32_t level; /* out only */
261 uint8_t prio;
262 uint8_t injectd; /* inject class distance */
263 uint8_t pad[2];
264};
265struct tc_htb_glob
266{
267 uint32_t rate2quantum; /* bps->quantum divisor */
268 uint32_t defcls; /* default class number */
269 uint32_t use_dcache; /* use dequeue cache ? */
270 uint32_t debug; /* debug flags */
271
272
273 /* stats */
274 uint32_t deq_rate; /* dequeue rate */
275 uint32_t utilz; /* dequeue utilization */
276 uint32_t trials; /* deq_prio trials per dequeue */
277 uint32_t dcache_hits;
278 uint32_t direct_pkts; /* count of non shapped packets */
279};
280enum
281{
282 TCA_HTB_UNSPEC,
283 TCA_HTB_PARMS,
284 TCA_HTB_INIT,
285 TCA_HTB_CTAB,
286 TCA_HTB_RTAB,
287};
288struct tc_htb_xstats
289{
290 uint32_t lends;
291 uint32_t borrows;
292 uint32_t giants; /* too big packets (rate will not be accurate) */
293 uint32_t injects; /* how many times leaf used injected bw */
294 uint32_t tokens;
295 uint32_t ctokens;
296};
297
298/* CBQ section */
299
300#define TC_CBQ_MAXPRIO 8
301#define TC_CBQ_MAXLEVEL 8
302#define TC_CBQ_DEF_EWMA 5
303
304struct tc_cbq_lssopt
305{
306 unsigned char change;
307 unsigned char flags;
308#define TCF_CBQ_LSS_BOUNDED 1
309#define TCF_CBQ_LSS_ISOLATED 2
310 unsigned char ewma_log;
311 unsigned char level;
312#define TCF_CBQ_LSS_FLAGS 1
313#define TCF_CBQ_LSS_EWMA 2
314#define TCF_CBQ_LSS_MAXIDLE 4
315#define TCF_CBQ_LSS_MINIDLE 8
316#define TCF_CBQ_LSS_OFFTIME 0x10
317#define TCF_CBQ_LSS_AVPKT 0x20
318 uint32_t maxidle;
319 uint32_t minidle;
320 uint32_t offtime;
321 uint32_t avpkt;
322};
323
324struct tc_cbq_wrropt
325{
326 unsigned char flags;
327 unsigned char priority;
328 unsigned char cpriority;
329 unsigned char __reserved;
330 uint32_t allot;
331 uint32_t weight;
332};
333
334struct tc_cbq_ovl
335{
336 unsigned char strategy;
337#define TC_CBQ_OVL_CLASSIC 0
338#define TC_CBQ_OVL_DELAY 1
339#define TC_CBQ_OVL_LOWPRIO 2
340#define TC_CBQ_OVL_DROP 3
341#define TC_CBQ_OVL_RCLASSIC 4
342 unsigned char priority2;
343 uint32_t penalty;
344};
345
346struct tc_cbq_police
347{
348 unsigned char police;
349 unsigned char __res1;
350 unsigned short __res2;
351};
352
353struct tc_cbq_fopt
354{
355 uint32_t split;
356 uint32_t defmap;
357 uint32_t defchange;
358};
359
360struct tc_cbq_xstats
361{
362 uint32_t borrows;
363 uint32_t overactions;
364 int32_t avgidle;
365 int32_t undertime;
366};
367
368enum
369{
370 TCA_CBQ_UNSPEC,
371 TCA_CBQ_LSSOPT,
372 TCA_CBQ_WRROPT,
373 TCA_CBQ_FOPT,
374 TCA_CBQ_OVL_STRATEGY,
375 TCA_CBQ_RATE,
376 TCA_CBQ_RTAB,
377 TCA_CBQ_POLICE,
378};
379
380#define TCA_CBQ_MAX TCA_CBQ_POLICE
381
382/* dsmark section */
383
384enum {
385 TCA_DSMARK_UNSPEC,
386 TCA_DSMARK_INDICES,
387 TCA_DSMARK_DEFAULT_INDEX,
388 TCA_DSMARK_SET_TC_INDEX,
389 TCA_DSMARK_MASK,
390 TCA_DSMARK_VALUE
391};
392
393#define TCA_DSMARK_MAX TCA_DSMARK_VALUE
394
395/* ATM section */
396
397enum {
398 TCA_ATM_UNSPEC,
399 TCA_ATM_FD, /* file/socket descriptor */
400 TCA_ATM_PTR, /* pointer to descriptor - later */
401 TCA_ATM_HDR, /* LL header */
402 TCA_ATM_EXCESS, /* excess traffic class (0 for CLP) */
403 TCA_ATM_ADDR, /* PVC address (for output only) */
404 TCA_ATM_STATE /* VC state (ATM_VS_*; for output only) */
405};
406
407#define TCA_ATM_MAX TCA_ATM_STATE
408
409#endif