More IE dissection.
authorAnders Broman <anders.broman@ericsson.com>
Mon, 31 Jan 2011 22:25:19 +0000 (22:25 -0000)
committerAnders Broman <anders.broman@ericsson.com>
Mon, 31 Jan 2011 22:25:19 +0000 (22:25 -0000)
svn path=/trunk/; revision=35736

epan/dissectors/packet-bssgp.c
epan/dissectors/packet-gsm_a_common.c
epan/dissectors/packet-gsm_a_common.h

index 732aba8494773e0bcf2b6fcf981cac2a40058bf3..485b253f2e39a671bc13f09e4b84e3d9c6fb3f93 100644 (file)
@@ -7249,6 +7249,10 @@ de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gc
 /*
  * 11.3.56     Deciphering Keys
  */
+/* Rest of element coded as the value part defined in
+ * 3GPP TS 49.031, not including 3GPP TS 49.031 IEI and
+ * 3GPP TS 49.031 octet length indicator
+ */
 /*
  * 11.3.57     LCS Priority
  */
@@ -7259,6 +7263,10 @@ de_bssgp_nsei(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gc
 /*
  * 11.3.58     LCS Cause
  */
+/* Rest of element coded as the value part defined in
+ * 3GPP TS 49.031, not including 3GPP TS 49.031 IEI and
+ * 3GPP TS 49.031 octet length indicator
+ */
 /*
  * 11.3.59     LCS Capability
  */
@@ -7877,6 +7885,21 @@ de_bssgp_active_pfcs_list(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint
 /*
  * 11.3.96     Velocity Data
  */
+static guint16
+de_bssgp_velocity_data(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
+{
+       guint32 curr_offset;
+
+       curr_offset = offset;
+
+       /* The rest of the information element contains an octet sequence
+        * identical to that for Description of Velocity defined in 3GPP TS
+        * 23.032.
+        */
+       curr_offset = dissect_description_of_velocity(tvb, tree, curr_offset, len, add_string, string_len);
+
+       return(curr_offset-offset);
+}
 /*
  * 11.3.97     DTM Handover Command
  */
@@ -8144,11 +8167,11 @@ const value_string bssgp_elem_strings[] = {
                                                                                                                                        /* 11.3.51      LCS Client Type BSSGP_IEI_LCS_CLIENT_TYPE, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCS_CLIENT_TYPE*/
                                                                                                                                        /* 11.3.52      Requested GPS Assistance Data BSSGP_IEI_REQUESTED_GPS_ASSISTANCE_DATA, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_REQ_GPS_ASSIST_D*/
                                                                                                                                        /* 11.3.53      Location Type 0x7c, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_GANSS_LOC_TYPE*/
/* 11.3.54    Location Estimate */
/* 11.3.55    Positioning Data */
/* 11.3.56    Deciphering Keys */
/* 11.3.57    LCS Priority */
/* 11.3.58    LCS Cause */
                                                                                                                                      /* 11.3.54      Location Estimate BSSGP_IEI_LOCATION_ESTIMATE, GSM_A_PDU_TYPE_BSSMAP, BE_LOC_EST*/
                                                                                                                                      /* 11.3.55      Positioning Data 0x7d, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_POS_DATA*/
                                                                                                                                      /* 11.3.56      Deciphering Keys BSSGP_IEI_DECIPHERING_KEYS, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_DECIPH_KEYS */
                                                                                                                                      /* 11.3.57      LCS Priority BSSGP_IEI_LCS_PRIORITY, GSM_A_PDU_TYPE_BSSMAP, BE_LCS_PRIO;*/
                                                                                                                                      /* 11.3.58      LCS Cause BSSGP_IEI_LCS_CAUSE, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCS_CAUSE */
                                                                                                                                        /* 11.3.59      LCS Capability 0x49 , GSM_A_PDU_TYPE_GM, DE_PS_LCS_CAP*/
  /* 11.3.60    RRLP Flags */
  /* 11.3.61    RIM Application Identity */
@@ -8216,7 +8239,7 @@ const value_string bssgp_elem_strings[] = {
        { 0x00, "PS Handover Indications" },                                                    /* 11.3.95a     PS Handover Indications */
        { 0x00, "SI/PSI Container" },                                                                   /* 11.3.95b     SI/PSI Container */
        { 0x00, "Active PFCs List" },                                                                   /* 11.3.95c     Active PFCs List */
/* 11.3.96    Velocity Data */
      { 0x00, "Velocity Data" },                                                                              /* 11.3.96      Velocity Data */
        { 0x00, "DTM Handover Command" },                                                               /* 11.3.97      DTM Handover Command */
        { 0x00, "PS Handover Indications" },                                                    /* 11.3.98      CS Indication */
                                                                                                                                        /* 11.3.99      Requested GANSS Assistance Data 0x7b, GSM_A_PDU_TYPE_BSSMAP, BE_GANSS_ASS_DTA*/
@@ -8310,6 +8333,7 @@ typedef enum
        DE_BSSGP_PS_HO_INDICATIONS,                                                                     /* 11.3.95a     PS Handover Indications */
        DE_BSSGP_SIPSI_CONTAINER,                                                                       /* 11.3.95b     SI/PSI Container */
        DE_BSSGP_ACTIVE_PFCS_LIST,                                                                      /* 11.3.95c     Active PFCs List */
+       DE_BSSGP_VELOCITY_DATA,                                                                         /* 11.3.96      Velocity Data */
        DE_BBSGP_DTM_HO_CMD,                                                                            /* 11.3.97      DTM Handover Command */
        DE_BSSGP_CS_INDICATION,                                                                         /* 11.3.98      CS Indication */
        DE_BSSGP_FLOW_CONTROL_GRAN,                                                                     /* 11.3.102     Flow Control Granularity */
@@ -8390,6 +8414,7 @@ guint16 (*bssgp_elem_fcn[])(tvbuff_t *tvb, proto_tree *tree, guint32 offset, gui
        de_bssgp_ps_ho_indications,                                                                     /* 11.3.95a     PS Handover Indications */
        de_bssgp_sipsi_container,                                                                       /* 11.3.95b     SI/PSI Container */
        de_bssgp_active_pfcs_list,                                                                      /* 11.3.95c     Active PFCs List */
+       de_bssgp_velocity_data,                                                                         /* 11.3.96      Velocity Data */
        de_bssgp_dtm_ho_cmd,                                                                            /* 11.3.97      DTM Handover Command */
        de_bssgp_cs_indication,                                                                         /* 11.3.98      CS Indication */
        de_bssgp_flow_control_gran,                                                                     /* 11.3.102     Flow Control Granularity */
@@ -9989,6 +10014,41 @@ bssgp_perform_loc_request(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint
 
 /*
  * 10.5.2      PERFORM-LOCATION-RESPONSE
+ */
+static void
+bssgp_perform_loc_response(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len)
+{
+       guint32 curr_offset;
+       guint32 consumed;
+       guint   curr_len;
+
+       curr_offset = offset;
+       curr_len = len;
+
+       /*This PDU allows the BSS to respond to the SGSN after the completion of the location procedure. */
+       /* Direction: BSS to SGSN */
+       gpinfo->link_dir = P2P_DIR_UL;
+
+       /* TLLI TLLI/11.3.35 M TLV 6 */
+       ELEM_MAND_TELV(BSSGP_IEI_TLLI, GSM_A_PDU_TYPE_RR, DE_RR_TLLI , NULL);
+       /* BVCI (PCU-PTP) BVCI/11.3.6 M TLV 4 */
+       ELEM_MAND_TELV(BSSGP_IEI_BVCI, BSSGP_PDU_TYPE, DE_BSSGP_BVCI , " - (PCU-PTP)");
+       /* Location Estimate (note 1) Location Estimate/11.3.54 C TLV 3-? */
+       ELEM_OPT_TELV(BSSGP_IEI_LOCATION_ESTIMATE, GSM_A_PDU_TYPE_BSSMAP, BE_LOC_EST, NULL);
+       /* Positioning Data Positioning Data/11.3.55 O TLV 3-? */
+       ELEM_OPT_TELV(0x7d, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_POS_DATA, NULL);
+       /* Deciphering Keys (note 2) Deciphering Keys/11.3.56 C TLV 3-? */
+       ELEM_OPT_TELV(BSSGP_IEI_DECIPHERING_KEYS, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_DECIPH_KEYS, NULL);
+       /* LCS Cause (note 3) LCS Cause/11.3.58 O TLV 3-? */
+       ELEM_OPT_TELV(BSSGP_IEI_LCS_CAUSE, GSM_PDU_TYPE_BSSMAP_LE, DE_BMAPLE_LCS_CAUSE, NULL);
+       /* Velocity Data Velocity Data/11.3.96 O TLV 3-? */
+       ELEM_MAND_TELV(0x78, BSSGP_PDU_TYPE, DE_BSSGP_VELOCITY_DATA , NULL);
+       /* GANSS Positioning Data GANSS Positioning Data /11.3.101 O TLV 3-? */
+
+       EXTRANEOUS_DATA_CHECK_EXPERT(curr_len, 0, gpinfo);
+}
+
+/*
  * 10.5.3      PERFORM-LOCATION-ABORT
  * 10.5.4      POSITION-COMMAND
  * 10.5.5      POSITION-RESPONSE
index ed2bdffa2ca29812851778588d1f98a56123b6f1..b7ab196d9804790ec79aed3cf82da4a313f34cc1 100644 (file)
@@ -680,6 +680,14 @@ static int hf_gsm_a_geo_loc_orientation_of_major_axis = -1;
 static int hf_gsm_a_geo_loc_uncertainty_altitude = -1;
 static int hf_gsm_a_geo_loc_confidence = -1;
 static int hf_gsm_a_geo_loc_no_of_points = -1;
+static int hf_gsm_a_velocity_type = -1;
+static int hf_gsm_a_bearing = -1;
+static int hf_gsm_a_horizontal_speed = -1;
+static int hf_gsm_a_uncertainty_speed = -1;
+static int hf_gsm_a_h_uncertainty_speed = -1;
+static int hf_gsm_a_v_uncertainty_speed = -1;
+static int hf_gsm_a_vertical_speed = -1;
+static int hf_gsm_a_d = -1;
 static int hf_gsm_a_geo_loc_D = -1;
 static int hf_gsm_a_geo_loc_altitude = -1;
 static int hf_gsm_a_geo_loc_inner_radius = -1;
@@ -909,6 +917,155 @@ dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tr
 
 }
 
+/* TS 23.032
+ * Ch. 8 Description of Velocity
+ */
+/* 8.6 Coding of Velocity Type */
+static const value_string gsm_a_velocity_type_vals[] = {
+       { 0,            "Horizontal Velocity"},
+       { 1,            "Horizontal with Vertical Velocity"},
+       { 2,            "Horizontal Velocity with Uncertainty"},
+       { 3,            "Horizontal with Vertical Velocity and Uncertainty"},
+       { 4,            "reserved for future use"},
+       { 5,            "reserved for future use"},
+       { 6,            "reserved for future use"},
+       { 7,            "reserved for future use"},
+       { 8,            "reserved for future use"},
+       { 9,            "reserved for future use"},
+       { 10,           "reserved for future use"},
+       { 11,           "reserved for future use"},
+       { 12,           "reserved for future use"},
+       { 13,           "reserved for future use"},
+       { 14,           "reserved for future use"},
+       { 15,           "reserved for future use"},
+       { 0,    NULL }
+};
+
+static const value_string gsm_a_dir_of_ver_speed_vals[] = {
+    { 0, "Downward" },
+    { 1, "Upward" },
+    { 0, NULL}
+};
+
+guint16
+dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
+{
+       proto_item *velocity_item;
+       guint32 curr_offset;
+       guint8 velocity_type, uncertainty_speed=0;
+
+       curr_offset = offset;
+
+       /* Bit 8 - 5 Velocity Type */
+       velocity_type = tvb_get_guint8(tvb,curr_offset);
+       proto_tree_add_item(tree, hf_gsm_a_velocity_type, tvb, offset, 1, FALSE);
+       curr_offset++;
+
+       switch(velocity_type){
+               case 0:
+                       /* 8.12 Coding of Horizontal Velocity */
+                       /* Spare bits */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 3, FALSE);
+                       /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, FALSE);
+                       curr_offset+=2;
+                       /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, FALSE);
+                       proto_item_append_text(velocity_item," km/h");
+                       curr_offset+=2;
+                       break;
+               case 1:
+                       /* 8.13 Coding of Horizontal with Vertical Velocity */
+                       /* Spare bits */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 2, FALSE);
+                       /* D: Direction of Vertical Speed */
+                       proto_tree_add_item(tree, hf_gsm_a_d, tvb, offset, 1, FALSE);
+                       /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, FALSE);
+                       curr_offset+=2;
+                       /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, FALSE);
+                       proto_item_append_text(velocity_item," km/h");
+                       curr_offset+=2;
+                       /* Vertical Speed Octet 5 
+                        * Vertical speed is encoded in increments of 1 kilometre per hour using 8 bits giving a number N between 0 and 28-1.
+                        */
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, offset, 1, FALSE);
+                       proto_item_append_text(velocity_item," km/h");
+                       curr_offset++;
+                       break;
+               case 2:
+                       /* 8.14 Coding of Horizontal Velocity with Uncertainty */
+                       /* Spare bits */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 3, FALSE);
+                       /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, FALSE);
+                       curr_offset+=2;
+                       /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, FALSE);
+                       proto_item_append_text(velocity_item," km/h");
+                       curr_offset+=2;
+                       /* Uncertainty Speed Octet 5 
+                        * Uncertainty speed is encoded in increments of 1 kilometre per hour using an 8 bit binary coded number N. The value of
+                        * N gives the uncertainty speed except for N=255 which indicates that the uncertainty is not specified.
+                        */
+                       uncertainty_speed = tvb_get_guint8(tvb,curr_offset);
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_uncertainty_speed, tvb, offset, 2, FALSE);
+                       if(uncertainty_speed==255){
+                               proto_item_append_text(velocity_item," not specified");
+                       }else{
+                               proto_item_append_text(velocity_item," km/h");
+                       }
+                       offset++;
+                       break;
+               case 3:
+                       /* 8.15 Coding of Horizontal with Vertical Velocity and Uncertainty */
+                       /* Spare bits */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_spare_bits, tvb, (curr_offset<<3)+4, 2, FALSE);
+                       /* D: Direction of Vertical Speed */
+                       proto_tree_add_item(tree, hf_gsm_a_d, tvb, offset, 1, FALSE);
+                       /* Bearing is encoded in increments of 1 degree measured clockwise from North using a 9 bit binary coded number N. */
+                       proto_tree_add_bits_item(tree, hf_gsm_a_bearing, tvb, (curr_offset<<3)+7, 9, FALSE);
+                       curr_offset+=2;
+                       /* Horizontal speed is encoded in increments of 1 kilometre per hour using a 16 bit binary coded number N. */
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_horizontal_speed, tvb, offset, 2, FALSE);
+                       proto_item_append_text(velocity_item," km/h");
+                       curr_offset+=2;
+                       /* Vertical Speed Octet 5 
+                        * Vertical speed is encoded in increments of 1 kilometre per hour using 8 bits giving a number N between 0 and 28-1.
+                        */
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_vertical_speed, tvb, offset, 1, FALSE);
+                       proto_item_append_text(velocity_item," km/h");
+                       curr_offset++;
+
+                       /* Horizontal Uncertainty Speed Octet 6 */
+                       uncertainty_speed = tvb_get_guint8(tvb,curr_offset);
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_h_uncertainty_speed, tvb, offset, 2, FALSE);
+                       if(uncertainty_speed==255){
+                               proto_item_append_text(velocity_item," not specified");
+                       }else{
+                               proto_item_append_text(velocity_item," km/h");
+                       }
+                       offset++;
+
+                       /* Vertical Uncertainty Speed Octet 7 */
+                       uncertainty_speed = tvb_get_guint8(tvb,curr_offset);
+                       velocity_item = proto_tree_add_item(tree, hf_gsm_a_v_uncertainty_speed, tvb, offset, 2, FALSE);
+                       if(uncertainty_speed==255){
+                               proto_item_append_text(velocity_item," not specified");
+                       }else{
+                               proto_item_append_text(velocity_item," km/h");
+                       }
+                       offset++;
+
+                       break;
+               default:
+                       break;
+       }
+
+       return(curr_offset-offset);
+}
+
 const char* get_gsm_a_msg_string(int pdu_type, int idx)
 {
        const char *msg_string=NULL;
@@ -3843,6 +4000,46 @@ proto_register_gsm_a_common(void)
                FT_UINT8,BASE_DEC, NULL, 0x0f,
                NULL, HFILL }
        },
