wireshark/epan/dissectors/packet-q931.h

110 lines
3.4 KiB
C
Raw Normal View History

/* packet-q931.h
* Declarations of exported routines and tables for Q.931 and Q.2931 frame
* disassembly
* Guy Harris <guy@alum.mit.edu>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef __PACKET_Q931_H__
#define __PACKET_Q931_H__
#include "ws_symbol_export.h"
WS_DLL_PUBLIC void dissect_q931_bearer_capability_ie(tvbuff_t *, int, int,
proto_tree *);
extern void dissect_q931_cause_ie(tvbuff_t *, int, int,
proto_tree *, int, guint8 *,const value_string *);
Add "tvb_reported_length()" to get the "reported length" of a tvbuff (i.e., the amount of data that was in the packet, even if not all of it was captured), for use when dissecting packets containing data that fills the packet (we want the dissector to try to dissect all of it; if it runs past the end of the captured data, we want it to throw an exception so that we'll put a "Short Frame" note in the protocol tree). This means we always want a tvbuff to have a real reported length value, so we make it an unsigned integer, and don't bother checking it for -1, as it should never be -1. If the reported length passed in to "tvb_set_subset()" is -1, set the reported length to the reported length of the tvbuff of which the new tvbuff will be a subset minus the offset in that tvbuff of the subset, so that "-1" means "what's left of the packet after we chop off the header". This is necessary in order to ensure that all tvbuffs have a real reported length value. Have "dissect_packet()" set the reported length of the top-level tvbuff to the reported length of the frame, so that we start out with a tvbuff with a real reported length value. Have "tvb_offset_exists()" return FALSE if the offset is past the end of the tvbuff. If the offset passed to it is postitive, have "compute_offset_length()" check for that it's not more than one byte past the end of the tvbuff - if it's just past the end, we don't want the check to fail, as we don't want attempts to create a subset tvbuff containing zero bytes to fail; that would be done if a captured packet was all header and no payload, and we'd want the dissector of the payload, not the dissector of the header, to throw an exception, as the problem isn't with the protocol for the header, it's with the protocol for the payload. Convert the ATM dissector, the SSCOP dissector, the Q.2931 dissector, and the Q.931 dissector to use tvbuffs. Make the LAPD dissector set up a tvbuff for the Q.931 dissector (it's not converted yet). svn path=/trunk/; revision=2023
2000-05-29 08:57:42 +00:00
extern void dissect_q931_progress_indicator_ie(tvbuff_t *, int, int,
proto_tree *);
WS_DLL_PUBLIC void dissect_q931_high_layer_compat_ie(tvbuff_t *, int, int,
proto_tree *);
extern void dissect_q931_user_user_ie(tvbuff_t *tvb, packet_info *pinfo, int offset, int len,
proto_tree *tree);
extern value_string_ext q931_cause_location_vals_ext;
typedef struct _q931_packet_info {
gchar *calling_number;
gchar *called_number;
guint8 cause_value;
gint32 crv;
guint8 message_type;
} q931_packet_info;
/*
* the following allows TAP code access to the messages
* without having to duplicate it. With MSVC and a
* libwireshark.dll, we need a special declaration.
*/
WS_DLL_PUBLIC value_string_ext q931_cause_code_vals_ext;
WS_DLL_PUBLIC const value_string q931_message_type_vals[];
extern value_string_ext q931_protocol_discriminator_vals_ext;
extern value_string_ext q931_progress_description_vals_ext;
extern value_string_ext q931_call_state_vals_ext;
/*
* Q.931 message types.
*/
#define Q931_ESCAPE 0x00
#define Q931_ALERTING 0x01
#define Q931_CALL_PROCEEDING 0x02
#define Q931_PROGRESS 0x03
#define Q931_SETUP 0x05
#define Q931_GROUIP_SERVICE 0x06
#define Q931_CONNECT 0x07
#define Q931_RESYNC_REQ 0x08
#define Q931_RESYNC_RESP 0x09
#define Q931_VERSION 0x0A
#define Q931_GROUIP_SERVICE_ACK 0x0B
#define Q931_SETUP_ACK 0x0D
#define Q931_CONNECT_ACK 0x0F
#define Q931_USER_INFORMATION 0x20
#define Q931_SUSPEND_REJECT 0x21
#define Q931_RESUME_REJECT 0x22
#define Q931_HOLD 0x24
#define Q931_SUSPEND 0x25
#define Q931_RESUME 0x26
#define Q931_HOLD_ACK 0x28
#define Q931_SUSPEND_ACK 0x2D
#define Q931_RESUME_ACK 0x2E
#define Q931_HOLD_REJECT 0x30
#define Q931_RETRIEVE 0x31
#define Q931_RETRIEVE_ACK 0x33
#define Q931_RETRIEVE_REJECT 0x37
#define Q931_DETACH 0x40
#define Q931_DISCONNECT 0x45
#define Q931_RESTART 0x46
#define Q931_DETACH_ACKNOWLEDGE 0x48
#define Q931_RELEASE 0x4D
#define Q931_RESTART_ACK 0x4E
#define Q931_RELEASE_COMPLETE 0x5A
#define Q931_SEGMENT 0x60
#define Q931_FACILITY 0x62
#define Q931_REGISTER 0x64
#define Q931_FACILITY_ACKNOWLEDGE 0x6A
#define Q931_NOTIFY 0x6E
#define Q931_FACILITY_REJECT 0x72
#define Q931_STATUS_ENQUIRY 0x75
#define Q931_CONGESTION_CONTROL 0x79
#define Q931_INFORMATION 0x7B
#define Q931_STATUS 0x7D
/*
* Maintenance message types.
* AT&T TR41459, Nortel NIS A211-1, Telcordia SR-4994, ...
*/
#define DMS_SERVICE_ACKNOWLEDGE 0x07
#define DMS_SERVICE 0x0F
#endif