Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
openairinterface5G
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Merge Requests
27
Merge Requests
27
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
oai
openairinterface5G
Commits
7a6709a2
Commit
7a6709a2
authored
Mar 24, 2017
by
Cedric Roux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
warning removal/bug fixes/adding logs in rb_tool.c
parent
676ca5c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
openair2/NETWORK_DRIVER/MESH/RB_TOOL/rb_tool.c
openair2/NETWORK_DRIVER/MESH/RB_TOOL/rb_tool.c
+21
-14
No files found.
openair2/NETWORK_DRIVER/MESH/RB_TOOL/rb_tool.c
View file @
7a6709a2
...
...
@@ -36,7 +36,8 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <netinet/in.h>
#include <arpa/inet.h>
...
...
@@ -109,7 +110,7 @@ void IAL_NAS_ioctl_init(int inst)
{
struct
nas_msg_statistic_reply
*
msgrep
;
int
err
,
rc
;
int
err
;
sprintf
(
gifr
.
name
,
"oai%d"
,
inst
);
...
...
@@ -132,7 +133,6 @@ void IAL_NAS_ioctl_init(int inst)
if
(
err
<
0
)
{
printf
(
"IOCTL error, err=%d
\n
"
,
err
);
rc
=
-
1
;
}
printf
(
"tx_packets = %u, rx_packets = %u
\n
"
,
msgrep
->
tx_packets
,
msgrep
->
rx_packets
);
...
...
@@ -151,16 +151,10 @@ void IAL_NAS_ioctl_init(int inst)
int
main
(
int
argc
,
char
**
argv
)
//---------------------------------------------------------------------------
{
int
done
=
0
,
rc
=
0
,
meas_polling_counter
=
0
;
fd_set
readfds
;
struct
timeval
tv
;
int
i
=
0
;
int
err
=
0
;
char
*
buffer
;
int
c
=
0
;
int
action
=
0
,
rbset
=
0
,
cxset
=
0
,
instset
=
0
,
saddr_ipv4set
=
0
,
saddr_ipv6set
=
0
,
daddr_ipv4set
=
0
,
daddr_ipv6set
=
0
,
dscpset
=
0
,
mpls_outlabelset
=
0
,
mpls_inlabelset
=
0
;
char
rb
[
100
],
cx
[
100
],
dscp
[
100
],
inst
[
100
],
mpls_outgoinglabel
[
100
],
mpls_incominglabel
[
100
];
int
index
=
0
;
struct
nas_msg_rb_establishment_request
*
msgreq
=
NULL
;
struct
nas_msg_class_add_request
*
msgreq_class
=
NULL
;
in_addr_t
saddr_ipv4
,
daddr_ipv4
;
...
...
@@ -213,15 +207,21 @@ int main(int argc,char **argv)
mpls_inlabelset
=
1
;
break
;
case
's'
:
inet_aton
(
optarg
,
&
saddr_ipv4
);
case
's'
:
{
struct
in_addr
a
;
inet_aton
(
optarg
,
&
a
);
saddr_ipv4
=
a
.
s_addr
;
saddr_ipv4set
=
1
;
break
;
}
case
't'
:
inet_aton
(
optarg
,
&
daddr_ipv4
);
case
't'
:
{
struct
in_addr
a
;
inet_aton
(
optarg
,
&
a
);
daddr_ipv4
=
a
.
s_addr
;
daddr_ipv4set
=
1
;
break
;
}
case
'x'
:
printf
(
"IPv6: %s
\n
"
,
optarg
);
...
...
@@ -303,7 +303,7 @@ int main(int argc,char **argv)
if
(
action
==
ADD_RB
)
{
gifr
.
type
=
NAS_MSG_RB_ESTABLISHMENT_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
if
(
saddr_ipv4set
==
1
)
{
...
...
@@ -329,6 +329,7 @@ int main(int argc,char **argv)
gifr
.
type
=
NAS_MSG_CLASS_ADD_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
msgreq_class
->
rab_id
=
atoi
(
rb
);
msgreq_class
->
lcr
=
atoi
(
cx
);
...
...
@@ -340,6 +341,7 @@ int main(int argc,char **argv)
msgreq_class
->
saddr
.
ipv4
=
daddr_ipv4
;
gifr
.
type
=
NAS_MSG_CLASS_ADD_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
}
if
(
saddr_ipv6set
==
1
)
{
...
...
@@ -370,6 +372,7 @@ int main(int argc,char **argv)
gifr
.
type
=
NAS_MSG_CLASS_ADD_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
msgreq_class
->
rab_id
=
atoi
(
rb
);
msgreq_class
->
lcr
=
atoi
(
cx
);
...
...
@@ -380,6 +383,7 @@ int main(int argc,char **argv)
memcpy
(
&
msgreq_class
->
saddr
.
ipv6
,
&
daddr_ipv6
,
16
);
gifr
.
type
=
NAS_MSG_CLASS_ADD_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
}
...
...
@@ -411,6 +415,7 @@ int main(int argc,char **argv)
gifr
.
type
=
NAS_MSG_CLASS_ADD_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
msgreq_class
->
rab_id
=
atoi
(
rb
);
msgreq_class
->
lcr
=
atoi
(
cx
);
...
...
@@ -430,12 +435,14 @@ int main(int argc,char **argv)
gifr
.
type
=
NAS_MSG_CLASS_ADD_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
}
}
else
if
(
action
==
DEL_RB
)
{
gifr
.
type
=
NAS_MSG_RB_RELEASE_REQUEST
;
err
=
ioctl
(
fd
,
NAS_IOCTL_RRM
,
&
gifr
);
if
(
err
==
-
1
)
perror
(
"ioctl"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment