2 * IS-IS Rout(e)ing protocol - isis_adjacency.h
3 * IS-IS adjacency handling
5 * Copyright (C) 2001,2002 Sampo Saaristo
6 * Tampere University of Technology
7 * Institute of Communications Engineering
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public Licenseas published by the Free
12 * Software Foundation; either version 2 of the License, or (at your option)
15 * This program is distributed in the hope that it will be useful,but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
20 * You should have received a copy of the GNU General Public License along
21 * with this program; see the file COPYING; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #ifndef _ZEBRA_ISIS_ADJACENCY_H
26 #define _ZEBRA_ISIS_ADJACENCY_H
35 enum isis_system_type
{
45 ISIS_ADJ_INITIALIZING
,
51 * we use the following codes to give an indication _why_
52 * a specific adjacency is up or down
54 enum isis_adj_updown_reason
{
55 ISIS_ADJ_REASON_SEENSELF
,
56 ISIS_ADJ_REASON_AREA_MISMATCH
,
57 ISIS_ADJ_REASON_HOLDTIMER_EXPIRED
,
58 ISIS_ADJ_REASON_AUTH_FAILED
,
59 ISIS_ADJ_REASON_CHECKSUM_FAILED
62 #define DIS_RECORDS 8 /* keep the last 8 DIS state changes on record */
64 struct isis_dis_record
{
65 int dis
; /* is our neighbor the DIS ? */
66 time_t last_dis_change
; /* timestamp for last dis change */
69 struct isis_adjacency
{
70 u_char snpa
[ETH_ALEN
]; /* NeighbourSNPAAddress */
71 u_char sysid
[ISIS_SYS_ID_LEN
]; /* neighbourSystemIdentifier */
72 u_char lanid
[ISIS_SYS_ID_LEN
+ 1]; /* LAN id on bcast circuits */
73 int dischanges
[ISIS_LEVELS
]; /* how many DIS changes ? */
74 /* an array of N levels for M records */
75 struct isis_dis_record dis_record
[DIS_RECORDS
* ISIS_LEVELS
];
76 enum isis_adj_state adj_state
; /* adjacencyState */
77 enum isis_adj_usage adj_usage
; /* adjacencyUsage */
78 struct list
*area_addrs
; /* areaAdressesOfNeighbour */
79 struct nlpids nlpids
; /* protocols spoken ... */
80 struct list
*ipv4_addrs
;
81 struct in_addr router_address
;
82 struct list
*ipv6_addrs
;
83 struct in6_addr router_address6
;
84 u_char prio
[ISIS_LEVELS
]; /* priorityOfNeighbour for DIS */
85 int circuit_t
; /* from hello PDU hdr */
86 int level
; /* level (1 or 2) */
87 enum isis_system_type sys_type
; /* neighbourSystemType */
88 u_int16_t hold_time
; /* entryRemainingTime */
90 u_int32_t last_flap
; /* last time the adj flapped */
91 int flaps
; /* number of adjacency flaps */
92 struct thread
*t_expire
; /* expire after hold_time */
93 struct isis_circuit
*circuit
; /* back pointer */
94 uint16_t *mt_set
; /* Topologies this adjacency is valid for */
95 unsigned int mt_count
; /* Number of entries in mt_set */
98 struct isis_adjacency
*isis_adj_lookup(const u_char
*sysid
, struct list
*adjdb
);
99 struct isis_adjacency
*isis_adj_lookup_snpa(const u_char
*ssnpa
,
101 struct isis_adjacency
*isis_new_adj(const u_char
*id
, const u_char
*snpa
,
102 int level
, struct isis_circuit
*circuit
);
103 void isis_delete_adj(void *adj
);
104 void isis_adj_state_change(struct isis_adjacency
*adj
,
105 enum isis_adj_state state
, const char *reason
);
106 void isis_adj_print(struct isis_adjacency
*adj
);
107 int isis_adj_expire(struct thread
*thread
);
108 void isis_adj_print_vty(struct isis_adjacency
*adj
, struct vty
*vty
,
110 void isis_adj_build_neigh_list(struct list
*adjdb
, struct list
*list
);
111 void isis_adj_build_up_list(struct list
*adjdb
, struct list
*list
);
112 int isis_adj_usage2levels(enum isis_adj_usage usage
);
114 #endif /* ISIS_ADJACENCY_H */