summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-08-12 16:21:32 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-11-12 16:05:04 +0100
commitb6db8d0efb3350f4ed24943366ccffdabdb392bf (patch)
tree82a1805d723f0e16dca16b59e677bcc55b181e92
parent0dd4717063371d6938fbe3c10d9c216830b8ff5d (diff)
cosmetic prep: change int -> bool authorize_subscriber()
Upcoming function subscr_authorized() will flip this to bool, so separate this change cosmetically. Change-Id: Iba0184a71afa01141ef06c474cb554e79ad8f5d5
-rw-r--r--openbsc/src/libmsc/gsm_04_08.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c
index 3a71961..087bcb4 100644
--- a/openbsc/src/libmsc/gsm_04_08.c
+++ b/openbsc/src/libmsc/gsm_04_08.c
@@ -246,11 +246,11 @@ static bool subscr_regexp_check(const struct gsm_network *net, const char *imsi)
return false;
}
-static int authorize_subscriber(struct gsm_loc_updating_operation *loc,
+static bool authorize_subscriber(struct gsm_loc_updating_operation *loc,
struct gsm_subscriber *subscriber)
{
if (!subscriber)
- return 0;
+ return false;
/*
* Do not send accept yet as more information should arrive. Some
@@ -258,14 +258,14 @@ static int authorize_subscriber(struct gsm_loc_updating_operation *loc,
* what we want to do with that.
*/
if (loc && (loc->waiting_for_imsi || loc->waiting_for_imei))
- return 0;
+ return false;
switch (subscriber->group->net->auth_policy) {
case GSM_AUTH_POLICY_CLOSED:
return subscriber->authorized;
case GSM_AUTH_POLICY_REGEXP:
if (subscriber->authorized)
- return 1;
+ return true;
if (subscr_regexp_check(subscriber->group->net,
subscriber->imsi))
subscriber->authorized = 1;
@@ -275,9 +275,9 @@ static int authorize_subscriber(struct gsm_loc_updating_operation *loc,
return subscriber->authorized;
return (subscriber->flags & GSM_SUBSCRIBER_FIRST_CONTACT);
case GSM_AUTH_POLICY_ACCEPT_ALL:
- return 1;
+ return true;
default:
- return 0;
+ return false;
}
}