diff options
author | Álvaro Neira Ayuso <anayuso@sysmocom.de> | 2014-05-20 07:42:24 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2014-05-20 09:45:36 +0200 |
commit | afee0b7929a00500f9c204f3bc7e12f72451e832 (patch) | |
tree | fcdbc562a6312d0dbf5e98d7332e9f6a88be6f5b | |
parent | f5f41e805195c8c3294a9e6a68b10f975fbabbbd (diff) |
utils: Classify the OML message using the return type
Classify the OML message and return the manufacturer type
or an error. Currently ETSI, ip.access and Osmocom are known.
Signed-off-by: Alvaro Neira Ayuso <anayuso@sysmocom.de>
-rw-r--r-- | src/osmo-bts-sysmo/utils.c | 12 | ||||
-rw-r--r-- | src/osmo-bts-sysmo/utils.h | 6 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/osmo-bts-sysmo/utils.c b/src/osmo-bts-sysmo/utils.c index b50b5cdb..4b29afec 100644 --- a/src/osmo-bts-sysmo/utils.c +++ b/src/osmo-bts-sysmo/utils.c @@ -248,12 +248,14 @@ int check_oml_msg(struct msgb *msg) sizeof(ipaccess_magic)); if (strncmp(ipaccess_magic, label_id, - sizeof(ipaccess_magic)) == 0) + sizeof(ipaccess_magic)) == 0) { msg->l3h = msg->l3h + sizeof(ipaccess_magic) + 1; - else if (strncmp(osmocom_magic, label_id, - sizeof(osmocom_magic)) == 0) + return OML_MSG_TYPE_IPA; + } else if (strncmp(osmocom_magic, label_id, + sizeof(osmocom_magic)) == 0) { msg->l3h = msg->l3h + sizeof(osmocom_magic) + 1; - else { + return OML_MSG_TYPE_OSMO; + } else { msg->l3h = NULL; LOGP(DL1C, LOGL_ERROR, "Manuf Label Unknown %s\n", label_id); @@ -261,7 +263,7 @@ int check_oml_msg(struct msgb *msg) } } - return 0; + return OML_MSG_TYPE_ETSI; } int check_ipa_header(struct msgb *msg) diff --git a/src/osmo-bts-sysmo/utils.h b/src/osmo-bts-sysmo/utils.h index 4f2293aa..b0c624f7 100644 --- a/src/osmo-bts-sysmo/utils.h +++ b/src/osmo-bts-sysmo/utils.h @@ -21,6 +21,12 @@ enum manuf_type_id { OSMOCOM_MANUF_ID, }; +enum oml_message_type { + OML_MSG_TYPE_ETSI, + OML_MSG_TYPE_IPA, + OML_MSG_TYPE_OSMO, +}; + static const char osmocom_magic[] = "org.osmocom"; static const char ipaccess_magic[] = "com.ipaccess"; |