From f4b83c38dfa8df60e96e2dca064877bc3c55627a Mon Sep 17 00:00:00 2001 From: martinm Date: Tue, 3 Oct 2006 14:21:07 +0000 Subject: - Add special case for reading strange encoding of ATM CID field - Indicate direction of DCH Data in info column - Assume EDCH payload CRC if 2 bytes are left over (previous test was broken) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19405 f5534014-38df-0310-8fa8-9805f1628bb7 --- wiretap/catapult_dct2000.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'wiretap/catapult_dct2000.c') diff --git a/wiretap/catapult_dct2000.c b/wiretap/catapult_dct2000.c index da5b126958..94c5319d5f 100644 --- a/wiretap/catapult_dct2000.c +++ b/wiretap/catapult_dct2000.c @@ -979,6 +979,13 @@ gboolean parse_line(gint line_length, gint *seconds, gint *useconds, aal_header_chars[header_chars_seen] = linebuff[n]; } + /* Sometimes see strange encoding of cid in last (non-digit) character */ + if (header_chars_seen == (AAL_HEADER_CHARS-1)) + { + aal_header_chars[AAL_HEADER_CHARS-1] = linebuff[n]; + header_chars_seen++; + } + if (header_chars_seen != AAL_HEADER_CHARS || n >= line_length) { return FALSE; @@ -1042,7 +1049,7 @@ gboolean parse_line(gint line_length, gint *seconds, gint *useconds, /* Didn't fit in buffer. Fail rather than use truncated */ return FALSE; } - + /* Convert found value into number */ seconds_buff[seconds_chars] = '\0'; *seconds = atoi(seconds_buff); @@ -1227,10 +1234,19 @@ void set_aal_info(union wtap_pseudo_header *pseudo_header, packet_direction_t di /* 0 means we don't know how many cells the frame comprises. */ pseudo_header->dct2000.inner_pseudo_header.atm.cells = 0; - /* cid is last byte */ - pseudo_header->dct2000.inner_pseudo_header.atm.aal2_cid = - ((hex_from_char(aal_header_chars[10]) << 4) | - hex_from_char(aal_header_chars[11])); + /* cid is usually last byte. Unless last char is not hex digit, in which + case cid is derived from last char in ascii */ + if (isalnum(aal_header_chars[11])) + { + pseudo_header->dct2000.inner_pseudo_header.atm.aal2_cid = + ((hex_from_char(aal_header_chars[10]) << 4) | + hex_from_char(aal_header_chars[11])); + } + else + { + pseudo_header->dct2000.inner_pseudo_header.atm.aal2_cid = + (int)aal_header_chars[11] - 48; + } } -- cgit v1.2.3