]>
git.proxmox.com Git - mirror_frr.git/blob - zebra/irdp.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* ICMP Router Discovery Messages
3 * Copyright (C) 1997, 2000 Kunihiro Ishiguro
7 * This file is modified and completed for the Zebra IRDP implementation
8 * by Robert Olsson, Swedish University of Agricultural Sciences
21 #ifndef ICMP_ROUTERADVERT
22 #define ICMP_ROUTERADVERT 9
23 #endif /* ICMP_ROUTERADVERT */
25 #ifndef ICMP_ROUTERSOLICIT
26 #define ICMP_ROUTERSOLICIT 10
27 #endif /* ICMP_ROUTERSOLICT */
29 /* Multicast groups */
30 #ifndef INADDR_ALLHOSTS_GROUP
31 #define INADDR_ALLHOSTS_GROUP 0xe0000001U /* 224.0.0.1 */
32 #endif /* INADDR_ALLHOSTS_GROUP */
34 #ifndef INADDR_ALLRTRS_GROUP
35 #define INADDR_ALLRTRS_GROUP 0xe0000002U /* 224.0.0.2 */
36 #endif /* INADDR_ALLRTRS_GROUP */
38 /* Default irdp packet interval */
39 #define IRDP_DEFAULT_INTERVAL 300
41 /* Router constants from RFC1256 */
42 #define MAX_INITIAL_ADVERT_INTERVAL 16
43 #define MAX_INITIAL_ADVERTISEMENTS 3
44 #define MAX_RESPONSE_DELAY 2
46 #define IRDP_MAXADVERTINTERVAL 600
47 #define IRDP_MINADVERTINTERVAL 450 /* 0.75*600 */
48 #define IRDP_LIFETIME 1350 /* 3*450 */
49 #define IRDP_PREFERENCE 0
53 #define IRDP_LAST_ADVERT_MESSAGES 2 /* The last adverts with Holdtime 0 */
55 #define IRDP_RX_BUF 1500
58 Comments comes from RFC1256 ICMP Router Discovery Messages.
60 The IP destination address to be used for multicast Router
61 Advertisements sent from the interface. The only permissible
62 values are the all-systems multicast address, 224.0.0.1, or the
63 limited-broadcast address, 255.255.255.255. (The all-systems
64 address is preferred wherever possible, i.e., on any link where
65 all listening hosts support IP multicast.)
67 Default: 224.0.0.1 if the router supports IP multicast on the
68 interface, else 255.255.255.255
70 The maximum time allowed between sending multicast Router
71 Advertisements from the interface, in seconds. Must be no less
72 than 4 seconds and no greater than 1800 seconds.
76 The minimum time allowed between sending unsolicited multicast
77 Router Advertisements from the interface, in seconds. Must be no
78 less than 3 seconds and no greater than MaxAdvertisementInterval.
80 Default: 0.75 * MaxAdvertisementInterval
82 The value to be placed in the Lifetime field of Router
83 Advertisements sent from the interface, in seconds. Must be no
84 less than MaxAdvertisementInterval and no greater than 9000
87 Default: 3 * MaxAdvertisementInterval
89 The preferability of the address as a default router address,
90 relative to other router addresses on the same subnet. A 32-bit,
91 signed, twos-complement integer, with higher values meaning more
92 preferable. The minimum value (hex 80000000) is used to indicate
93 that the address, even though it may be advertised, is not to be
94 used by neighboring hosts as a default router address.
99 struct irdp_interface
{
102 unsigned long MaxAdvertInterval
;
103 unsigned long MinAdvertInterval
;
104 unsigned long Preference
;
108 #define IF_ACTIVE (1<<0) /* ICMP Active */
109 #define IF_BROADCAST (1<<1) /* 255.255.255.255 */
110 #define IF_SOLICIT (1<<2) /* Solicit active */
111 #define IF_DEBUG_MESSAGES (1<<3)
112 #define IF_DEBUG_PACKET (1<<4)
113 #define IF_DEBUG_MISC (1<<5)
114 #define IF_SHUTDOWN (1<<6)
116 struct interface
*ifp
;
117 struct event
*t_advertise
;
118 unsigned long irdp_sent
;
121 struct list
*AdvPrefList
;
129 extern void irdp_if_init(void);
130 extern int irdp_sock_init(void);
131 extern int irdp_config_write(struct vty
*, struct interface
*);
132 extern void irdp_send_thread(struct event
*t_advert
);
133 extern void irdp_advert_off(struct interface
*ifp
);
134 extern void process_solicit(struct interface
*ifp
);
135 extern void irdp_read_raw(struct event
*r
);
136 extern void send_packet(struct interface
*ifp
, struct stream
*s
, uint32_t dst
,
137 struct prefix
*p
, uint32_t ttl
);