aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-23 12:19:00 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-03-23 12:28:06 +0100
commit7046633c02d15939d4953f1860f38be28f42667e (patch)
treed3af5fcf1c4d886f654d27cc747e8ce4decb1ae2 /include
parent4d244d3c31486f4e353dc997c92fa46129d82406 (diff)
xua: Generalize the m2ua_msg and call it xua_msg
Generalize, this requires various API modifications but that is the most sane path forward.
Diffstat (limited to 'include')
-rw-r--r--include/sigtran/Makefile.am2
-rw-r--r--include/sigtran/m2ua_types.h17
-rw-r--r--include/sigtran/xua_msg.h (renamed from include/sigtran/m2ua_msg.h)29
-rw-r--r--include/sigtran/xua_types.h17
4 files changed, 30 insertions, 35 deletions
diff --git a/include/sigtran/Makefile.am b/include/sigtran/Makefile.am
index 053530a..aa0f95c 100644
--- a/include/sigtran/Makefile.am
+++ b/include/sigtran/Makefile.am
@@ -1,2 +1,2 @@
-sigtran_HEADERS = m3ua_types.h xua_types.h m2ua_types.h m2ua_msg.h
+sigtran_HEADERS = m3ua_types.h xua_types.h xua_msg.h m2ua_types.h
sigtrandir = $(includedir)/osmocom/sigtran
diff --git a/include/sigtran/m2ua_types.h b/include/sigtran/m2ua_types.h
index d6854e8..7184f54 100644
--- a/include/sigtran/m2ua_types.h
+++ b/include/sigtran/m2ua_types.h
@@ -89,16 +89,6 @@ enum {
M2UA_IIM_DEREG_RSP, /* Deregistration Response (DEREG RSP) */
};
-struct m2ua_common_hdr {
- uint8_t version;
- uint8_t spare;
- uint8_t msg_class;
- uint8_t msg_type;
- uint32_t msg_length;
- uint8_t data[0];
-} __attribute__((packed));
-
-
/**
* Tag Values for M2UA
*/
@@ -124,13 +114,6 @@ enum {
M2UA_TAG_DEREG_STATUS, /* De-Registration Status */
};
-struct m2ua_parameter_hdr {
- uint16_t tag;
- uint16_t len;
- uint8_t data[0];
-} __attribute__((packed));
-
-
/**
* 3.3.1.5 State Request
*/
diff --git a/include/sigtran/m2ua_msg.h b/include/sigtran/xua_msg.h
index e878edd..9cc8632 100644
--- a/include/sigtran/m2ua_msg.h
+++ b/include/sigtran/xua_msg.h
@@ -15,24 +15,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+#pragma once
-
-#ifndef m2ua_msg_h
-#define m2ua_msg_h
-
-#include "m2ua_types.h"
+#include "xua_types.h"
#include <osmocom/core/linuxlist.h>
struct msgb;
-struct m2ua_msg {
- struct m2ua_common_hdr hdr;
+struct xua_msg {
+ struct xua_common_hdr hdr;
struct llist_head headers;
};
-struct m2ua_msg_part {
+struct xua_msg_part {
struct llist_head entry;
uint16_t tag;
@@ -43,16 +40,14 @@ struct m2ua_msg_part {
};
-struct m2ua_msg *m2ua_msg_alloc(void);
-void m2ua_msg_free(struct m2ua_msg *msg);
-
-int m2ua_msg_add_data(struct m2ua_msg *msg, uint16_t tag, uint16_t len, uint8_t *dat);
+struct xua_msg *xua_msg_alloc(void);
+void xua_msg_free(struct xua_msg *msg);
-struct m2ua_msg_part *m2ua_msg_find_tag(struct m2ua_msg *msg, uint16_t tag);
+int xua_msg_add_data(struct xua_msg *msg, uint16_t tag, uint16_t len, uint8_t *dat);
-struct m2ua_msg *m2ua_from_msg(uint16_t len, uint8_t *data);
-struct msgb *m2ua_to_msg(struct m2ua_msg *msg);
+struct xua_msg_part *xua_msg_find_tag(struct xua_msg *msg, uint16_t tag);
-void m2ua_set_log_area(int log_area);
+struct xua_msg *xua_from_msg(const int version, uint16_t len, uint8_t *data);
+struct msgb *xua_to_msg(const int version, struct xua_msg *msg);
-#endif
+void xua_set_log_area(int log_area);
diff --git a/include/sigtran/xua_types.h b/include/sigtran/xua_types.h
index 7a74d91..6568283 100644
--- a/include/sigtran/xua_types.h
+++ b/include/sigtran/xua_types.h
@@ -1,5 +1,7 @@
#pragma once
+#include <stdint.h>
+
/**
* Common tag values used by all user adaption layers
*/
@@ -26,3 +28,18 @@ enum {
MUA_TAG_CORREL_ID, /* Correlation Id */
};
+struct xua_common_hdr {
+ uint8_t version;
+ uint8_t spare;
+ uint8_t msg_class;
+ uint8_t msg_type;
+ uint32_t msg_length;
+ uint8_t data[0];
+} __attribute__((packed));
+
+
+struct xua_parameter_hdr {
+ uint16_t tag;
+ uint16_t len;
+ uint8_t data[0];
+} __attribute__((packed));