Feature #2873
closed
pdpa global array to be moved to gsn_t
Added by pespin over 6 years ago.
Updated almost 5 years ago.
Description
In pdp.c:
/* ***********************************************************
* Global variables TODO: most should be moved to gsn_t
*************************************************************/
static struct pdp_t pdpa[PDP_MAX]; /* PDP storage */
static struct pdp_t *hashtid[PDP_MAX]; /* Hash table for IMSI + NSAPI */
Then APIs in the same file (pdp_init, pdp_newpdp, pdp_getgtp0, etc.) should be updated to receive a point to pdpa as first parameter.
The global array is initialized using pdp_init(), which is called during gtp_new() which already contains the allocated gsn_t context.
This means:
- pdp_init() is not really a public API and we can modify it. it's only meant to be called from inside libgtp.
- We modify pdp_init() to pass the allocated gsn_t and save it as a static pointer in pdp.c
- We keep the old pdp_*(...) APIs for backward compatibility
- We add new gtp_pdp_*(gsn_t*, ...) APIs
- Old pdp_*(...) implementations are changed to call newgtp_pdp_*() APIs with the static gsn_t as first parameter.
- Status changed from New to Feedback
- Assignee set to pespin
- % Done changed from 0 to 90
- Status changed from Feedback to Resolved
- % Done changed from 90 to 100
Merged, closing the ticket.
Also available in: Atom
PDF