Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/networking/tc.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/networking/tc.c
r2725 r3232 7 7 * Bernhard Reutner-Fischer adjusted for busybox 8 8 */ 9 10 //usage:#define tc_trivial_usage 11 /* //usage: "[OPTIONS] OBJECT CMD [dev STRING]" */ 12 //usage: "OBJECT CMD [dev STRING]" 13 //usage:#define tc_full_usage "\n\n" 14 //usage: "OBJECT: {qdisc|class|filter}\n" 15 //usage: "CMD: {add|del|change|replace|show}\n" 16 //usage: "\n" 17 //usage: "qdisc [ handle QHANDLE ] [ root |"IF_FEATURE_TC_INGRESS(" ingress |")" parent CLASSID ]\n" 18 /* //usage: "[ estimator INTERVAL TIME_CONSTANT ]\n" */ 19 //usage: " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" 20 //usage: " QDISC_KIND := { [p|b]fifo | tbf | prio | cbq | red | etc. }\n" 21 //usage: "qdisc show [ dev STRING ]"IF_FEATURE_TC_INGRESS(" [ingress]")"\n" 22 //usage: "class [ classid CLASSID ] [ root | parent CLASSID ]\n" 23 //usage: " [ [ QDISC_KIND ] [ help | OPTIONS ] ]\n" 24 //usage: "class show [ dev STRING ] [ root | parent CLASSID ]\n" 25 //usage: "filter [ pref PRIO ] [ protocol PROTO ]\n" 26 /* //usage: "\t[ estimator INTERVAL TIME_CONSTANT ]\n" */ 27 //usage: " [ root | classid CLASSID ] [ handle FILTERID ]\n" 28 //usage: " [ [ FILTER_TYPE ] [ help | OPTIONS ] ]\n" 29 //usage: "filter show [ dev STRING ] [ root | parent CLASSID ]" 9 30 10 31 #include "libbb.h" … … 38 59 struct globals { 39 60 int filter_ifindex; 40 __u32filter_qdisc;41 __u32filter_parent;42 __u32filter_prio;43 __u32filter_proto;61 uint32_t filter_qdisc; 62 uint32_t filter_parent; 63 uint32_t filter_prio; 64 uint32_t filter_proto; 44 65 } FIX_ALIASING; 45 66 #define G (*(struct globals*)&bb_common_bufsiz1) 67 struct BUG_G_too_big { 68 char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; 69 }; 46 70 #define filter_ifindex (G.filter_ifindex) 47 71 #define filter_qdisc (G.filter_qdisc) … … 49 73 #define filter_prio (G.filter_prio) 50 74 #define filter_proto (G.filter_proto) 51 52 void BUG_tc_globals_too_big(void); 53 #define INIT_G() do { \ 54 if (sizeof(G) > COMMON_BUFSIZE) \ 55 BUG_tc_globals_too_big(); \ 56 } while (0) 75 #define INIT_G() do { } while (0) 57 76 58 77 /* Allocates a buffer containing the name of a class id. … … 76 95 77 96 /* Get a qdisc handle. Return 0 on success, !0 otherwise. */ 78 static int get_qdisc_handle( __u32*h, const char *str) {79 __u32maj;97 static int get_qdisc_handle(uint32_t *h, const char *str) { 98 uint32_t maj; 80 99 char *p; 81 100 … … 95 114 96 115 /* Get class ID. Return 0 on success, !0 otherwise. */ 97 static int get_tc_classid( __u32*h, const char *str) {98 __u32maj, min;116 static int get_tc_classid(uint32_t *h, const char *str) { 117 uint32_t maj, min; 99 118 char *p; 100 119 … … 373 392 else if (msg->tcm_parent) { 374 393 classid = print_tc_classid(filter_qdisc ? 375 394 TC_H_MIN(msg->tcm_parent) : msg->tcm_parent); 376 395 printf("parent %s ", classid); 377 396 if (ENABLE_FEATURE_CLEAN_UP) … … 495 514 filter_parent = TC_H_ROOT; 496 515 } else if (arg == ARG_parent) { 497 __u32handle;516 uint32_t handle; 498 517 if (msg.tcm_parent) 499 518 duparg(*argv, "parent"); … … 508 527 /* reject LONG_MIN || LONG_MAX */ 509 528 /* TODO: for fw 510 if ((slash = strchr(handle, '/')) != NULL) 529 slash = strchr(handle, '/'); 530 if (slash != NULL) 511 531 *slash = '\0'; 512 532 */ 513 533 msg.tcm_handle = get_u32(*argv, "handle"); 514 /* if (slash) {if (get_u32( __u32&mask, slash+1, NULL)) inv mask; addattr32(n, MAX_MSG, TCA_FW_MASK, mask); */534 /* if (slash) {if (get_u32(uint32_t &mask, slash+1, NULL)) inv mask; addattr32(n, MAX_MSG, TCA_FW_MASK, mask); */ 515 535 } else if (arg == ARG_classid && obj == OBJ_class && cmd == CMD_change){ 516 536 } else if (arg == ARG_pref || arg == ARG_prio) { /* filter::list */
Note:
See TracChangeset
for help on using the changeset viewer.