diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-16 23:00:50 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-02-17 19:34:28 +0100 |
commit | 64b7d56dc0f5a7b03bad2f9d9fb147f7da0f53a1 (patch) | |
tree | 54d60c1d339a96383cd53a6406f75825019db335 /src/ss7_application.c | |
parent | c5200fcb354b7c70cf0c1198abf10281906c3aad (diff) |
ss7: Move all mtp linksets callbacks into the app layer
Diffstat (limited to 'src/ss7_application.c')
-rw-r--r-- | src/ss7_application.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/ss7_application.c b/src/ss7_application.c index 06e666e..b860b8a 100644 --- a/src/ss7_application.c +++ b/src/ss7_application.c @@ -31,6 +31,61 @@ /* the SS7 dispatch... maybe as function pointers in the future */ +void forward_sccp_stp(struct mtp_link_set *set, struct msgb *_msg, int sls) +{ + struct mtp_link_set *other; + other = set->app->route_src.set == set ? + set->app->route_dst.set : set->app->route_src.set; + mtp_link_set_submit_sccp_data(other, sls, _msg->l2h, msgb_l2len(_msg)); +} + +void forward_isup_stp(struct mtp_link_set *set, struct msgb *msg, int sls) +{ + struct mtp_link_set *other; + other = set->app->route_src.set == set ? + set->app->route_dst.set : set->app->route_src.set; + mtp_link_set_submit_isup_data(other, sls, msg->l3h, msgb_l3len(msg)); +} + +void mtp_link_set_forward_sccp(struct mtp_link_set *set, struct msgb *_msg, int sls) +{ + if (!set->app) { + LOGP(DINP, LOGL_ERROR, "Linkset %d/%s has no application.\n", + set->no, set->name); + return; + } + + switch (set->app->type) { + case APP_STP: + forward_sccp_stp(set, _msg, sls); + break; + case APP_CELLMGR: + case APP_RELAY: + app_forward_sccp(set->app, _msg, sls); + break; + } +} + +void mtp_link_set_forward_isup(struct mtp_link_set *set, struct msgb *msg, int sls) +{ + if (!set->app) { + LOGP(DINP, LOGL_ERROR, "Linkset %d/%s has no application.\n", + set->no, set->name); + return; + } + + + switch (set->app->type) { + case APP_STP: + forward_isup_stp(set, msg, sls); + break; + case APP_CELLMGR: + case APP_RELAY: + LOGP(DINP, LOGL_ERROR, "ISUP is not handled.\n"); + break; + } +} + void mtp_linkset_down(struct mtp_link_set *set) { set->available = 0; |