Added ipa_compare as requested.
This commit is contained in:
parent
38506f71b0
commit
2f5d154466
1 changed files with 6 additions and 0 deletions
|
@ -56,6 +56,7 @@ typedef u32 ip_addr;
|
||||||
#define ipa_class_mask(x) x = _MI(ipv4_class_mask(_I(x)))
|
#define ipa_class_mask(x) x = _MI(ipv4_class_mask(_I(x)))
|
||||||
#define ipa_from_u32(x) _MI(x)
|
#define ipa_from_u32(x) _MI(x)
|
||||||
#define ipa_to_u32(x) _I(x)
|
#define ipa_to_u32(x) _I(x)
|
||||||
|
#define ipa_compare(x,y) ipv4_compare(_I(x),_I(y))
|
||||||
|
|
||||||
int ipv4_classify(u32);
|
int ipv4_classify(u32);
|
||||||
u32 ipv4_class_mask(u32);
|
u32 ipv4_class_mask(u32);
|
||||||
|
@ -68,4 +69,9 @@ static inline unsigned ipv4_hash(u32 a)
|
||||||
return a & 0xffff;
|
return a & 0xffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int ipv4_compare(u32 x, u32 y)
|
||||||
|
{
|
||||||
|
return (x > y) - (x < y);
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue