]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/interface.h
ospfd: free unreachable router LSA node so that it is not left unreachable
[mirror_frr.git] / zebra / interface.h
index c6930ce8168f50cf7c953d687e961847d7288dbd..f3f41b90c5c418a1fc9b281ce81de598a88cc4aa 100644 (file)
@@ -30,6 +30,7 @@
 #include "zebra/zebra_l2.h"
 #include "zebra/zebra_nhg_private.h"
 #include "zebra/zebra_router.h"
+#include "zebra/rtadv.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -46,218 +47,6 @@ extern "C" {
 
 #define IF_VLAN_BITMAP_MAX 4096
 
-#if defined(HAVE_RTADV)
-/* Router advertisement parameter.  From RFC4861, RFC6275 and RFC4191. */
-struct rtadvconf {
-       /* A flag indicating whether or not the router sends periodic Router
-          Advertisements and responds to Router Solicitations.
-          Default: false */
-       int AdvSendAdvertisements;
-
-       /* The maximum time allowed between sending unsolicited multicast
-          Router Advertisements from the interface, in milliseconds.
-          MUST be no less than 70 ms [RFC6275 7.5] and no greater
-          than 1800000 ms [RFC4861 6.2.1].
-
-          Default: 600000 milliseconds */
-       int MaxRtrAdvInterval;
-#define RTADV_MAX_RTR_ADV_INTERVAL 600000
-
-       /* The minimum time allowed between sending unsolicited multicast
-          Router Advertisements from the interface, in milliseconds.
-          MUST be no less than 30 ms [RFC6275 7.5].
-          MUST be no greater than .75 * MaxRtrAdvInterval.
-
-          Default: 0.33 * MaxRtrAdvInterval */
-       int MinRtrAdvInterval; /* This field is currently unused. */
-#define RTADV_MIN_RTR_ADV_INTERVAL (0.33 * RTADV_MAX_RTR_ADV_INTERVAL)
-
-       /* Unsolicited Router Advertisements' interval timer. */
-       int AdvIntervalTimer;
-
-       /* The true/false value to be placed in the "Managed address
-          configuration" flag field in the Router Advertisement.  See
-          [ADDRCONF].
-
-          Default: false */
-       int AdvManagedFlag;
-       struct timeval lastadvmanagedflag;
-
-
-       /* The true/false value to be placed in the "Other stateful
-          configuration" flag field in the Router Advertisement.  See
-          [ADDRCONF].
-
-          Default: false */
-       int AdvOtherConfigFlag;
-       struct timeval lastadvotherconfigflag;
-
-       /* The value to be placed in MTU options sent by the router.  A
-          value of zero indicates that no MTU options are sent.
-
-          Default: 0 */
-       int AdvLinkMTU;
-
-
-       /* The value to be placed in the Reachable Time field in the Router
-          Advertisement messages sent by the router.  The value zero means
-          unspecified (by this router).  MUST be no greater than 3,600,000
-          milliseconds (1 hour).
-
-          Default: 0 */
-       uint32_t AdvReachableTime;
-#define RTADV_MAX_REACHABLE_TIME 3600000
-       struct timeval lastadvreachabletime;
-
-       /* The value to be placed in the Retrans Timer field in the Router
-          Advertisement messages sent by the router.  The value zero means
-          unspecified (by this router).
-
-          Default: 0 */
-       int AdvRetransTimer;
-       struct timeval lastadvretranstimer;
-
-       /* The default value to be placed in the Cur Hop Limit field in the
-          Router Advertisement messages sent by the router.  The value
-          should be set to that current diameter of the Internet.  The
-          value zero means unspecified (by this router).
-
-          Default: The value specified in the "Assigned Numbers" RFC
-          [ASSIGNED] that was in effect at the time of implementation. */
-       int AdvCurHopLimit;
-       struct timeval lastadvcurhoplimit;
-
-#define RTADV_DEFAULT_HOPLIMIT 64 /* 64 hops */
-
-       /* The value to be placed in the Router Lifetime field of Router
-          Advertisements sent from the interface, in seconds.  MUST be
-          either zero or between MaxRtrAdvInterval and 9000 seconds.  A
-          value of zero indicates that the router is not to be used as a
-          default router.
-
-          Default: 3 * MaxRtrAdvInterval */
-       int AdvDefaultLifetime;
-#define RTADV_MAX_RTRLIFETIME 9000 /* 2.5 hours */
-
-       /* A list of prefixes to be placed in Prefix Information options in
-          Router Advertisement messages sent from the interface.
-
-          Default: all prefixes that the router advertises via routing
-          protocols as being on-link for the interface from which the
-          advertisement is sent. The link-local prefix SHOULD NOT be
-          included in the list of advertised prefixes. */
-       struct list *AdvPrefixList;
-
-       /* The true/false value to be placed in the "Home agent"
-          flag field in the Router Advertisement.  See [RFC6275 7.1].
-
-          Default: false */
-       int AdvHomeAgentFlag;
-#ifndef ND_RA_FLAG_HOME_AGENT
-#define ND_RA_FLAG_HOME_AGENT  0x20
-#endif
-
-       /* The value to be placed in Home Agent Information option if Home
-          Flag is set.
-          Default: 0 */
-       int HomeAgentPreference;
-
-       /* The value to be placed in Home Agent Information option if Home
-          Flag is set. Lifetime (seconds) MUST not be greater than 18.2
-          hours.
-          The value 0 has special meaning: use of AdvDefaultLifetime value.
-
-          Default: 0 */
-       int HomeAgentLifetime;
-#define RTADV_MAX_HALIFETIME 65520 /* 18.2 hours */
-
-       /* The true/false value to insert or not an Advertisement Interval
-          option. See [RFC 6275 7.3]
-
-          Default: false */
-       int AdvIntervalOption;
-
-       /* The value to be placed in the Default Router Preference field of
-          a router advertisement. See [RFC 4191 2.1 & 2.2]
-
-          Default: 0 (medium) */
-       int DefaultPreference;
-#define RTADV_PREF_MEDIUM 0x0 /* Per RFC4191. */
-
-       /*
-        * List of recursive DNS servers to include in the RDNSS option.
-        * See [RFC8106 5.1]
-        *
-        * Default: empty list; do not emit RDNSS option
-        */
-       struct list *AdvRDNSSList;
-
-       /*
-        * List of DNS search domains to include in the DNSSL option.
-        * See [RFC8106 5.2]
-        *
-        * Default: empty list; do not emit DNSSL option
-        */
-       struct list *AdvDNSSLList;
-
-       /*
-        * rfc4861 states RAs must be sent at least 3 seconds apart.
-        * We allow faster retransmits to speed up convergence but can
-        * turn that capability off to meet the rfc if needed.
-        */
-       bool UseFastRexmit; /* True if fast rexmits are enabled */
-
-       uint8_t inFastRexmit; /* True if we're rexmits faster than usual */
-
-       /* Track if RA was configured by BGP or by the Operator or both */
-       uint8_t ra_configured;    /* Was RA configured? */
-#define BGP_RA_CONFIGURED (1<<0)  /* BGP configured RA? */
-#define VTY_RA_CONFIGURED (1<<1)  /* Operator configured RA? */
-#define VTY_RA_INTERVAL_CONFIGURED (1<<2)  /* Operator configured RA interval */
-       int NumFastReXmitsRemain; /* Loaded first with number of fast
-                                    rexmits to do */
-
-#define RTADV_FAST_REXMIT_PERIOD 1 /* 1 sec */
-#define RTADV_NUM_FAST_REXMITS   4 /* Fast Rexmit RA 4 times on certain events */
-};
-
-struct rtadv_rdnss {
-       /* Address of recursive DNS server to advertise */
-       struct in6_addr addr;
-
-       /*
-        * Lifetime in seconds; all-ones means infinity, zero
-        * stop using it.
-        */
-       uint32_t lifetime;
-
-       /* If lifetime not set, use a default of 3*MaxRtrAdvInterval */
-       int lifetime_set;
-};
-
-/*
- * [RFC1035 2.3.4] sets the maximum length of a domain name (a sequence of
- * labels, each prefixed by a length octet) at 255 octets.
- */
-#define RTADV_MAX_ENCODED_DOMAIN_NAME 255
-
-struct rtadv_dnssl {
-       /* Domain name without trailing root zone dot (NUL-terminated) */
-       char name[RTADV_MAX_ENCODED_DOMAIN_NAME - 1];
-
-       /* Name encoded as in [RFC1035 3.1] */
-       uint8_t encoded_name[RTADV_MAX_ENCODED_DOMAIN_NAME];
-
-       /* Actual length of encoded_name */
-       size_t encoded_len;
-
-       /* Lifetime as for RDNSS */
-       uint32_t lifetime;
-       int lifetime_set;
-};
-
-#endif /* HAVE_RTADV */
-
 /* Zebra interface type - ones of interest. */
 enum zebra_iftype {
        ZEBRA_IF_OTHER = 0, /* Anything else */
@@ -340,6 +129,12 @@ struct zebra_if {
        /* MPLS status. */
        bool mpls;
 
+       /* Linkdown status */
+       bool linkdown, linkdownv6;
+
+       /* Is Multicast Forwarding on? */
+       bool v4mcast_on, v6mcast_on;
+
        /* Router advertise configuration. */
        uint8_t rtadv_enable;
 
@@ -361,10 +156,8 @@ struct zebra_if {
        unsigned int down_count;
        char down_last[FRR_TIMESTAMP_LEN];
 
-#if defined(HAVE_RTADV)
        struct rtadvconf rtadv;
        unsigned int ra_sent, ra_rcvd;
-#endif /* HAVE_RTADV */
 
        struct irdp_interface *irdp;