Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
map-controller
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-controller
Commits
fb368c32
Commit
fb368c32
authored
May 13, 2022
by
Janusz Dziedzic
Browse files
Options
Downloads
Patches
Plain Diff
opclass use timestamp_* util functions
Signed-off-by:
Janusz Dziedzic
<
janusz.dziedzic@iopsys.eu
>
parent
b30bf582
No related branches found
No related tags found
No related merge requests found
Pipeline
#51261
passed
May 13, 2022
Stage: static_code_analysis
Stage: compile_test
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/cntlr.c
+1
-4
1 addition, 4 deletions
src/cntlr.c
src/cntlr_ubus.c
+1
-1
1 addition, 1 deletion
src/cntlr_ubus.c
src/utils/opclass.c
+1
-1
1 addition, 1 deletion
src/utils/opclass.c
src/utils/opclass.h
+1
-1
1 addition, 1 deletion
src/utils/opclass.h
with
4 additions
and
7 deletions
src/cntlr.c
+
1
−
4
View file @
fb368c32
...
@@ -1200,13 +1200,10 @@ void cntlr_radio_cur_opclass_dump(struct netif_radio *radio)
...
@@ -1200,13 +1200,10 @@ void cntlr_radio_cur_opclass_dump(struct netif_radio *radio)
static
bool
cntlr_radio_opclass_expired
(
struct
netif_radio
*
radio
)
static
bool
cntlr_radio_opclass_expired
(
struct
netif_radio
*
radio
)
{
{
time_t
age
;
if
(
!
radio
->
opclass
.
entry_num
)
if
(
!
radio
->
opclass
.
entry_num
)
return
true
;
return
true
;
age
=
time
(
NULL
)
-
radio
->
opclass
.
entry_time
;
if
(
timestamp_expired
(
&
radio
->
opclass
.
entry_time
,
120000
))
if
(((
unsigned
int
)
age
)
>
120
)
return
true
;
return
true
;
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/cntlr_ubus.c
+
1
−
1
View file @
fb368c32
...
@@ -438,7 +438,7 @@ static void cntlr_status_add_opclass(struct blob_buf *bb, struct opclass *opclas
...
@@ -438,7 +438,7 @@ static void cntlr_status_add_opclass(struct blob_buf *bb, struct opclass *opclas
/* Add age */
/* Add age */
snprintf
(
age
,
sizeof
(
age
),
"%s_age"
,
name
);
snprintf
(
age
,
sizeof
(
age
),
"%s_age"
,
name
);
blobmsg_add_u32
(
bb
,
age
,
(
uint32_t
)
(
time
(
NULL
)
-
opclass
->
entry_time
));
blobmsg_add_u32
(
bb
,
age
,
timestamp_elapsed_sec
(
&
opclass
->
entry_time
));
a
=
blobmsg_open_array
(
bb
,
name
);
a
=
blobmsg_open_array
(
bb
,
name
);
for
(
j
=
0
;
j
<
opclass
->
entry_num
;
j
++
)
{
for
(
j
=
0
;
j
<
opclass
->
entry_num
;
j
++
)
{
...
...
This diff is collapsed.
Click to expand it.
src/utils/opclass.c
+
1
−
1
View file @
fb368c32
...
@@ -34,7 +34,7 @@ struct opclass_entry *opclass_new_entry(struct opclass *opclass)
...
@@ -34,7 +34,7 @@ struct opclass_entry *opclass_new_entry(struct opclass *opclass)
entry
=
&
opclass
->
entry
[
opclass
->
entry_num
];
entry
=
&
opclass
->
entry
[
opclass
->
entry_num
];
opclass
->
entry_num
++
;
opclass
->
entry_num
++
;
opclass
->
entry_time
=
time
(
NULL
);
timestamp_update
(
&
opclass
->
entry_time
);
return
entry
;
return
entry
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/utils/opclass.h
+
1
−
1
View file @
fb368c32
...
@@ -28,7 +28,7 @@ struct opclass_entry {
...
@@ -28,7 +28,7 @@ struct opclass_entry {
};
};
struct
opclass
{
struct
opclass
{
time_t
entry_time
;
struct
timespec
entry_time
;
int
entry_num
;
int
entry_num
;
struct
opclass_entry
entry
[
64
];
struct
opclass_entry
entry
[
64
];
...
...
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