diff options
author | Guy Harris <guy@alum.mit.edu> | 2000-04-13 08:14:35 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2000-04-13 08:14:35 +0000 |
commit | e70b4f7700d6c2970e60f601e1a4b4a28736e28e (patch) | |
tree | 18e76909b9e62fb8b6f50312e0c548e4d26e3fb0 /packet-osi.c | |
parent | dccffa9d2fe07846aeade1ecc78badbb4ccf1630 (diff) | |
download | wireshark-e70b4f7700d6c2970e60f601e1a4b4a28736e28e.tar.gz wireshark-e70b4f7700d6c2970e60f601e1a4b4a28736e28e.tar.bz2 wireshark-e70b4f7700d6c2970e60f601e1a4b4a28736e28e.zip |
Set the COL_PROTOCOL column to "ISIS" in the ISIS dissector, rather than
in its caller.
Set the COL_PROTOCOL column to "COTP" in the COTP dissector, rather than
in the dissectors it calls, so that it's done for all frames we hand to
that dissector.
Set the COL_INFO field for COTP packets we don't dissect because the
length indicator is zero, or the frame is too short, or the PDU type is
bogus.
svn path=/trunk/; revision=1842
Diffstat (limited to 'packet-osi.c')
-rw-r--r-- | packet-osi.c | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/packet-osi.c b/packet-osi.c index 78f1864814..ed0b5fbb99 100644 --- a/packet-osi.c +++ b/packet-osi.c @@ -1,7 +1,7 @@ /* packet-osi.c * Routines for ISO/OSI network and transport protocol packet disassembly * - * $Id: packet-osi.c,v 1.25 2000/04/13 07:52:55 guy Exp $ + * $Id: packet-osi.c,v 1.26 2000/04/13 08:14:33 guy Exp $ * Laurent Deniel <deniel@worldnet.fr> * * Ethereal - Network traffic analyzer @@ -269,8 +269,6 @@ static int osi_decode_DR(const u_char *pd, int offset, break; } - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "DR TPDU src-ref: 0x%04x dst-ref: 0x%04x", src_ref, dst_ref); @@ -360,8 +358,6 @@ static int osi_decode_DT(const u_char *pd, int offset, break; } - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "DT TPDU (%d) dst-ref: 0x%04x %s", tpdu_nr, @@ -502,8 +498,6 @@ static int osi_decode_ED(const u_char *pd, int offset, break; } /* li */ - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "ED TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); @@ -585,8 +579,6 @@ static int osi_decode_RJ(const u_char *pd, int offset, break; } - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "RJ TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); @@ -685,8 +677,6 @@ static int osi_decode_CC(const u_char *pd, int offset, if (class_option > 4) return -1; - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "%s TPDU src-ref: 0x%04x dst-ref: 0x%04x", (tpdu == CR_TPDU) ? "CR" : "CC", @@ -972,8 +962,6 @@ static int osi_decode_DC(const u_char *pd, int offset, break; } /* li */ - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "DC TPDU src-ref: 0x%04x dst-ref: 0x%04x", src_ref, @@ -1026,8 +1014,6 @@ static int osi_decode_AK(const u_char *pd, int offset, if (!is_LI_NORMAL_AK(li)) { tpdu_nr = pd[offset + P_TPDU_NR_234]; - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "AK TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); @@ -1132,8 +1118,6 @@ static int osi_decode_AK(const u_char *pd, int offset, tpdu_nr = EXTRACT_LONG(&pd[offset + P_TPDU_NR_234]); cdt_in_ak = EXTRACT_SHORT(&pd[offset + P_CDT_IN_AK]); - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "AK TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); @@ -1285,8 +1269,6 @@ static int osi_decode_EA(const u_char *pd, int offset, break; } /* li */ - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "EA TPDU (%d) dst-ref: 0x%04x", tpdu_nr, dst_ref); @@ -1371,8 +1353,6 @@ static int osi_decode_ER(const u_char *pd, int offset, break; } - if (check_col(fd, COL_PROTOCOL)) - col_add_str(fd, COL_PROTOCOL, "COTP"); if (check_col(fd, COL_INFO)) col_add_fstr(fd, COL_INFO, "ER TPDU dst-ref: 0x%04x", dst_ref); @@ -1401,8 +1381,18 @@ static void dissect_cotp_internal(const u_char *pd, int offset, frame_data *fd, { int status = -1; - if (((li = pd[offset + P_LI]) == 0) || - (!BYTES_ARE_IN_FRAME(offset, P_LI + li + 1))) { + if (check_col(fd, COL_PROTOCOL)) + col_add_str(fd, COL_PROTOCOL, "COTP"); + + if ((li = pd[offset + P_LI]) == 0) { + if (check_col(fd, COL_INFO)) + col_add_str(fd, COL_INFO, "Length indicator is zero"); + dissect_data(pd, offset, fd, tree); + return; + } + if (!BYTES_ARE_IN_FRAME(offset, P_LI + li + 1)) { + if (check_col(fd, COL_INFO)) + col_add_str(fd, COL_INFO, "Captured data in frame doesn't include entire frame"); dissect_data(pd, offset, fd, tree); return; } @@ -1441,6 +1431,8 @@ static void dissect_cotp_internal(const u_char *pd, int offset, frame_data *fd, status = osi_decode_ER(pd, offset, fd, tree); break; default : + if (check_col(fd, COL_INFO)) + col_add_fstr(fd, COL_INFO, "Unknown TPDU type (0x%x)", tpdu); break; } @@ -1749,9 +1741,6 @@ void dissect_osi(const u_char *pd, int offset, frame_data *fd, dissect_data(pd, offset, fd, tree); break; case NLPID_ISO10589_ISIS: - if (check_col(fd, COL_PROTOCOL)) { - col_add_str(fd, COL_PROTOCOL, "ISIS"); - } dissect_isis(pd, offset, fd, tree); break; default: |