gsup: Use new libosmogsm struct osmo_gsup_pdp_info fields

This also makes sure it doesn't compile against older libosmogsm gsup
versions which would break ABI.

Change-Id: I0d03d368e73ab62ec631420769f6af91f2ff9987
Related: OS#6091
Depends: libosmocore.git Change-Id 70be3560659c58f24b8db529c4fc85da4bb0ec04
This commit is contained in:
Pau Espin 2024-01-19 21:24:09 +01:00
parent f2545b1b8f
commit dc4c294f94
5 changed files with 21 additions and 5 deletions

View File

@ -1 +1,2 @@
#component what description / commit summary line
libosmocore > 1.9.0 gsup.h: Using new fields in struct osmo_gsup_pdp_info (ABI break)

View File

@ -4,7 +4,9 @@
#include <stdint.h>
#include <osmocom/core/linuxlist.h>
#include <osmocom/core/socket.h>
#include <osmocom/gsm/protocol/gsm_23_003.h>
#include <osmocom/gsm/protocol/gsm_04_08_gprs.h>
#include <osmocom/sgsn/apn.h>
@ -54,7 +56,9 @@ struct sgsn_subscriber_pdp_data {
struct llist_head list;
unsigned int context_id;
uint16_t pdp_type;
enum gsm48_pdp_type_org pdp_type_org;
enum gsm48_pdp_type_nr pdp_type_nr;
struct osmo_sockaddr pdp_address[2];
char apn_str[GSM_APN_LENGTH];
uint8_t qos_subscribed[20];
size_t qos_subscribed_len;

View File

@ -376,7 +376,8 @@ static void gprs_subscr_gsup_insert_data(struct gprs_subscr *subscr,
}
OSMO_ASSERT(pdp_data != NULL);
pdp_data->pdp_type = pdp_info->pdp_type;
pdp_data->pdp_type_org = pdp_info->pdp_type_org;
pdp_data->pdp_type_nr = pdp_info->pdp_type_nr;
osmo_apn_to_str(pdp_data->apn_str,
pdp_info->apn_enc, pdp_info->apn_enc_len);

View File

@ -990,8 +990,17 @@ static void subscr_dump_full_vty(struct vty *vty, struct gprs_subscr *gsub, int
}
llist_for_each_entry(pdp, &gsub->sgsn_data->pdp_list, list) {
vty_out(vty, " PDP info: Id: %d, Type: 0x%04x, APN: '%s'",
pdp->context_id, pdp->pdp_type, pdp->apn_str);
char ip_str[INET6_ADDRSTRLEN] = { 0 };
vty_out(vty, " PDP info: Id: %d, Addr(Org: 0x%02x Type: 0x%02x",
pdp->context_id, pdp->pdp_type_org, pdp->pdp_type_nr);
if (pdp->pdp_address[0].u.sa.sa_family != AF_UNSPEC)
vty_out(vty, " Addr[0]: %s", osmo_sockaddr_ntop(&pdp->pdp_address[0].u.sa, ip_str));
if (pdp->pdp_address[0].u.sa.sa_family != AF_UNSPEC)
vty_out(vty, " Addr[1]: %s", osmo_sockaddr_ntop(&pdp->pdp_address[1].u.sa, ip_str));
vty_out(vty, ") APN: '%s'", pdp->apn_str);
if (pdp->qos_subscribed_len)
vty_out(vty, " QoS: %s", osmo_hexdump(pdp->qos_subscribed, pdp->qos_subscribed_len));

View File

@ -1489,7 +1489,8 @@ static void test_ggsn_selection(void)
pdp_data = sgsn_subscriber_pdp_data_alloc(s1->sgsn_data);
pdp_data->context_id = 1;
pdp_data->pdp_type = 0x0121;
pdp_data->pdp_type_org = PDP_TYPE_ORG_IETF;
pdp_data->pdp_type_nr = PDP_TYPE_N_IETF_IPv4;
osmo_strlcpy(pdp_data->apn_str, "*", sizeof(pdp_data->apn_str));
/* Resolve GGSNs */