return 1;
}
-void prefix_copy(struct prefix *dest, const struct prefix *src)
+void prefix_copy(union prefixptr udest, union prefixconstptr usrc)
{
+ struct prefix *dest = udest.p;
+ const struct prefix *src = usrc.p;
+
dest->family = src->family;
dest->prefixlen = src->prefixlen;
* the same. Note that this routine has the same return value sense
* as '==' (which is different from prefix_cmp).
*/
-int prefix_same(const struct prefix *p1, const struct prefix *p2)
+int prefix_same(union prefixconstptr up1, union prefixconstptr up2)
{
+ const struct prefix *p1 = up1.p;
+ const struct prefix *p2 = up2.p;
+
if ((p1 && !p2) || (!p1 && p2))
return 0;
* this routine has the same return sense as strcmp (which is different
* from prefix_same).
*/
-int prefix_cmp(const struct prefix *p1, const struct prefix *p2)
+int prefix_cmp(union prefixconstptr up1, union prefixconstptr up2)
{
+ const struct prefix *p1 = up1.p;
+ const struct prefix *p2 = up2.p;
int offset;
int shift;
int i;
extern int prefix_match(const struct prefix *, const struct prefix *);
extern int prefix_match_network_statement(const struct prefix *,
const struct prefix *);
-extern int prefix_same(const struct prefix *, const struct prefix *);
-extern int prefix_cmp(const struct prefix *, const struct prefix *);
+extern int prefix_same(union prefixconstptr, union prefixconstptr);
+extern int prefix_cmp(union prefixconstptr, union prefixconstptr);
extern int prefix_common_bits(const struct prefix *, const struct prefix *);
-extern void prefix_copy(struct prefix *dest, const struct prefix *src);
+extern void prefix_copy(union prefixptr, union prefixconstptr);
extern void apply_mask(struct prefix *);
extern struct prefix *sockunion2prefix(const union sockunion *dest,