bssap: forward paging from MSC to all BSCs

I've considered only forwarding to specific BSCs based on the cell
identifier list inside the paging. For that, the cell identifier would
need to be stored beforehand (read it from location update? or put it in
vty config?) and I'm not sure if it is required, so don't do this for
now and extend it later if needed.

Related: SYS#5560
Related: https://osmocom.org/projects/osmo-bscnat/wiki/AoIP_OsmoBSCNAT#PAGING-BSC
Change-Id: I2532d94aab82d136b932d57fa53c8ecf2d8d1fd9
This commit is contained in:
Oliver Smith 2022-03-23 12:35:49 +01:00
parent af61b08191
commit a73b45a934
1 changed files with 38 additions and 0 deletions

View File

@ -38,6 +38,41 @@ int bssmap_tx_reset(struct bsc_nat_sccp_inst *sccp_inst, struct osmo_sccp_addr *
return osmo_sccp_tx_unitdata_msg(sccp_inst->scu, &sccp_inst->addr, addr, msg);
}
static int bssmap_cn_handle_paging(struct osmo_sccp_addr *addr, struct msgb *msg, unsigned int length)
{
struct bsc_nat_sccp_inst *sccp_inst = g_bsc_nat->ran.sccp_inst;
struct msc *msc = msc_get();
struct bsc *bsc;
int ret = 0;
int rc;
if (msc->addr.pc != addr->pc) {
LOGP(DMAIN, LOGL_ERROR, "Unexpected Rx PAGING in CN from %s, which is not %s\n",
osmo_ss7_pointcode_print(NULL, addr->pc), talloc_get_name(msc));
return -1;
}
LOGP(DMAIN, LOGL_DEBUG, "Rx PAGING from %s\n", talloc_get_name(msc));
msgb_pull_to_l2(msg);
/* Page all BSCs */
llist_for_each_entry(bsc, &g_bsc_nat->ran.bscs, list) {
LOGP(DMAIN, LOGL_DEBUG, "Fwd to %s\n", talloc_get_name(bsc));
rc = osmo_sccp_tx_unitdata(sccp_inst->scu,
&sccp_inst->addr,
&bsc->addr,
msg->data,
msgb_length(msg));
if (rc < 0) {
LOGP(DMAIN, LOGL_ERROR, "Fwd to %s failed\n", talloc_get_name(bsc));
ret = rc;
}
}
return ret;
}
static int bssmap_cn_handle_reset_ack(struct osmo_sccp_addr *addr, struct msgb *msg, unsigned int length)
{
struct msc *msc = msc_get();
@ -59,6 +94,9 @@ static int bssmap_cn_rcvmsg_udt(struct osmo_sccp_addr *addr, struct msgb *msg, u
int ret = 0;
switch (msg->l3h[0]) {
case BSS_MAP_MSG_PAGING:
ret = bssmap_cn_handle_paging(addr, msg, length);
break;
case BSS_MAP_MSG_RESET_ACKNOWLEDGE:
ret = bssmap_cn_handle_reset_ack(addr, msg, length);
break;