paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 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 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 25 | #include "if.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 26 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 27 | /* Debug option */ |
| 28 | extern 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) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 35 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 36 | /* Interface structure */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 37 | struct 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 */ |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 46 | struct list *neighbor_list; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 47 | |
| 48 | /* linklocal address of this I/F */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 49 | struct in6_addr *linklocal_addr; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 50 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 51 | /* Interface ID; use interface->ifindex */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 52 | |
| 53 | /* ospf6 instance id */ |
| 54 | u_char instance_id; |
| 55 | |
| 56 | /* I/F transmission delay */ |
| 57 | u_int32_t transdelay; |
| 58 | |
| 59 | /* Router Priority */ |
| 60 | u_char priority; |
| 61 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 62 | /* Time Interval */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 63 | u_int16_t hello_interval; |
| 64 | u_int16_t dead_interval; |
| 65 | u_int32_t rxmt_interval; |
| 66 | |
| 67 | /* Cost */ |
| 68 | u_int32_t cost; |
| 69 | |
| 70 | /* I/F MTU */ |
| 71 | u_int32_t ifmtu; |
| 72 | |
| 73 | /* Interface State */ |
| 74 | u_char state; |
| 75 | |
| 76 | /* OSPF6 Interface flag */ |
| 77 | char flag; |
| 78 | |
Dmitrij Tejblum | d42306d | 2011-04-22 19:27:54 +0400 | [diff] [blame] | 79 | /* MTU mismatch check */ |
| 80 | u_char mtu_ignore; |
| 81 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 82 | /* Decision of DR Election */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 83 | u_int32_t drouter; |
| 84 | u_int32_t bdrouter; |
| 85 | u_int32_t prev_drouter; |
| 86 | u_int32_t prev_bdrouter; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 87 | |
| 88 | /* Linklocal LSA Database: includes Link-LSA */ |
| 89 | struct ospf6_lsdb *lsdb; |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 90 | struct ospf6_lsdb *lsdb_self; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 91 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 92 | struct ospf6_lsdb *lsupdate_list; |
| 93 | struct ospf6_lsdb *lsack_list; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 94 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 95 | /* Ongoing Tasks */ |
| 96 | struct thread *thread_send_hello; |
| 97 | struct thread *thread_send_lsupdate; |
| 98 | struct thread *thread_send_lsack; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 99 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 100 | struct thread *thread_network_lsa; |
| 101 | struct thread *thread_link_lsa; |
| 102 | struct thread *thread_intra_prefix_lsa; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 103 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 104 | struct ospf6_route_table *route_connected; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 105 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 106 | /* prefix-list name to filter connected prefix */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 107 | char *plist_name; |
| 108 | }; |
| 109 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 110 | /* interface state */ |
| 111 | #define OSPF6_INTERFACE_NONE 0 |
| 112 | #define OSPF6_INTERFACE_DOWN 1 |
| 113 | #define OSPF6_INTERFACE_LOOPBACK 2 |
| 114 | #define OSPF6_INTERFACE_WAITING 3 |
| 115 | #define OSPF6_INTERFACE_POINTTOPOINT 4 |
| 116 | #define OSPF6_INTERFACE_DROTHER 5 |
| 117 | #define OSPF6_INTERFACE_BDR 6 |
| 118 | #define OSPF6_INTERFACE_DR 7 |
| 119 | #define OSPF6_INTERFACE_MAX 8 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 120 | |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 121 | extern const char *ospf6_interface_state_str[]; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 122 | |
| 123 | /* flags */ |
| 124 | #define OSPF6_INTERFACE_DISABLE 0x01 |
| 125 | #define OSPF6_INTERFACE_PASSIVE 0x02 |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 126 | |
Vyacheslav Trushkin | b51a3a3 | 2012-02-10 10:42:45 +0400 | [diff] [blame] | 127 | /* default values */ |
| 128 | #define OSPF6_INTERFACE_HELLO_INTERVAL 10 |
| 129 | #define OSPF6_INTERFACE_DEAD_INTERVAL 40 |
| 130 | #define OSPF6_INTERFACE_RXMT_INTERVAL 5 |
| 131 | #define OSPF6_INTERFACE_COST 1 |
| 132 | #define OSPF6_INTERFACE_PRIORITY 1 |
| 133 | #define OSPF6_INTERFACE_TRANSDELAY 1 |
| 134 | #define OSPF6_INTERFACE_INSTANCE_ID 0 |
| 135 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 136 | |
| 137 | /* Function Prototypes */ |
| 138 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 139 | extern struct ospf6_interface *ospf6_interface_lookup_by_ifindex (int); |
| 140 | extern struct ospf6_interface *ospf6_interface_create (struct interface *); |
| 141 | extern void ospf6_interface_delete (struct ospf6_interface *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 142 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 143 | extern void ospf6_interface_enable (struct ospf6_interface *); |
| 144 | extern void ospf6_interface_disable (struct ospf6_interface *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 145 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 146 | extern void ospf6_interface_if_add (struct interface *); |
| 147 | extern void ospf6_interface_if_del (struct interface *); |
| 148 | extern void ospf6_interface_state_update (struct interface *); |
| 149 | extern void ospf6_interface_connected_route_update (struct interface *); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 150 | |
| 151 | /* interface event */ |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 152 | extern int interface_up (struct thread *); |
| 153 | extern int interface_down (struct thread *); |
| 154 | extern int wait_timer (struct thread *); |
| 155 | extern int backup_seen (struct thread *); |
| 156 | extern int neighbor_change (struct thread *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 157 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 158 | extern void ospf6_interface_init (void); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 159 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 160 | extern int config_write_ospf6_debug_interface (struct vty *vty); |
| 161 | extern void install_element_ospf6_debug_interface (void); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 162 | |
| 163 | #endif /* OSPF6_INTERFACE_H */ |