]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/interface.h
Zebra.h header cleanup (#4444)
[mirror_frr.git] / zebra / interface.h
index c6d8b24b019a23f0259bceabee81191a8c4db22b..6a3914451aa71d522a000be7a9eccb9986ffbb53 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Interface function header.
  * Copyright (C) 1999 Kunihiro Ishiguro
  *
 
 #include "zebra/zebra_l2.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* For interface multicast configuration. */
 #define IF_ZEBRA_MULTICAST_UNSPEC 0
 #define IF_ZEBRA_MULTICAST_ON     1
@@ -167,6 +172,22 @@ struct rtadvconf {
        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;
+
        uint8_t inFastRexmit; /* True if we're rexmits faster than usual */
 
        /* Track if RA was configured by BGP or by the Operator or both */
@@ -181,6 +202,41 @@ struct rtadvconf {
 #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. */
@@ -192,6 +248,8 @@ typedef enum {
        ZEBRA_IF_VLAN,      /* VLAN sub-interface */
        ZEBRA_IF_MACVLAN,   /* MAC VLAN interface*/
        ZEBRA_IF_VETH,      /* VETH interface*/
+       ZEBRA_IF_BOND,      /* Bond */
+       ZEBRA_IF_BOND_SLAVE,        /* Bond */
 } zebra_iftype_t;
 
 /* Zebra "slave" interface type */
@@ -199,6 +257,7 @@ typedef enum {
        ZEBRA_IF_SLAVE_NONE,   /* Not a slave */
        ZEBRA_IF_SLAVE_VRF,    /* Member of a VRF */
        ZEBRA_IF_SLAVE_BRIDGE, /* Member of a bridge */
+       ZEBRA_IF_SLAVE_BOND,   /* Bond member */
        ZEBRA_IF_SLAVE_OTHER,  /* Something else - e.g., bond slave */
 } zebra_slave_iftype_t;
 
@@ -268,6 +327,8 @@ struct zebra_if {
         */
        struct zebra_l2info_brslave brslave_info;
 
+       struct zebra_l2info_bondslave bondslave_info;
+
        /* Link fields - for sub-interfaces. */
        ifindex_t link_ifindex;
        struct interface *link;
@@ -279,7 +340,11 @@ struct zebra_if {
         * for bgp unnumbered?
         */
        bool v6_2_v4_ll_neigh_entry;
+       char neigh_mac[6];
        struct in6_addr v6_2_v4_ll_addr6;
+
+       /* The description of the interface */
+       char *desc;
 };
 
 DECLARE_HOOK(zebra_if_extra_info, (struct vty * vty, struct interface *ifp),
@@ -323,6 +388,10 @@ static inline void zebra_if_set_ziftype(struct interface *ifp,
 #define IS_ZEBRA_IF_VRF_SLAVE(ifp)                                             \
        (((struct zebra_if *)(ifp->info))->zif_slave_type == ZEBRA_IF_SLAVE_VRF)
 
+#define IS_ZEBRA_IF_BOND_SLAVE(ifp)                                    \
+       (((struct zebra_if *)(ifp->info))->zif_slave_type                      \
+        == ZEBRA_IF_SLAVE_BOND)
+
 extern void zebra_if_init(void);
 
 extern struct interface *if_lookup_by_index_per_ns(struct zebra_ns *, uint32_t);
@@ -332,6 +401,10 @@ extern struct interface *if_link_per_ns(struct zebra_ns *, struct interface *);
 extern const char *ifindex2ifname_per_ns(struct zebra_ns *, unsigned int);
 
 extern void if_unlink_per_ns(struct interface *);
+extern void if_nbr_mac_to_ipv4ll_neigh_update(struct interface *fip,
+                                             char mac[6],
+                                             struct in6_addr *address,
+                                             int add);
 extern void if_nbr_ipv6ll_to_ipv4ll_neigh_update(struct interface *ifp,
                                                 struct in6_addr *address,
                                                 int add);
@@ -349,6 +422,7 @@ extern void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id);
 extern void zebra_if_update_link(struct interface *ifp, ifindex_t link_ifindex,
                                 ns_id_t ns_id);
 extern void zebra_if_update_all_links(void);
+extern void zebra_if_set_protodown(struct interface *ifp, bool down);
 
 extern void vrf_add_update(struct vrf *vrfp);
 
@@ -366,4 +440,8 @@ extern int interface_list_proc(void);
 extern int ifaddr_proc_ipv6(void);
 #endif /* HAVE_PROC_NET_IF_INET6 */
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _ZEBRA_INTERFACE_H */