diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-02-11 23:26:57 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-02-11 23:26:57 +0100 |
commit | 0af11f97b582754df36b588e04fd9d9377b50823 (patch) | |
tree | 040f31c4fb33a1b11b39fc02a16f14a147097bdd /sys/include | |
parent | 66b9196f77442ba8a2cbb1396c7640fd4176c4eb (diff) |
libip: replace v4parsecidr() with new parseipandmask()
we want to accept V4 subnets in CIDR notation consistently which
means we need to interpret the mask in context of the IP address.
so parseipmask() now has an additional v4 flag argument which
offsets the prefixlength by 96 so a /24 will be interpreted
as a /120.
parseipandmask() is the new function which handles this automatically
depending on the ip address type.
v4parsecidr() is now obsolete.
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/ip.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/include/ip.h b/sys/include/ip.h index 56e707729..c2ab8dcf8 100644 --- a/sys/include/ip.h +++ b/sys/include/ip.h @@ -161,9 +161,9 @@ void maskip(uchar*, uchar*, uchar*); int eipfmt(Fmt*); int isv4(uchar*); vlong parseip(uchar*, char*); -vlong parseipmask(uchar*, char*); +vlong parseipmask(uchar*, char*, int); +vlong parseipandmask(uchar*, uchar*, char*, char*); char* v4parseip(uchar*, char*); -char* v4parsecidr(uchar*, uchar*, char*); int parseether(uchar*, char*); int myipaddr(uchar*, char*); int myetheraddr(uchar*, char*); |