Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iproute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
iproute2
Commits
d81b135b
Commit
d81b135b
authored
Aug 23, 2004
by
net[shemminger]!shemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import patch jamal-p1
(Logical change 1.70)
parent
ae02026a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
33 deletions
+14
-33
tc/f_u32.c
tc/f_u32.c
+14
-16
tc/m_action.c
tc/m_action.c
+0
-4
tc/tc_class.c
tc/tc_class.c
+0
-4
tc/tc_filter.c
tc/tc_filter.c
+0
-4
tc/tc_qdisc.c
tc/tc_qdisc.c
+0
-5
No files found.
tc/f_u32.c
View file @
d81b135b
...
...
@@ -123,8 +123,6 @@ static int pack_key(struct tc_u32_sel *sel, __u32 key, __u32 mask, int off, int
return
-
1
;
sel
->
keys
[
i
].
val
|=
key
;
sel
->
keys
[
i
].
mask
|=
mask
;
sel
->
keys
[
i
].
off
=
0
;
sel
->
keys
[
i
].
offmask
=
0
;
return
0
;
}
}
...
...
@@ -710,19 +708,10 @@ static int parse_hashkey(int *argc_p, char ***argv_p, struct tc_u32_sel *sel)
while
(
argc
>
0
)
{
if
(
matches
(
*
argv
,
"mask"
)
==
0
)
{
__u32
mask
;
int
i
=
0
;
NEXT_ARG
();
if
(
get_u32
(
&
mask
,
*
argv
,
16
))
return
-
1
;
sel
->
hmask
=
htonl
(
mask
);
mask
=
sel
->
hmask
;
while
(
!
(
mask
&
1
))
{
i
++
;
mask
>>=
1
;
}
#ifdef fix_u32_bug
sel
->
fshift
=
i
;
#endif
}
else
if
(
matches
(
*
argv
,
"at"
)
==
0
)
{
int
num
;
NEXT_ARG
();
...
...
@@ -875,6 +864,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char **
}
strncpy
(
ind
,
*
argv
,
sizeof
(
ind
)
-
1
);
addattr_l
(
n
,
MAX_MSG
,
TCA_U32_INDEV
,
ind
,
strlen
(
ind
)
+
1
);
}
else
if
(
matches
(
*
argv
,
"action"
)
==
0
)
{
NEXT_ARG
();
if
(
parse_action
(
&
argc
,
&
argv
,
TCA_U32_ACT
,
n
))
{
...
...
@@ -882,6 +872,7 @@ static int u32_parse_opt(struct filter_util *qu, char *handle, int argc, char **
return
-
1
;
}
continue
;
}
else
if
(
matches
(
*
argv
,
"police"
)
==
0
)
{
NEXT_ARG
();
if
(
parse_police
(
&
argc
,
&
argv
,
TCA_U32_POLICE
,
n
))
{
...
...
@@ -920,6 +911,7 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __
{
struct
rtattr
*
tb
[
TCA_U32_MAX
+
1
];
struct
tc_u32_sel
*
sel
=
NULL
;
struct
tc_u32_pcnt
*
pf
=
NULL
;
if
(
opt
==
NULL
)
return
0
;
...
...
@@ -964,10 +956,19 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __
fprintf
(
f
,
"link %s "
,
sprint_u32_handle
(
*
(
__u32
*
)
RTA_DATA
(
tb
[
TCA_U32_LINK
]),
b1
));
}
if
(
tb
[
TCA_U32_PCNT
])
{
if
(
RTA_PAYLOAD
(
tb
[
TCA_U32_PCNT
])
<
sizeof
(
*
pf
))
{
fprintf
(
f
,
"Broken perf counters
\n
"
);
return
-
1
;
}
pf
=
RTA_DATA
(
tb
[
TCA_U32_PCNT
]);
}
if
(
sel
)
{
int
i
;
struct
tc_u32_key
*
key
=
sel
->
keys
;
if
(
show_stats
&&
NULL
!=
pf
)
fprintf
(
f
,
" (rule hit %llu success %llu)"
,
pf
->
rcnt
,
pf
->
rhit
);
if
(
sel
->
nkeys
)
{
for
(
i
=
0
;
i
<
sel
->
nkeys
;
i
++
,
key
++
)
{
fprintf
(
f
,
"
\n
match %08x/%08x at %s%d"
,
...
...
@@ -975,6 +976,8 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __
(
unsigned
int
)
ntohl
(
key
->
mask
),
key
->
offmask
?
"nexthdr+"
:
""
,
key
->
off
);
if
(
show_stats
&&
NULL
!=
pf
)
fprintf
(
f
,
" (success %lld ) "
,
pf
->
kcnts
[
i
]);
}
}
...
...
@@ -994,11 +997,6 @@ static int u32_print_opt(struct filter_util *qu, FILE *f, struct rtattr *opt, __
}
}
if
(
show_stats
&&
tb
[
TCA_U32_PCNT
]){
struct
tc_u32_pcnt
*
p
=
RTA_DATA
(
tb
[
TCA_U32_PCNT
]);
fprintf
(
f
,
" (rule hit %llu success %llu)"
,
p
->
rcnt
,
p
->
rhit
);
}
if
(
tb
[
TCA_U32_POLICE
])
{
fprintf
(
f
,
"
\n
"
);
tc_print_police
(
f
,
tb
[
TCA_U32_POLICE
]);
...
...
tc/m_action.c
View file @
d81b135b
...
...
@@ -262,21 +262,17 @@ tc_print_one_action(FILE * f, struct rtattr *arg)
if
(
show_stats
)
{
if
(
tb
[
TCA_STATS
])
{
#ifndef STOOPID_8BYTE
if
(
RTA_PAYLOAD
(
tb
[
TCA_STATS
])
<
sizeof
(
struct
tc_stats
))
fprintf
(
f
,
"statistics truncated"
);
else
{
#endif
struct
tc_stats
st
;
memcpy
(
&
st
,
RTA_DATA
(
tb
[
TCA_STATS
]),
sizeof
(
st
));
fprintf
(
f
,
"
\t
"
);
print_tcstats
(
f
,
&
st
);
fprintf
(
f
,
"
\n
"
);
#ifndef STOOPID_8BYTE
}
#endif
}
}
...
...
tc/tc_class.c
View file @
d81b135b
...
...
@@ -241,18 +241,14 @@ int print_class(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf
(
fp
,
"
\n
"
);
if
(
show_stats
)
{
if
(
tb
[
TCA_STATS
])
{
#ifndef STOOPID_8BYTE
if
(
RTA_PAYLOAD
(
tb
[
TCA_STATS
])
<
sizeof
(
struct
tc_stats
))
fprintf
(
fp
,
"statistics truncated"
);
else
{
#endif
struct
tc_stats
st
;
memcpy
(
&
st
,
RTA_DATA
(
tb
[
TCA_STATS
]),
sizeof
(
st
));
print_class_tcstats
(
fp
,
&
st
);
fprintf
(
fp
,
"
\n
"
);
#ifndef STOOPID_8BYTE
}
#endif
}
if
(
q
&&
tb
[
TCA_XSTATS
])
{
q
->
print_xstats
(
q
,
fp
,
tb
[
TCA_XSTATS
]);
...
...
tc/tc_filter.c
View file @
d81b135b
...
...
@@ -254,18 +254,14 @@ int print_filter(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
if
(
show_stats
)
{
if
(
tb
[
TCA_STATS
])
{
#ifndef STOOPID_8BYTE
if
(
RTA_PAYLOAD
(
tb
[
TCA_STATS
])
<
sizeof
(
struct
tc_stats
))
fprintf
(
fp
,
"statistics truncated"
);
else
{
#endif
struct
tc_stats
st
;
memcpy
(
&
st
,
RTA_DATA
(
tb
[
TCA_STATS
]),
sizeof
(
st
));
print_tcstats
(
fp
,
&
st
);
fprintf
(
fp
,
"
\n
"
);
#ifndef STOOPID_8BYTE
}
#endif
}
}
fflush
(
fp
);
...
...
tc/tc_qdisc.c
View file @
d81b135b
...
...
@@ -173,7 +173,6 @@ void print_tcstats(FILE *fp, struct tc_stats *st)
fprintf
(
fp
,
" Sent %llu bytes %u pkts (dropped %u, overlimits %u ) "
,
(
unsigned
long
long
)
st
->
bytes
,
st
->
packets
,
st
->
drops
,
st
->
overlimits
);
if
(
st
->
bps
||
st
->
pps
||
st
->
qlen
||
st
->
backlog
)
{
fprintf
(
fp
,
"
\n
"
);
if
(
st
->
bps
||
st
->
pps
)
{
...
...
@@ -256,19 +255,15 @@ int print_qdisc(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
fprintf
(
fp
,
"
\n
"
);
if
(
show_stats
)
{
if
(
tb
[
TCA_STATS
])
{
#ifndef STOOPID_8BYTE
if
(
RTA_PAYLOAD
(
tb
[
TCA_STATS
])
<
sizeof
(
struct
tc_stats
))
fprintf
(
fp
,
"statistics truncated"
);
else
{
#endif
struct
tc_stats
st
;
memcpy
(
&
st
,
RTA_DATA
(
tb
[
TCA_STATS
]),
sizeof
(
st
));
print_tcstats
(
fp
,
&
st
);
fprintf
(
fp
,
"
\n
"
);
}
#ifndef STOOPID_8BYTE
}
#endif
if
(
q
&&
tb
[
TCA_XSTATS
])
{
q
->
print_xstats
(
q
,
fp
,
tb
[
TCA_XSTATS
]);
fprintf
(
fp
,
"
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment