#define EVPNES_LOCAL 0x01
#define EVPNES_REMOTE 0x02
- /* Id for deriving the RD
- * automatically for this ESI */
+ /*
+ * Id for deriving the RD
+ * automatically for this ESI
+ */
uint16_t rd_id;
/* RD for this VNI. */
/* list of VTEPs in the same site */
struct list *vtep_list;
- /* Route table for EVPN routes for
- * this ESI. - type4 routes */
+ /*
+ * Route table for EVPN routes for
+ * this ESI. - type4 routes
+ */
struct bgp_table *route_table;
QOBJ_FIELDS
#define RT_TYPE_EXPORT 2
#define RT_TYPE_BOTH 3
+#define EVPN_DAD_DEFAULT_TIME 180 /* secs */
+#define EVPN_DAD_DEFAULT_MAX_MOVES 5 /* default from RFC 7432 */
+#define EVPN_DAD_DEFAULT_AUTO_RECOVERY_TIME 1800 /* secs */
+
+struct bgp_evpn_info {
+ /* enable disable dup detect */
+ bool dup_addr_detect;
+
+ /* Detection time(M) */
+ int dad_time;
+ /* Detection max moves(N) */
+ uint32_t dad_max_moves;
+ /* Permanent freeze */
+ bool dad_freeze;
+ /* Recovery time */
+ uint32_t dad_freeze_time;
+};
+
static inline int is_vrf_rd_configured(struct bgp *bgp_vrf)
{
return (CHECK_FLAG(bgp_vrf->vrf_flags, BGP_VRF_RD_CFGD));
eval->val[7] = seq & 0xff;
}
+static inline void encode_na_flag_extcomm(struct ecommunity_val *eval,
+ uint8_t na_flag)
+{
+ memset(eval, 0, sizeof(*eval));
+ eval->val[0] = ECOMMUNITY_ENCODE_EVPN;
+ eval->val[1] = ECOMMUNITY_EVPN_SUBTYPE_ND;
+ if (na_flag)
+ eval->val[2] |= ECOMMUNITY_EVPN_SUBTYPE_ND_ROUTER_FLAG;
+}
+
static inline void ip_prefix_from_type5_prefix(struct prefix_evpn *evp,
struct prefix *ip)
{
}
}
-static inline int is_evpn_prefix_default(struct prefix *evp)
+static inline int is_evpn_prefix_default(const struct prefix *evp)
{
if (evp->family != AF_EVPN)
return 0;
static inline void es_get_system_mac(esi_t *esi,
struct ethaddr *mac)
{
- /* for type-1 and type-3 ESIs,
- the system mac starts at val[1]
+ /*
+ * for type-1 and type-3 ESIs,
+ * the system mac starts at val[1]
*/
memcpy(mac, &esi->val[1], ETH_ALEN);
}
return CHECK_FLAG(es->flags, EVPNES_LOCAL) ? 1 : 0;
}
+extern void bgp_evpn_install_uninstall_default_route(struct bgp *bgp_vrf,
+ afi_t afi, safi_t safi,
+ bool add);
extern void evpn_rt_delete_auto(struct bgp *, vni_t, struct list *);
extern void bgp_evpn_configure_export_rt_for_vrf(struct bgp *bgp_vrf,
struct ecommunity *ecomadd);
extern struct evpnes *bgp_evpn_es_new(struct bgp *bgp, esi_t *esi,
struct ipaddr *originator_ip);
extern void bgp_evpn_es_free(struct bgp *bgp, struct evpnes *es);
+extern bool bgp_evpn_lookup_l3vni_l2vni_table(vni_t vni);
#endif /* _BGP_EVPN_PRIVATE_H */