Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (7 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/networking/tc.c

    r2725 r3232  
    77 * Bernhard Reutner-Fischer adjusted for busybox
    88 */
     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 ]"
    930
    1031#include "libbb.h"
     
    3859struct globals {
    3960    int filter_ifindex;
    40     __u32 filter_qdisc;
    41     __u32 filter_parent;
    42     __u32 filter_prio;
    43     __u32 filter_proto;
     61    uint32_t filter_qdisc;
     62    uint32_t filter_parent;
     63    uint32_t filter_prio;
     64    uint32_t filter_proto;
    4465} FIX_ALIASING;
    4566#define G (*(struct globals*)&bb_common_bufsiz1)
     67struct BUG_G_too_big {
     68        char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1];
     69};
    4670#define filter_ifindex (G.filter_ifindex)
    4771#define filter_qdisc (G.filter_qdisc)
     
    4973#define filter_prio (G.filter_prio)
    5074#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)
    5776
    5877/* Allocates a buffer containing the name of a class id.
     
    7695
    7796/* Get a qdisc handle.  Return 0 on success, !0 otherwise.  */
    78 static int get_qdisc_handle(__u32 *h, const char *str) {
    79     __u32 maj;
     97static int get_qdisc_handle(uint32_t *h, const char *str) {
     98    uint32_t maj;
    8099    char *p;
    81100
     
    95114
    96115/* Get class ID.  Return 0 on success, !0 otherwise.  */
    97 static int get_tc_classid(__u32 *h, const char *str) {
    98     __u32 maj, min;
     116static int get_tc_classid(uint32_t *h, const char *str) {
     117    uint32_t maj, min;
    99118    char *p;
    100119
     
    373392    else if (msg->tcm_parent) {
    374393        classid = print_tc_classid(filter_qdisc ?
    375                                    TC_H_MIN(msg->tcm_parent) : msg->tcm_parent);
     394                TC_H_MIN(msg->tcm_parent) : msg->tcm_parent);
    376395        printf("parent %s ", classid);
    377396        if (ENABLE_FEATURE_CLEAN_UP)
     
    495514                filter_parent = TC_H_ROOT;
    496515        } else if (arg == ARG_parent) {
    497             __u32 handle;
     516            uint32_t handle;
    498517            if (msg.tcm_parent)
    499518                duparg(*argv, "parent");
     
    508527            /* reject LONG_MIN || LONG_MAX */
    509528            /* TODO: for fw
    510                if ((slash = strchr(handle, '/')) != NULL)
     529            slash = strchr(handle, '/');
     530            if (slash != NULL)
    511531                   *slash = '\0';
    512532             */
    513533            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); */
    515535        } else if (arg == ARG_classid && obj == OBJ_class && cmd == CMD_change){
    516536        } else if (arg == ARG_pref || arg == ARG_prio) { /* filter::list */
Note: See TracChangeset for help on using the changeset viewer.