Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Black
OpenXG-RAN
Commits
a94c742c
Commit
a94c742c
authored
Jul 01, 2014
by
Lionel Gauthier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git-svn-id:
http://svn.eurecom.fr/openair4G/trunk@5457
818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent
e401e9f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
19 deletions
+24
-19
openair1/SIMULATION/ETH_TRANSPORT/pgm_link.c
openair1/SIMULATION/ETH_TRANSPORT/pgm_link.c
+24
-19
No files found.
openair1/SIMULATION/ETH_TRANSPORT/pgm_link.c
View file @
a94c742c
...
...
@@ -47,7 +47,7 @@ log_handler (
}
#endif
int
pgm_oai_init
(
char
*
if_
name
)
int
pgm_oai_init
(
char
*
if_
addr
)
{
pgm_error_t
*
pgm_err
=
NULL
;
...
...
@@ -68,19 +68,19 @@ int pgm_oai_init(char *if_name)
exit
(
EXIT_FAILURE
);
}
return
pgm_create_socket
(
oai_emulation
.
info
.
multicast_group
,
if_
name
);
return
pgm_create_socket
(
oai_emulation
.
info
.
multicast_group
,
if_
addr
);
}
int
pgm_recv_msg
(
int
group
,
uint8_t
*
buffer
,
uint32_t
length
,
unsigned
int
frame
,
unsigned
int
next_slot
)
{
size_t
num_bytes
=
0
;
int
status
=
0
;
pgm_error_t
*
pgm_err
=
NULL
;
size_t
num_bytes
=
0
;
int
status
=
0
;
pgm_error_t
*
pgm_err
=
NULL
;
struct
pgm_sockaddr_t
from
;
socklen_t
fromlen
=
sizeof
(
from
);
uint32_t
timeout
=
0
;
int
flags
=
0
;
socklen_t
fromlen
=
sizeof
(
from
);
uint32_t
timeout
=
0
;
int
flags
=
0
;
if
(
pgm_would_block
==
0
)
{
flags
=
MSG_DONTWAIT
;
...
...
@@ -89,8 +89,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
DevCheck
((
group
<=
MULTICAST_LINK_NUM_GROUPS
)
&&
(
group
>=
0
),
group
,
MULTICAST_LINK_NUM_GROUPS
,
0
);
#ifdef DEBUG_EMU
LOG_I
(
EMU
,
"[PGM] Entering recv function for group %d
\n
"
,
group
);
#endif
do
{
status
=
pgm_recvfrom
(
pgm_multicast_group
[
group
].
sock
,
buffer
,
...
...
@@ -102,7 +103,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
&
pgm_err
);
if
(
PGM_IO_STATUS_NORMAL
==
status
)
{
#ifdef DEBUG_EMU
LOG_D
(
EMU
,
"[PGM] Received %d bytes for group %d
\n
"
,
num_bytes
,
group
);
#endif
return
num_bytes
;
}
else
if
(
PGM_IO_STATUS_TIMER_PENDING
==
status
)
{
if
(
pgm_would_block
==
0
)
{
...
...
@@ -123,7 +126,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
}
else
if
(
PGM_IO_STATUS_RESET
==
status
)
{
LOG_W
(
EMU
,
"[PGM] Got session reset
\n
"
);
}
else
{
#ifdef DEBUG_EMU
LOG_D
(
EMU
,
"[PGM] Got status %d
\n
"
,
status
);
#endif
if
(
pgm_err
)
{
LOG_E
(
EMU
,
"[PGM] recvform failed: %s"
,
pgm_err
->
message
);
pgm_error_free
(
pgm_err
);
...
...
@@ -153,17 +158,17 @@ static
int
pgm_create_socket
(
int
index
,
const
char
*
if_addr
)
{
struct
pgm_addrinfo_t
*
res
=
NULL
;
pgm_error_t
*
pgm_err
=
NULL
;
sa_family_t
sa_family
=
AF_INET
;
int
udp_encap_port
=
46014
+
index
;
int
max_tpdu
=
1500
;
int
sqns
=
100
;
int
port
;
pgm_error_t
*
pgm_err
=
NULL
;
sa_family_t
sa_family
=
AF_INET
;
int
udp_encap_port
=
46014
+
index
;
int
max_tpdu
=
1500
;
int
sqns
=
100
;
int
port
=
0
;
struct
pgm_sockaddr_t
addr
;
int
blocking
=
1
;
int
multicast_loop
=
0
;
int
multicast_hops
=
0
;
int
dscp
,
i
;
int
blocking
=
1
;
int
multicast_loop
=
0
;
int
multicast_hops
=
0
;
int
dscp
,
i
;
port
=
udp_encap_port
;
...
...
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