diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-02 15:55:22 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-02 16:30:10 +0200 |
commit | 3a9c52a5dc8a625b916193b7bea90254af0e04f1 (patch) | |
tree | 0d340347f1c6e3606cde26c60fd4b35c5382720a /openbsc/src | |
parent | c6580c5b2c11ca6bbc22676866c5cfe4dc36596f (diff) |
paging: change subscr_paging_cb() into subscr_rx_paging_response()
Remove one layer of callback indirection in paging. When a paging response
arrives, we always want to first secure the connection, thus a fixed
subscr_rx_paging_response() function is more appropriate and avoids having
to store a cbfn. The actual actions to be taken upon successful paging are
of course still in callback functions stored with each subscriber.
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/libmsc/gsm_subscriber.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/openbsc/src/libmsc/gsm_subscriber.c b/openbsc/src/libmsc/gsm_subscriber.c index 1901ea29b..46b6b03eb 100644 --- a/openbsc/src/libmsc/gsm_subscriber.c +++ b/openbsc/src/libmsc/gsm_subscriber.c @@ -121,23 +121,18 @@ static int subscr_paging_sec_cb(unsigned int hooknum, unsigned int event, return rc; } -static int subscr_paging_cb(unsigned int hooknum, unsigned int event, - struct msgb *msg, void *data, void *param) +int subscr_rx_paging_response(struct msgb *msg, + struct gsm_subscriber_connection *conn) { - struct gsm_subscriber_connection *conn = data; struct gsm48_hdr *gh; struct gsm48_pag_resp *pr; - /* Non-success implies a problem, dispatch directly */ - if (event != GSM_PAGING_SUCCEEDED) - return subscr_paging_dispatch(hooknum, event, msg, data, param); - - /* Get paging response */ + /* Get key_seq from Paging Response headers */ gh = msgb_l3(msg); pr = (struct gsm48_pag_resp *)gh->data; - /* We _really_ have a channel, secure it now ! */ - return gsm48_secure_channel(conn, pr->key_seq, subscr_paging_sec_cb, param); + /* Secure the connection */ + return gsm48_secure_channel(conn, pr->key_seq, subscr_paging_sec_cb, NULL); } int msc_paging_request(struct gsm_network *network, struct gsm_subscriber *subscr, |