aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/msg_utils.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2014-08-17 22:01:45 +0200
committerHarald Welte <laforge@gnumonks.org>2014-08-24 17:28:47 +0200
commit85c7e90f434192e4fd6713d219bc33e0a47f6cde (patch)
treea115b37eebf16cfcbba0aaf6278d64b5a3f49101 /src/common/msg_utils.c
parentaf066bab9dac8f52efad4d924b6dcc3bc3c64626 (diff)
A dedicated OML router program (osmobts-omlrouter)
The idea of this OML router is to be the entity that connects the OML link to the BSC. osmo-bts as well as other programs like sysmobts-mgr and possibly more will then connect to the OML-router rather than the BSC. The point is that those "OML clients" can then register for certain OML messages (particularly the managed objects like TRX, etc.) which then get routed to them. This is particularly useful in the context of 'stacked' multi-TRX BTSs, where we will have two osmo-bts processes, one on each of the TRX, both connecting OML to the oml-router. Through their respective subscription of the baseband transceiver OML object, they will get routed the IPA CONNECT RSL message from the BSC, and both osmo-bts processes will establish independent RSL connections to the BSC.
Diffstat (limited to 'src/common/msg_utils.c')
-rw-r--r--src/common/msg_utils.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c
index f3cba090..22a3012a 100644
--- a/src/common/msg_utils.c
+++ b/src/common/msg_utils.c
@@ -103,13 +103,6 @@ int msg_verify_ipa_structure(struct msgb *msg)
hh = (struct ipaccess_head *) msg->l1h;
- if (hh->proto != IPAC_PROTO_OML) {
- LOGP(DL1C, LOGL_ERROR,
- "Incorrect ipa header protocol 0x%x 0x%x\n",
- hh->proto, IPAC_PROTO_OML);
- return -1;
- }
-
if (ntohs(hh->len) != msgb_l1len(msg) - sizeof(struct ipaccess_head)) {
LOGP(DL1C, LOGL_ERROR,
"Incorrect ipa header msg size %d %d\n",
@@ -117,7 +110,16 @@ int msg_verify_ipa_structure(struct msgb *msg)
return -1;
}
- msg->l2h = hh->data;
+ if (hh->proto == IPAC_PROTO_OSMO) {
+ struct ipaccess_head_ext *hh_ext = (struct ipaccess_head_ext *) hh->data;
+ if (ntohs(hh->len) < sizeof(*hh_ext)) {
+ LOGP(DL1C, LOGL_ERROR, "IPA length shorter than OSMO header\n");
+ return -1;
+ }
+ msg->l2h = hh_ext->data;
+ } else
+ msg->l2h = hh->data;
+
return 0;
}