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
22fa92e3
Commit
22fa92e3
authored
Jun 07, 2013
by
Stephen Hemminger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
htb: fix indentation
iproute2 uses kernel style indenting
parent
44f1ff0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
50 deletions
+49
-50
tc/q_htb.c
tc/q_htb.c
+49
-50
No files found.
tc/q_htb.c
View file @
22fa92e3
...
@@ -69,21 +69,21 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
...
@@ -69,21 +69,21 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
while
(
argc
>
0
)
{
while
(
argc
>
0
)
{
if
(
matches
(
*
argv
,
"r2q"
)
==
0
)
{
if
(
matches
(
*
argv
,
"r2q"
)
==
0
)
{
NEXT_ARG
();
NEXT_ARG
();
if
(
get_u32
(
&
opt
.
rate2quantum
,
*
argv
,
10
))
{
if
(
get_u32
(
&
opt
.
rate2quantum
,
*
argv
,
10
))
{
explain1
(
"r2q"
);
return
-
1
;
explain1
(
"r2q"
);
return
-
1
;
}
}
}
else
if
(
matches
(
*
argv
,
"default"
)
==
0
)
{
}
else
if
(
matches
(
*
argv
,
"default"
)
==
0
)
{
NEXT_ARG
();
NEXT_ARG
();
if
(
get_u32
(
&
opt
.
defcls
,
*
argv
,
16
))
{
if
(
get_u32
(
&
opt
.
defcls
,
*
argv
,
16
))
{
explain1
(
"default"
);
return
-
1
;
explain1
(
"default"
);
return
-
1
;
}
}
}
else
if
(
matches
(
*
argv
,
"debug"
)
==
0
)
{
}
else
if
(
matches
(
*
argv
,
"debug"
)
==
0
)
{
NEXT_ARG
();
p
=
*
argv
;
NEXT_ARG
();
p
=
*
argv
;
for
(
i
=
0
;
i
<
16
;
i
++
,
p
++
)
{
for
(
i
=
0
;
i
<
16
;
i
++
,
p
++
)
{
if
(
*
p
<
'0'
||
*
p
>
'3'
)
break
;
if
(
*
p
<
'0'
||
*
p
>
'3'
)
break
;
opt
.
debug
|=
(
*
p
-
'0'
)
<<
(
2
*
i
);
opt
.
debug
|=
(
*
p
-
'0'
)
<<
(
2
*
i
);
}
}
}
else
{
}
else
{
fprintf
(
stderr
,
"What is
\"
%s
\"
?
\n
"
,
*
argv
);
fprintf
(
stderr
,
"What is
\"
%s
\"
?
\n
"
,
*
argv
);
explain
();
explain
();
...
@@ -146,8 +146,8 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
...
@@ -146,8 +146,8 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
explain1
(
"quantum"
);
return
-
1
;
explain1
(
"quantum"
);
return
-
1
;
}
}
}
else
if
(
matches
(
*
argv
,
"burst"
)
==
0
||
}
else
if
(
matches
(
*
argv
,
"burst"
)
==
0
||
strcmp
(
*
argv
,
"buffer"
)
==
0
||
strcmp
(
*
argv
,
"buffer"
)
==
0
||
strcmp
(
*
argv
,
"maxburst"
)
==
0
)
{
strcmp
(
*
argv
,
"maxburst"
)
==
0
)
{
NEXT_ARG
();
NEXT_ARG
();
if
(
get_size_and_cell
(
&
buffer
,
&
cell_log
,
*
argv
)
<
0
)
{
if
(
get_size_and_cell
(
&
buffer
,
&
cell_log
,
*
argv
)
<
0
)
{
explain1
(
"buffer"
);
explain1
(
"buffer"
);
...
@@ -155,8 +155,8 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
...
@@ -155,8 +155,8 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
}
}
ok
++
;
ok
++
;
}
else
if
(
matches
(
*
argv
,
"cburst"
)
==
0
||
}
else
if
(
matches
(
*
argv
,
"cburst"
)
==
0
||
strcmp
(
*
argv
,
"cbuffer"
)
==
0
||
strcmp
(
*
argv
,
"cbuffer"
)
==
0
||
strcmp
(
*
argv
,
"cmaxburst"
)
==
0
)
{
strcmp
(
*
argv
,
"cmaxburst"
)
==
0
)
{
NEXT_ARG
();
NEXT_ARG
();
if
(
get_size_and_cell
(
&
cbuffer
,
&
ccell_log
,
*
argv
)
<
0
)
{
if
(
get_size_and_cell
(
&
cbuffer
,
&
ccell_log
,
*
argv
)
<
0
)
{
explain1
(
"cbuffer"
);
explain1
(
"cbuffer"
);
...
@@ -196,7 +196,7 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
...
@@ -196,7 +196,7 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
argc
--
;
argv
++
;
argc
--
;
argv
++
;
}
}
/* if (!ok)
/* if (!ok)
return 0;*/
return 0;*/
if
(
opt
.
rate
.
rate
==
0
)
{
if
(
opt
.
rate
.
rate
==
0
)
{
...
@@ -254,47 +254,46 @@ static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
...
@@ -254,47 +254,46 @@ static int htb_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
parse_rtattr_nested
(
tb
,
TCA_HTB_RTAB
,
opt
);
parse_rtattr_nested
(
tb
,
TCA_HTB_RTAB
,
opt
);
if
(
tb
[
TCA_HTB_PARMS
])
{
if
(
tb
[
TCA_HTB_PARMS
])
{
hopt
=
RTA_DATA
(
tb
[
TCA_HTB_PARMS
]);
hopt
=
RTA_DATA
(
tb
[
TCA_HTB_PARMS
]);
if
(
RTA_PAYLOAD
(
tb
[
TCA_HTB_PARMS
])
<
sizeof
(
*
hopt
))
return
-
1
;
if
(
RTA_PAYLOAD
(
tb
[
TCA_HTB_PARMS
])
<
sizeof
(
*
hopt
))
return
-
1
;
if
(
!
hopt
->
level
)
{
if
(
!
hopt
->
level
)
{
fprintf
(
f
,
"prio %d "
,
(
int
)
hopt
->
prio
);
fprintf
(
f
,
"prio %d "
,
(
int
)
hopt
->
prio
);
if
(
show_details
)
if
(
show_details
)
fprintf
(
f
,
"quantum %d "
,
(
int
)
hopt
->
quantum
);
fprintf
(
f
,
"quantum %d "
,
(
int
)
hopt
->
quantum
);
}
}
fprintf
(
f
,
"rate %s "
,
sprint_rate
(
hopt
->
rate
.
rate
,
b1
));
fprintf
(
f
,
"rate %s "
,
sprint_rate
(
hopt
->
rate
.
rate
,
b1
));
if
(
hopt
->
rate
.
overhead
)
if
(
hopt
->
rate
.
overhead
)
fprintf
(
f
,
"overhead %u "
,
hopt
->
rate
.
overhead
);
fprintf
(
f
,
"overhead %u "
,
hopt
->
rate
.
overhead
);
buffer
=
tc_calc_xmitsize
(
hopt
->
rate
.
rate
,
hopt
->
buffer
);
buffer
=
tc_calc_xmitsize
(
hopt
->
rate
.
rate
,
hopt
->
buffer
);
fprintf
(
f
,
"ceil %s "
,
sprint_rate
(
hopt
->
ceil
.
rate
,
b1
));
fprintf
(
f
,
"ceil %s "
,
sprint_rate
(
hopt
->
ceil
.
rate
,
b1
));
cbuffer
=
tc_calc_xmitsize
(
hopt
->
ceil
.
rate
,
hopt
->
cbuffer
);
cbuffer
=
tc_calc_xmitsize
(
hopt
->
ceil
.
rate
,
hopt
->
cbuffer
);
if
(
show_details
)
{
if
(
show_details
)
{
fprintf
(
f
,
"burst %s/%u mpu %s overhead %s "
,
fprintf
(
f
,
"burst %s/%u mpu %s overhead %s "
,
sprint_size
(
buffer
,
b1
),
sprint_size
(
buffer
,
b1
),
1
<<
hopt
->
rate
.
cell_log
,
1
<<
hopt
->
rate
.
cell_log
,
sprint_size
(
hopt
->
rate
.
mpu
&
0xFF
,
b2
),
sprint_size
(
hopt
->
rate
.
mpu
&
0xFF
,
b2
),
sprint_size
((
hopt
->
rate
.
mpu
>>
8
)
&
0xFF
,
b3
));
sprint_size
((
hopt
->
rate
.
mpu
>>
8
)
&
0xFF
,
b3
));
fprintf
(
f
,
"cburst %s/%u mpu %s overhead %s "
,
fprintf
(
f
,
"cburst %s/%u mpu %s overhead %s "
,
sprint_size
(
cbuffer
,
b1
),
sprint_size
(
cbuffer
,
b1
),
1
<<
hopt
->
ceil
.
cell_log
,
1
<<
hopt
->
ceil
.
cell_log
,
sprint_size
(
hopt
->
ceil
.
mpu
&
0xFF
,
b2
),
sprint_size
(
hopt
->
ceil
.
mpu
&
0xFF
,
b2
),
sprint_size
((
hopt
->
ceil
.
mpu
>>
8
)
&
0xFF
,
b3
));
sprint_size
((
hopt
->
ceil
.
mpu
>>
8
)
&
0xFF
,
b3
));
fprintf
(
f
,
"level %d "
,
(
int
)
hopt
->
level
);
fprintf
(
f
,
"level %d "
,
(
int
)
hopt
->
level
);
}
else
{
}
else
{
fprintf
(
f
,
"burst %s "
,
sprint_size
(
buffer
,
b1
));
fprintf
(
f
,
"burst %s "
,
sprint_size
(
buffer
,
b1
));
fprintf
(
f
,
"cburst %s "
,
sprint_size
(
cbuffer
,
b1
));
fprintf
(
f
,
"cburst %s "
,
sprint_size
(
cbuffer
,
b1
));
}
}
if
(
show_raw
)
if
(
show_raw
)
fprintf
(
f
,
"buffer [%08x] cbuffer [%08x] "
,
fprintf
(
f
,
"buffer [%08x] cbuffer [%08x] "
,
hopt
->
buffer
,
hopt
->
cbuffer
);
hopt
->
buffer
,
hopt
->
cbuffer
);
}
}
if
(
tb
[
TCA_HTB_INIT
])
{
if
(
tb
[
TCA_HTB_INIT
])
{
gopt
=
RTA_DATA
(
tb
[
TCA_HTB_INIT
]);
gopt
=
RTA_DATA
(
tb
[
TCA_HTB_INIT
]);
if
(
RTA_PAYLOAD
(
tb
[
TCA_HTB_INIT
])
<
sizeof
(
*
gopt
))
return
-
1
;
if
(
RTA_PAYLOAD
(
tb
[
TCA_HTB_INIT
])
<
sizeof
(
*
gopt
))
return
-
1
;
fprintf
(
f
,
"r2q %d default %x direct_packets_stat %u"
,
fprintf
(
f
,
"r2q %d default %x direct_packets_stat %u"
,
gopt
->
rate2quantum
,
gopt
->
defcls
,
gopt
->
direct_pkts
);
gopt
->
rate2quantum
,
gopt
->
defcls
,
gopt
->
direct_pkts
);
if
(
show_details
)
if
(
show_details
)
fprintf
(
f
,
" ver %d.%d"
,
gopt
->
version
>>
16
,
gopt
->
version
&
0xffff
);
fprintf
(
f
,
" ver %d.%d"
,
gopt
->
version
>>
16
,
gopt
->
version
&
0xffff
);
}
}
...
...
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