Two fixes to tektronix k12 import:
authorlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 22 Aug 2005 23:11:48 +0000 (23:11 +0000)
committerlego <lego@f5534014-38df-0310-8fa8-9805f1628bb7>
Mon, 22 Aug 2005 23:11:48 +0000 (23:11 +0000)
- it appears that there are more packet record types other than 0x00010020.
     accept anything matching 0x00010020/28 as a packet record.

- make the stack filename lowercase before comparing it so that capitalization is not an issue.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15513 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-k12.c
wiretap/k12.c

index fc561a54141e3f69b13c8909e54a67f36d310594..8dbfa17220c0bbcfc4f8522495cb47962ad12386 100644 (file)
@@ -139,11 +139,13 @@ static GHashTable* k12_load_config(const gchar* filename) {
        }
 
        if (len > 0) {
+               
                lines = g_strsplit(buffer,"\n",0);
                
                for (i = 0 ; lines[i]; i++) {
                        g_strstrip(lines[i]);
-                       
+                       g_strdown(lines[i]);
+
                        if(*(lines[i]) == '#' || *(lines[i]) == '\0')
                                continue;
                        
index e4eaddc879f8c1d3fe26899c4be6ae0e2b237d77..42e90f72059786a4dc0506c2be1b045ffff97825 100644 (file)
@@ -77,6 +77,9 @@ typedef struct _k12_src_desc_t {
 #define K12_REC_20030          0x00020030 /* human readable start time  */ 
 #define K12_REC_20032          0x00020031 /* human readable stop time */
 
+#define K12_MASK_PACKET                0xfffffff0
+
+
 #define K12_RECORD_LEN         0x0
 #define K12_RECORD_TYPE        0x4
 #define K12_RECORD_FRAME_LEN   0x8
@@ -203,7 +206,7 @@ static gboolean k12_read(wtap *wth, int *err, gchar **err_info _U_, long *data_o
                
                offset += len;
                
-       } while ( type != K12_REC_PACKET );
+       } while ( (type & K12_MASK_PACKET) != K12_REC_PACKET );
        
        wth->data_offset = offset;
        
@@ -351,7 +354,7 @@ int k12_open(wtap *wth, int *err, gchar **err_info _U_) {
 
                type = pntohl( read_buffer + K12_RECORD_TYPE );
                
-               if ( type == K12_REC_PACKET) {
+               if ( (type & K12_MASK_PACKET) == K12_REC_PACKET) {
                        /*
                         * we are at the first packet record, rewind and leave.
                         */
@@ -395,6 +398,8 @@ int k12_open(wtap *wth, int *err, gchar **err_info _U_) {
                        rec->input_name = g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len, name_len);
                        rec->stack_file = g_memdup(read_buffer + K12_SRCDESC_EXTRATYPE + extra_len + name_len, stack_len);
                        
+                       g_strdown(rec->stack_file);
+                               
                        g_hash_table_insert(file_data->src_by_id,GUINT_TO_POINTER(rec->input),rec);
                        g_hash_table_insert(file_data->src_by_name,rec->stack_file,rec);