~ubuntu-branches/ubuntu/precise/iproute/precise

« back to all changes in this revision

Viewing changes to tc/f_fw.c

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt, Andreas Henriksson, Justin B Rye, Alexander Wirt
  • Date: 2008-05-11 11:18:29 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080511111829-rfewew7s6kiev0bh
Tags: 20080417-1
[ Andreas Henriksson ]
* New upstream release, v2.6.25 a.k.a. snapshot 20080417.
  - Initial documentation for xfrm (Partially fixes #451337)
  - Fixes manpage error caught by lintian!
* Fix typos (syntax error) in ip(8) manpage.
  - Introduced by upstream, caught by lintian yet again!
* Don't ship useless headers in iproute-dev (Closes: #467557)
* Cherry-pick "Fix bad hash calculation because of signed address" from
  upstream. (Closes: #480173)

[ Justin B Rye ]
* Update package description (Closes: #464521)

[ Alexander Wirt ]
* Fix typo in short package description.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        fprintf(stderr, "Usage: ... fw [ classid CLASSID ] [ police POLICE_SPEC ]\n");
29
29
        fprintf(stderr, "       POLICE_SPEC := ... look at TBF\n");
30
30
        fprintf(stderr, "       CLASSID := X:Y\n");
 
31
        fprintf(stderr, "\nNOTE: CLASSID is parsed as hexadecimal input.\n");
31
32
}
32
33
 
33
34
#define usage() return(-1)
40
41
 
41
42
        memset(&tp, 0, sizeof(tp));
42
43
 
 
44
        tail = NLMSG_TAIL(n);
 
45
        addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
 
46
 
43
47
        if (handle) {
 
48
                char *slash;
 
49
                __u32 mask = 0;
 
50
                if ((slash = strchr(handle, '/')) != NULL)
 
51
                        *slash = '\0';
44
52
                if (get_u32(&t->tcm_handle, handle, 0)) {
45
53
                        fprintf(stderr, "Illegal \"handle\"\n");
46
54
                        return -1;
47
55
                }
 
56
                if (slash) {
 
57
                        if (get_u32(&mask, slash+1, 0)) {
 
58
                                fprintf(stderr, "Illegal \"handle\" mask\n");
 
59
                                return -1;
 
60
                        }
 
61
                        addattr32(n, MAX_MSG, TCA_FW_MASK, mask);
 
62
                }
48
63
        }
49
64
 
50
65
        if (argc == 0)
51
66
                return 0;
52
67
 
53
 
        tail = NLMSG_TAIL(n);
54
 
        addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
55
 
 
56
68
        while (argc > 0) {
57
69
                if (matches(*argv, "classid") == 0 ||
58
70
                    matches(*argv, "flowid") == 0) {
111
123
 
112
124
        parse_rtattr_nested(tb, TCA_FW_MAX, opt);
113
125
 
114
 
        if (handle)
115
 
                fprintf(f, "handle 0x%x ", handle);
 
126
        if (handle || tb[TCA_FW_MASK]) {
 
127
                __u32 mark = 0, mask = 0;
 
128
                if(handle)
 
129
                        mark = handle;
 
130
                if(tb[TCA_FW_MASK] &&
 
131
                    (mask = *(__u32*)RTA_DATA(tb[TCA_FW_MASK])) != 0xFFFFFFFF)
 
132
                        fprintf(f, "handle 0x%x/0x%x ", mark, mask);
 
133
                else
 
134
                        fprintf(f, "handle 0x%x ", handle);
 
135
        }
116
136
 
117
137
        if (tb[TCA_FW_CLASSID]) {
118
138
                SPRINT_BUF(b1);