@@ -93,6 +93,7 @@ static struct tlv_definition abis_nm_att_tlvdef_ipa = {
/* ip.access nanoBTS specific commands */
static const char ipaccess_magic[] = "com.ipaccess";
+static const char osmocom_magic[] = "org.osmocom";
static int oml_ipa_set_attr(struct gsm_bts *bts, struct msgb *msg);
/*
@@ -163,13 +164,6 @@ int oml_send_msg(struct msgb *msg, int is_manuf)
{
struct abis_om_hdr *omh;
- 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));
- }
-
/* Push the main OML header and send it off */
omh = (struct abis_om_hdr *) msgb_push(msg, sizeof(*omh));
if (is_manuf)
@@ -321,6 +315,7 @@ int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause)
struct msgb *msg;
struct abis_om_fom_hdr *foh;
int is_manuf = 0;
+ uint8_t *manuf;
msg = oml_msgb_alloc();
if (!msg)
@@ -349,6 +344,24 @@ int oml_fom_ack_nack(struct msgb *old_msg, uint8_t cause)
foh->msg_type++; /* ack */
}
+ if (is_manuf) {
+ if (strncmp(osmocom_magic, (const char *)old_oh->data + 1,
+ sizeof(osmocom_magic)) == 0) {
+ manuf = msgb_push(msg, 1 + sizeof(osmocom_magic));
+ manuf[0] = sizeof(osmocom_magic);
+ memcpy(manuf+1, osmocom_magic, sizeof(osmocom_magic));
+ } else if (strncmp(ipaccess_magic,
+ (const char *)old_oh->data + 1,
+ sizeof(ipaccess_magic)) == 0) {
+ manuf = msgb_push(msg, 1 + sizeof(ipaccess_magic));
+ manuf[0] = sizeof(ipaccess_magic);
+ memcpy(manuf+1, ipaccess_magic, sizeof(ipaccess_magic));
+ } else {
+ LOGP(DOML, LOGL_ERROR, "Unknown manufacturer label.\n");
+ return -1;
+ }
+ }
+
return oml_send_msg(msg, is_manuf);
}