Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openairinterface5G
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
openairinterface5G
Commits
4f618d61
Commit
4f618d61
authored
9 years ago
by
Xenofon Foukas
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some bugs that would lead to segfaults and modified to support changes in protocol
parent
d5830ced
No related branches found
No related tags found
1 merge request
!47
Feature 68 enb agent
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openair2/ENB_APP/enb_agent_common.c
+3
-1
3 additions, 1 deletion
openair2/ENB_APP/enb_agent_common.c
openair2/ENB_APP/enb_agent_handler.c
+17
-13
17 additions, 13 deletions
openair2/ENB_APP/enb_agent_handler.c
with
20 additions
and
14 deletions
openair2/ENB_APP/enb_agent_common.c
+
3
−
1
View file @
4f618d61
...
...
@@ -64,7 +64,7 @@ int enb_agent_deserialize_message(void *data, int size, Protocol__ProgranMessage
*
msg
=
protocol__progran_message__unpack
(
NULL
,
size
,
data
);
if
(
*
msg
==
NULL
)
goto
error
;
return
0
;
error:
...
...
@@ -118,6 +118,7 @@ int enb_agent_hello(uint32_t xid, Protocol__ProgranMessage **msg) {
protocol__progran_message__init
(
*
msg
);
(
*
msg
)
->
msg_case
=
PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG
;
(
*
msg
)
->
msg_dir
=
PROTOCOL__PROGRAN_DIRECTION__INITIATING_MESSAGE
;
(
*
msg
)
->
has_msg_dir
=
1
;
(
*
msg
)
->
hello_msg
=
hello_msg
;
return
0
;
...
...
@@ -216,6 +217,7 @@ int enb_agent_echo_reply(uint32_t xid, Protocol__ProgranMessage **msg) {
protocol__progran_message__init
(
*
msg
);
(
*
msg
)
->
msg_case
=
PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REPLY_MSG
;
(
*
msg
)
->
msg_dir
=
PROTOCOL__PROGRAN_DIRECTION__SUCCESSFUL_OUTCOME
;
(
*
msg
)
->
has_msg_dir
=
1
;
(
*
msg
)
->
echo_reply_msg
=
echo_reply_msg
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
openair2/ENB_APP/enb_agent_handler.c
+
17
−
13
View file @
4f618d61
...
...
@@ -42,10 +42,11 @@
#include
"assertions.h"
enb_agent_message_decoded_callback
messages_callback
[][
3
]
=
{
{
enb_agent_hello
,
enb_agent_hello
,
0
},
/*PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG*/
{
enb_agent_echo_request
,
enb_agent_echo_reply
,
0
},
/**/
{
0
,
enb_agent_mac_reply
,
0
},
/*stats*/
{
0
,
0
,
0
},
{
enb_agent_hello
,
0
,
0
},
/*PROTOCOL__PROGRAN_MESSAGE__MSG_HELLO_MSG*/
{
enb_agent_echo_reply
,
0
,
0
},
/*PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REQUEST_MSG*/
{
0
,
0
,
0
},
/*PROTOCOL__PROGRAN_MESSAGE__MSG_ECHO_REPLY_MSG*/
//Must add handler when receiving echo reply
{
enb_agent_mac_reply
,
0
,
0
},
/*PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REQUEST_MSG*/
{
0
,
0
,
0
},
/*PROTOCOL__PROGRAN_MESSAGE__MSG_STATS_REPLY_MSG*/
};
...
...
@@ -61,33 +62,35 @@ Protocol__ProgranMessage* enb_agent_handle_message (uint32_t xid,
uint8_t
*
data
,
uint32_t
size
){
Protocol__ProgranMessage
*
message
;
Protocol__ProgranMessage
*
decoded_message
,
*
reply_
message
;
err_code_t
err_code
;
DevAssert
(
data
!=
NULL
);
if
(
enb_agent_deserialize_message
(
data
,
size
,
&
message
)
<
0
)
{
if
(
enb_agent_deserialize_message
(
data
,
size
,
&
decoded_
message
)
<
0
)
{
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_DECODING
;
goto
error
;
}
if
((
message
->
msg_case
>
sizeof
(
messages_callback
)
/
(
3
*
sizeof
(
enb_agent_message_decoded_callback
)))
||
(
message
->
msg_dir
>
PROTOCOL__PROGRAN_DIRECTION__UNSUCCESSFUL_OUTCOME
)){
if
((
decoded_
message
->
msg_case
>
sizeof
(
messages_callback
)
/
(
3
*
sizeof
(
enb_agent_message_decoded_callback
)))
||
(
decoded_
message
->
msg_dir
>
PROTOCOL__PROGRAN_DIRECTION__UNSUCCESSFUL_OUTCOME
)){
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_NOT_HANDLED
;
goto
error
;
}
if
(
messages_callback
[
message
->
msg_case
][
message
->
msg_dir
]
==
NULL
)
{
if
(
messages_callback
[
decoded_
message
->
msg_case
-
1
][
decoded_
message
->
msg_dir
-
1
]
==
NULL
)
{
err_code
=
PROTOCOL__PROGRAN_ERR__MSG_NOT_SUPPORTED
;
goto
error
;
}
err_code
=
((
*
messages_callback
[
message
->
msg_case
-
1
][
message
->
msg_dir
-
1
])(
xid
,
&
message
));
err_code
=
((
*
messages_callback
[
decoded_
message
->
msg_case
-
1
][
decoded_
message
->
msg_dir
-
1
])(
xid
,
&
reply_
message
));
if
(
err_code
<
0
){
goto
error
;
}
return
message
;
protocol__progran_message__free_unpacked
(
decoded_message
,
NULL
);
return
reply_message
;
error:
LOG_E
(
ENB_APP
,
"errno %d occured
\n
"
,
err_code
);
...
...
@@ -110,11 +113,12 @@ void * enb_agent_send_message(uint32_t xid,
}
// free the msg --> later keep this in the data struct and just update the values
enb_agent_mac_destroy_stats_reply
(
msg
);
//TODO call proper destroy function
// enb_agent_mac_destroy_stats_reply(msg);
DevAssert
(
buffer
!=
NULL
);
LOG_D
(
ENB_APP
,
"Serilized the enb mac stats reply (size %d)
\n
"
,
size
);
LOG_D
(
ENB_APP
,
"Serilized the enb mac stats reply (size %d)
\n
"
,
*
size
);
return
buffer
;
...
...
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