]>
git.ipfire.org Git - thirdparty/bird.git/blob - lib/ip.h
2 * BIRD Internet Routing Daemon -- The Internet Protocol
4 * (c) 1998 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL.
18 #define ipa_in_net(x,n,p) (!ipa_nonzero(ipa_and(ipa_xor((n),(x)),ipa_mkmask(p))))
21 * ip_classify() returns either a negative number for invalid addresses
22 * or scope OR'ed together with address type.
25 #define IADDR_INVALID -1
26 #define IADDR_SCOPE_MASK 0xfff
27 #define IADDR_HOST 0x1000
28 #define IADDR_BROADCAST 0x2000
29 #define IADDR_MULTICAST 0x4000
38 #define SCOPE_ORGANIZATION 3
39 #define SCOPE_UNIVERSE 4
41 char *ip_scope_text(unsigned);
52 #define ip_is_prefix(a,l) (!ipa_nonzero(ipa_and(a, ipa_not(ipa_mkmask(l)))))
55 * Conversions between internal and string representation
58 char *ip_ntop(ip_addr a
, char *);
59 char *ip_ntox(ip_addr a
, char *);
60 int ip_pton(char *a
, ip_addr
*o
);