diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2024-05-21 15:57:04 +1000 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2024-05-22 23:20:55 +0200 |
commit | a63199832a737dde45500e4037608727701c782f (patch) | |
tree | 951f21bedabaea40886003cfb3c68aa51ef9d156 /inany.c | |
parent | 7a832a8a0edbdd5a705c1fe03fca0790a535ab11 (diff) | |
download | passt-a63199832a737dde45500e4037608727701c782f.tar passt-a63199832a737dde45500e4037608727701c782f.tar.gz passt-a63199832a737dde45500e4037608727701c782f.tar.bz2 passt-a63199832a737dde45500e4037608727701c782f.tar.lz passt-a63199832a737dde45500e4037608727701c782f.tar.xz passt-a63199832a737dde45500e4037608727701c782f.tar.zst passt-a63199832a737dde45500e4037608727701c782f.zip |
inany: Better helpers for using inany and specific family addrs together
This adds some extra inany helpers for comparing an inany address to
addresses of a specific family (including special addresses), and building
an inany from an IPv4 address (either statically or at runtime).
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'inany.c')
-rw-r--r-- | inany.c | 17 |
1 files changed, 2 insertions, 15 deletions
@@ -17,21 +17,8 @@ #include "siphash.h" #include "inany.h" -const union inany_addr inany_loopback4 = { - .v4mapped = { - .zero = { 0 }, - .one = { 0xff, 0xff, }, - .a4 = IN4ADDR_LOOPBACK_INIT, - }, -}; - -const union inany_addr inany_any4 = { - .v4mapped = { - .zero = { 0 }, - .one = { 0xff, 0xff, }, - .a4 = IN4ADDR_ANY_INIT, - }, -}; +const union inany_addr inany_loopback4 = INANY_INIT4(IN4ADDR_LOOPBACK_INIT); +const union inany_addr inany_any4 = INANY_INIT4(IN4ADDR_ANY_INIT); /** inany_ntop - Convert an IPv[46] address to text format * @src: IPv[46] address |