libgtp: Introduce cb_recovery3
Since osmo-ggsn can manage several GSN structures simultaneously, it needs the gsn_t pointer to know the ggsn it should forward the call to. Related: OS#4165 Change-Id: I33b4fe594d5833993af01cce34737e61e597b320
This commit is contained in:
parent
c602d7cf00
commit
5d8b226597
17
gtp/gtp.c
17
gtp/gtp.c
|
@ -219,6 +219,8 @@ static void emit_cb_recovery(struct gsn_t *gsn, struct sockaddr_in * peer,
|
|||
gsn->cb_recovery(peer, recovery);
|
||||
if (gsn->cb_recovery2)
|
||||
gsn->cb_recovery2(peer, pdp, recovery);
|
||||
if (gsn->cb_recovery3)
|
||||
gsn->cb_recovery3(gsn, peer, pdp, recovery);
|
||||
}
|
||||
|
||||
int gtp_set_cb_recovery(struct gsn_t *gsn,
|
||||
|
@ -242,6 +244,21 @@ int gtp_set_cb_recovery2(struct gsn_t *gsn,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* cb_recovery()
|
||||
* pdp may be NULL if Recovery IE was received from a message independent
|
||||
* of any PDP ctx (such as Echo Response), or because pdp ctx is unknown to the
|
||||
* local setup. In case pdp is known, caller may want to keep that pdp alive to
|
||||
* handle subsequent msg cb as this specific pdp ctx is still valid according to
|
||||
* specs.
|
||||
*/
|
||||
int gtp_set_cb_recovery3(struct gsn_t *gsn,
|
||||
int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer,
|
||||
struct pdp_t *pdp, uint8_t recovery))
|
||||
{
|
||||
gsn->cb_recovery3 = cb_recovery3;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int gtp_set_cb_data_ind(struct gsn_t *gsn,
|
||||
int (*cb_data_ind) (struct pdp_t * pdp,
|
||||
void *pack, unsigned len))
|
||||
|
|
|
@ -277,6 +277,7 @@ struct gsn_t {
|
|||
int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len);
|
||||
int (*cb_recovery) (struct sockaddr_in * peer, uint8_t recovery);
|
||||
int (*cb_recovery2) (struct sockaddr_in * peer, struct pdp_t * pdp, uint8_t recovery);
|
||||
int (*cb_recovery3) (struct gsn_t *gsn, struct sockaddr_in *peer, struct pdp_t *pdp, uint8_t recovery);
|
||||
|
||||
/* Counters */
|
||||
|
||||
|
@ -372,6 +373,11 @@ int gtp_set_cb_recovery(struct gsn_t *gsn,
|
|||
OSMO_DEPRECATED("Use gtp_set_cb_recovery2() instead, to obtain pdp ctx originating the recovery");
|
||||
int gtp_set_cb_recovery2(struct gsn_t *gsn,
|
||||
int (*cb) (struct sockaddr_in * peer,
|
||||
struct pdp_t * pdp,
|
||||
uint8_t recovery))
|
||||
OSMO_DEPRECATED("Use gtp_set_cb_recovery3() instead, to obtain gsn handling the recovery");;
|
||||
int gtp_set_cb_recovery3(struct gsn_t *gsn,
|
||||
int (*cb) (struct gsn_t * gsn, struct sockaddr_in * peer,
|
||||
struct pdp_t * pdp,
|
||||
uint8_t recovery));
|
||||
|
||||
|
|
Loading…
Reference in New Issue