[Accel-ppp-users] [PATCH 0/3] utils: implement IPv4 parsing primitive for iprange
Status: Beta
Brought to you by:
xebd
From: Guillaume N. <g....@al...> - 2018-12-07 16:37:54
|
This series extends utils.c with IPv4 parsing functions. The objective is to simplify the code having to deal with IPv4 text representations (for parsing and for printing). Patch 1 redefines u_parse_ip4addr() to make it work like its IPv6 counterpart. Patch 2 defines u_ip4str(), to easily print an IPv4 from a printf()-like function. It also adds u_parse_ip4cidr() and u_parse_ip4range() to simplify the parsing of IPv4 addresse ranges. Patch 3 uses these new functions to simplify the parsing of the [client-ip-range] section (accel-ppp.conf). Next, I'm planning to rework the RADIUS Framed-Route attribute parsing if this approach is considered useful. Guillaume Nault (3): utils: rework u_parse_ip4addr() utils: add IPv4 string parsing helpers iprange: rework range parsing using u_parse_*() functions accel-pppd/iprange.c | 159 +++++++++++++++++-------------------------- accel-pppd/utils.c | 130 ++++++++++++++++++++++++++++------- accel-pppd/utils.h | 7 +- 3 files changed, 172 insertions(+), 124 deletions(-) -- 2.20.0.rc1 |