Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PacketCaptureDiagnostics
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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
BBF
PacketCaptureDiagnostics
Commits
d1115ed0
Commit
d1115ed0
authored
10 months ago
by
Amin Ben Romdhane
Browse files
Options
Downloads
Patches
Plain Diff
Align with new code-analysis docker image
parent
6c64e11d
No related branches found
No related tags found
1 merge request
!5
Align with new code-analysis docker image
Pipeline
#216450
passed
3 weeks ago
Stage: static_code_analysis
Changes
4
Pipelines
5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+4
-8
4 additions, 8 deletions
.gitlab-ci.yml
gitlab-ci/install-dependencies.sh
+10
-0
10 additions, 0 deletions
gitlab-ci/install-dependencies.sh
gitlab-ci/shared.sh
+2
-12
2 additions, 12 deletions
gitlab-ci/shared.sh
src/packetcapture.c
+6
-5
6 additions, 5 deletions
src/packetcapture.c
with
22 additions
and
25 deletions
.gitlab-ci.yml
+
4
−
8
View file @
d1115ed0
variables
:
SOURCE_FOLDER
:
"
src"
include
:
include
:
-
project
:
'
iopsys/gitlab-ci-pipeline'
-
project
:
'
iopsys/gitlab-ci-pipeline'
file
:
'
/static-code-analysis.yml'
file
:
'
/static-code-analysis.yml'
ref
:
'
0.3
2'
ref
:
'
1.
2'
stages
:
stages
:
-
static_code_analysis
-
static_code_analysis
variables
:
DEBUG
:
'
TRUE'
SOURCE_FOLDER
:
"
./src"
FLAWFINDER_OPTIONS
:
"
-m
4
--error-level=5"
CPPCHECK_OPTIONS
:
"
--enable=all
--error-exitcode=1"
COMPILE
:
"
./gitlab-ci/compile.sh"
This diff is collapsed.
Click to expand it.
gitlab-ci/
compile
.sh
→
gitlab-ci/
install-dependencies
.sh
+
10
−
0
View file @
d1115ed0
#!/bin/bash
#!/bin/bash
echo
"Install dependencies for functional test"
pwd
source
./gitlab-ci/shared.sh
source
./gitlab-ci/shared.sh
install_bbfd
# install bbfdm
install_bbfdm
exec_cmd_verbose make
-C
./src
This diff is collapsed.
Click to expand it.
gitlab-ci/shared.sh
+
2
−
12
View file @
d1115ed0
...
@@ -11,18 +11,9 @@ function exec_cmd()
...
@@ -11,18 +11,9 @@ function exec_cmd()
fi
fi
}
}
function
exec_cmd_verbose
()
function
install_bbfdm
()
{
{
echo
"executing
$@
"
[
-d
"/opt/dev/bbfdm"
]
&&
return
0
if
!
$@
;
then
echo
"Failed to execute
$@
"
exit
1
fi
}
function
install_bbfd
()
{
[
-d
"/opt/dev/bbfdm"
]
&&
rm
-rf
/opt/dev/bbfdm
if
[
-n
"
${
BBFDM_BRANCH
}
"
]
;
then
if
[
-n
"
${
BBFDM_BRANCH
}
"
]
;
then
exec_cmd git clone
-b
${
BBFDM_BRANCH
}
https://dev.iopsys.eu/bbf/bbfdm.git /opt/dev/bbfdm
exec_cmd git clone
-b
${
BBFDM_BRANCH
}
https://dev.iopsys.eu/bbf/bbfdm.git /opt/dev/bbfdm
...
@@ -33,5 +24,4 @@ function install_bbfd()
...
@@ -33,5 +24,4 @@ function install_bbfd()
cd
/opt/dev/bbfdm
cd
/opt/dev/bbfdm
./gitlab-ci/install-dependencies.sh
install
./gitlab-ci/install-dependencies.sh
install
./gitlab-ci/setup.sh
install
./gitlab-ci/setup.sh
install
cd
-
}
}
This diff is collapsed.
Click to expand it.
src/packetcapture.c
+
6
−
5
View file @
d1115ed0
...
@@ -33,10 +33,11 @@ static int browsePacketCaptureResultInst(struct dmctx *dmctx, DMNODE *parent_nod
...
@@ -33,10 +33,11 @@ static int browsePacketCaptureResultInst(struct dmctx *dmctx, DMNODE *parent_nod
static
void
stop_packetcapture_diagnostics
(
void
)
static
void
stop_packetcapture_diagnostics
(
void
)
{
{
char
cmd
[
256
]
=
{
0
};
char
output
[
256
]
=
{
0
},
cmd
[
256
]
=
{
0
};
snprintf
(
cmd
,
sizeof
(
cmd
),
"sh %s '{
\"
proto
\"
:
\"
both_proto
\"
,
\"
cancel
\"
:
\"
1
\"
}'"
,
PACKET_CAPTURE_DIAGNOSTIC_PATH
);
snprintf
(
cmd
,
sizeof
(
cmd
),
"sh %s '{
\"
proto
\"
:
\"
both_proto
\"
,
\"
cancel
\"
:
\"
1
\"
}'"
,
PACKET_CAPTURE_DIAGNOSTIC_PATH
);
system
(
cmd
);
run_cmd
(
cmd
,
output
,
sizeof
(
output
));
}
}
/*************************************************************
/*************************************************************
...
@@ -90,14 +91,14 @@ int operate_Device_packetCapture(char *refparam, struct dmctx *ctx, void *data,
...
@@ -90,14 +91,14 @@ int operate_Device_packetCapture(char *refparam, struct dmctx *ctx, void *data,
if
(
format
[
0
]
!=
'\0'
&&
bbfdm_validate_string
(
ctx
,
format
,
-
1
,
-
1
,
allowed_format
,
NULL
))
if
(
format
[
0
]
!=
'\0'
&&
bbfdm_validate_string
(
ctx
,
format
,
-
1
,
-
1
,
allowed_format
,
NULL
))
return
USP_FAULT_INVALID_ARGUMENT
;
return
USP_FAULT_INVALID_ARGUMENT
;
char
*
duration
=
dmjson_get_value
((
json_object
*
)
value
,
1
,
"Duration"
);
const
char
*
duration
=
dmjson_get_value
((
json_object
*
)
value
,
1
,
"Duration"
);
if
(
duration
[
0
]
!=
'\0'
)
{
if
(
duration
[
0
]
!=
'\0'
)
{
if
(
bbfdm_validate_unsignedInt
(
ctx
,
duration
,
RANGE_ARGS
{{
"1"
,
NULL
}},
1
))
if
(
bbfdm_validate_unsignedInt
(
ctx
,
duration
,
RANGE_ARGS
{{
"1"
,
NULL
}},
1
))
return
USP_FAULT_INVALID_ARGUMENT
;
return
USP_FAULT_INVALID_ARGUMENT
;
}
else
}
else
duration
=
"1"
;
duration
=
"1"
;
char
*
pack_count
=
dmjson_get_value
((
json_object
*
)
value
,
1
,
"PacketCount"
);
const
char
*
pack_count
=
dmjson_get_value
((
json_object
*
)
value
,
1
,
"PacketCount"
);
if
(
pack_count
[
0
]
!=
'\0'
)
{
if
(
pack_count
[
0
]
!=
'\0'
)
{
if
(
bbfdm_validate_unsignedInt
(
ctx
,
pack_count
,
RANGE_ARGS
{{
0
,
NULL
}},
1
))
if
(
bbfdm_validate_unsignedInt
(
ctx
,
pack_count
,
RANGE_ARGS
{{
0
,
NULL
}},
1
))
return
USP_FAULT_INVALID_ARGUMENT
;
return
USP_FAULT_INVALID_ARGUMENT
;
...
@@ -354,7 +355,7 @@ static int set_PacketCapture_Username(char *refparam, struct dmctx *ctx, void *d
...
@@ -354,7 +355,7 @@ static int set_PacketCapture_Username(char *refparam, struct dmctx *ctx, void *d
static
int
get_PacketCapture_Password
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
static
int
get_PacketCapture_Password
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
{
*
value
=
""
;
*
value
=
dmstrdup
(
""
)
;
return
0
;
return
0
;
}
}
...
...
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