replace the command line option -a with the auth-policy config option

This commit is contained in:
Jan Luebbe 2009-08-12 12:48:00 +02:00 committed by Harald Welte (local)
parent 0e451d0f2e
commit 06513f26a1
2 changed files with 8 additions and 14 deletions

View File

@ -1115,7 +1115,6 @@ static void print_help()
printf(" -s --disable-color\n");
printf(" -c --config-file filename The config file to use.\n");
printf(" -l --database db-name The database to use\n");
printf(" -a --authorize-everyone Allow everyone into the network.\n");
printf(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n");
printf(" -p --pcap file The filename of the pcap file\n");
printf(" -C --cardnr number For bs11 select E1 card number other than 0\n");
@ -1165,9 +1164,6 @@ static void handle_options(int argc, char** argv)
case 'c':
config_file = strdup(optarg);
break;
case 'a':
gsm0408_allow_everyone(1);
break;
case 'r':
gsm0408_set_reject_cause(atoi(optarg));
break;

View File

@ -304,13 +304,6 @@ struct gsm_lai {
u_int16_t lac;
};
static int authorize_everonye = 0;
void gsm0408_allow_everyone(int everyone)
{
printf("Allowing everyone?\n");
authorize_everonye = everyone;
}
static int reject_cause = 0;
void gsm0408_set_reject_cause(int cause)
{
@ -333,10 +326,15 @@ static int authorize_subscriber(struct gsm_loc_updating_operation *loc,
if (loc && (loc->waiting_for_imsi || loc->waiting_for_imei))
return 0;
if (authorize_everonye)
switch (subscriber->net->auth_policy) {
case GSM_AUTH_POLICY_CLOSED:
return subscriber->authorized;
case GSM_AUTH_POLICY_ACCEPT_ALL:
return 1;
return subscriber->authorized;
case GSM_AUTH_POLICY_TOKEN:
default:
return 0;
}
}
static void release_loc_updating_req(struct gsm_lchan *lchan)