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.
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index dc4f6d7..4a23115 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 @@
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_update_reason {
GSM_SUBSCRIBER_UPDATE_ATTACHED,
GSM_SUBSCRIBER_UPDATE_DETACHED,
+ GSM_SUBSCRIBER_UPDATE_EQUIPMENT,
};
struct gsm_subscriber *subscr_get(struct gsm_subscriber *subscr);