2 * Defines and such for LSP and their CLV decodes
4 * $Id: packet-isis-lsp.h,v 1.1 1999/12/15 04:34:18 guy Exp $
5 * Stuart Stanley <stuarts@mxmail.net>
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@zing.org>
9 * Copyright 1998 Gerald Combs
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.
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.
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.
29 #ifndef _PACKET_ISIS_LSP_H
30 #define _PACKET_ISIS_LSP_H
33 * Declare what an LSP id looks like (used by LSP and sequence number
37 guint8 source_id[6]; /* source id part */
38 guint8 psuodonode_id; /* psn id */
39 guint8 lsp_number; /* frag number */
44 * Declare L1/L2 LSP base header.
47 guint8 isis_lsp_pdu_length[2]; /* pdu length including hdr */
48 guint8 isis_lsp_remaining_life[2]; /* seconds before expiration */
49 isis_lsp_id_t isis_lsp_id;
50 guint8 isis_lsp_sequence_number[4];
51 guint8 isis_lsp_checksum[2];
52 guint8 isis_lsp_type_block; /* partition/att/hip/istype */
55 #define ISIS_LSP_PARTITION_MASK 0x80
56 #define ISIS_LSP_ATT_MASK 0x78
57 #define ISIS_LSP_ATT_SHIFT 3
58 #define ISIS_LSP_HIPPITY_MASK 0x04
59 #define ISIS_LSP_IS_TYPE_MASK 0x03
61 #define ISIS_LSP_PARTITION(x) (x&ISIS_LSP_PARTITION_MASK)
62 #define ISIS_LSP_ATT(x) ((x&ISIS_LSP_ATT_MASK)>>ISIS_LSP_ATT_SHIFT)
63 #define ISIS_LSP_HIPPITY(x) (x&ISIS_LSP_HIPPITY_MASK)
64 #define ISIS_LSP_IS_TYPE(x) (x&ISIS_LSP_IS_TYPE_MASK)
66 #define ISIS_LSP_TYPE_UNUSED0 0
67 #define ISIS_LSP_TYPE_LEVEL_1 1
68 #define ISIS_LSP_TYPE_UNUSED2 2
69 #define ISIS_LSP_TYPE_LEVEL_2 3
71 #define ISIS_LSP_CLV_METRIC_SUPPORTED(x) ((x)&0xf0)
72 #define ISIS_LSP_CLV_METRIC_RESERVED(x) ((x)&0x40)
73 #define ISIS_LSP_CLV_METRIC_VALUE(x) ((x)&0x3f)
76 * detail clv information on L1 lsp packets
78 #define ISIS_CLV_L1_LSP_AREA_ADDRESS 1
79 #define ISIS_CLV_L1_LSP_IS_NEIGHBORS 2
80 #define ISIS_CLV_L1_LSP_ES_NEIGHBORS 3
81 #define ISIS_CLV_L1_LSP_IP_INT_REACHABLE 128
82 #define ISIS_CLV_L1_LSP_NLPID 129
83 #define ISIS_CLV_L1_LSP_IP_INTERFACE_ADDR 132
85 * Note, the spec say 133, but everyone seems to use 10. Any clue on why
86 * this is would be appreciated!
88 #define ISIS_CLV_L1_LSP_AUTHENTICATION_NS 10 /* non spec */
89 #define ISIS_CLV_L1_LSP_AUTHENTICATION 133
92 * detail clv information on L2 lsp packets
94 #define ISIS_CLV_L2_LSP_AREA_ADDRESS 1
95 #define ISIS_CLV_L2_LSP_IS_NEIGHBORS 2
96 #define ISIS_CLV_L2_LSP_PARTITION_DIS 4
97 #define ISIS_CLV_L2_LSP_PREFIX_NEIGHBORS 5
98 #define ISIS_CLV_L2_LSP_IP_INT_REACHABLE 128
99 #define ISIS_CLV_L2_LSP_NLPID 129
100 #define ISIS_CLV_L2_LSP_IP_EXT_REACHABLE 130
101 #define ISIS_CLV_L2_LSP_IDRP_INFO 131
102 #define ISIS_CLV_L2_LSP_IP_INTERFACE_ADDR 132
104 * Note, the spec say 133, but everyone seems to use 10. Any clue on why
105 * this is would be appreciated!
107 #define ISIS_CLV_L2_LSP_AUTHENTICATION_NS 10 /*non spec */
108 #define ISIS_CLV_L2_LSP_AUTHENTICATION 133
111 * Published API functions. NOTE, this are "local" API functions and
112 * are only valid from with isis decodes.
114 extern void isis_dissect_isis_lsp(int hello_type, int header_length,
115 const u_char *pd, int offset, frame_data *fd, proto_tree *tree);
116 extern void isis_lsp_decode_lsp_id(char *tstr, proto_tree *tree, int offset,
119 #endif /* _PACKET_ISIS_LSP_H */