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
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
ca078afb
Commit
ca078afb
authored
1 month ago
by
Anjan Chanda
Browse files
Options
Downloads
Patches
Plain Diff
cntlr-apis: provide well defined APIs to plugins and other applications
parent
8fbf3b37
No related branches found
No related tags found
No related merge requests found
Pipeline
#209716
passed
1 month ago
Stage: static_code_analysis
Stage: compile_test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Makefile
+6
-3
6 additions, 3 deletions
src/Makefile
src/cntlr_apis.c
+76
-0
76 additions, 0 deletions
src/cntlr_apis.c
src/cntlr_apis.h
+27
-0
27 additions, 0 deletions
src/cntlr_apis.h
with
109 additions
and
3 deletions
src/Makefile
+
6
−
3
View file @
ca078afb
...
...
@@ -34,9 +34,9 @@ OBJS = \
main.o
\
dpp.o
\
scan.o
\
steer.o
steer.o
\
steer_module.o
OBJS
+=
steer_module.o
LIBS
=
-lubus
-lubox
-ljson-c
-lblobmsg_json
-luci
-pthread
LIBS
+=
-rdynamic
-ldl
...
...
@@ -53,11 +53,14 @@ HOOKS = pre-commit
.PHONY
:
all version.h check clean plugins FORCE
all
:
version $(EXECS) plugins
all
:
version $(EXECS)
libcntlr-apis.so
plugins
%.o
:
%.c
$(
CC
)
$(
CFLAGS
)
-c
-o
$@
$<
libcntlr-apis.so
:
cntlr_apis.o
$(
CC
)
-shared
-Wl
,-soname,libcntlr-apis.so
$^
-o
$@
$(
LIBS
)
-L
.
version.h
:
@
(
\
[
command
-v
git
>
/dev/null 2>&1
]
||
{
\
...
...
This diff is collapsed.
Click to expand it.
src/cntlr_apis.c
0 → 100644
+
76
−
0
View file @
ca078afb
/*
* cntlr_apis.c - public APIs available to Controller plugins.
*
* Copyright (C) 2025 Genexis Sweden AB.
*
* See LICENSE file for source code license information.
*
*/
#include
"cntlr.h"
#include
"sta.h"
#include
"cntlr_apis.h"
int
cntlr_register_module
(
void
**
controller
,
void
*
module
)
{
//TODO
return
-
1
;
}
void
cntlr_unregister_module
(
void
*
module
)
{
//TODO
}
struct
wifi_radio_element
*
cntlr_get_radio_element
(
void
*
cntlr
,
uint8_t
*
ruid
)
{
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
netif_radio
*
r
;
r
=
cntlr_find_radio
(
c
,
ruid
);
return
r
?
r
->
radio_el
:
NULL
;
}
struct
wifi_radio_element
*
cntlr_get_radio_element_by_bssid
(
void
*
cntlr
,
uint8_t
*
bssid
)
{
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
netif_radio
*
r
=
NULL
;
struct
netif_iface
*
p
=
NULL
;
struct
node
*
n
=
NULL
;
list_for_each_entry
(
n
,
&
c
->
nodelist
,
list
)
{
list_for_each_entry
(
r
,
&
n
->
radiolist
,
list
)
{
list_for_each_entry
(
p
,
&
r
->
iflist
,
list
)
{
if
(
!
memcmp
(
p
->
bss
->
bssid
,
bssid
,
6
))
return
r
->
radio_el
;
}
}
}
return
NULL
;
}
struct
wifi_radio_element
*
cntlr_get_radio_element_in_node_by_band
(
void
*
cntlr
,
uint8_t
*
node_almacaddr
,
enum
wifi_band
band
)
{
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
netif_radio
*
r
=
NULL
;
struct
node
*
n
;
n
=
cntlr_find_node
(
c
,
node_almacaddr
);
if
(
!
n
)
return
NULL
;
r
=
cntlr_find_radio_in_node_by_band
(
c
,
n
,
band
);
return
r
?
r
->
radio_el
:
NULL
;
}
struct
wifi_sta_element
*
cntlr_get_sta_element
(
void
*
cntlr
,
uint8_t
*
macaddr
)
{
struct
controller
*
c
=
(
struct
controller
*
)
cntlr
;
struct
sta
*
s
;
s
=
cntlr_find_sta
(
c
->
sta_table
,
macaddr
);
return
s
?
s
->
de_sta
:
NULL
;
}
This diff is collapsed.
Click to expand it.
src/cntlr_apis.h
0 → 100644
+
27
−
0
View file @
ca078afb
/*
* cntlr_apis.h
* Library header file for libcntlr-apis.so.
*
* Copyright (C) 2025 Genexis Sweden AB.
*
*/
#ifndef CNTLR_APIS_H
#define CNTLR_APIS_H
#include
"wifi_dataelements.h"
int
cntlr_register_module
(
void
**
controller
,
void
*
module
);
void
cntlr_unregister_module
(
void
*
module
);
struct
wifi_radio_element
*
cntlr_get_radio_element
(
void
*
cntlr
,
uint8_t
*
ruid
);
struct
wifi_radio_element
*
cntlr_get_radio_element_by_bssid
(
void
*
cntlr
,
uint8_t
*
bssid
);
struct
wifi_radio_element
*
cntlr_get_radio_element_in_node_by_band
(
void
*
cntlr
,
uint8_t
*
node_almacaddr
,
enum
wifi_band
band
);
struct
wifi_sta_element
*
cntlr_get_sta_element
(
void
*
cntlr
,
uint8_t
*
macaddr
);
#endif
/* CNTLR_APIS_H */
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
register
or
sign in
to comment