X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=secnet.git;a=blobdiff_plain;f=ipaddr.h;h=54f10d434367988a596f526c6fb1f267b75fe544;hp=f481b3e5f55c1f33a65c391d101915db88668aae;hb=5d8fc5c038cb1e4a213e5d0283ebfc5c853ac04f;hpb=fe5e9cc422cd72526ccfceffbc7e5af8ac83b407 diff --git a/ipaddr.h b/ipaddr.h index f481b3e..54f10d4 100644 --- a/ipaddr.h +++ b/ipaddr.h @@ -6,12 +6,12 @@ struct subnet { uint32_t prefix; uint32_t mask; - uint32_t len; + int len; }; struct subnet_list { - uint32_t entries; - uint32_t alloc; + int32_t entries; + int32_t alloc; struct subnet *list; }; @@ -20,15 +20,14 @@ struct iprange { }; struct ipset { - uint32_t l; /* Number of entries in list */ - uint32_t a; /* Allocated space in list */ + int32_t l; /* Number of entries in list */ + int32_t a; /* Allocated space in list */ struct iprange *d; }; extern struct subnet_list *subnet_list_new(void); extern void subnet_list_free(struct subnet_list *a); -extern void subnet_list_append(struct subnet_list *a, uint32_t prefix, - uint32_t len); +extern void subnet_list_append(struct subnet_list *a, uint32_t prefix, int len); static inline bool_t subnet_match(struct subnet s, uint32_t address) {