From c2e302dc84490691b17fcfa6246e40eaf9a0ab32 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 5 Jul 2009 14:08:13 +0200 Subject: Store classmark1/2/3 in equipment SQL table For further evaluation/analysis, this patch stores the classmark 1, 2 and 3 values of every equipment in the SQL database. We can use this non-volatile data to determine the supported features for each handset that we've ever seen on our network. --- openbsc/include/openbsc/gsm_subscriber.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'openbsc/include') diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h index dc4f6d7a6..4a2311555 100644 --- a/openbsc/include/openbsc/gsm_subscriber.h +++ b/openbsc/include/openbsc/gsm_subscriber.h @@ -11,6 +11,18 @@ #define GSM_NAME_LENGTH 128 #define GSM_EXTENSION_LENGTH 128 +struct gsm_equipment { + long long unsigned int id; + char imei[GSM_IMEI_LENGTH]; + char name[GSM_NAME_LENGTH]; + + struct gsm48_classmark1 classmark1; + u_int8_t classmark2_len; + u_int8_t classmark2[3]; + u_int8_t classmark3_len; + u_int8_t classmark3[14]; +}; + struct gsm_subscriber { struct gsm_network *net; long long unsigned int id; @@ -21,18 +33,14 @@ struct gsm_subscriber { char extension[GSM_EXTENSION_LENGTH]; int authorized; + /* Every user can only have one equipment in use at any given + * point in time */ + struct gsm_equipment equipment; + /* for internal management */ int use_count; struct llist_head entry; - /* those are properties of the equipment, but they - * are applicable to the subscriber at the moment */ - struct gsm48_classmark1 classmark1; - u_int8_t classmark2_len; - u_int8_t classmark2[3]; - u_int8_t classmark3_len; - u_int8_t classmark3[14]; - /* pending requests */ int in_callback; struct llist_head requests; @@ -47,6 +55,7 @@ enum gsm_subscriber_field { enum gsm_subscriber_update_reason { GSM_SUBSCRIBER_UPDATE_ATTACHED, GSM_SUBSCRIBER_UPDATE_DETACHED, + GSM_SUBSCRIBER_UPDATE_EQUIPMENT, }; struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr); -- cgit v1.2.3