[skinny] Update message definitions
authorDiederik de Groot <dkgroot@talon.nl>
Sat, 14 May 2016 12:05:30 +0000 (14:05 +0200)
committerMichael Mann <mmann78@netscape.net>
Tue, 17 May 2016 18:18:21 +0000 (18:18 +0000)
- Deal with short EnblocCallMessage coming from 7936
- SubscriptionStatReqMessage is shorter than previously known
- Use buttonType enum in FeatureStatV2Message and FeatureStatMessage

Change-Id: I0c4db5a0199ebb95bf807c858971d763faeef016
Reviewed-on: https://code.wireshark.org/review/15427
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
epan/dissectors/packet-skinny.c
tools/SkinnyProtocolOptimized.xml

index 9241a0ee7d337a56fbc55cc131b6151818e7a17c..354f12a8d37bf272d2b2df42506280003be15b62 100644 (file)
@@ -252,6 +252,7 @@ static const value_string  message_id[] = {
   { 0x0156, "CallHistoryInfo" },
   { 0x0156, "LocationInfo" },
   { 0x0158, "MwiResponse" },
+  { 0x0159, "AddOnDeviceCapabilities" },
   { 0x015a, "EnhancedAlarm" },
   { 0x015e, "CallCountReq" },
   { 0x015f, "CallCountResp" },
@@ -2142,7 +2143,10 @@ static int hf_skinny_stimulusInstance = -1;
 static int hf_skinny_stimulusStatus = -1;
 static int hf_skinny_streamPassThroughID = -1;
 static int hf_skinny_subAppID = -1;
+static int hf_skinny_subcriptionFeatureID = -1;
+static int hf_skinny_subscriptionFeatureID = -1;
 static int hf_skinny_subscriptionID = -1;
+static int hf_skinny_subscriptionoFeatureID = -1;
 static int hf_skinny_systemTime = -1;
 static int hf_skinny_temporalSpatialTradeOff = -1;
 static int hf_skinny_temporalSpatialTradeOffCapability = -1;
@@ -2163,6 +2167,10 @@ static int hf_skinny_transmitPort = -1;
 static int hf_skinny_transmitPreference = -1;
 static int hf_skinny_unRegReasonCode = -1;
 static int hf_skinny_unknown = -1;
+static int hf_skinny_unknown1_0159 = -1;
+static int hf_skinny_unknown2_0159 = -1;
+static int hf_skinny_unknown3_0159 = -1;
+static int hf_skinny_unknownString_0159 = -1;
 static int hf_skinny_userName = -1;
 static int hf_skinny_v150sprt = -1;
 static int hf_skinny_vendor = -1;
@@ -2449,12 +2457,16 @@ handle_KeypadButtonMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
 static void
 handle_EnblocCallMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
 {
+  guint32 hdr_data_length = tvb_get_letohl(ptvcursor_tvbuff(cursor), 0);
   guint32 hdr_version = tvb_get_letohl(ptvcursor_tvbuff(cursor), 4);
   guint32 VariableDirnumSize = (hdr_version >= V18_MSG_TYPE) ? 25 : 24;
+
   si->calledParty = g_strdup(tvb_format_stringzpad(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), VariableDirnumSize));
   ptvcursor_add(cursor, hf_skinny_calledParty, VariableDirnumSize, ENC_ASCII|ENC_NA);
-  si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
-  ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN);
+  if (hdr_data_length > 28) {
+    si->lineId = tvb_get_letohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
+    ptvcursor_add(cursor, hf_skinny_lineInstance, 4, ENC_LITTLE_ENDIAN);
+  }
 }
 
 /*
@@ -4226,9 +4238,9 @@ static void
 handle_SubscriptionStatReqMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
 {
   ptvcursor_add(cursor, hf_skinny_transactionID, 4, ENC_LITTLE_ENDIAN);
-  ptvcursor_add(cursor, hf_skinny_featureID, 4, ENC_LITTLE_ENDIAN);
+  ptvcursor_add(cursor, hf_skinny_subcriptionFeatureID, 4, ENC_LITTLE_ENDIAN);
   ptvcursor_add(cursor, hf_skinny_timer, 4, ENC_LITTLE_ENDIAN);
-  ptvcursor_add(cursor, hf_skinny_subscriptionID, 256, ENC_ASCII|ENC_NA);
+  ptvcursor_add(cursor, hf_skinny_subscriptionID, 64, ENC_ASCII|ENC_NA);
 }
 
 /*
@@ -7379,7 +7391,7 @@ static void
 handle_SubscriptionStatMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
 {
   ptvcursor_add(cursor, hf_skinny_transactionID, 4, ENC_LITTLE_ENDIAN);
-  ptvcursor_add(cursor, hf_skinny_featureID, 4, ENC_LITTLE_ENDIAN);
+  ptvcursor_add(cursor, hf_skinny_subscriptionoFeatureID, 4, ENC_LITTLE_ENDIAN);
   ptvcursor_add(cursor, hf_skinny_timer, 4, ENC_LITTLE_ENDIAN);
   ptvcursor_add(cursor, hf_skinny_cause, 4, ENC_LITTLE_ENDIAN);
 }
@@ -7395,7 +7407,7 @@ static void
 handle_NotificationMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
 {
   ptvcursor_add(cursor, hf_skinny_transactionID, 4, ENC_LITTLE_ENDIAN);
-  ptvcursor_add(cursor, hf_skinny_featureID, 4, ENC_LITTLE_ENDIAN);
+  ptvcursor_add(cursor, hf_skinny_subscriptionFeatureID, 4, ENC_LITTLE_ENDIAN);
   ptvcursor_add(cursor, hf_skinny_status, 4, ENC_LITTLE_ENDIAN);
   ptvcursor_add(cursor, hf_skinny_text, 97, ENC_ASCII|ENC_NA);
 }
@@ -7484,6 +7496,22 @@ handle_MwiResponseMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
   ptvcursor_add(cursor, hf_skinny_mwi_notification_result, 4, ENC_LITTLE_ENDIAN);
 }
 
+/*
+ * Message:   AddOnDeviceCapabilitiesMessage
+ * Opcode:    0x0159
+ * Type:      RegistrationAndManagement
+ * Direction: dev2pbx
+ * VarLength: no
+ */
+static void
+handle_AddOnDeviceCapabilitiesMessage(ptvcursor_t *cursor, packet_info * pinfo _U_)
+{
+  ptvcursor_add(cursor, hf_skinny_unknown1_0159, 4, ENC_LITTLE_ENDIAN);
+  ptvcursor_add(cursor, hf_skinny_unknown2_0159, 4, ENC_LITTLE_ENDIAN);
+  ptvcursor_add(cursor, hf_skinny_unknown3_0159, 4, ENC_LITTLE_ENDIAN);
+  ptvcursor_add(cursor, hf_skinny_unknownString_0159, 152, ENC_ASCII|ENC_NA);
+}
+
 /*
  * Message:   EnhancedAlarmMessage
  * Opcode:    0x015a
@@ -7767,6 +7795,7 @@ static const struct opcode2handler {
   {0x0156, handle_CallHistoryInfoMessage                  , "CallHistoryInfoMessage"},
   {0x0156, handle_LocationInfoMessage                     , "LocationInfoMessage"},
   {0x0158, handle_MwiResponseMessage                      , "MwiResponseMessage"},
+  {0x0159, handle_AddOnDeviceCapabilitiesMessage          , "AddOnDeviceCapabilitiesMessage"},
   {0x015a, handle_EnhancedAlarmMessage                    , "EnhancedAlarmMessage"},
   {0x015e, NULL                                           , "CallCountReqMessage"},
   {0x015f, handle_CallCountRespMessage                    , "CallCountRespMessage"},
@@ -9143,6 +9172,18 @@ proto_register_skinny(void)
       {
         "unknown", "skinny.unknown", FT_UINT8, BASE_DEC, NULL, 0x0,
         "unknown (Part of ProtocolVer)", HFILL }},
+    { &hf_skinny_unknown1_0159,
+      {
+        "unknown1_0159", "skinny.unknown1.0159", FT_UINT32, BASE_DEC, NULL, 0x0,
+        NULL, HFILL }},
+    { &hf_skinny_unknown2_0159,
+      {
+        "unknown2_0159", "skinny.unknown2.0159", FT_UINT32, BASE_DEC, NULL, 0x0,
+        NULL, HFILL }},
+    { &hf_skinny_unknown3_0159,
+      {
+        "unknown3_0159", "skinny.unknown3.0159", FT_UINT32, BASE_DEC, NULL, 0x0,
+        NULL, HFILL }},
     { &hf_skinny_v150sprt,
       {
         "v150sprt", "skinny.v150sprt", FT_UINT8, BASE_DEC, NULL, 0x0,
@@ -9373,7 +9414,7 @@ proto_register_skinny(void)
         NULL, HFILL }},
     {&hf_skinny_featureID,
       {
-        "featureID", "skinny.featureID", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &SubscriptionFeatureID_ext, 0x0,
+        "featureID", "skinny.featureID", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &ButtonType_ext, 0x0,
         NULL, HFILL }},
     {&hf_skinny_featureTextLabel,
       {
@@ -9663,10 +9704,22 @@ proto_register_skinny(void)
       {
         "subAppID", "skinny.subAppID", FT_STRING, BASE_NONE, NULL, 0x0,
         NULL, HFILL }},
+    {&hf_skinny_subcriptionFeatureID,
+      {
+        "subcriptionFeatureID", "skinny.subcriptionFeatureID", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &SubscriptionFeatureID_ext, 0x0,
+        NULL, HFILL }},
+    {&hf_skinny_subscriptionFeatureID,
+      {
+        "subscriptionFeatureID", "skinny.subscriptionFeatureID", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &SubscriptionFeatureID_ext, 0x0,
+        NULL, HFILL }},
     {&hf_skinny_subscriptionID,
       {
         "subscriptionID", "skinny.subscriptionID", FT_STRING, BASE_NONE, NULL, 0x0,
         NULL, HFILL }},
+    {&hf_skinny_subscriptionoFeatureID,
+      {
+        "subscriptionoFeatureID", "skinny.subscriptionoFeatureID", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &SubscriptionFeatureID_ext, 0x0,
+        NULL, HFILL }},
     {&hf_skinny_text,
       {
         "text", "skinny.text", FT_STRING, BASE_NONE, NULL, 0x0,
@@ -9687,6 +9740,10 @@ proto_register_skinny(void)
       {
         "unRegReasonCode", "skinny.unRegReasonCode", FT_UINT32, BASE_HEX | BASE_EXT_STRING, &UnRegReasonCode_ext, 0x0,
         NULL, HFILL }},
+    {&hf_skinny_unknownString_0159,
+      {
+        "unknownString_0159", "skinny.unknownString.0159", FT_STRING, BASE_NONE, NULL, 0x0,
+        NULL, HFILL }},
     {&hf_skinny_userName,
       {
         "userName", "skinny.userName", FT_STRING, BASE_NONE, NULL, 0x0,
index 96886e01c7f24bf877f2e979c0013a1f1d6bef97..3bb6e77330ce6d4ffb8922ef7832ad9c72c02d1d 100644 (file)
   <message comment="" direction="dev2pbx" dynamic="no" name="EnblocCallMessage" opcode="0x0004" status="no" type="CallControl">
     <fields>
       <string comment="CalledPartyNumber" declare="yes" name="calledParty" size="VariableDirnumSize" type="char"/>
+    </fields>
+    <fields size_gt="28">
       <integer comment="LineId" name="lineInstance" type="uint32"/>
     </fields>
   </message>
   <message comment="" direction="dev2pbx" dynamic="no" name="SubscriptionStatReqMessage" opcode="0x0048" status="request" type="CallControl">
     <fields beginversion="0" endversion="22">
       <integer comment="" name="transactionID" type="uint32"/>
-      <enum comment="" name="featureID" subtype="SubscriptionFeatureID" type="uint32"/>
+      <enum comment="" name="subcriptionFeatureID" subtype="SubscriptionFeatureID" type="uint32"/>
       <integer comment="" name="timer" type="uint32"/>
-      <string comment="" name="subscriptionID" size="256" type="char"/>
+      <string comment="" name="subscriptionID" size="64" type="char"/>
     </fields>
   </message>
   <enum name="MediaPathID">
   <message comment="" direction="pbx2dev" dynamic="no" name="FeatureStatMessage" opcode="0x011f" status="result" type="RegistrationAndManagement">
     <fields beginversion="0" endversion="22">
       <integer comment="" name="featureIndex" type="uint32"/>
-      <integer comment="" name="featureID" type="uint32"/>
+      <enum comment="" name="featureID" subtype="ButtonType" type="uint32"/>
       <string comment="" name="featureTextLabel" size="40" type="char"/>
       <integer comment="" name="featureStatus" type="uint32"/>
     </fields>
   <message comment="" direction="pbx2dev" dynamic="yes" name="FeatureStatV2Message" opcode="0x0146" status="no" type="RegistrationAndManagement">
     <fields alignment="4" beginversion="0" endversion="22">
       <integer comment="" name="featureIndex" type="uint32"/>
-      <integer comment="" name="featureID" type="uint32"/>
+      <enum comment="" name="featureID" subtype="ButtonType" type="uint32"/>
       <integer comment="" name="featureStatus" type="uint32"/>
       <string comment="" name="featureTextLabel" size="121" type="char"/>
     </fields>
   <message comment="" direction="pbx2dev" dynamic="no" name="SubscriptionStatMessage" opcode="0x0152" status="result" type="RegistrationAndManagement">
     <fields beginversion="0" endversion="22">
       <integer comment="" name="transactionID" type="uint32"/>
-      <enum comment="" name="featureID" subtype="SubscriptionFeatureID" type="uint32"/>
+      <enum comment="" name="subscriptionoFeatureID" subtype="SubscriptionFeatureID" type="uint32"/>
       <integer comment="" name="timer" type="uint32"/>
       <enum comment="" name="cause" subtype="SubscribeCause" type="uint32"/>
     </fields>
   <message comment="" direction="pbx2dev" dynamic="no" name="NotificationMessage" opcode="0x0153" status="no" type="RegistrationAndManagement">
     <fields alignment="4" beginversion="0" endversion="22">
       <integer comment="" name="transactionID" type="uint32"/>
-      <enum comment="" name="featureID" subtype="SubscriptionFeatureID" type="uint32"/>
+      <enum comment="" name="subscriptionFeatureID" subtype="SubscriptionFeatureID" type="uint32"/>
       <integer comment="" name="status" type="uint32"/>
       <string comment="" name="text" size="97" type="char"/>
     </fields>
       <enum comment="" name="mwi_notification_result" subtype="MwiNotificationResult" type="uint32"/>
     </fields>
   </message>
+  <message comment="" direction="dev2pbx" dynamic="no" name="AddOnDeviceCapabilitiesMessage" opcode="0x0159" status="no" type="RegistrationAndManagement">
+    <fields beginversion="0" endversion="22">
+      <integer comment="" name="unknown1_0159" type="uint32"/>
+      <integer comment="" name="unknown2_0159" type="uint32"/>
+      <integer comment="" name="unknown3_0159" type="uint32"/>
+      <string comment="" name="unknownString_0159" size="152" type="char"/>
+    </fields>
+  </message>
   <message comment="" direction="pbx2dev" dynamic="no" name="EnhancedAlarmMessage" opcode="0x015a" status="no" type="RegistrationAndManagement">
     <fields alignment="4" beginversion="0" endversion="22">
       <xml comment="" name="alarmInfo" size="2048" type="xml"/>