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
4bfe4a9d
Commit
4bfe4a9d
authored
4 months ago
by
Anjan Chanda
Browse files
Options
Downloads
Patches
Plain Diff
show version info
parent
2f840318
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#197096
passed
4 months ago
Stage: static_code_analysis
Stage: compile_test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
src/Makefile
+18
-3
18 additions, 3 deletions
src/Makefile
src/main.c
+30
-4
30 additions, 4 deletions
src/main.c
with
49 additions
and
7 deletions
.gitignore
+
1
−
0
View file @
4bfe4a9d
...
...
@@ -11,3 +11,4 @@ src/tags
src/mapcontroller
.configured_*
.pkgdir
version.h
This diff is collapsed.
Click to expand it.
src/Makefile
+
18
−
3
View file @
4bfe4a9d
...
...
@@ -4,8 +4,12 @@ CFLAGS+=-I. -Iutils -D_GNU_SOURCE
CFLAGS
+=
-g
-Wall
ifeq
(,$(findstring EASYMESH_VERSION,$(CFLAGS)))
$(info
'EASYMESH_VERSION is not set. Build for 6'
)
$(info
EASYMESH_VERSION
is
not
set.
Build
for
6)
EASYMESH_VERSION
=
6
CFLAGS
+=
-DEASYMESH_VERSION
=
6
else
EASYMESH_VERSION
=
$(
patsubst
-DEASYMESH_VERSION
=
%,%,
$(
filter
-DEASYMESH_VERSION
=
%,
$(
CFLAGS
)))
$(info
EASYMESH_VERSION
passed
is
$(EASYMESH_VERSION))
endif
OBJS
=
\
...
...
@@ -47,13 +51,24 @@ plugin_sofile = $(wildcard $(d)/*.so)
plugin_files
=
$(
foreach d,
$(
plugin_subdirs
)
,
$(
plugin_sofile
))
HOOKS
=
pre-commit
.PHONY
:
all check clean plugins FORCE
.PHONY
:
all
version.h
check clean plugins FORCE
all
:
$(EXECS) plugins
all
:
version
$(EXECS) plugins
%.o
:
%.c
$(
CC
)
$(
CFLAGS
)
-c
-o
$@
$<
version.h
:
@
(
\
[
command
-v
git
>
/dev/null 2>&1
]
||
{
\
h
=
$(
shell git rev-parse
--short
=
8 HEAD
);
\
}
;
\
echo
"const char *verstring =
\"
6.0
\"
;"
>
$@
;
\
echo
"const char *githash =
\"
$$
h
\"
;"
>>
$@
;
\
)
version
:
version.h
mapcontroller
:
$(OBJS)
$(
CC
)
$(
LDFLAGS
)
-o
$@
$^
$(
LIBS
)
...
...
This diff is collapsed.
Click to expand it.
src/main.c
+
30
−
4
View file @
4bfe4a9d
...
...
@@ -9,16 +9,18 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<stdint.h>
#include
<unistd.h>
#include
<getopt.h>
#include
<sys/types.h>
#include
<fcntl.h>
#include
<stdbool.h>
#include
<stdint.h>
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include
"version.h"
#include
"utils/debug.h"
#include
"utils/utils.h"
...
...
@@ -42,14 +44,19 @@ void usage(char *prog)
fprintf
(
stderr
,
" -v, debug verbosity; more 'v's mean more verbose
\n
"
);
fprintf
(
stderr
,
" -l, log to syslog
\n
"
);
fprintf
(
stderr
,
" -d, debug mode; i.e. don't daemonize
\n
"
);
fprintf
(
stderr
,
" -m, in debug mode trace alloc/free calls
\n
"
);
fprintf
(
stderr
,
" -p <pidfile> pid file path
\n
"
);
fprintf
(
stderr
,
" -o <file>, log to file
\n
"
);
fprintf
(
stderr
,
" -f, treat above file as fifo
\n
"
);
fprintf
(
stderr
,
" -w, wait for external
l
trigger
\n
"
);
fprintf
(
stderr
,
" -w, wait for external trigger
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
}
static
void
print_version
(
void
)
{
fprintf
(
stdout
,
"%s: %s-g%s
\n
"
,
PROG_NAME
,
verstring
,
githash
);
fprintf
(
stdout
,
"%s: EASYMESH_VERSION %d
\n
"
,
PROG_NAME
,
EASYMESH_VERSION
);
}
int
main
(
int
argc
,
char
**
argv
)
{
struct
log_options
lopts
=
{
...
...
@@ -59,10 +66,29 @@ int main(int argc, char **argv)
.
level
=
DEFAULT_LOGLEVEL
,
.
features
=
LOG_FEATURE_ALL
,
};
static
struct
option
lgopts
[]
=
{
{
"version"
,
0
,
0
,
0
},
{
"help"
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
},
};
int
lidx
=
0
;
int
ch
;
while
((
ch
=
getopt
(
argc
,
argv
,
"hlfdvws:o:p:"
))
!=
-
1
)
{
while
((
ch
=
getopt
_long
(
argc
,
argv
,
"hlfdvws:o:p:"
,
lgopts
,
&
lidx
))
!=
-
1
)
{
switch
(
ch
)
{
case
0
:
switch
(
lidx
)
{
case
0
:
print_version
();
exit
(
0
);
case
1
:
usage
(
argv
[
0
]);
exit
(
0
);
default:
break
;
}
break
;
case
's'
:
ubus_socket
=
optarg
;
break
;
...
...
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