If a given TLV type isn't found in an aim_tlv table, just use "Unknown"
authorGuy Harris <guy@alum.mit.edu>
Mon, 17 Jan 2005 08:13:02 +0000 (08:13 -0000)
committerGuy Harris <guy@alum.mit.edu>
Mon, 17 Jan 2005 08:13:02 +0000 (08:13 -0000)
as the description - some aim_tlv tables have NULL in the end-of-table
entry.

For those that don't, replace "Unknown" with NULL; "Unknown" is now
redundant.

svn path=/trunk/; revision=13084

epan/dissectors/packet-aim-bos.c
epan/dissectors/packet-aim-icq.c
epan/dissectors/packet-aim-location.c
epan/dissectors/packet-aim-messaging.c
epan/dissectors/packet-aim-signon.c
epan/dissectors/packet-aim-ssi.c
epan/dissectors/packet-aim.c

index bab1b5430027ca69769e9d8b185ed0a2a7d21802..ff52f15d41fa15c2152eefd445cdff70f9de7b2a 100644 (file)
@@ -62,7 +62,7 @@
 static const aim_tlv privacy_tlvs[] = {
        { AIM_PRIVACY_TLV_MAX_VISIB_LIST_SIZE, "Max visible list size", dissect_aim_tlv_value_uint16 },
        { AIM_PRIVACY_TLV_MAX_INVISIB_LIST_SIZE, "Max invisible list size", dissect_aim_tlv_value_uint16 },
-       { 0, "Unknown", NULL },
+       { 0, NULL, NULL },
 };
 
 /* Initialize the protocol and registered fields */
