paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* Interface function header. |
| 2 | * Copyright (C) 1999 Kunihiro Ishiguro |
| 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 Free |
| 18 | * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 19 | * 02111-1307, USA. |
| 20 | */ |
| 21 | |
paul | 5b73a67 | 2004-07-23 15:26:14 +0000 | [diff] [blame] | 22 | #ifndef _ZEBRA_INTERFACE_H |
| 23 | #define _ZEBRA_INTERFACE_H |
| 24 | |
| 25 | #include "redistribute.h" |
| 26 | |
hasso | ca77698 | 2004-06-12 14:33:05 +0000 | [diff] [blame] | 27 | #ifdef HAVE_IRDP |
| 28 | #include "zebra/irdp.h" |
| 29 | #endif |
| 30 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 31 | /* For interface multicast configuration. */ |
| 32 | #define IF_ZEBRA_MULTICAST_UNSPEC 0 |
| 33 | #define IF_ZEBRA_MULTICAST_ON 1 |
| 34 | #define IF_ZEBRA_MULTICAST_OFF 2 |
| 35 | |
| 36 | /* For interface shutdown configuration. */ |
| 37 | #define IF_ZEBRA_SHUTDOWN_UNSPEC 0 |
| 38 | #define IF_ZEBRA_SHUTDOWN_ON 1 |
| 39 | #define IF_ZEBRA_SHUTDOWN_OFF 2 |
| 40 | |
| 41 | /* Router advertisement feature. */ |
| 42 | #if (defined(LINUX_IPV6) && (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)) || defined(KAME) |
hasso | 726f9b2 | 2003-05-25 21:04:54 +0000 | [diff] [blame] | 43 | #ifdef HAVE_RTADV |
| 44 | #define RTADV |
| 45 | #endif |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | #endif |
| 47 | |
| 48 | #ifdef RTADV |
| 49 | /* Router advertisement parameter. From RFC2461. */ |
| 50 | struct rtadvconf |
| 51 | { |
| 52 | /* A flag indicating whether or not the router sends periodic Router |
| 53 | Advertisements and responds to Router Solicitations. |
| 54 | Default: FALSE */ |
| 55 | int AdvSendAdvertisements; |
| 56 | |
| 57 | /* The maximum time allowed between sending unsolicited multicast |
| 58 | Router Advertisements from the interface, in seconds. MUST be no |
| 59 | less than 4 seconds and no greater than 1800 seconds. |
| 60 | |
| 61 | Default: 600 seconds */ |
| 62 | int MaxRtrAdvInterval; |
| 63 | #define RTADV_MAX_RTR_ADV_INTERVAL 600 |
| 64 | |
| 65 | /* The minimum time allowed between sending unsolicited multicast |
| 66 | Router Advertisements from the interface, in seconds. MUST be no |
| 67 | less than 3 seconds and no greater than .75 * MaxRtrAdvInterval. |
| 68 | |
| 69 | Default: 0.33 * MaxRtrAdvInterval */ |
| 70 | int MinRtrAdvInterval; |
| 71 | #define RTADV_MIN_RTR_ADV_INTERVAL (0.33 * RTADV_MAX_RTR_ADV_INTERVAL) |
| 72 | |
| 73 | /* Unsolicited Router Advertisements' interval timer. */ |
| 74 | int AdvIntervalTimer; |
| 75 | |
| 76 | /* The TRUE/FALSE value to be placed in the "Managed address |
| 77 | configuration" flag field in the Router Advertisement. See |
| 78 | [ADDRCONF]. |
| 79 | |
| 80 | Default: FALSE */ |
| 81 | int AdvManagedFlag; |
| 82 | |
| 83 | |
| 84 | /* The TRUE/FALSE value to be placed in the "Other stateful |
| 85 | configuration" flag field in the Router Advertisement. See |
| 86 | [ADDRCONF]. |
| 87 | |
| 88 | Default: FALSE */ |
| 89 | int AdvOtherConfigFlag; |
| 90 | |
| 91 | /* The value to be placed in MTU options sent by the router. A |
| 92 | value of zero indicates that no MTU options are sent. |
| 93 | |
| 94 | Default: 0 */ |
| 95 | int AdvLinkMTU; |
| 96 | |
| 97 | |
| 98 | /* The value to be placed in the Reachable Time field in the Router |
| 99 | Advertisement messages sent by the router. The value zero means |
| 100 | unspecified (by this router). MUST be no greater than 3,600,000 |
| 101 | milliseconds (1 hour). |
| 102 | |
| 103 | Default: 0 */ |
| 104 | u_int32_t AdvReachableTime; |
| 105 | #define RTADV_MAX_REACHABLE_TIME 3600000 |
| 106 | |
| 107 | |
| 108 | /* The value to be placed in the Retrans Timer field in the Router |
| 109 | Advertisement messages sent by the router. The value zero means |
| 110 | unspecified (by this router). |
| 111 | |
| 112 | Default: 0 */ |
| 113 | int AdvRetransTimer; |
| 114 | |
| 115 | /* The default value to be placed in the Cur Hop Limit field in the |
| 116 | Router Advertisement messages sent by the router. The value |
| 117 | should be set to that current diameter of the Internet. The |
| 118 | value zero means unspecified (by this router). |
| 119 | |
| 120 | Default: The value specified in the "Assigned Numbers" RFC |
| 121 | [ASSIGNED] that was in effect at the time of implementation. */ |
| 122 | int AdvCurHopLimit; |
| 123 | |
| 124 | /* The value to be placed in the Router Lifetime field of Router |
| 125 | Advertisements sent from the interface, in seconds. MUST be |
| 126 | either zero or between MaxRtrAdvInterval and 9000 seconds. A |
| 127 | value of zero indicates that the router is not to be used as a |
| 128 | default router. |
| 129 | |
| 130 | Default: 3 * MaxRtrAdvInterval */ |
| 131 | int AdvDefaultLifetime; |
| 132 | #define RTADV_ADV_DEFAULT_LIFETIME (3 * RTADV_MAX_RTR_ADV_INTERVAL) |
| 133 | |
| 134 | |
| 135 | /* A list of prefixes to be placed in Prefix Information options in |
| 136 | Router Advertisement messages sent from the interface. |
| 137 | |
| 138 | Default: all prefixes that the router advertises via routing |
| 139 | protocols as being on-link for the interface from which the |
| 140 | advertisement is sent. The link-local prefix SHOULD NOT be |
| 141 | included in the list of advertised prefixes. */ |
| 142 | list AdvPrefixList; |
| 143 | }; |
| 144 | |
| 145 | #endif /* RTADV */ |
| 146 | |
| 147 | /* `zebra' daemon local interface structure. */ |
| 148 | struct zebra_if |
| 149 | { |
| 150 | /* Shutdown configuration. */ |
| 151 | u_char shutdown; |
| 152 | |
| 153 | /* Multicast configuration. */ |
| 154 | u_char multicast; |
| 155 | |
| 156 | /* Router advertise configuration. */ |
| 157 | u_char rtadv_enable; |
| 158 | |
| 159 | /* Interface's address. */ |
| 160 | list address; |
| 161 | |
| 162 | #ifdef RTADV |
| 163 | struct rtadvconf rtadv; |
| 164 | #endif /* RTADV */ |
hasso | ca77698 | 2004-06-12 14:33:05 +0000 | [diff] [blame] | 165 | |
| 166 | #ifdef HAVE_IRDP |
| 167 | struct irdp_interface irdp; |
| 168 | #endif |
| 169 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 170 | }; |
| 171 | |
| 172 | void if_delete_update (struct interface *ifp); |
| 173 | void if_add_update (struct interface *ifp); |
| 174 | void if_up (struct interface *); |
| 175 | void if_down (struct interface *); |
| 176 | void if_refresh (struct interface *); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 177 | |
| 178 | #ifdef HAVE_PROC_NET_DEV |
| 179 | int ifstat_update_proc (); |
| 180 | #endif /* HAVE_PROC_NET_DEV */ |
| 181 | #ifdef HAVE_NET_RT_IFLIST |
| 182 | void ifstat_update_sysctl (); |
| 183 | |
| 184 | #endif /* HAVE_NET_RT_IFLIST */ |
| 185 | #ifdef HAVE_PROC_NET_DEV |
| 186 | int interface_list_proc (); |
| 187 | #endif /* HAVE_PROC_NET_DEV */ |
| 188 | #ifdef HAVE_PROC_NET_IF_INET6 |
| 189 | int ifaddr_proc_ipv6 (); |
| 190 | #endif /* HAVE_PROC_NET_IF_INET6 */ |
| 191 | |
| 192 | #ifdef BSDI |
| 193 | int if_kvm_get_mtu (struct interface *); |
| 194 | #endif /* BSDI */ |
paul | 5b73a67 | 2004-07-23 15:26:14 +0000 | [diff] [blame] | 195 | |
| 196 | #endif /* _ZEBRA_INTERFACE_H */ |