diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-23 15:58:24 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-26 09:33:47 +0200 |
commit | a78b6026c95b7db80d71efa039eb3eecd626aec9 (patch) | |
tree | 4d9a17d82dba1de81d2daad0598c7dd0dac6e2eb /openbsc/src/osmo-bsc/osmo_bsc_msc.c | |
parent | 163f6123265de45404e5420853e4263493c7de8a (diff) |
bsc: Handle MGCP coming from Osmo Extensions header
Start using the new Osmo Extension header and forward MGCP
to the MGCP GW.
Diffstat (limited to 'openbsc/src/osmo-bsc/osmo_bsc_msc.c')
-rw-r--r-- | openbsc/src/osmo-bsc/osmo_bsc_msc.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc/osmo_bsc_msc.c b/openbsc/src/osmo-bsc/osmo_bsc_msc.c index 135779eaa..91d9f7322 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_msc.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_msc.c @@ -188,6 +188,24 @@ static int msc_alink_do_write(struct bsc_fd *fd, struct msgb *msg) return ret; } +static void osmo_ext_handle(struct osmo_msc_data *msc, struct msgb *msg) +{ + struct ipaccess_head *hh; + struct ipaccess_head_ext *hh_ext; + + hh = (struct ipaccess_head *) msg->data; + hh_ext = (struct ipaccess_head_ext *) hh->data; + if (msg->len < sizeof(*hh) + sizeof(*hh_ext)) { + LOGP(DMSC, LOGL_ERROR, "Packet too short for extended header.\n"); + return; + } + + msg->l2h = hh_ext->data; + if (hh_ext->proto == IPAC_PROTO_EXT_MGCP) + mgcp_forward(msc, msg); + +} + static int ipaccess_a_fd_cb(struct bsc_fd *bfd) { int error; @@ -225,6 +243,8 @@ static int ipaccess_a_fd_cb(struct bsc_fd *bfd) sccp_system_incoming(msg); } else if (hh->proto == IPAC_PROTO_MGCP_OLD) { mgcp_forward(data, msg); + } else if (hh->proto == IPAC_PROTO_OSMO) { + osmo_ext_handle(data, msg); } msgb_free(msg); |