More updates from Hannes Gredler.
[obnox/wireshark/wip.git] / packet-isis.h
1 /* packet-isis.h
2  * Defines and such for core isis protcol decode.
3  *
4  * $Id: packet-isis.h,v 1.4 2000/04/17 01:36:31 guy Exp $
5  * Stuart Stanley <stuarts@mxmail.net>
6  *
7  * Ethereal - Network traffic analyzer
8  * By Gerald Combs <gerald@zing.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * 
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  * 
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  * 
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  *
26  *
27  */
28
29 #ifndef _PACKET_ISIS_H
30 #define _PACKET_ISIS_H
31
32 /*
33  * The version we support is 1
34  */
35 #define ISIS_REQUIRED_VERSION 1
36
37 /*
38  * ISIS type field values
39  */
40 #define ISIS_TYPE_L1_HELLO  15
41 #define ISIS_TYPE_L2_HELLO  16
42 #define ISIS_TYPE_PTP_HELLO 17
43 #define ISIS_TYPE_L1_LSP    18
44 #define ISIS_TYPE_L2_LSP    20
45 #define ISIS_TYPE_L1_CSNP   24
46 #define ISIS_TYPE_L2_CSNP   25
47 #define ISIS_TYPE_L1_PSNP   26
48 #define ISIS_TYPE_L2_PSNP   27
49
50 #define ISIS_TYPE_MASK      0x1f
51 #define ISIS_R8_MASK        0x80
52 #define ISIS_R7_MASK        0x40
53 #define ISIS_R6_MASK        0x20
54
55 /*
56  * The common first 8 octets of the ISIS protocol header.
57  */
58 typedef struct {
59   guint8 isis_irpd;  /* Intradomain Routing Protocol Descriminator: 0x83 */
60   guint8 isis_header_length;  /* header length in octets */
61   guint8 isis_version;        /* isis version, must be 0x01 */
62   guint8 isis_system_id_len;  /* length of the system ID fields */
63   guint8 isis_type_reserved;  /* packet type & reserved */
64   guint8 isis_version2;       /* another version(?!), must be 0x01 */
65   guint8 isis_reserved;       /* reserved, must be 0 */
66   guint8 isis_max_area_adr;   /* Maximum Number of AREA Addresses permitted */
67 } isis_hdr_t;                 /* for this AREA. Value of 0 allows 3 Addresses */
68
69 #define isis_type isis_type_reserved&ISIS_TYPE_MASK
70 #define isis_r8   isis_type_reserved&ISIS_R8_MASK
71 #define isis_r7   isis_type_reserved&ISIS_R7_MASK
72 #define isis_r6   isis_type_reserved&ISIS_R6_MASK
73
74
75 /*
76  * published API functions
77  */
78
79 extern char *isis_address_to_string ( const u_char *pd, int offset, int len );
80 extern void isis_dissect_unknown( int offset, guint length, proto_tree *tree,
81                                   frame_data *fd, char *fmat, ...);
82
83 #endif /* _PACKET_ISIS_H */