2000-10-19 06:45:11 +00:00
|
|
|
/* packet-tpkt.h
|
|
|
|
*
|
|
|
|
* Routines for TPKT dissection
|
|
|
|
*
|
|
|
|
* Copyright 2000, Philips Electronics N.V.
|
|
|
|
* Andreas Sikkema <andreas.sikkema@philips.com>
|
|
|
|
*
|
Clean up the heuristic code in the Q.931 dissector. If it's a heuristic
dissector, it's looking for Q.931 encapsulated inside TPKT, so it
shouldn't check whether the first byte is NLPID_Q_931 or not, as it
*won't* be NLPID_Q_931, it'll be 3, for the TPKT version. It should
first check whether "is_tpkt()" thinks it's a TPKT packet, and then
check that the packet has at least 3 bytes past the TPKT header, then
check the first byte in the payload to see whether it's NLPID_Q_931. If
that all succeeds, treat it as Q.931 inside TPKT.
Make "is_tpkt()" return the length from the TPKT header on success, and
-1 on failure, and return the offset past the TPKT header via a pointer
(so clients don't have to know that the TPKT header is 4 bytes long).
svn path=/trunk/; revision=4669
2002-02-02 02:51:20 +00:00
|
|
|
* $Id: packet-tpkt.h,v 1.5 2002/02/02 02:51:20 guy Exp $
|
2001-06-12 06:32:39 +00:00
|
|
|
*
|
2000-10-19 06:45:11 +00:00
|
|
|
* Ethereal - Network traffic analyzer
|
2001-06-12 06:32:39 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
2000-10-19 06:45:11 +00:00
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2001-03-28 07:49:41 +00:00
|
|
|
/*
|
|
|
|
* Check whether this could be a TPKT-encapsulated PDU.
|
Clean up the heuristic code in the Q.931 dissector. If it's a heuristic
dissector, it's looking for Q.931 encapsulated inside TPKT, so it
shouldn't check whether the first byte is NLPID_Q_931 or not, as it
*won't* be NLPID_Q_931, it'll be 3, for the TPKT version. It should
first check whether "is_tpkt()" thinks it's a TPKT packet, and then
check that the packet has at least 3 bytes past the TPKT header, then
check the first byte in the payload to see whether it's NLPID_Q_931. If
that all succeeds, treat it as Q.931 inside TPKT.
Make "is_tpkt()" return the length from the TPKT header on success, and
-1 on failure, and return the offset past the TPKT header via a pointer
(so clients don't have to know that the TPKT header is 4 bytes long).
svn path=/trunk/; revision=4669
2002-02-02 02:51:20 +00:00
|
|
|
* Returns -1 if it's not.
|
|
|
|
* Sets "*offset" to the offset of the first byte past the TPKT header,
|
|
|
|
* and returns the length from the TPKT header, if it is.
|
2001-03-28 07:49:41 +00:00
|
|
|
*/
|
Clean up the heuristic code in the Q.931 dissector. If it's a heuristic
dissector, it's looking for Q.931 encapsulated inside TPKT, so it
shouldn't check whether the first byte is NLPID_Q_931 or not, as it
*won't* be NLPID_Q_931, it'll be 3, for the TPKT version. It should
first check whether "is_tpkt()" thinks it's a TPKT packet, and then
check that the packet has at least 3 bytes past the TPKT header, then
check the first byte in the payload to see whether it's NLPID_Q_931. If
that all succeeds, treat it as Q.931 inside TPKT.
Make "is_tpkt()" return the length from the TPKT header on success, and
-1 on failure, and return the offset past the TPKT header via a pointer
(so clients don't have to know that the TPKT header is 4 bytes long).
svn path=/trunk/; revision=4669
2002-02-02 02:51:20 +00:00
|
|
|
int is_tpkt( tvbuff_t *tvb, int *offset );
|
2001-03-28 07:49:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Dissect the TPKT header; called from the TPKT dissector, as well as
|
|
|
|
* from dissectors such as the dissector for Q.931-over-TCP.
|
|
|
|
*
|
2001-03-28 08:06:07 +00:00
|
|
|
* Returns -1 if TPKT isn't enabled, otherwise returns the PDU length
|
|
|
|
* from the TPKT header.
|
2001-03-28 07:49:41 +00:00
|
|
|
*/
|
Clean up the heuristic code in the Q.931 dissector. If it's a heuristic
dissector, it's looking for Q.931 encapsulated inside TPKT, so it
shouldn't check whether the first byte is NLPID_Q_931 or not, as it
*won't* be NLPID_Q_931, it'll be 3, for the TPKT version. It should
first check whether "is_tpkt()" thinks it's a TPKT packet, and then
check that the packet has at least 3 bytes past the TPKT header, then
check the first byte in the payload to see whether it's NLPID_Q_931. If
that all succeeds, treat it as Q.931 inside TPKT.
Make "is_tpkt()" return the length from the TPKT header on success, and
-1 on failure, and return the offset past the TPKT header via a pointer
(so clients don't have to know that the TPKT header is 4 bytes long).
svn path=/trunk/; revision=4669
2002-02-02 02:51:20 +00:00
|
|
|
int dissect_tpkt_header( tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|
|
|
proto_tree *tree );
|