diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2005-08-22 23:11:48 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2005-08-22 23:11:48 +0000 |
commit | 9362605183179e8b5e901b9bc18c4fa9848531c8 (patch) | |
tree | 4706a918a4a24970888c19b8113b9d87466abb90 | |
parent | 412ae3d09dfb7fca622f1b597b5905dbe9e89bad (diff) |
Two fixes to tektronix k12 import:
- 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.
svn path=/trunk/; revision=15513
-rw-r--r-- | epan/dissectors/packet-k12.c | 4 | ||||
-rw-r--r-- | wiretap/k12.c | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-k12.c b/epan/dissectors/packet-k12.c index fc561a5414..8dbfa17220 100644 --- a/epan/dissectors/packet-k12.c +++ b/epan/dissectors/packet-k12.c @@ -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; diff --git a/wiretap/k12.c b/wiretap/k12.c index e4eaddc879..42e90f7205 100644 --- a/wiretap/k12.c +++ b/wiretap/k12.c @@ -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); |