Project

General

Profile

Feature #2873

pdpa global array to be moved to gsn_t

Added by pespin over 1 year ago. Updated 19 days ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
01/25/2018
Due date:
% Done:

100%

Spec Reference:

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.

History

#1 Updated by pespin 26 days 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 25 days ago

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

Should be accomplished by:
osmo-ggsn:
remote: https://gerrit.osmocom.org/#/c/osmo-ggsn/+/14296 gtp: Introduce new pdp APIs (and deprecate old ones) to support multiple GSN
remote: https://gerrit.osmocom.org/#/c/osmo-ggsn/+/14297 gtp: Replace old pdp APIs with new ones with multi-gsn support
remote: https://gerrit.osmocom.org/#/c/osmo-ggsn/+/14298 ggsn: vty: Require ggsn param in <show pdp-context> cmd
remote: https://gerrit.osmocom.org/#/c/osmo-ggsn/+/14299 sgsnemu: Replace old API pdp_newpdp with new one provided by libgtp

osmo-sgsn:
https://gerrit.osmocom.org/#/c/osmo-sgsn/+/14292 sgsn_libgtp: Replace deprcated API pdp_newpdp with per-gsn new API

#3 Updated by pespin 19 days 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)