#include <zebra.h>
+#include "command.h"
#include "prefix.h"
#include "ipaddr.h"
#include "vty.h"
return buf;
}
+bool ipv4_unicast_valid(const struct in_addr *addr)
+{
+ in_addr_t ip = ntohl(addr->s_addr);
+
+ if (IPV4_CLASS_D(ip))
+ return false;
+
+ if (IPV4_CLASS_E(ip)) {
+ if (cmd_allow_reserved_ranges_get())
+ return true;
+ else
+ return false;
+ }
+
+ return true;
+}
+
printfrr_ext_autoreg_p("EA", printfrr_ea);
static ssize_t printfrr_ea(struct fbuf *buf, struct printfrr_eargs *ea,
const void *ptr)
#define IPV4_NET0(a) ((((uint32_t)(a)) & 0xff000000) == 0x00000000)
#define IPV4_NET127(a) ((((uint32_t)(a)) & 0xff000000) == 0x7f000000)
#define IPV4_LINKLOCAL(a) ((((uint32_t)(a)) & 0xffff0000) == 0xa9fe0000)
+#define IPV4_CLASS_D(a) ((((uint32_t)(a)) & 0xf0000000) == 0xe0000000)
+#define IPV4_CLASS_E(a) ((((uint32_t)(a)) & 0xf0000000) == 0xf0000000)
#define IPV4_CLASS_DE(a) ((((uint32_t)(a)) & 0xe0000000) == 0xe0000000)
#define IPV4_MC_LINKLOCAL(a) ((((uint32_t)(a)) & 0xffffff00) == 0xe0000000)
extern char *esi_to_str(const esi_t *esi, char *buf, int size);
extern char *evpn_es_df_alg2str(uint8_t df_alg, char *buf, int buf_len);
extern void prefix_evpn_hexdump(const struct prefix_evpn *p);
-
-static inline bool ipv4_unicast_valid(const struct in_addr *addr)
-{
-
- in_addr_t ip = ntohl(addr->s_addr);
-
- if (IPV4_CLASS_DE(ip))
- return false;
-
- return true;
-}
+extern bool ipv4_unicast_valid(const struct in_addr *addr);
static inline int ipv6_martian(const struct in6_addr *addr)
{