]> git.ipfire.org Git - thirdparty/ulogd2.git/commit
IP2BIN, IP2HBIN, IP2STR: refactor `interp` call-backs
authorJeremy Sowden <jeremy@azazel.net>
Mon, 26 May 2025 17:19:02 +0000 (18:19 +0100)
committerFlorian Westphal <fw@strlen.de>
Sun, 1 Jun 2025 12:12:47 +0000 (14:12 +0200)
commitc0f9d1950e0968688558c2abbaa41cffd03f19de
tree082d6c952dd36064b2fa1fa6501e0553123eea24
parent6498d29aa15557428aa62f37c478a602e03bd740
IP2BIN, IP2HBIN, IP2STR: refactor `interp` call-backs

IP2STR and IP2BIN do all family checks inside the for-loop that converts the
address fields, whereas IP2HBIN does the checks once before the loop.  Refactor
the former to do as the latter.

Also, move all the remaining contents of the for-loops, apart from the
`pp_is_valid` checks, into `ip2*` functions.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Florian Westphal <fw@strlen.de>
filter/ulogd_filter_IP2BIN.c
filter/ulogd_filter_IP2HBIN.c
filter/ulogd_filter_IP2STR.c