wireshark/epan/dissectors/packet-osi.h

76 lines
3.0 KiB
C
Raw Normal View History

/* packet-osi.h
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _PACKET_OSI_H
#define _PACKET_OSI_H
#include <epan/osi-utils.h>
#define PDU_TYPE_ESIS_ESH 100
#define PDU_TYPE_ESIS_ISH 101
#define PDU_TYPE_ESIS_RD 102
#define PDU_TYPE_ISIS_L1_HELLO 201
#define PDU_TYPE_ISIS_L2_HELLO 202
#define PDU_TYPE_ISIS_PTP_HELLO 203
#define PDU_TYPE_ISIS_L1_CSNP 204
#define PDU_TYPE_ISIS_L1_PSNP 205
#define PDU_TYPE_ISIS_L2_CSNP 206
#define PDU_TYPE_ISIS_L2_PSNP 207
#define PROTO_STRING_ISIS "ISO 10589 ISIS InTRA Domain Routeing Information Exchange Protocol"
#define PROTO_STRING_IDRP "ISO 10747 IDRP InTER Domain Routeing Information Exchange Protocol"
#define PROTO_STRING_ESIS "ISO 9542 ESIS Routeing Information Exchange Protocol"
#define PROTO_STRING_CLNP "ISO 8473/X.233 CLNP ConnectionLess Network Protocol"
#define PROTO_STRING_COTP "ISO 8073/X.224 COTP Connection-Oriented Transport Protocol"
#define PROTO_STRING_CLTP "ISO 8602/X.234 CLTP ConnectionLess Transport Protocol"
#define PROTO_STRING_LSP "ISO 10589 ISIS Link State Protocol Data Unit"
#define PROTO_STRING_CSNP "ISO 10589 ISIS Complete Sequence Numbers Protocol Data Unit"
#define PROTO_STRING_PSNP "ISO 10589 ISIS Partial Sequence Numbers Protocol Data Unit"
#define OSI_PDU_TYPE_MASK 0x1f
#define BIS_PDU_TYPE MASK 0xff
/*
* published API functions
*/
typedef enum {
NO_CKSUM, /* checksum field is 0 */
DATA_MISSING, /* not all the data covered by the checksum was captured */
CKSUM_OK, /* checksum is OK */
CKSUM_NOT_OK /* checksum is not OK */
} cksum_status_t;
/* Exposed to be used by packet-osi-options.c */
extern int proto_osi;
extern cksum_status_t calc_checksum(tvbuff_t *, int, guint, guint);
Handle the pseudo-trailer for the ATN extended checksums by passing in the source and destination address lengths and data, and adding them in, rather than by copying those fields to a fixed-size static buffer - that gets rid of a global variable (global variables considered harmful), and also means that we don't try to copy 24 bytes of length+address from packets that don't *have* 24 bytes of length+address (which caused exceptions to be thrown on some OSI captures I have). Construct some LI #defines out of other LI #defines, to make it a bit clearer why they have the values they do. Support the "additional information related to the clearing of the connection" variable part parameter of the COTP DR packet (which just means giving it a name, as its contents are user-defined - some HP-UX OSI stack appears to just stick in a string saying that it's said stack). Make the code that decodes the variable part of a DR packet look like the code that decodes the variable part of most other packets. For COTP CR packets, determine the class up front by checking whether the length is > 2. (At some point we might want to associate a class indication with the COTP connection, if we see the connection setup, and, if we have that indication, use it in preference to the heuristics.) Make the code to handle various length indicator values in the ATN case more like the code in the non-ATN case. Dissect the variable part of COTP ER packets. Fix tpyos (TDPU->TPDU, tdpu->tpdu) and typpoes (accross->across). Clean up white space. svn path=/trunk/; revision=46060
2012-11-17 22:12:37 +00:00
extern cksum_status_t check_and_get_checksum(tvbuff_t *, int, guint, guint, int, guint16*);
extern gboolean check_atn_ec_32(tvbuff_t *tvb, guint tpdu_len, guint offset_ec_32_val, guint offset_iso8073_val, guint clnp_dst_len, const guint8 *clnp_dst, guint clnp_src_len, const guint8 *clnp_src);
extern gboolean check_atn_ec_16(tvbuff_t *tvb, guint tpdu_len, guint offset_ec_16_val, guint offset_iso8073_val, guint clnp_dst_len, const guint8 *clnp_dst, guint clnp_src_len, const guint8 *clnp_src);
#endif /* _PACKET_OSI_H */