Feature #2873

pdpa global array to be moved to gsn_t

Added by pespin over 1 year ago. Updated 4 months ago.

Target version:
Start date:
Due date:
% Done:


Spec Reference:


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.


#1 Updated by pespin 5 months ago

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.

#2 Updated by pespin 5 months ago

  • Status changed from New to Feedback
  • Assignee set to pespin
  • % Done changed from 0 to 90

Should be accomplished by:
remote: gtp: Introduce new pdp APIs (and deprecate old ones) to support multiple GSN
remote: gtp: Replace old pdp APIs with new ones with multi-gsn support
remote: ggsn: vty: Require ggsn param in <show pdp-context> cmd
remote: sgsnemu: Replace old API pdp_newpdp with new one provided by libgtp

osmo-sgsn: sgsn_libgtp: Replace deprcated API pdp_newpdp with per-gsn new API

#3 Updated by pespin 4 months ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Merged, closing the ticket.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)