-#define IP4_MIN_MTU 576 /* RFC 2328 A.1 */
-#define IP6_MIN_MTU 1280 /* RFC 5340 A.1 */
+#define IP4_MIN_MTU 576
+#define IP6_MIN_MTU 1280
#define IP4_OSPF_ALL_ROUTERS ipa_build4(224, 0, 0, 5)
#define IP4_OSPF_DES_ROUTERS ipa_build4(224, 0, 0, 6)
#define IP6_NONE _MI6(0,0,0,0)
#define IPA_NONE IP6_NONE
+#define IP_PREC_INTERNET_CONTROL 0xc0
+
/*
* Use the structural representation when you want to make sure
#define ipa_xor(x,y) ip6_xor(x,y)
#define ipa_not(x) ip6_not(x)
+/* These should be used when both IPv4 and IPv6 zero addresses should be checked */
+/* Zero address is either token for invalid/unused, or prefix for default route */
+
+static inline int ipa_zero2(ip6_addr a)
+{ return !_I0(a) && !_I1(a) && ((_I2(a) == 0) || (_I2(a) == 0xffff)) && !_I3(a); }
+
+static inline int ipa_nonzero2(ip6_addr a)
+{ return _I0(a) || _I1(a) || ((_I2(a) != 0) && (_I2(a) != 0xffff)) || _I3(a); }
+
+
#define ip4_equal(x,y) (_I(x) == _I(y))
#define ip4_zero(x) (!_I(x))
#define ip4_nonzero(x) _I(x)
int ip4_classify(ip4_addr ad);
int ip6_classify(ip6_addr *a);
+static inline int ipa_classify_net(ip_addr a)
+{ return ipa_zero2(a) ? (IADDR_HOST | SCOPE_UNIVERSE) : ipa_classify(a); }
+
#define ipa_is_link_local(a) ip6_is_link_local(a)
static inline int ip6_is_link_local(ip6_addr a)
* Network prefixes
*/
-static inline int ipa_classify_net(ip_addr a)
-{ return ipa_zero(a) ? (IADDR_HOST | SCOPE_UNIVERSE) : ipa_classify(a); }
/*
#define MAX_PREFIX_LENGTH 32
/*
#define ip_skip_header(x, y) ipv4_skip_header(x, y)
-#define IP_PREC_INTERNET_CONTROL 0xc0
+
*/
void fn_print(char *buf, int buflen, struct fib_node *n);
-
-
/* In IPv6, SOCK_RAW does not return packet header */
#define ip_skip_header(x, y) x
-/*
- * RFC 1883 defines packet precendece, but RFC 2460 replaces it
- * by generic Traffic Class ID with no defined semantics. Better
- * not use it yet.
- */
-#define IP_PREC_INTERNET_CONTROL -1
-
#endif