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