summaryrefslogtreecommitdiffstats
path: root/include/osmocom/sigtran
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-04-03 16:37:38 +0200
committerHarald Welte <laforge@gnumonks.org>2017-04-10 10:41:16 +0200
commit6023bcae16b1dfb21f0b515de4aba8669e006b0f (patch)
tree3c56f765b33ce850bdc03acf21f2a55ca7ec25a7 /include/osmocom/sigtran
parent58768015ed653b1824da87008b8bece017d46135 (diff)
xua_msg: Add concept of xua_msg_class and xua_msg_dialect
A xua_msg_class repreents one xUA message class (like M3UA XFER or SUA CL). A dialect is then something like SUA or M3UA, each consisting of as many as 256 message classes. Each class contains value_strings of the individual messages, as well as constraint information on mandatory IEs for each message. Change-Id: Ib538aca295b7b50132bc814b2d7b56cbe5d65bfc
Diffstat (limited to 'include/osmocom/sigtran')
-rw-r--r--include/osmocom/sigtran/xua_msg.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/osmocom/sigtran/xua_msg.h b/include/osmocom/sigtran/xua_msg.h
index 23f92c5..6e98409 100644
--- a/include/osmocom/sigtran/xua_msg.h
+++ b/include/osmocom/sigtran/xua_msg.h
@@ -42,6 +42,23 @@ struct xua_msg_part {
/* TODO: keep small data in the struct for perf reasons */
};
+struct xua_msg_class {
+ const char *name;
+ const struct value_string *msgt_names;
+ const struct value_string *iei_names;
+ const uint16_t *mand_ies[256];
+};
+
+struct xua_dialect {
+ const char *name;
+ uint16_t port;
+ uint16_t ppid;
+ int log_subsys;
+ const struct xua_msg_class *class[256];
+};
+
+extern const struct xua_dialect xua_dialect_sua;
+extern const struct xua_dialect xua_dialect_m3ua;
extern int DXUA;
@@ -66,3 +83,10 @@ int xua_msg_add_u32(struct xua_msg *xua, uint16_t iei, uint32_t val);
uint32_t xua_msg_part_get_u32(struct xua_msg_part *part);
uint32_t xua_msg_get_u32(struct xua_msg *xua, uint16_t iei);
int xua_msg_add_sccp_addr(struct xua_msg *xua, uint16_t iei, const struct osmo_sccp_addr *addr);
+
+const char *xua_class_msg_name(const struct xua_msg_class *xmc, uint16_t msg_type);
+const char *xua_class_iei_name(const struct xua_msg_class *xmc, uint16_t iei);
+char *xua_hdr_dump(struct xua_msg *xua, const struct xua_dialect *dialect);
+char *xua_msg_dump(struct xua_msg *xua, const struct xua_dialect *dialect);
+int xua_dialect_check_all_mand_ies(const struct xua_dialect *dialect, struct xua_msg *xua);
+