1999-03-23 03:14:46 +00:00
|
|
|
/* packet-ip.h
|
|
|
|
* Definitions for IP packet disassembly structures and routines
|
|
|
|
*
|
2006-05-21 04:49:01 +00:00
|
|
|
* Wireshark - Network traffic analyzer
|
|
|
|
* By Gerald Combs <gerald@wireshark.org>
|
1999-03-23 03:14:46 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-03-23 03:14:46 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-03-23 03:14:46 +00:00
|
|
|
* 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.
|
2002-08-28 21:04:11 +00:00
|
|
|
*
|
1999-03-23 03:14:46 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-06-28 22:56:06 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
1999-03-23 03:14:46 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __PACKET_IP_H__
|
|
|
|
#define __PACKET_IP_H__
|
|
|
|
|
2013-03-01 23:53:11 +00:00
|
|
|
#include "ws_symbol_export.h"
|
|
|
|
|
2013-11-05 17:48:48 +00:00
|
|
|
extern int proto_ip;
|
|
|
|
|
2009-05-20 15:50:40 +00:00
|
|
|
typedef struct _ws_ip
|
2009-07-09 11:32:50 +00:00
|
|
|
{
|
2016-07-19 21:06:31 +00:00
|
|
|
guint8 ip_ver; /* 4 or 6 */
|
|
|
|
guint8 ip_tos; /* IPv4: type of service; IPv6: traffic class */
|
|
|
|
guint32 ip_flw; /* IPv4: (zero); IPv6: flow label */
|
|
|
|
guint32 ip_len; /* IPv4: total length; IPv6: payload length (minus extensions) */
|
|
|
|
guint16 ip_id; /* IPv4: identification; IPv6: (zero) */
|
|
|
|
guint16 ip_off; /* IPv4: fragment offset; IPv6: (zero) */
|
|
|
|
guint8 ip_ttl; /* IPv4: time-to-live; IPv6: hop limit */
|
|
|
|
guint8 ip_nxt; /* IPv4: protocol; IPv6: next header */
|
|
|
|
guint16 ip_sum; /* IPv4: checksum; IPv6: (zero) */
|
|
|
|
address ip_src; /* source address */
|
|
|
|
address ip_dst; /* destination address */
|
2009-05-20 15:50:40 +00:00
|
|
|
} ws_ip;
|
2003-01-22 01:16:33 +00:00
|
|
|
|
2015-09-02 00:28:18 +00:00
|
|
|
/* Differentiated Services Codepoint */
|
|
|
|
#define IPDSFIELD_DSCP_MASK 0xFC
|
|
|
|
#define IPDSFIELD_DSCP(dsfield) (((dsfield) & IPDSFIELD_DSCP_MASK) >> 2)
|
|
|
|
|
|
|
|
/* Explicit Congestion Notification */
|
|
|
|
#define IPDSFIELD_ECN_MASK 0x03
|
|
|
|
#define IPDSFIELD_ECN(dsfield) ((dsfield) & IPDSFIELD_ECN_MASK)
|
|
|
|
|
2015-12-15 00:25:31 +00:00
|
|
|
gboolean capture_ip(const guchar *, int, int, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header);
|
2015-08-15 16:55:27 +00:00
|
|
|
|
2015-04-26 03:29:30 +00:00
|
|
|
gboolean ip_try_dissect(gboolean heur_first, tvbuff_t *tvb,
|
|
|
|
packet_info *pinfo, proto_tree *tree, ws_ip *iph);
|
2000-02-15 21:06:58 +00:00
|
|
|
|
2015-09-02 00:28:18 +00:00
|
|
|
/* Export the DSCP/ECN extended value-string table for other protocols */
|
2013-03-01 23:53:11 +00:00
|
|
|
WS_DLL_PUBLIC value_string_ext dscp_vals_ext;
|
2015-09-02 00:28:18 +00:00
|
|
|
WS_DLL_PUBLIC value_string_ext ecn_vals_ext;
|
|
|
|
WS_DLL_PUBLIC value_string_ext dscp_short_vals_ext;
|
|
|
|
WS_DLL_PUBLIC value_string_ext ecn_short_vals_ext;
|
2001-12-29 00:43:55 +00:00
|
|
|
|
2015-09-02 00:28:18 +00:00
|
|
|
#endif /* __PACKET_IP_H__ */
|
2014-09-28 23:25:09 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Editor modelines - http://www.wireshark.org/tools/modelines.html
|
|
|
|
*
|
|
|
|
* Local variables:
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* tab-width: 8
|
|
|
|
* indent-tabs-mode: nil
|
|
|
|
* End:
|
|
|
|
*
|
|
|
|
* vi: set shiftwidth=4 tabstop=8 expandtab:
|
|
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
|
|
*/
|