+       { &hf_gsm_a_velocity_type,
+               { "Number of points","gsm_a.gad.velocity_type",
+               FT_UINT8,BASE_DEC, VALS(gsm_a_velocity_type_vals), 0xf0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_bearing,
+               { "Bearing","gsm_a.gad.bearing",
+               FT_UINT16,BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_horizontal_speed,
+               { "Horizontal Speed","gsm_a.gad.horizontal_velocity",
+               FT_UINT16,BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_vertical_speed,
+               { "Vertical Speed","gsm_a.gad.vertical_speed",
+               FT_UINT8,BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_uncertainty_speed,
+               { "Uncertainty Speed","gsm_a.gad.uncertainty_speed",
+               FT_UINT8,BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_h_uncertainty_speed,
+               { "Horizontal Uncertainty Speed","gsm_a.gad.v_uncertainty_speed",
+               FT_UINT8,BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_v_uncertainty_speed,
+               { "Vertical Uncertainty Speed","gsm_a.gad.h_uncertainty_speed",
+               FT_UINT8,BASE_DEC, NULL, 0x0,
+               NULL, HFILL }
+       },
+       { &hf_gsm_a_d,
+               { "Direction of Vertical Speed", "gsm_a.gad.d",
+               FT_BOOLEAN, 8, TFS(&gsm_a_dir_of_ver_speed_vals), 0x08,
+               NULL, HFILL}
+       },
        { &hf_gsm_a_geo_loc_D,
                { "D: Direction of Altitude","gsm_a.gad.D",
                FT_UINT16,BASE_DEC, VALS(dir_of_alt_vals), 0x8000,
index 102106d071e4e8c64d446f55716bceb51e6c6efa..7043763600e2df316758d8c44dd942d501a7b0fe 100644 (file)
@@ -160,6 +160,8 @@ extern packet_info *gsm_a_dtap_pinfo;
 
 /* TS 23 032 */
 void dissect_geographical_description(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
+guint16 dissect_description_of_velocity(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_);
+
 
 /* common field values */
 extern int hf_gsm_a_length;