replace the command line option -a with the auth-policy config option
This commit is contained in:
parent
0e451d0f2e
commit
06513f26a1
|
@ -1115,7 +1115,6 @@ static void print_help()
|
||||||
printf(" -s --disable-color\n");
|
printf(" -s --disable-color\n");
|
||||||
printf(" -c --config-file filename The config file to use.\n");
|
printf(" -c --config-file filename The config file to use.\n");
|
||||||
printf(" -l --database db-name The database 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(" -r --reject-cause number The reject cause for LOCATION UPDATING REJECT.\n");
|
||||||
printf(" -p --pcap file The filename of the pcap file\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");
|
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':
|
case 'c':
|
||||||
config_file = strdup(optarg);
|
config_file = strdup(optarg);
|
||||||
break;
|
break;
|
||||||
case 'a':
|
|
||||||
gsm0408_allow_everyone(1);
|
|
||||||
break;
|
|
||||||
case 'r':
|
case 'r':
|
||||||
gsm0408_set_reject_cause(atoi(optarg));
|
gsm0408_set_reject_cause(atoi(optarg));
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -304,13 +304,6 @@ struct gsm_lai {
|
||||||
u_int16_t lac;
|
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;
|
static int reject_cause = 0;
|
||||||
void gsm0408_set_reject_cause(int cause)
|
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))
|
if (loc && (loc->waiting_for_imsi || loc->waiting_for_imei))
|
||||||
return 0;
|
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 1;
|
||||||
|
case GSM_AUTH_POLICY_TOKEN:
|
||||||
return subscriber->authorized;
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void release_loc_updating_req(struct gsm_lchan *lchan)
|
static void release_loc_updating_req(struct gsm_lchan *lchan)
|
||||||
|
|
Loading…
Reference in New Issue