]> git.proxmox.com Git - mirror_frr.git/blame - isisd/isis_circuit.h
*: make consistent & update GPLv2 file headers
[mirror_frr.git] / isisd / isis_circuit.h
CommitLineData
eb5d44eb 1/*
2 * IS-IS Rout(e)ing protocol - isis_circuit.h
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
896014f4
DL
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
eb5d44eb 21 */
22
23#ifndef ISIS_CIRCUIT_H
24#define ISIS_CIRCUIT_H
25
91283e76 26#include "vty.h"
65f9a9a8 27#include "if.h"
676a4ea3 28#include "qobj.h"
65f9a9a8
DL
29
30#include "isis_constants.h"
31#include "isis_common.h"
91283e76 32
eb5d44eb 33#define CIRCUIT_MAX 255
34
f390d2c7 35struct password
36{
eb5d44eb 37 struct password *next;
f390d2c7 38 int len;
39 u_char *pass;
eb5d44eb 40};
41
f390d2c7 42struct metric
43{
eb5d44eb 44 u_char metric_default;
45 u_char metric_error;
46 u_char metric_expense;
47 u_char metric_delay;
48};
49
f390d2c7 50struct isis_bcast_info
51{
52 u_char snpa[ETH_ALEN]; /* SNPA of this circuit */
53 char run_dr_elect[2]; /* Should we run dr election ? */
54 struct thread *t_run_dr[2]; /* DR election thread */
55 struct thread *t_send_lan_hello[2]; /* send LAN IIHs in this thread */
56 struct list *adjdb[2]; /* adjacency dbs */
57 struct list *lan_neighs[2]; /* list of lx neigh snpa */
58 char is_dr[2]; /* Are we level x DR ? */
59 u_char l1_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-1 DR */
60 u_char l2_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-2 DR */
61 struct thread *t_refresh_pseudo_lsp[2]; /* refresh pseudo-node LSPs */
eb5d44eb 62};
63
f390d2c7 64struct isis_p2p_info
65{
66 struct isis_adjacency *neighbor;
67 struct thread *t_send_p2p_hello; /* send P2P IIHs in this thread */
eb5d44eb 68};
69
f390d2c7 70struct isis_circuit
71{
eb5d44eb 72 int state;
f390d2c7 73 u_char circuit_id; /* l1/l2 p2p/bcast CircuitID */
74 struct isis_area *area; /* back pointer to the area */
75 struct interface *interface; /* interface info from z */
76 int fd; /* IS-IS l1/2 socket */
238497fc 77 int sap_length; /* SAP length for DLPI */
f390d2c7 78 struct nlpids nlpids;
eb5d44eb 79 /*
80 * Threads
81 */
82 struct thread *t_read;
83 struct thread *t_send_csnp[2];
84 struct thread *t_send_psnp[2];
f390d2c7 85 struct list *lsp_queue; /* LSPs to be txed (both levels) */
3f045a08
JB
86 time_t lsp_queue_last_cleared;/* timestamp used to enforce transmit interval;
87 * for scalability, use one timestamp per
88 * circuit, instead of one per lsp per circuit
89 */
eb5d44eb 90 /* there is no real point in two streams, just for programming kicker */
f390d2c7 91 int (*rx) (struct isis_circuit * circuit, u_char * ssnpa);
92 struct stream *rcv_stream; /* Stream for receiving */
93 int (*tx) (struct isis_circuit * circuit, int level);
94 struct stream *snd_stream; /* Stream for sending */
95 int idx; /* idx in S[RM|SN] flags */
3f045a08
JB
96#define CIRCUIT_T_UNKNOWN 0
97#define CIRCUIT_T_BROADCAST 1
98#define CIRCUIT_T_P2P 2
99#define CIRCUIT_T_LOOPBACK 3
f390d2c7 100 int circ_type; /* type of the physical interface */
3f045a08 101 int circ_type_config; /* config type of the physical interface */
f390d2c7 102 union
103 {
eb5d44eb 104 struct isis_bcast_info bc;
105 struct isis_p2p_info p2p;
106 } u;
3f045a08
JB
107 u_char priority[2]; /* l1/2 IS configured priority */
108 int pad_hellos; /* add padding to Hello PDUs ? */
f390d2c7 109 char ext_domain; /* externalDomain (boolean) */
3f045a08 110 int lsp_regenerate_pending[ISIS_LEVELS];
eb5d44eb 111 /*
112 * Configurables
113 */
f390d2c7 114 struct isis_passwd passwd; /* Circuit rx/tx password */
3f045a08 115 int is_type; /* circuit is type == level of circuit
f8c06e2c 116 * differentiated from circuit type (media) */
f390d2c7 117 u_int32_t hello_interval[2]; /* l1HelloInterval in msecs */
118 u_int16_t hello_multiplier[2]; /* l1HelloMultiplier */
119 u_int16_t csnp_interval[2]; /* level-1 csnp-interval in seconds */
120 u_int16_t psnp_interval[2]; /* level-1 psnp-interval in seconds */
47a928fb 121 u_int8_t metric[2];
f21fb272 122 u_int32_t te_metric[2];
f8c06e2c 123 struct mpls_te_circuit *mtc; /* Support for MPLS-TE parameters - see isis_te.[c,h] */
f390d2c7 124 int ip_router; /* Route IP ? */
3f045a08 125 int is_passive; /* Is Passive ? */
064f4896 126 struct list *mt_settings; /* IS-IS MT Settings */
f390d2c7 127 struct list *ip_addrs; /* our IP addresses */
f390d2c7 128 int ipv6_router; /* Route IPv6 ? */
129 struct list *ipv6_link; /* our link local IPv6 addresses */
130 struct list *ipv6_non_link; /* our non-link local IPv6 addresses */
eb5d44eb 131 u_int16_t upadjcount[2];
3f045a08
JB
132#define ISIS_CIRCUIT_FLAPPED_AFTER_SPF 0x01
133 u_char flags;
eb5d44eb 134 /*
135 * Counters as in 10589--11.2.5.9
136 */
f390d2c7 137 u_int32_t adj_state_changes; /* changesInAdjacencyState */
138 u_int32_t init_failures; /* intialisationFailures */
139 u_int32_t ctrl_pdus_rxed; /* controlPDUsReceived */
140 u_int32_t ctrl_pdus_txed; /* controlPDUsSent */
141 u_int32_t desig_changes[2]; /* lanLxDesignatedIntermediateSystemChanges */
142 u_int32_t rej_adjacencies; /* rejectedAdjacencies */
676a4ea3
DL
143
144 QOBJ_FIELDS
eb5d44eb 145};
676a4ea3 146DECLARE_QOBJ_TYPE(isis_circuit)
eb5d44eb 147
f390d2c7 148void isis_circuit_init (void);
149struct isis_circuit *isis_circuit_new (void);
3f045a08 150void isis_circuit_del (struct isis_circuit *circuit);
f390d2c7 151struct isis_circuit *circuit_lookup_by_ifp (struct interface *ifp,
152 struct list *list);
153struct isis_circuit *circuit_scan_by_ifp (struct interface *ifp);
f390d2c7 154void isis_circuit_configure (struct isis_circuit *circuit,
155 struct isis_area *area);
f390d2c7 156void isis_circuit_deconfigure (struct isis_circuit *circuit,
157 struct isis_area *area);
f390d2c7 158void isis_circuit_if_add (struct isis_circuit *circuit,
159 struct interface *ifp);
3f045a08
JB
160void isis_circuit_if_del (struct isis_circuit *circuit,
161 struct interface *ifp);
162void isis_circuit_if_bind (struct isis_circuit *circuit,
163 struct interface *ifp);
164void isis_circuit_if_unbind (struct isis_circuit *circuit,
165 struct interface *ifp);
f390d2c7 166void isis_circuit_add_addr (struct isis_circuit *circuit,
167 struct connected *conn);
168void isis_circuit_del_addr (struct isis_circuit *circuit,
169 struct connected *conn);
5904f19f 170void isis_circuit_prepare (struct isis_circuit *circuit);
3f045a08
JB
171int isis_circuit_up (struct isis_circuit *circuit);
172void isis_circuit_down (struct isis_circuit *);
173void circuit_update_nlpids (struct isis_circuit *circuit);
174void isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty,
175 char detail);
b20ccb3a
CF
176size_t isis_circuit_pdu_size(struct isis_circuit *circuit);
177void isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream);
3f045a08 178
65f9a9a8
DL
179struct isis_circuit *isis_circuit_create (struct isis_area *area, struct interface *ifp);
180void isis_circuit_af_set (struct isis_circuit *circuit, bool ip_router, bool ipv6_router);
181int isis_circuit_passive_set (struct isis_circuit *circuit, bool passive);
182void isis_circuit_is_type_set (struct isis_circuit *circuit, int is_type);
183int isis_circuit_circ_type_set (struct isis_circuit *circuit, int circ_type);
184
185int isis_circuit_metric_set (struct isis_circuit *circuit, int level, int metric);
186
50c7d14a
CF
187int isis_circuit_passwd_unset (struct isis_circuit *circuit);
188int isis_circuit_passwd_cleartext_set (struct isis_circuit *circuit, const char *passwd);
189int isis_circuit_passwd_hmac_md5_set (struct isis_circuit *circuit, const char *passwd);
190
064f4896
CF
191int isis_circuit_mt_enabled_set (struct isis_circuit *circuit, uint16_t mtid, bool enabled);
192
eb5d44eb 193#endif /* _ZEBRA_ISIS_CIRCUIT_H */