2017-02-15 11:16:50 +00:00
|
|
|
#ifndef _S1AP_MESSAGE_H__
|
|
|
|
#define _S1AP_MESSAGE_H__
|
2017-02-04 16:13:43 +00:00
|
|
|
|
2017-02-04 16:28:53 +00:00
|
|
|
#include "core_pkbuf.h"
|
2017-02-04 16:13:43 +00:00
|
|
|
#include "s1ap_ies_defs.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
2017-09-13 02:57:17 +00:00
|
|
|
/* Octets */
|
|
|
|
#define S1AP_CLEAR_DATA(__dATA) \
|
|
|
|
do { \
|
|
|
|
d_assert((__dATA), , "Null param"); \
|
|
|
|
if ((__dATA)->buf) \
|
|
|
|
{ \
|
|
|
|
core_free((__dATA)->buf); \
|
|
|
|
(__dATA)->buf = NULL; \
|
|
|
|
(__dATA)->size = 0; \
|
|
|
|
} \
|
|
|
|
} while(0)
|
|
|
|
#define S1AP_STORE_DATA(__dST, __sRC) \
|
|
|
|
do { \
|
|
|
|
d_assert((__sRC),, "Null param") \
|
|
|
|
d_assert((__sRC)->buf,, "Null param") \
|
|
|
|
d_assert((__dST),, "Null param") \
|
|
|
|
S1AP_CLEAR_DATA(__dST); \
|
|
|
|
(__dST)->size = (__sRC)->size; \
|
|
|
|
(__dST)->buf = core_calloc(1, sizeof((__dST)->size)); \
|
|
|
|
memcpy((__dST)->buf, (__sRC)->buf, (__dST)->size); \
|
|
|
|
} while(0)
|
|
|
|
|
2017-03-06 00:07:59 +00:00
|
|
|
CORE_DECLARE(int) s1ap_decode_pdu(s1ap_message_t *message, pkbuf_t *pkbuf);
|
|
|
|
CORE_DECLARE(int) s1ap_encode_pdu(pkbuf_t **pkbuf, s1ap_message_t *message);
|
|
|
|
CORE_DECLARE(int) s1ap_free_pdu(s1ap_message_t *message);
|
2017-02-04 16:13:43 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|