Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-agent
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Automate
Agent sessions
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-agent
Commits
8bb6911a
Commit
8bb6911a
authored
Aug 29, 2023
by
Maxim Menshikov
Browse files
Options
Downloads
Patches
Plain Diff
Support rule output value 0x00-0x07
parent
18a18607
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/qos.c
+32
-3
32 additions, 3 deletions
src/qos.c
src/qos_internal.h
+1
-0
1 addition, 0 deletions
src/qos_internal.h
with
33 additions
and
3 deletions
src/qos.c
+
32
−
3
View file @
8bb6911a
...
@@ -298,6 +298,30 @@ dscp_pcp_conv_result dscp_pcp2qosmap(uint8_t dscp_pcp[64],
...
@@ -298,6 +298,30 @@ dscp_pcp_conv_result dscp_pcp2qosmap(uint8_t dscp_pcp[64],
return
rc
;
return
rc
;
}
}
dscp_pcp_conv_result
dscp_pcp2qosmap_simple
(
int
pcp
,
char
*
str
,
size_t
len
)
{
size_t
i
;
for
(
i
=
0
;
i
<=
0x7
;
++
i
)
{
char
s
[
50
];
/*
* Map DSCP [0, 63] to PCP passed as argument,
* all other PCP->DSCP ranges are mapped to [255, 255] (unused)
*/
sprintf
(
s
,
"%s%d,%d"
,
(
i
!=
0
)
?
","
,
(
pcp
==
i
)
?
0
:
255
,
(
pcp
==
i
)
?
63
:
255
);
if
((
strlen
(
str
)
+
strlen
(
s
))
>=
len
)
return
DSCP_PCP_CONV_RESULT_TOO_LONG
;
strcat
(
str
,
s
);
}
return
DSCP_PCP_CONV_RESULT_OK
;
}
int
qos_apply_dscp_rules
(
void
*
agent
)
int
qos_apply_dscp_rules
(
void
*
agent
)
{
{
dscp_pcp_conv_result
rc
;
dscp_pcp_conv_result
rc
;
...
@@ -309,10 +333,15 @@ int qos_apply_dscp_rules(void *agent)
...
@@ -309,10 +333,15 @@ int qos_apply_dscp_rules(void *agent)
list_for_each_entry
(
r
,
&
a
->
qos_rules
,
list
)
{
list_for_each_entry
(
r
,
&
a
->
qos_rules
,
list
)
{
char
str
[
512
]
=
{
'\0'
};
char
str
[
512
]
=
{
'\0'
};
if
(
r
->
spr
.
output
!=
0x08
)
if
(
r
->
spr
.
output
<
0x08
)
{
continue
;
rc
=
dscp_pcp2qosmap_simple
(
r
->
spr
.
output
,
str
,
sizeof
(
str
)
-
1
)
;
}
else
if
(
r
->
spr
.
output
==
0x08
)
{
rc
=
dscp_pcp2qosmap
(
r
->
dscp
.
dscp_pcp
,
str
,
sizeof
(
str
)
-
1
);
rc
=
dscp_pcp2qosmap
(
r
->
dscp
.
dscp_pcp
,
str
,
sizeof
(
str
)
-
1
);
}
else
{
err
(
"%s: unsupported SPR output value
\n
"
,
__func__
);
rc
=
DSCP_PCP_CONV_RESULT_FAIL
;
}
if
(
rc
!=
DSCP_PCP_CONV_RESULT_OK
&&
if
(
rc
!=
DSCP_PCP_CONV_RESULT_OK
&&
rc
!=
DSCP_PCP_CONV_RESULT_OK_TOO_MANY_EXC
)
{
rc
!=
DSCP_PCP_CONV_RESULT_OK_TOO_MANY_EXC
)
{
err
(
"%s: wrong QoS map
\n
"
,
__func__
);
err
(
"%s: wrong QoS map
\n
"
,
__func__
);
...
...
This diff is collapsed.
Click to expand it.
src/qos_internal.h
+
1
−
0
View file @
8bb6911a
...
@@ -80,6 +80,7 @@ typedef enum dscp_pcp_conv_result {
...
@@ -80,6 +80,7 @@ typedef enum dscp_pcp_conv_result {
but too many exceptions */
but too many exceptions */
DSCP_PCP_CONV_RESULT_TOO_LONG
,
/**< Too long result that didn't
DSCP_PCP_CONV_RESULT_TOO_LONG
,
/**< Too long result that didn't
fit the output buffer */
fit the output buffer */
DSCP_PCP_CONV_RESULT_FAIL
,
/**< Failure producing QoS map */
}
dscp_pcp_conv_result
;
}
dscp_pcp_conv_result
;
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment