aboutsummaryrefslogtreecommitdiffstats
path: root/sgsnemu/sgsnemu.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-09-24 18:12:40 +0800
committerHarald Welte <laforge@gnumonks.org>2017-10-01 18:19:07 +0800
commit840a8e9713f1e1c60e3b38ba51847355555cafd9 (patch)
tree47a889a7811258e586bc6668331ffb73d3e58e21 /sgsnemu/sgsnemu.c
parentcee7546f15bc66443c17a0b2cbca2570d85e3517 (diff)
sgsnemu: Allow specification of PDP (EUA) Type IPv4 or IPv6
This just adds the capability to sgsnemu to request a certain PDP EUA type. It doesn't mean it actually handles anything beyond the existing IPv4 yet. Change-Id: I157f9157a7ff2ea56c37a4a902d4706de4c7d35d
Diffstat (limited to 'sgsnemu/sgsnemu.c')
-rw-r--r--sgsnemu/sgsnemu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c
index 4cc2021..c181603 100644
--- a/sgsnemu/sgsnemu.c
+++ b/sgsnemu/sgsnemu.c
@@ -118,6 +118,7 @@ struct {
struct ul16_t msisdn;
int norecovery_given;
int tx_gpdu_seq;
+ uint8_t pdp_type;
} options;
/* Definitions to use for PING. Most of the ping code was derived from */
@@ -926,6 +927,12 @@ int process_options(int argc, char **argv)
else
options.tx_gpdu_seq = 1;
+ /* PDP Type */
+ if (!strcmp(args_info.pdp_type_arg, "v6"))
+ options.pdp_type = PDP_EUA_TYPE_v6;
+ else
+ options.pdp_type = PDP_EUA_TYPE_v4;
+
return 0;
}
@@ -1580,7 +1587,10 @@ int main(int argc, char **argv)
msisdn_add(&options.msisdn, &pdp->msisdn, n);
}
- ipv42eua(&pdp->eua, NULL); /* Request dynamic IP address */
+ /* Request dynamic IP address */
+ pdp->eua.v[0] = PDP_EUA_ORG_IETF;
+ pdp->eua.v[1] = options.pdp_type;
+ pdp->eua.l = 2;
if (options.pco.l > sizeof(pdp->pco_req.v)) {
SYS_ERR(DSGSN, LOGL_ERROR, 0,