]> git.proxmox.com Git - mirror_frr.git/blame - ospf6d/ospf6_interface.h
lib: drop off "masters" list on master_free()
[mirror_frr.git] / ospf6d / ospf6_interface.h
CommitLineData
718e3744 1/*
508e53e2 2 * Copyright (C) 2003 Yasuhiro Ohara
718e3744 3 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
896014f4
DL
16 * You should have received a copy of the GNU General Public License along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
718e3744 19 */
20
21#ifndef OSPF6_INTERFACE_H
22#define OSPF6_INTERFACE_H
23
ae19c240 24#include "qobj.h"
3012671f 25#include "hook.h"
508e53e2 26#include "if.h"
718e3744 27
508e53e2 28/* Debug option */
29extern unsigned char conf_debug_ospf6_interface;
30#define OSPF6_DEBUG_INTERFACE_ON() \
31 (conf_debug_ospf6_interface = 1)
32#define OSPF6_DEBUG_INTERFACE_OFF() \
33 (conf_debug_ospf6_interface = 0)
34#define IS_OSPF6_DEBUG_INTERFACE \
35 (conf_debug_ospf6_interface)
718e3744 36
508e53e2 37/* Interface structure */
718e3744 38struct ospf6_interface
39{
40 /* IF info from zebra */
41 struct interface *interface;
42
43 /* back pointer */
44 struct ospf6_area *area;
45
46 /* list of ospf6 neighbor */
52dc7ee6 47 struct list *neighbor_list;
718e3744 48
49 /* linklocal address of this I/F */
508e53e2 50 struct in6_addr *linklocal_addr;
718e3744 51
508e53e2 52 /* Interface ID; use interface->ifindex */
718e3744 53
54 /* ospf6 instance id */
55 u_char instance_id;
56
57 /* I/F transmission delay */
58 u_int32_t transdelay;
59
c5926a92
DD
60 /* Network Type */
61 u_char type;
62
718e3744 63 /* Router Priority */
64 u_char priority;
65
508e53e2 66 /* Time Interval */
718e3744 67 u_int16_t hello_interval;
68 u_int16_t dead_interval;
69 u_int32_t rxmt_interval;
70
3bc4f84e
VB
71 u_int32_t state_change;
72
718e3744 73 /* Cost */
74 u_int32_t cost;
75
76 /* I/F MTU */
77 u_int32_t ifmtu;
78
0c7ef48a
DS
79 /* Configured MTU */
80 u_int32_t c_ifmtu;
81
718e3744 82 /* Interface State */
83 u_char state;
84
8e370bfa
DS
85 /* Interface socket setting trial counter, resets on success */
86 u_char sso_try_cnt;
87
718e3744 88 /* OSPF6 Interface flag */
89 char flag;
90
d42306d9
DT
91 /* MTU mismatch check */
92 u_char mtu_ignore;
93
718e3744 94 /* Decision of DR Election */
508e53e2 95 u_int32_t drouter;
96 u_int32_t bdrouter;
97 u_int32_t prev_drouter;
98 u_int32_t prev_bdrouter;
718e3744 99
100 /* Linklocal LSA Database: includes Link-LSA */
101 struct ospf6_lsdb *lsdb;
6452df09 102 struct ospf6_lsdb *lsdb_self;
718e3744 103
508e53e2 104 struct ospf6_lsdb *lsupdate_list;
105 struct ospf6_lsdb *lsack_list;
718e3744 106
508e53e2 107 /* Ongoing Tasks */
108 struct thread *thread_send_hello;
109 struct thread *thread_send_lsupdate;
110 struct thread *thread_send_lsack;
718e3744 111
508e53e2 112 struct thread *thread_network_lsa;
113 struct thread *thread_link_lsa;
114 struct thread *thread_intra_prefix_lsa;
718e3744 115
508e53e2 116 struct ospf6_route_table *route_connected;
718e3744 117
508e53e2 118 /* prefix-list name to filter connected prefix */
718e3744 119 char *plist_name;
7f342629
DS
120
121 /* BFD information */
68fe91d6 122 void *bfd_info;
ae19c240
DL
123
124 QOBJ_FIELDS
718e3744 125};
ae19c240 126DECLARE_QOBJ_TYPE(ospf6_interface)
718e3744 127
508e53e2 128/* interface state */
129#define OSPF6_INTERFACE_NONE 0
130#define OSPF6_INTERFACE_DOWN 1
131#define OSPF6_INTERFACE_LOOPBACK 2
132#define OSPF6_INTERFACE_WAITING 3
133#define OSPF6_INTERFACE_POINTTOPOINT 4
134#define OSPF6_INTERFACE_DROTHER 5
135#define OSPF6_INTERFACE_BDR 6
136#define OSPF6_INTERFACE_DR 7
137#define OSPF6_INTERFACE_MAX 8
138
0c083ee9 139extern const char *ospf6_interface_state_str[];
718e3744 140
508e53e2 141/* flags */
142#define OSPF6_INTERFACE_DISABLE 0x01
143#define OSPF6_INTERFACE_PASSIVE 0x02
c19543b2 144#define OSPF6_INTERFACE_NOAUTOCOST 0x04
718e3744 145
b51a3a31
VT
146/* default values */
147#define OSPF6_INTERFACE_HELLO_INTERVAL 10
148#define OSPF6_INTERFACE_DEAD_INTERVAL 40
149#define OSPF6_INTERFACE_RXMT_INTERVAL 5
150#define OSPF6_INTERFACE_COST 1
151#define OSPF6_INTERFACE_PRIORITY 1
152#define OSPF6_INTERFACE_TRANSDELAY 1
153#define OSPF6_INTERFACE_INSTANCE_ID 0
70bd3c43
DS
154#define OSPF6_INTERFACE_BANDWIDTH 10000 /* Mbps */
155#define OSPF6_REFERENCE_BANDWIDTH 100000 /* Mbps */
8e370bfa
DS
156#define OSPF6_INTERFACE_SSO_RETRY_INT 1
157#define OSPF6_INTERFACE_SSO_RETRY_MAX 5
b51a3a31 158
6b0655a2 159
718e3744 160/* Function Prototypes */
161
b892f1dd 162extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex (ifindex_t);
6ac29a51
PJ
163extern struct ospf6_interface *ospf6_interface_create (struct interface *);
164extern void ospf6_interface_delete (struct ospf6_interface *);
718e3744 165
6ac29a51
PJ
166extern void ospf6_interface_enable (struct ospf6_interface *);
167extern void ospf6_interface_disable (struct ospf6_interface *);
718e3744 168
6ac29a51
PJ
169extern void ospf6_interface_if_add (struct interface *);
170extern void ospf6_interface_if_del (struct interface *);
171extern void ospf6_interface_state_update (struct interface *);
172extern void ospf6_interface_connected_route_update (struct interface *);
508e53e2 173
174/* interface event */
6ac29a51
PJ
175extern int interface_up (struct thread *);
176extern int interface_down (struct thread *);
177extern int wait_timer (struct thread *);
178extern int backup_seen (struct thread *);
179extern int neighbor_change (struct thread *);
718e3744 180
6ac29a51 181extern void ospf6_interface_init (void);
718e3744 182
a1b11f9b
DS
183extern void install_element_ospf6_clear_interface (void);
184
6ac29a51
PJ
185extern int config_write_ospf6_debug_interface (struct vty *vty);
186extern void install_element_ospf6_debug_interface (void);
718e3744 187
3012671f
DL
188DECLARE_HOOK(ospf6_interface_change,
189 (struct ospf6_interface *oi, int state, int old_state),
190 (oi, state, old_state))
191
718e3744 192#endif /* OSPF6_INTERFACE_H */