index 0a1a9ba9a4eb202e2ffcb139a14cd8bf866b3104..e4cb11756cdb3f120a04d2f4249dba847bd403b6 100644 (file)
@@ -66,7 +66,7 @@ static int dissect_aim_tlv_value_icq(proto_item *ti, guint16 subtype, tvbuff_t *
 
 static const aim_tlv icq_tlv[] = {
    { TLV_ICQ_META_DATA, "Encapsulated ICQ Meta Data", dissect_aim_tlv_value_icq },
-   { 0, "Unknown", NULL },
+   { 0, NULL, NULL },
 };
 
 /* Initialize the protocol and registered fields */
index 7bd8f60835c5d5ceb31bb115389e7d924bae6a97..b7bfe42728ea64e6dd54eba913f9f1a6dd0964d2 100644 (file)
@@ -55,7 +55,7 @@ static const aim_tlv msg_tlv[] = {
   { FAMILY_LOCATION_USERINFO_AWAYENCODING, "Away Msg Encoding", dissect_aim_tlv_value_string },
   { FAMILY_LOCATION_USERINFO_AWAYMSG, "Away Message", dissect_aim_tlv_value_string },
   { FAMILY_LOCATION_USERINFO_CAPS, "Capabilities", dissect_aim_tlv_value_bytes },
-  { 0, "Unknown", 0 }
+  { 0, NULL, 0 }
 };
 
 #define AIM_LOCATION_RIGHTS_TLV_MAX_PROFILE_LENGTH     0x0001
@@ -64,7 +64,7 @@ static const aim_tlv msg_tlv[] = {
 static const aim_tlv location_rights_tlvs[] = {
   { AIM_LOCATION_RIGHTS_TLV_MAX_PROFILE_LENGTH, "Max Profile Length", dissect_aim_tlv_value_uint16 },
   { AIM_LOCATION_RIGHTS_TLV_MAX_CAPABILITIES, "Max capabilities", dissect_aim_tlv_value_uint16 },
-  { 0, "Unknown", NULL }
+  { 0, NULL, NULL }
 };
 
 
@@ -74,7 +74,7 @@ static const aim_tlv location_rights_tlvs[] = {
 static const aim_tlv location_userinfo_tlvs[] = {
        { AIM_LOCATION_USERINFO_TLV_MIME_TYPE, "Mime Type", dissect_aim_tlv_value_string },
        { AIM_LOCATION_USERINFO_TLV_CLIENT_CAPABILITIES, "Client capabilities", dissect_aim_tlv_value_client_capabilities },
-       { 0, "Unknown", NULL }
+       { 0, NULL, NULL }
 };
 
 #define FAMILY_LOCATION_USERINFO_INFOTYPE_GENERALINFO  0x0001
index 47ea5bd381a0641f9e175f8c460cf94aaf390464..609e50363ae3440b99503bc76945fb3aaec965d0 100644 (file)
@@ -60,7 +60,7 @@ static const aim_tlv messaging_incoming_ch1_tlvs[] = {
   { INCOMING_CH1_ICON_PRESENT, "Icon present", dissect_aim_tlv_value_bytes },
   { INCOMING_CH1_BUDDY_REQ, "Buddy Req", dissect_aim_tlv_value_bytes },
   { INCOMING_CH1_TYPING, "Non-direct connect typing notification", dissect_aim_tlv_value_bytes },
-  { 0, "Unknown", NULL },
+  { 0, NULL, NULL },
 };
 
 int dissect_aim_tlv_value_rendezvous ( proto_item *ti, guint16 valueid _U_, tvbuff_t *tvb, packet_info *pinfo _U_);
@@ -73,7 +73,7 @@ extern int dissect_aim_tlv_value_capability_data ( proto_item *ti, guint16 value
 static const aim_tlv messaging_incoming_ch2_tlvs[] = {
   { INCOMING_CH2_SERVER_ACK_REQ, "Server Ack Requested", dissect_aim_tlv_value_bytes },
   { INCOMING_CH2_RENDEZVOUS_DATA, "Rendez Vous Data", dissect_aim_tlv_value_rendezvous },
-  { 0, "Unknown", NULL },
+  { 0, NULL, NULL },
 };
 
 #define RENDEZVOUS_TLV_INT_IP                          0x0003
@@ -86,7 +86,7 @@ static const aim_tlv rendezvous_tlvs[] = {
        { RENDEZVOUS_TLV_EXT_IP, "External IP", dissect_aim_tlv_value_ipv4 },
        { RENDEZVOUS_TLV_EXT_PORT, "External Port", dissect_aim_tlv_value_uint16 },
        { RENDEZVOUS_TLV_CAPABILITY_DATA, "Capability Data", dissect_aim_tlv_value_capability_data },
-       { 0, "Unknown", NULL },
+       { 0, NULL, NULL },
 };
 
 #define MINITYPING_FINISHED_SIGN                       0x0000
index f36cded5dcb8066048262fa350afa9694a7037bd..4758f601f9fb2ec65605f322d6454f082e46f94f 100644 (file)
@@ -131,7 +131,7 @@ static int dissect_aim_tlv_value_registration(proto_item *ti _U_, guint16 value_
 
 static const aim_tlv registration_tlvs[] = {
        { REG_TLV_REGISTRATION_INFO, "Registration Info", dissect_aim_tlv_value_registration },
-       { 0, "Unknown", NULL },
+       { 0, NULL, NULL },
 };
 
 static int dissect_aim_snac_register (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
index 39b8fcd3db5aaf2145ebc4bb47eced43890983a4..4809511b88de17d13a4656abb08cc4b896b16dbd 100644 (file)
@@ -66,7 +66,7 @@ static const value_string aim_fnac_family_ssi_types[] = {
 
 static const aim_tlv ssi_rightsinfo_tlvs[] = {
        { SSI_RIGHTSINFO_TLV_MAX_ITEMS, "Maximums For Items", dissect_aim_tlv_value_bytes }, 
-       { 0, "Unknown", NULL },
+       { 0, NULL, NULL },
 };
 
 /* Initialize the protocol and registered fields */
index e4f7d72a99b42ac22b5d55d26674fcaac0895ca4..528cac50ba0a972a3186c97ec4baac60226d7fc6 100644 (file)
@@ -227,7 +227,7 @@ const aim_tlv client_tlvs[] = {
   { AIM_CLIENT_TLV_LOCAL_PERSONAL_ALERT, "Personal Alert for Buddy", dissect_aim_tlv_value_uint16 },
   { AIM_CLIENT_TLV_LOCAL_PERSONAL_SOUND, "Personal Sound for Buddy", dissect_aim_tlv_value_string },
   { AIM_CLIENT_TLV_FIRST_MESSAGE_SENT, " First Time Message Sent to Buddy (Unix Timestamp)", dissect_aim_tlv_value_uint32 },
-  { 0, "Unknown", NULL },
+  { 0, NULL, NULL },
 };
 
 
@@ -262,7 +262,7 @@ const aim_tlv onlinebuddy_tlvs[] = {
   { AIM_ONLINEBUDDY_SESSIONLEN, "Session Length (sec)", dissect_aim_tlv_value_uint32 },
   { AIM_ONLINEBUDDY_ICQSESSIONLEN, "ICQ Session Length (sec)", dissect_aim_tlv_value_uint32 },
   { AIM_ONLINEBUDDY_AVAILMSG, "Available Message", dissect_aim_tlv_value_bytes },
-  { 0, "Unknown", NULL }
+  { 0, NULL, NULL }
 };
 
 #define DC_DISABLED            0x0000
@@ -303,7 +303,7 @@ static GList *families = NULL;
 
 const aim_tlv motd_tlvs[] = {
   { AIM_MOTD_TLV_MOTD, "Message of the day message", dissect_aim_tlv_value_string },
-  { 0, "Unknown", NULL }
+  { 0, NULL, NULL }
 };
 
 #define CLASS_UNCONFIRMED            0x0001
@@ -326,7 +326,7 @@ const aim_tlv motd_tlvs[] = {
 
 static const aim_tlv fnac_tlvs[] = {
   { FNAC_TLV_FAMILY_VERSION, "SNAC Family Version", dissect_aim_tlv_value_uint16 },
-  { 0, "Unknown", NULL }
+  { 0, NULL, NULL }
 };
 
 static int dissect_aim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
@@ -1225,6 +1225,7 @@ int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_,
   guint16 length;
   int i = 0;
   const aim_tlv *tmp;
+  const char *desc;
   proto_item *ti1;
   proto_tree *tlv_tree;
   int orig_offset;
@@ -1256,13 +1257,18 @@ int dissect_aim_tlv(tvbuff_t *tvb, packet_info *pinfo _U_,
 
   if (tree) {
     offset = orig_offset;
+
+    if (tmp[i].desc != NULL)
+      desc = tmp[i].desc;
+    else
+      desc = "Unknown";
     
-    ti1 = proto_tree_add_text(tree, tvb, offset, length + 4, "TLV: %s", tmp[i].desc);
+    ti1 = proto_tree_add_text(tree, tvb, offset, length + 4, "TLV: %s", desc);
 
     tlv_tree = proto_item_add_subtree(ti1, ett_aim_tlv);
 
     proto_tree_add_text(tlv_tree, tvb, offset, 2,
-                       "Value ID: %s (0x%04x)", tmp[i].desc, valueid);
+                       "Value ID: %s (0x%04x)", desc, valueid);
     offset += 2;
     
     proto_tree_add_text(tlv_tree, tvb, offset, 2,