aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/oml.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-05-25 16:21:35 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-07-31 16:58:26 +0200
commit0655cac6f1fbb0a669f064780a171a363ce8ef83 (patch)
tree17bda895ab0b476e73d74e9fdb6deb21dd38689b /src/common/oml.c
parentb05d72d21b8cc91126cf45525f9010df6142e1c2 (diff)
sysmobts: Verify the structure of IPA and OML messages
Extend the router to verify that the message received is properly encoded. The code can deal with the basic structure of ETSI OML and vendor specific messages for ip.access and the osmocom project.
Diffstat (limited to 'src/common/oml.c')
-rw-r--r--src/common/oml.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/common/oml.c b/src/common/oml.c
index b7c12f7c..2d690d63 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -92,7 +92,9 @@ static struct tlv_definition abis_nm_att_tlvdef_ipa = {
};
/* ip.access nanoBTS specific commands */
-static const char ipaccess_magic[] = "com.ipaccess";
+const char oml_ipa_magic[] = "com.ipaccess";
+const char oml_osmo_magic[] = "org.osmocom";
+
static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg);
/*
@@ -165,9 +167,9 @@ int oml_send_msg(struct msgb *msg, int is_manuf)
if (is_manuf) {
/* length byte, string + 0 termination */
- uint8_t *manuf = msgb_push(msg, 1 + sizeof(ipaccess_magic));
- manuf[0] = strlen(ipaccess_magic)+1;
- memcpy(manuf+1, ipaccess_magic, strlen(ipaccess_magic));
+ uint8_t *manuf = msgb_push(msg, 1 + sizeof(oml_ipa_magic));
+ manuf[0] = strlen(oml_ipa_magic)+1;
+ memcpy(manuf+1, oml_ipa_magic, strlen(oml_ipa_magic));
}
/* Push the main OML header and send it off */
@@ -1048,7 +1050,7 @@ static int down_mom(struct gsm_bts *bts, struct msgb *msg)
return -EIO;
}
- if (strncmp((char *)&oh->data[1], ipaccess_magic, idstrlen)) {
+ if (strncmp((char *)&oh->data[1], oml_ipa_magic, idstrlen)) {
LOGP(DOML, LOGL_ERROR, "Manufacturer OML message != ipaccess not supported\n");
return -EINVAL;
}