dnsjit.filter.ipsplit(3)
π dnsjit.filter.ipsplit β from the dnsjit manual, section 3 π
okay bestie, gather round, because this one is literally so satisfying once it clicks. it's dnsjit.filter.ipsplit, and it's the little filter that sorts your packets by who sent them. let's get into it π«Ά
β¨ NAME β¨
dnsjit.filter.ipsplit β pass objects to receivers based on the source IP address π
πΈ SYNOPSIS πΈ
local ipsplit = require("dnsjit.filter.ipsplit").new()
ipsplit.receiver(...)
ipsplit.receiver(...)
ipsplit.receiver(...)
input.receiver(ipsplit)
look at that. three receivers, one filter, zero drama. the way that just works π
π¦ DESCRIPTION π¦
so the filter passes objects on to other receivers. that's its whole job and it does it gorgeously.
any object chain that doesn't have an IPv4/IPv6 packet in it? discarded. bye π not invited.
packets that share the same source IP address are considered to be sent from the same "client". that's the whole mental model, bestie β source IP = client identity, periodt.
when the first packet from a client gets processed, that client gets assigned to a receiver. and then? every single object from that client goes to the assigned receiver. forever (well, for the lifetime of the filter, but you get the vibe). no flip-flopping, no chaos. main character consistency π
oh and bonus feature: the filter can also write a receiver-specific client ID (starting from 1) into the source or destination IP in the packet. cute, right?
π§ Functions π§
IpSplit.new()β creates a brand new IpSplit filter. fresh out the box, ready to slay β¨IpSplit:log()β hands you the Log object so you can control logging for this instance or module. useful when you're like "wait why is stuff disappearing" πIpSplit:receive()β returns the C functions and context for receiving objects. that's the plumbing, don't touch it, just trust it π«ΆIpSplit:receiver(o, weight)β set the receiver that objects get passed to. call it multiple times to add more receivers, stack 'em up π- the
weightparameter adjusts how clients get distributed among receivers. weightmust be a positive integer.- default is
1.
- the
IpSplit:discarded()β the number of input packets that got discarded for various reasons. ngl if this number is big, something's up. to investigate causes, run with an increased logging level πIpSplit:sequential()β sets the client assignment mode to sequential. it assignsweightclients to a receiver before moving on to the next receiver. this is the default mode, bestie. it's giving orderly. it's giving line leader energy πIpSplit:random(seed)β sets the client assignment mode to random. each client gets randomly assigned to a receiver, andweightaffects the probability. the important part: the client assignment is stable (and portable) for a givenseed. so same seed, same split, every time. reproducibility ate and left no crumbs πIpSplit:overwrite_none()β don't overwrite the source or destination IP. this is the default πIpSplit:overwrite_src()β write the receiver-specific client ID into bytes 0-3 of the source IP (host byte order). noted. exact. don't forget the byte order, iykyk πIpSplit:overwrite_dst()β write the receiver-specific client ID into bytes 0-3 of the destination IP (host byte order). same deal, different field π
π AUTHORS and CONTRIBUTORS π
these absolute legends made it happen:
- Jerry LundstrΓΆm (DNS-OARC)
- TomΓ‘Ε‘ KΕΓΕΎek (CZ.NIC)
- Petr Ε paΔek (ISC)
maintained by DNS-OARC π
https://www.dns-oarc.net/
π BUGS π
found a bug? want a feature? pls don't suffer in silence, go here:
https://codeberg.org/DNS-OARC/dnsjit/issues
got a question or just need a hand? hit up:
admin@dns-oarc.net
fr fr, if something's acting cursed, the issue tracker is the move. they're nice, i promise π«Ά
and that's the whole page, bestie!! this was dnsjit.filter.ipsplit(3) from dnsjit version 1.5.1 β go split those clients, stay stable with your seed, and don't forget to check discarded() when things get weird. mwah π
β¨ππ¦πΈπ
π¦ where this page comes from
- epel 10: dnsjit 1.5.1-2.el10_2 Β· GPL-3.0-or-later
- epel 9: dnsjit 1.5.1-2.el9 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 43: dnsjit 1.5.1-2.fc43 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- fedora 44: dnsjit 1.5.1-2.fc44 Β· GPL-3.0-or-later
- ubuntu resolute: dnsjit 1.5.1-2 Β· GPL-3.0-or-later
- ubuntu stonking: dnsjit-dev 1.5.1-6 Β· GPL-3.0-or-later
- Copyright (c) 2018-2026 OARC, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms