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>
This commit is contained in:
parent
f5f41e8051
commit
afee0b7929
|
@ -248,12 +248,14 @@ int check_oml_msg(struct msgb *msg)
|
||||||
sizeof(ipaccess_magic));
|
sizeof(ipaccess_magic));
|
||||||
|
|
||||||
if (strncmp(ipaccess_magic, label_id,
|
if (strncmp(ipaccess_magic, label_id,
|
||||||
sizeof(ipaccess_magic)) == 0)
|
sizeof(ipaccess_magic)) == 0) {
|
||||||
msg->l3h = msg->l3h + sizeof(ipaccess_magic) + 1;
|
msg->l3h = msg->l3h + sizeof(ipaccess_magic) + 1;
|
||||||
else if (strncmp(osmocom_magic, label_id,
|
return OML_MSG_TYPE_IPA;
|
||||||
sizeof(osmocom_magic)) == 0)
|
} else if (strncmp(osmocom_magic, label_id,
|
||||||
|
sizeof(osmocom_magic)) == 0) {
|
||||||
msg->l3h = msg->l3h + sizeof(osmocom_magic) + 1;
|
msg->l3h = msg->l3h + sizeof(osmocom_magic) + 1;
|
||||||
else {
|
return OML_MSG_TYPE_OSMO;
|
||||||
|
} else {
|
||||||
msg->l3h = NULL;
|
msg->l3h = NULL;
|
||||||
LOGP(DL1C, LOGL_ERROR,
|
LOGP(DL1C, LOGL_ERROR,
|
||||||
"Manuf Label Unknown %s\n", label_id);
|
"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)
|
int check_ipa_header(struct msgb *msg)
|
||||||
|
|
|
@ -21,6 +21,12 @@ enum manuf_type_id {
|
||||||
OSMOCOM_MANUF_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 osmocom_magic[] = "org.osmocom";
|
||||||
static const char ipaccess_magic[] = "com.ipaccess";
|
static const char ipaccess_magic[] = "com.ipaccess";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue