aboutsummaryrefslogtreecommitdiffstats
path: root/sgsnemu/cmdline.c
diff options
context:
space:
mode:
authorjjako <jjako>2004-07-20 08:30:21 +0000
committerjjako <jjako>2004-07-20 08:30:21 +0000
commit1a51df711157545307f842f575ecb305f528deab (patch)
tree84b6574f450f158925c7d6a4c12269075700cda8 /sgsnemu/cmdline.c
parent9b4971d4a64af27c96a31473f0aff2f74b1dbacf (diff)
Added selmode
Diffstat (limited to 'sgsnemu/cmdline.c')
-rw-r--r--sgsnemu/cmdline.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c
index fa7ad7f..08582c9 100644
--- a/sgsnemu/cmdline.c
+++ b/sgsnemu/cmdline.c
@@ -1,7 +1,7 @@
/*
File autogenerated by gengetopt version 2.8
generated with the following command:
- /mnt/hda5/bin/gengetopt --conf-parser
+ gengetopt --conf-parser
The developers of gengetopt consider the fixed text that goes in all
gengetopt output files to be in the public domain:
@@ -55,6 +55,7 @@ cmdline_parser_print_help (void)
printf(" --timelimit=INT Exit after timelimit seconds (default='0')\n");
printf(" --gtpversion=INT GTP version to use (default='1')\n");
printf(" -aSTRING --apn=STRING Access point name (default='internet')\n");
+ printf(" --selmode=INT Selection mode (default='0x01')\n");
printf(" -iSTRING --imsi=STRING IMSI (default='240010123456789')\n");
printf(" --nsapi=INT NSAPI (default='0')\n");
printf(" -mSTRING --msisdn=STRING Mobile Station ISDN number (default='46702123456')\n");
@@ -108,6 +109,7 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
args_info->timelimit_given = 0 ;
args_info->gtpversion_given = 0 ;
args_info->apn_given = 0 ;
+ args_info->selmode_given = 0 ;
args_info->imsi_given = 0 ;
args_info->nsapi_given = 0 ;
args_info->msisdn_given = 0 ;
@@ -137,6 +139,7 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
args_info->timelimit_arg = 0 ;\
args_info->gtpversion_arg = 1 ;\
args_info->apn_arg = strdup("internet") ;\
+ args_info->selmode_arg = 0x01 ;\
args_info->imsi_arg = strdup("240010123456789") ;\
args_info->nsapi_arg = 0 ;\
args_info->msisdn_arg = strdup("46702123456") ;\
@@ -181,6 +184,7 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
{ "timelimit", 1, NULL, 0 },
{ "gtpversion", 1, NULL, 0 },
{ "apn", 1, NULL, 'a' },
+ { "selmode", 1, NULL, 0 },
{ "imsi", 1, NULL, 'i' },
{ "nsapi", 1, NULL, 0 },
{ "msisdn", 1, NULL, 'm' },
@@ -418,6 +422,19 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i
args_info->gtpversion_arg = strtol (optarg,&stop_char,0);
break;
}
+ /* Selection mode. */
+ else if (strcmp (long_options[option_index].name, "selmode") == 0)
+ {
+ if (args_info->selmode_given)
+ {
+ fprintf (stderr, "%s: `--selmode' option given more than once\n", PACKAGE);
+ clear_args ();
+ exit (EXIT_FAILURE);
+ }
+ args_info->selmode_given = 1;
+ args_info->selmode_arg = strtol (optarg,&stop_char,0);
+ break;
+ }
/* NSAPI. */
else if (strcmp (long_options[option_index].name, "nsapi") == 0)
{
@@ -803,6 +820,22 @@ cmdline_parser_configfile (char * const filename, struct gengetopt_args_info *ar
}
continue;
}
+ if (!strcmp(fopt, "selmode"))
+ {
+ if (override || !args_info->selmode_given)
+ {
+ args_info->selmode_given = 1;
+ if (fnum == 2)
+ args_info->selmode_arg = strtol (farg,&stop_char,0);
+ else
+ {
+ fprintf (stderr, "%s:%d: required <option_name> <option_val>\n",
+ filename, line_num);
+ exit (EXIT_FAILURE);
+ }
+ }
+ continue;
+ }
if (!strcmp(fopt, "imsi"))
{
if (override || !args_info->imsi_given)