]>
Commit | Line | Data |
---|---|---|
eb5d44eb | 1 | /* |
2 | * IS-IS Rout(e)ing protocol - isis_circuit.h | |
3 | * | |
4 | * Copyright (C) 2001,2002 Sampo Saaristo | |
d62a17ae | 5 | * Tampere University of Technology |
eb5d44eb | 6 | * Institute of Communications Engineering |
7 | * | |
d62a17ae | 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) | |
eb5d44eb | 11 | * any later version. |
12 | * | |
d62a17ae | 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 | |
eb5d44eb | 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" |
d1be6968 | 29 | #include "prefix.h" |
64dd3ffe | 30 | #include "ferr.h" |
65f9a9a8 DL |
31 | |
32 | #include "isis_constants.h" | |
33 | #include "isis_common.h" | |
91283e76 | 34 | |
58e16237 CF |
35 | struct isis_lsp; |
36 | ||
d62a17ae | 37 | struct password { |
38 | struct password *next; | |
39 | int len; | |
d7c0a89a | 40 | uint8_t *pass; |
eb5d44eb | 41 | }; |
42 | ||
d62a17ae | 43 | struct metric { |
d7c0a89a QY |
44 | uint8_t metric_default; |
45 | uint8_t metric_error; | |
46 | uint8_t metric_expense; | |
47 | uint8_t metric_delay; | |
eb5d44eb | 48 | }; |
49 | ||
d62a17ae | 50 | struct isis_bcast_info { |
d7c0a89a | 51 | uint8_t snpa[ETH_ALEN]; /* SNPA of this circuit */ |
d62a17ae | 52 | char run_dr_elect[2]; /* Should we run dr election ? */ |
53 | struct thread *t_run_dr[2]; /* DR election thread */ | |
54 | struct thread *t_send_lan_hello[2]; /* send LAN IIHs in this thread */ | |
55 | struct list *adjdb[2]; /* adjacency dbs */ | |
56 | struct list *lan_neighs[2]; /* list of lx neigh snpa */ | |
57 | char is_dr[2]; /* Are we level x DR ? */ | |
d7c0a89a QY |
58 | uint8_t l1_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-1 DR */ |
59 | uint8_t l2_desig_is[ISIS_SYS_ID_LEN + 1]; /* level-2 DR */ | |
d62a17ae | 60 | struct thread *t_refresh_pseudo_lsp[2]; /* refresh pseudo-node LSPs */ |
eb5d44eb | 61 | }; |
62 | ||
d62a17ae | 63 | struct isis_p2p_info { |
64 | struct isis_adjacency *neighbor; | |
65 | struct thread *t_send_p2p_hello; /* send P2P IIHs in this thread */ | |
eb5d44eb | 66 | }; |
67 | ||
d62a17ae | 68 | struct isis_circuit { |
69 | int state; | |
d7c0a89a | 70 | uint8_t circuit_id; /* l1/l2 bcast CircuitID */ |
d62a17ae | 71 | struct isis_area *area; /* back pointer to the area */ |
72 | struct interface *interface; /* interface info from z */ | |
73 | int fd; /* IS-IS l1/2 socket */ | |
74 | int sap_length; /* SAP length for DLPI */ | |
75 | struct nlpids nlpids; | |
76 | /* | |
77 | * Threads | |
78 | */ | |
79 | struct thread *t_read; | |
80 | struct thread *t_send_csnp[2]; | |
81 | struct thread *t_send_psnp[2]; | |
58e16237 | 82 | struct thread *t_send_lsp; |
9b39405f CF |
83 | struct isis_tx_queue *tx_queue; |
84 | ||
d62a17ae | 85 | /* there is no real point in two streams, just for programming kicker */ |
d7c0a89a | 86 | int (*rx)(struct isis_circuit *circuit, uint8_t *ssnpa); |
d62a17ae | 87 | struct stream *rcv_stream; /* Stream for receiving */ |
88 | int (*tx)(struct isis_circuit *circuit, int level); | |
89 | struct stream *snd_stream; /* Stream for sending */ | |
90 | int idx; /* idx in S[RM|SN] flags */ | |
3f045a08 JB |
91 | #define CIRCUIT_T_UNKNOWN 0 |
92 | #define CIRCUIT_T_BROADCAST 1 | |
93 | #define CIRCUIT_T_P2P 2 | |
94 | #define CIRCUIT_T_LOOPBACK 3 | |
d62a17ae | 95 | int circ_type; /* type of the physical interface */ |
96 | int circ_type_config; /* config type of the physical interface */ | |
97 | union { | |
98 | struct isis_bcast_info bc; | |
99 | struct isis_p2p_info p2p; | |
100 | } u; | |
d7c0a89a | 101 | uint8_t priority[2]; /* l1/2 IS configured priority */ |
d62a17ae | 102 | int pad_hellos; /* add padding to Hello PDUs ? */ |
103 | char ext_domain; /* externalDomain (boolean) */ | |
104 | int lsp_regenerate_pending[ISIS_LEVELS]; | |
105 | /* | |
106 | * Configurables | |
107 | */ | |
108 | struct isis_passwd passwd; /* Circuit rx/tx password */ | |
109 | int is_type; /* circuit is type == level of circuit | |
110 | * differentiated from circuit type (media) */ | |
ef020087 CF |
111 | uint32_t hello_interval[2]; /* hello-interval in seconds */ |
112 | uint16_t hello_multiplier[2]; /* hello-multiplier */ | |
113 | uint16_t csnp_interval[2]; /* csnp-interval in seconds */ | |
114 | uint16_t psnp_interval[2]; /* psnp-interval in seconds */ | |
d7c0a89a QY |
115 | uint8_t metric[2]; |
116 | uint32_t te_metric[2]; | |
d62a17ae | 117 | struct mpls_te_circuit |
118 | *mtc; /* Support for MPLS-TE parameters - see isis_te.[c,h] */ | |
119 | int ip_router; /* Route IP ? */ | |
120 | int is_passive; /* Is Passive ? */ | |
121 | struct list *mt_settings; /* IS-IS MT Settings */ | |
122 | struct list *ip_addrs; /* our IP addresses */ | |
123 | int ipv6_router; /* Route IPv6 ? */ | |
124 | struct list *ipv6_link; /* our link local IPv6 addresses */ | |
125 | struct list *ipv6_non_link; /* our non-link local IPv6 addresses */ | |
d7c0a89a | 126 | uint16_t upadjcount[2]; |
3f045a08 | 127 | #define ISIS_CIRCUIT_FLAPPED_AFTER_SPF 0x01 |
d7c0a89a | 128 | uint8_t flags; |
58e5d748 | 129 | bool disable_threeway_adj; |
d62a17ae | 130 | /* |
131 | * Counters as in 10589--11.2.5.9 | |
132 | */ | |
d7c0a89a QY |
133 | uint32_t adj_state_changes; /* changesInAdjacencyState */ |
134 | uint32_t init_failures; /* intialisationFailures */ | |
135 | uint32_t ctrl_pdus_rxed; /* controlPDUsReceived */ | |
136 | uint32_t ctrl_pdus_txed; /* controlPDUsSent */ | |
137 | uint32_t | |
d62a17ae | 138 | desig_changes[2]; /* lanLxDesignatedIntermediateSystemChanges */ |
d7c0a89a | 139 | uint32_t rej_adjacencies; /* rejectedAdjacencies */ |
d62a17ae | 140 | |
141 | QOBJ_FIELDS | |
eb5d44eb | 142 | }; |
676a4ea3 | 143 | DECLARE_QOBJ_TYPE(isis_circuit) |
eb5d44eb | 144 | |
d62a17ae | 145 | void isis_circuit_init(void); |
146 | struct isis_circuit *isis_circuit_new(void); | |
147 | void isis_circuit_del(struct isis_circuit *circuit); | |
148 | struct isis_circuit *circuit_lookup_by_ifp(struct interface *ifp, | |
149 | struct list *list); | |
150 | struct isis_circuit *circuit_scan_by_ifp(struct interface *ifp); | |
151 | void isis_circuit_configure(struct isis_circuit *circuit, | |
152 | struct isis_area *area); | |
153 | void isis_circuit_deconfigure(struct isis_circuit *circuit, | |
154 | struct isis_area *area); | |
155 | void isis_circuit_if_add(struct isis_circuit *circuit, struct interface *ifp); | |
156 | void isis_circuit_if_del(struct isis_circuit *circuit, struct interface *ifp); | |
157 | void isis_circuit_if_bind(struct isis_circuit *circuit, struct interface *ifp); | |
158 | void isis_circuit_if_unbind(struct isis_circuit *circuit, | |
159 | struct interface *ifp); | |
160 | void isis_circuit_add_addr(struct isis_circuit *circuit, | |
161 | struct connected *conn); | |
162 | void isis_circuit_del_addr(struct isis_circuit *circuit, | |
163 | struct connected *conn); | |
164 | void isis_circuit_prepare(struct isis_circuit *circuit); | |
165 | int isis_circuit_up(struct isis_circuit *circuit); | |
166 | void isis_circuit_down(struct isis_circuit *); | |
167 | void circuit_update_nlpids(struct isis_circuit *circuit); | |
168 | void isis_circuit_print_vty(struct isis_circuit *circuit, struct vty *vty, | |
169 | char detail); | |
b20ccb3a CF |
170 | size_t isis_circuit_pdu_size(struct isis_circuit *circuit); |
171 | void isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream); | |
3f045a08 | 172 | |
d62a17ae | 173 | struct isis_circuit *isis_circuit_create(struct isis_area *area, |
174 | struct interface *ifp); | |
175 | void isis_circuit_af_set(struct isis_circuit *circuit, bool ip_router, | |
176 | bool ipv6_router); | |
64dd3ffe | 177 | ferr_r isis_circuit_passive_set(struct isis_circuit *circuit, bool passive); |
d62a17ae | 178 | void isis_circuit_is_type_set(struct isis_circuit *circuit, int is_type); |
996c9314 | 179 | ferr_r isis_circuit_circ_type_set(struct isis_circuit *circuit, int circ_type); |
d62a17ae | 180 | |
64dd3ffe DL |
181 | ferr_r isis_circuit_metric_set(struct isis_circuit *circuit, int level, |
182 | int metric); | |
d62a17ae | 183 | |
64dd3ffe DL |
184 | ferr_r isis_circuit_passwd_unset(struct isis_circuit *circuit); |
185 | ferr_r isis_circuit_passwd_cleartext_set(struct isis_circuit *circuit, | |
186 | const char *passwd); | |
187 | ferr_r isis_circuit_passwd_hmac_md5_set(struct isis_circuit *circuit, | |
188 | const char *passwd); | |
d62a17ae | 189 | |
190 | int isis_circuit_mt_enabled_set(struct isis_circuit *circuit, uint16_t mtid, | |
191 | bool enabled); | |
064f4896 | 192 | |
eb5d44eb | 193 | #endif /* _ZEBRA_ISIS_CIRCUIT_H */ |