This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgReview at https://gerrit.osmocom.org/4043 sgsnemu: Add --no-tx-gpdu-seq option to suppress transmission of G-PDU sequence numbers Related: OS#2519 Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h M sgsnemu/sgsnemu.c 4 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/43/4043/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index d7be13a..6df8fc1 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -75,6 +75,7 @@ " --pingsize=INT Number of ping data bytes (default=`56')", " --pingcount=INT Number of ping req to send (default=`0')", " --pingquiet Do not print ping packet info (default=off)", + " --no-tx-gpdu-seq Don't transmit G-PDU sequence nums\n (default=off)", 0 }; @@ -159,6 +160,7 @@ args_info->pingsize_given = 0; args_info->pingcount_given = 0; args_info->pingquiet_given = 0; + args_info->no_tx_gpdu_seq_given = 0; } static @@ -238,6 +240,7 @@ args_info->pingcount_arg = 0; args_info->pingcount_orig = NULL; args_info->pingquiet_flag = 0; + args_info->no_tx_gpdu_seq_flag = 0; } @@ -286,6 +289,7 @@ args_info->pingsize_help = gengetopt_args_info_help[38]; args_info->pingcount_help = gengetopt_args_info_help[39]; args_info->pingquiet_help = gengetopt_args_info_help[40]; + args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[41]; } @@ -532,6 +536,8 @@ 0); if (args_info->pingquiet_given) write_into_file(outfile, "pingquiet", 0, 0); + if (args_info->no_tx_gpdu_seq_given) + write_into_file(outfile, "no-tx-gpdu-seq", 0, 0); i = EXIT_SUCCESS; return i; @@ -826,6 +832,7 @@ {"pingsize", 1, NULL, 0}, {"pingcount", 1, NULL, 0}, {"pingquiet", 0, NULL, 0}, + {"no-tx-gpdu-seq", 0, NULL, 0}, {0, 0, 0, 0} }; @@ -1401,6 +1408,21 @@ goto failure; } + /* Don't transmit G-PDU sequence nums. */ + else if (strcmp + (long_options[option_index].name, + "no-tx-gpdu-seq") == 0) { + + if (update_arg + ((void *)&(args_info->no_tx_gpdu_seq_flag), + 0, &(args_info->no_tx_gpdu_seq_given), + &(local_args_info.no_tx_gpdu_seq_given), + optarg, 0, 0, ARG_FLAG, check_ambiguity, + override, 1, 0, "no-tx-gpdu-seq", '-', + additional_error)) + goto failure; + + } break; case '?': /* Invalid option. */ diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 4fcc64a..a2681f1 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -60,4 +60,4 @@ option "pingsize" - "Number of ping data bytes" int default="56" no option "pingcount" - "Number of ping req to send" int default="0" no option "pingquiet" - "Do not print ping packet info" flag off - +option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index b93fa0b..38db7da 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -264,6 +264,10 @@ /**< @brief Do not print ping packet info (default=off). */ const char *pingquiet_help; /**< @brief Do not print ping packet info help description. */ + int no_tx_gpdu_seq_flag; + /**< @brief Don't transmit G-PDU sequence nums (default=off). */ + const char *no_tx_gpdu_seq_help; + /**< @brief Don't transmit G-PDU sequence nums help description. */ unsigned int help_given; /**< @brief Whether help was given. */ @@ -347,6 +351,8 @@ /**< @brief Whether pingcount was given. */ unsigned int pingquiet_given; /**< @brief Whether pingquiet was given. */ + unsigned int no_tx_gpdu_seq_given; + /**< @brief Whether no-tx-gpdu-seq was given. */ }; diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index 2bfe801..4cc2021 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -117,6 +117,7 @@ int imeisv_given; struct ul16_t msisdn; int norecovery_given; + int tx_gpdu_seq; } options; /* Definitions to use for PING. Most of the ping code was derived from */ @@ -297,6 +298,7 @@ printf("pingcount: %d\n", args_info.pingcount_arg); printf("pingquiet: %d\n", args_info.pingquiet_flag); printf("norecovery: %d\n", args_info.norecovery_flag); + printf("no-tx-gpdu-seq: %d\n", args_info.no_tx_gpdu_seq_flag); } /* Try out our new parser */ @@ -354,6 +356,7 @@ printf("pingcount: %d\n", args_info.pingcount_arg); printf("pingquiet: %d\n", args_info.pingquiet_flag); printf("norecovery: %d\n", args_info.norecovery_flag); + printf("no-tx-gpdu-seq: %d\n", args_info.no_tx_gpdu_seq_flag); } } @@ -917,6 +920,11 @@ /* norecovery */ options.norecovery_given = args_info.norecovery_flag; + + if (args_info.no_tx_gpdu_seq_flag) + options.tx_gpdu_seq = 0; + else + options.tx_gpdu_seq = 1; return 0; @@ -1591,6 +1599,8 @@ pdp->cch_pdp = options.cch; /* 2048 = Normal, 1024 = Prepaid, 512 = Flat rate, 256 = Hot billing */ + pdp->tx_gpdu_seq = options.tx_gpdu_seq; + /* Create context */ /* We send this of once. Retransmissions are handled by gtplib */ gtp_create_context_req(gsn, pdp, &iparr[n]); -- To view, visit https://gerrit.osmocom.org/4043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc650d896f0f72329090b56a37d9c16359294860 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte <laforge at gnumonks.org>