]> git.proxmox.com Git - mirror_frr.git/blame - ospf6d/ospf6_interface.h
Support of BFD status in Quagga
[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 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22#ifndef OSPF6_INTERFACE_H
23#define OSPF6_INTERFACE_H
24
508e53e2 25#include "if.h"
718e3744 26
508e53e2 27/* Debug option */
28extern unsigned char conf_debug_ospf6_interface;
29#define OSPF6_DEBUG_INTERFACE_ON() \
30 (conf_debug_ospf6_interface = 1)
31#define OSPF6_DEBUG_INTERFACE_OFF() \
32 (conf_debug_ospf6_interface = 0)
33#define IS_OSPF6_DEBUG_INTERFACE \
34 (conf_debug_ospf6_interface)
718e3744 35
508e53e2 36/* Interface structure */
718e3744 37struct ospf6_interface
38{
39 /* IF info from zebra */
40 struct interface *interface;
41
42 /* back pointer */
43 struct ospf6_area *area;
44
45 /* list of ospf6 neighbor */
52dc7ee6 46 struct list *neighbor_list;
718e3744 47
48 /* linklocal address of this I/F */
508e53e2 49 struct in6_addr *linklocal_addr;
718e3744 50
508e53e2 51 /* Interface ID; use interface->ifindex */
718e3744 52
53 /* ospf6 instance id */
54 u_char instance_id;
55
56 /* I/F transmission delay */
57 u_int32_t transdelay;
58
c5926a92
DD
59 /* Network Type */
60 u_char type;
61
718e3744 62 /* Router Priority */
63 u_char priority;
64
508e53e2 65 /* Time Interval */
718e3744 66 u_int16_t hello_interval;
67 u_int16_t dead_interval;
68 u_int32_t rxmt_interval;
69
3bc4f84e
VB
70 u_int32_t state_change;
71
718e3744 72 /* Cost */
73 u_int32_t cost;
74
75 /* I/F MTU */
76 u_int32_t ifmtu;
77
78 /* Interface State */
79 u_char state;
80
8e370bfa
DS
81 /* Interface socket setting trial counter, resets on success */
82 u_char sso_try_cnt;
83
718e3744 84 /* OSPF6 Interface flag */
85 char flag;
86
d42306d9
DT
87 /* MTU mismatch check */
88 u_char mtu_ignore;
89
718e3744 90 /* Decision of DR Election */
508e53e2 91 u_int32_t drouter;
92 u_int32_t bdrouter;
93 u_int32_t prev_drouter;
94 u_int32_t prev_bdrouter;
718e3744 95
96 /* Linklocal LSA Database: includes Link-LSA */
97 struct ospf6_lsdb *lsdb;
6452df09 98 struct ospf6_lsdb *lsdb_self;
718e3744 99
508e53e2 100 struct ospf6_lsdb *lsupdate_list;
101 struct ospf6_lsdb *lsack_list;
718e3744 102
508e53e2 103 /* Ongoing Tasks */
104 struct thread *thread_send_hello;
105 struct thread *thread_send_lsupdate;
106 struct thread *thread_send_lsack;
718e3744 107
508e53e2 108 struct thread *thread_network_lsa;
109 struct thread *thread_link_lsa;
110 struct thread *thread_intra_prefix_lsa;
718e3744 111
508e53e2 112 struct ospf6_route_table *route_connected;
718e3744 113
508e53e2 114 /* prefix-list name to filter connected prefix */
718e3744 115 char *plist_name;
7f342629
DS
116
117 /* BFD information */
68fe91d6 118 void *bfd_info;
718e3744 119};
120
508e53e2 121/* interface state */
122#define OSPF6_INTERFACE_NONE 0
123#define OSPF6_INTERFACE_DOWN 1
124#define OSPF6_INTERFACE_LOOPBACK 2
125#define OSPF6_INTERFACE_WAITING 3
126#define OSPF6_INTERFACE_POINTTOPOINT 4
127#define OSPF6_INTERFACE_DROTHER 5
128#define OSPF6_INTERFACE_BDR 6
129#define OSPF6_INTERFACE_DR 7
130#define OSPF6_INTERFACE_MAX 8
131
0c083ee9 132extern const char *ospf6_interface_state_str[];
718e3744 133
508e53e2 134/* flags */
135#define OSPF6_INTERFACE_DISABLE 0x01
136#define OSPF6_INTERFACE_PASSIVE 0x02
c19543b2 137#define OSPF6_INTERFACE_NOAUTOCOST 0x04
718e3744 138
b51a3a31
VT
139/* default values */
140#define OSPF6_INTERFACE_HELLO_INTERVAL 10
141#define OSPF6_INTERFACE_DEAD_INTERVAL 40
142#define OSPF6_INTERFACE_RXMT_INTERVAL 5
143#define OSPF6_INTERFACE_COST 1
144#define OSPF6_INTERFACE_PRIORITY 1
145#define OSPF6_INTERFACE_TRANSDELAY 1
146#define OSPF6_INTERFACE_INSTANCE_ID 0
c19543b2
VB
147#define OSPF6_INTERFACE_BANDWIDTH 10000 /* Kbps */
148#define OSPF6_REFERENCE_BANDWIDTH 100000 /* Kbps */
8e370bfa
DS
149#define OSPF6_INTERFACE_SSO_RETRY_INT 1
150#define OSPF6_INTERFACE_SSO_RETRY_MAX 5
b51a3a31 151
6b0655a2 152
718e3744 153/* Function Prototypes */
154
6ac29a51
PJ
155extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex (int);
156extern struct ospf6_interface *ospf6_interface_create (struct interface *);
157extern void ospf6_interface_delete (struct ospf6_interface *);
718e3744 158
6ac29a51
PJ
159extern void ospf6_interface_enable (struct ospf6_interface *);
160extern void ospf6_interface_disable (struct ospf6_interface *);
718e3744 161
6ac29a51
PJ
162extern void ospf6_interface_if_add (struct interface *);
163extern void ospf6_interface_if_del (struct interface *);
164extern void ospf6_interface_state_update (struct interface *);
165extern void ospf6_interface_connected_route_update (struct interface *);
508e53e2 166
167/* interface event */
6ac29a51
PJ
168extern int interface_up (struct thread *);
169extern int interface_down (struct thread *);
170extern int wait_timer (struct thread *);
171extern int backup_seen (struct thread *);
172extern int neighbor_change (struct thread *);
718e3744 173
6ac29a51 174extern void ospf6_interface_init (void);
718e3744 175
a1b11f9b
DS
176extern void install_element_ospf6_clear_interface (void);
177
6ac29a51
PJ
178extern int config_write_ospf6_debug_interface (struct vty *vty);
179extern void install_element_ospf6_debug_interface (void);
718e3744 180
181#endif /* OSPF6_INTERFACE_H */