Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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 UE
Commits
c09e75ad
Commit
c09e75ad
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
51bb17ac
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 @
c09e75ad
...
@@ -47,7 +47,7 @@ log_handler (
...
@@ -47,7 +47,7 @@ log_handler (
}
}
#endif
#endif
int
pgm_oai_init
(
char
*
if_
name
)
int
pgm_oai_init
(
char
*
if_
addr
)
{
{
pgm_error_t
*
pgm_err
=
NULL
;
pgm_error_t
*
pgm_err
=
NULL
;
...
@@ -68,19 +68,19 @@ int pgm_oai_init(char *if_name)
...
@@ -68,19 +68,19 @@ int pgm_oai_init(char *if_name)
exit
(
EXIT_FAILURE
);
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
,
int
pgm_recv_msg
(
int
group
,
uint8_t
*
buffer
,
uint32_t
length
,
unsigned
int
frame
,
unsigned
int
next_slot
)
unsigned
int
frame
,
unsigned
int
next_slot
)
{
{
size_t
num_bytes
=
0
;
size_t
num_bytes
=
0
;
int
status
=
0
;
int
status
=
0
;
pgm_error_t
*
pgm_err
=
NULL
;
pgm_error_t
*
pgm_err
=
NULL
;
struct
pgm_sockaddr_t
from
;
struct
pgm_sockaddr_t
from
;
socklen_t
fromlen
=
sizeof
(
from
);
socklen_t
fromlen
=
sizeof
(
from
);
uint32_t
timeout
=
0
;
uint32_t
timeout
=
0
;
int
flags
=
0
;
int
flags
=
0
;
if
(
pgm_would_block
==
0
)
{
if
(
pgm_would_block
==
0
)
{
flags
=
MSG_DONTWAIT
;
flags
=
MSG_DONTWAIT
;
...
@@ -89,8 +89,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
...
@@ -89,8 +89,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
DevCheck
((
group
<=
MULTICAST_LINK_NUM_GROUPS
)
&&
(
group
>=
0
),
DevCheck
((
group
<=
MULTICAST_LINK_NUM_GROUPS
)
&&
(
group
>=
0
),
group
,
MULTICAST_LINK_NUM_GROUPS
,
0
);
group
,
MULTICAST_LINK_NUM_GROUPS
,
0
);
#ifdef DEBUG_EMU
LOG_I
(
EMU
,
"[PGM] Entering recv function for group %d
\n
"
,
group
);
LOG_I
(
EMU
,
"[PGM] Entering recv function for group %d
\n
"
,
group
);
#endif
do
{
do
{
status
=
pgm_recvfrom
(
pgm_multicast_group
[
group
].
sock
,
status
=
pgm_recvfrom
(
pgm_multicast_group
[
group
].
sock
,
buffer
,
buffer
,
...
@@ -102,7 +103,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
...
@@ -102,7 +103,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
&
pgm_err
);
&
pgm_err
);
if
(
PGM_IO_STATUS_NORMAL
==
status
)
{
if
(
PGM_IO_STATUS_NORMAL
==
status
)
{
#ifdef DEBUG_EMU
LOG_D
(
EMU
,
"[PGM] Received %d bytes for group %d
\n
"
,
num_bytes
,
group
);
LOG_D
(
EMU
,
"[PGM] Received %d bytes for group %d
\n
"
,
num_bytes
,
group
);
#endif
return
num_bytes
;
return
num_bytes
;
}
else
if
(
PGM_IO_STATUS_TIMER_PENDING
==
status
)
{
}
else
if
(
PGM_IO_STATUS_TIMER_PENDING
==
status
)
{
if
(
pgm_would_block
==
0
)
{
if
(
pgm_would_block
==
0
)
{
...
@@ -123,7 +126,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
...
@@ -123,7 +126,9 @@ int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
}
else
if
(
PGM_IO_STATUS_RESET
==
status
)
{
}
else
if
(
PGM_IO_STATUS_RESET
==
status
)
{
LOG_W
(
EMU
,
"[PGM] Got session reset
\n
"
);
LOG_W
(
EMU
,
"[PGM] Got session reset
\n
"
);
}
else
{
}
else
{
#ifdef DEBUG_EMU
LOG_D
(
EMU
,
"[PGM] Got status %d
\n
"
,
status
);
LOG_D
(
EMU
,
"[PGM] Got status %d
\n
"
,
status
);
#endif
if
(
pgm_err
)
{
if
(
pgm_err
)
{
LOG_E
(
EMU
,
"[PGM] recvform failed: %s"
,
pgm_err
->
message
);
LOG_E
(
EMU
,
"[PGM] recvform failed: %s"
,
pgm_err
->
message
);
pgm_error_free
(
pgm_err
);
pgm_error_free
(
pgm_err
);
...
@@ -153,17 +158,17 @@ static
...
@@ -153,17 +158,17 @@ static
int
pgm_create_socket
(
int
index
,
const
char
*
if_addr
)
int
pgm_create_socket
(
int
index
,
const
char
*
if_addr
)
{
{
struct
pgm_addrinfo_t
*
res
=
NULL
;
struct
pgm_addrinfo_t
*
res
=
NULL
;
pgm_error_t
*
pgm_err
=
NULL
;
pgm_error_t
*
pgm_err
=
NULL
;
sa_family_t
sa_family
=
AF_INET
;
sa_family_t
sa_family
=
AF_INET
;
int
udp_encap_port
=
46014
+
index
;
int
udp_encap_port
=
46014
+
index
;
int
max_tpdu
=
1500
;
int
max_tpdu
=
1500
;
int
sqns
=
100
;
int
sqns
=
100
;
int
port
;
int
port
=
0
;
struct
pgm_sockaddr_t
addr
;
struct
pgm_sockaddr_t
addr
;
int
blocking
=
1
;
int
blocking
=
1
;
int
multicast_loop
=
0
;
int
multicast_loop
=
0
;
int
multicast_hops
=
0
;
int
multicast_hops
=
0
;
int
dscp
,
i
;
int
dscp
,
i
;
port
=
udp_encap_port
;
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