MiniDLNA update: 1.0.19.1 to 1.0.20
[tomato.git] / release / src / router / zebra / zebra / interface.h
blobf28adb3f4b3b4ae547274389c9c74fe4f382a5d4
1 /* Interface function header.
2 * Copyright (C) 1999 Kunihiro Ishiguro
4 * This file is part of GNU Zebra.
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.
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.
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.
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
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
32 /* Router advertisement feature. */
33 #if (defined(LINUX_IPV6) && (defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1)) || defined(KAME)
34 #define RTADV
35 #endif
37 #ifdef RTADV
38 /* Router advertisement parameter. From RFC2461. */
39 struct rtadvconf
41 /* A flag indicating whether or not the router sends periodic Router
42 Advertisements and responds to Router Solicitations.
43 Default: FALSE */
44 int AdvSendAdvertisements;
46 /* The maximum time allowed between sending unsolicited multicast
47 Router Advertisements from the interface, in seconds. MUST be no
48 less than 4 seconds and no greater than 1800 seconds.
50 Default: 600 seconds */
51 int MaxRtrAdvInterval;
52 #define RTADV_MAX_RTR_ADV_INTERVAL 600
54 /* The minimum time allowed between sending unsolicited multicast
55 Router Advertisements from the interface, in seconds. MUST be no
56 less than 3 seconds and no greater than .75 * MaxRtrAdvInterval.
58 Default: 0.33 * MaxRtrAdvInterval */
59 int MinRtrAdvInterval;
60 #define RTADV_MIN_RTR_ADV_INTERVAL (0.33 * RTADV_MAX_RTR_ADV_INTERVAL)
62 /* Unsolicited Router Advertisements' interval timer. */
63 int AdvIntervalTimer;
65 /* The TRUE/FALSE value to be placed in the "Managed address
66 configuration" flag field in the Router Advertisement. See
67 [ADDRCONF].
69 Default: FALSE */
70 int AdvManagedFlag;
73 /* The TRUE/FALSE value to be placed in the "Other stateful
74 configuration" flag field in the Router Advertisement. See
75 [ADDRCONF].
77 Default: FALSE */
78 int AdvOtherConfigFlag;
80 /* The value to be placed in MTU options sent by the router. A
81 value of zero indicates that no MTU options are sent.
83 Default: 0 */
84 int AdvLinkMTU;
87 /* The value to be placed in the Reachable Time field in the Router
88 Advertisement messages sent by the router. The value zero means
89 unspecified (by this router). MUST be no greater than 3,600,000
90 milliseconds (1 hour).
92 Default: 0 */
93 u_int32_t AdvReachableTime;
94 #define RTADV_MAX_REACHABLE_TIME 3600000
97 /* The value to be placed in the Retrans Timer field in the Router
98 Advertisement messages sent by the router. The value zero means
99 unspecified (by this router).
101 Default: 0 */
102 int AdvRetransTimer;
104 /* The default value to be placed in the Cur Hop Limit field in the
105 Router Advertisement messages sent by the router. The value
106 should be set to that current diameter of the Internet. The
107 value zero means unspecified (by this router).
109 Default: The value specified in the "Assigned Numbers" RFC
110 [ASSIGNED] that was in effect at the time of implementation. */
111 int AdvCurHopLimit;
113 /* The value to be placed in the Router Lifetime field of Router
114 Advertisements sent from the interface, in seconds. MUST be
115 either zero or between MaxRtrAdvInterval and 9000 seconds. A
116 value of zero indicates that the router is not to be used as a
117 default router.
119 Default: 3 * MaxRtrAdvInterval */
120 int AdvDefaultLifetime;
121 #define RTADV_ADV_DEFAULT_LIFETIME (3 * RTADV_MAX_RTR_ADV_INTERVAL)
124 /* A list of prefixes to be placed in Prefix Information options in
125 Router Advertisement messages sent from the interface.
127 Default: all prefixes that the router advertises via routing
128 protocols as being on-link for the interface from which the
129 advertisement is sent. The link-local prefix SHOULD NOT be
130 included in the list of advertised prefixes. */
131 list AdvPrefixList;
134 #endif /* RTADV */
136 /* `zebra' daemon local interface structure. */
137 struct zebra_if
139 /* Shutdown configuration. */
140 u_char shutdown;
142 /* Multicast configuration. */
143 u_char multicast;
145 /* Router advertise configuration. */
146 u_char rtadv_enable;
148 /* Interface's address. */
149 list address;
151 #ifdef RTADV
152 struct rtadvconf rtadv;
153 #endif /* RTADV */
155 #ifdef HAVE_IRDP
156 #include "irdp.h"
157 struct irdp_interface irdp;
158 #endif
162 void if_delete_update (struct interface *ifp);
163 void if_add_update (struct interface *ifp);
164 void if_up (struct interface *);
165 void if_down (struct interface *);
166 void if_refresh (struct interface *);
167 void zebra_interface_up_update (struct interface *ifp);
168 void zebra_interface_down_update (struct interface *ifp);
170 #ifdef HAVE_PROC_NET_DEV
171 int ifstat_update_proc ();
172 #endif /* HAVE_PROC_NET_DEV */
173 #ifdef HAVE_NET_RT_IFLIST
174 void ifstat_update_sysctl ();
176 #endif /* HAVE_NET_RT_IFLIST */
177 #ifdef HAVE_PROC_NET_DEV
178 int interface_list_proc ();
179 #endif /* HAVE_PROC_NET_DEV */
180 #ifdef HAVE_PROC_NET_IF_INET6
181 int ifaddr_proc_ipv6 ();
182 #endif /* HAVE_PROC_NET_IF_INET6 */
184 #ifdef BSDI
185 int if_kvm_get_mtu (struct interface *);
186 #endif /* BSDI */