* add support for storing classmark1/2/3 per subscriber
* add support for parsing measurement results (both BTS and MS side)

diff --git a/include/openbsc/gsm_04_08.h b/include/openbsc/gsm_04_08.h
index 8d00612..fe18f4e 100644
--- a/include/openbsc/gsm_04_08.h
+++ b/include/openbsc/gsm_04_08.h
@@ -4,6 +4,14 @@
 /* GSM TS 04.08  definitions */
 struct gsm_lchan;
 
+struct gsm48_classmark1 {
+	u_int8_t spare:1,
+		 rev_level:2,
+		 es_ind:1,
+		 a5_1:1,
+		 pwr_lev:3;
+} __attribute__ ((packed));
+
 /* Chapter 10.5.2.5 */
 struct gsm48_chan_desc {
 	u_int8_t chan_nr;
@@ -73,7 +81,7 @@
 	u_int8_t type:4,
 		 key_seq:4;
 	struct gsm48_loc_area_id lai;
-	u_int8_t classmark1;
+	struct gsm48_classmark1 classmark1;
 	u_int8_t mi_len;
 	u_int8_t mi[0];
 } __attribute__ ((packed));
@@ -186,7 +194,7 @@
 
 /* Section 9.2.12 IMSI Detach Indication */
 struct gsm48_imsi_detach_ind {
-	u_int8_t classmark1;
+	struct gsm48_classmark1 classmark1;
 	u_int8_t mi_len;
 	u_int8_t mi[0];
 } __attribute__ ((packed));
@@ -506,6 +514,30 @@
 };
 
 
+/* extracted from a L3 measurement report IE */
+struct gsm_meas_rep_cell {
+	u_int8_t rxlev;
+	u_int8_t bcch_freq;	/* fixme: translate to ARFCN */
+	u_int8_t bsic;
+};
+
+struct gsm_meas_rep {
+	unsigned int flags;
+	u_int8_t rxlev_full;
+	u_int8_t rxqual_full;
+	u_int8_t rxlev_sub;
+	u_int8_t rxqual_sub;
+	int num_cell;
+	struct gsm_meas_rep_cell cell[6];
+};
+#define MEAS_REP_F_DTX		0x01
+#define MEAS_REP_F_VALID	0x02
+#define MEAS_REP_F_BA1		0x04
+
+void gsm48_parse_meas_rep(struct gsm_meas_rep *rep, const u_int8_t *data,
+			  int len);
+
+
 struct msgb;
 struct gsm_bts;
 struct gsm_subscriber;
diff --git a/include/openbsc/gsm_subscriber.h b/include/openbsc/gsm_subscriber.h
index 99148b5..1ca79e2 100644
--- a/include/openbsc/gsm_subscriber.h
+++ b/include/openbsc/gsm_subscriber.h
@@ -23,6 +23,14 @@
 	/* 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];
 };
 
 enum gsm_subscriber_field {