getdata: add cidr range support

This makes 'range6 123::/45' style cidr notation to be understood as address
range.  Earlier ranges that used cidr failed to parse completely.

Reported-by: Jeff Bailey <jeffrey.bailey@bt.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola 2017-09-17 00:03:06 +01:00
parent 48d0629881
commit bb0fa9adae
No known key found for this signature in database
GPG key ID: A9553245FDE9B739
13 changed files with 175 additions and 5 deletions

View file

@ -238,6 +238,8 @@ extern int parse_ipaddr_init(const char *restrict src,
extern int parse_ipaddr_v4(const char *restrict src, union ipaddr_t *restrict dst);
extern int parse_ipaddr_v6(const char *restrict src, union ipaddr_t *restrict dst);
extern void parse_cidr(struct range_t *range_p, const char *word);
extern void (*copy_ipaddr) (union ipaddr_t *restrict dst, const union ipaddr_t *restrict src);
extern void copy_ipaddr_init(union ipaddr_t *restrict dst,
const union ipaddr_t *restrict src);