diff options
author | jjako <jjako> | 2004-05-27 20:06:36 +0000 |
---|---|---|
committer | jjako <jjako> | 2004-05-27 20:06:36 +0000 |
commit | 7e051d37bb866b5b50b450569ad869f55299f765 (patch) | |
tree | 7b4050625e9bf1b0d63fe15101a6b4ae06ec1a5a /sgsnemu/cmdline.c | |
parent | b62c3dd3c40c32c39466d83e589a846707d9ea99 (diff) |
Charging option
Diffstat (limited to 'sgsnemu/cmdline.c')
-rw-r--r-- | sgsnemu/cmdline.c | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index be47cc1..fa7ad7f 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: - gengetopt --conf-parser + /mnt/hda5/bin/gengetopt --conf-parser The developers of gengetopt consider the fixed text that goes in all gengetopt output files to be in the public domain: @@ -56,9 +56,10 @@ cmdline_parser_print_help (void) printf(" --gtpversion=INT GTP version to use (default='1')\n"); printf(" -aSTRING --apn=STRING Access point name (default='internet')\n"); printf(" -iSTRING --imsi=STRING IMSI (default='240010123456789')\n"); - printf(" --nsapi=INT NSAPI (default='1')\n"); + printf(" --nsapi=INT NSAPI (default='0')\n"); printf(" -mSTRING --msisdn=STRING Mobile Station ISDN number (default='46702123456')\n"); printf(" -qINT --qos=INT Requested quality of service (default='0x0b921f')\n"); + printf(" --charging=INT Charging characteristics (default='0x0800')\n"); printf(" -uSTRING --uid=STRING Login user ID (default='mig')\n"); printf(" -pSTRING --pwd=STRING Login password (default='hemmelig')\n"); printf(" --createif Create local network interface (default=off)\n"); @@ -111,6 +112,7 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i args_info->nsapi_given = 0 ; args_info->msisdn_given = 0 ; args_info->qos_given = 0 ; + args_info->charging_given = 0 ; args_info->uid_given = 0 ; args_info->pwd_given = 0 ; args_info->createif_given = 0 ; @@ -136,9 +138,10 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i args_info->gtpversion_arg = 1 ;\ args_info->apn_arg = strdup("internet") ;\ args_info->imsi_arg = strdup("240010123456789") ;\ - args_info->nsapi_arg = 1 ;\ + args_info->nsapi_arg = 0 ;\ args_info->msisdn_arg = strdup("46702123456") ;\ args_info->qos_arg = 0x0b921f ;\ + args_info->charging_arg = 0x0800 ;\ args_info->uid_arg = strdup("mig") ;\ args_info->pwd_arg = strdup("hemmelig") ;\ args_info->createif_flag = 0;\ @@ -182,6 +185,7 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i { "nsapi", 1, NULL, 0 }, { "msisdn", 1, NULL, 'm' }, { "qos", 1, NULL, 'q' }, + { "charging", 1, NULL, 0 }, { "uid", 1, NULL, 'u' }, { "pwd", 1, NULL, 'p' }, { "createif", 0, NULL, 0 }, @@ -427,6 +431,19 @@ cmdline_parser (int argc, char * const *argv, struct gengetopt_args_info *args_i args_info->nsapi_arg = strtol (optarg,&stop_char,0); break; } + /* Charging characteristics. */ + else if (strcmp (long_options[option_index].name, "charging") == 0) + { + if (args_info->charging_given) + { + fprintf (stderr, "%s: `--charging' option given more than once\n", PACKAGE); + clear_args (); + exit (EXIT_FAILURE); + } + args_info->charging_given = 1; + args_info->charging_arg = strtol (optarg,&stop_char,0); + break; + } /* Create local network interface. */ else if (strcmp (long_options[option_index].name, "createif") == 0) { @@ -850,6 +867,22 @@ cmdline_parser_configfile (char * const filename, struct gengetopt_args_info *ar } continue; } + if (!strcmp(fopt, "charging")) + { + if (override || !args_info->charging_given) + { + args_info->charging_given = 1; + if (fnum == 2) + args_info->charging_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, "uid")) { if (override || !args_info->uid_given) |