Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

SourceAddressKey

function SourceAddressKey(const aRemote: string; aIPv6PrefixBits: Integer): string;
WHAT COUNTS AS ONE SOURCE, for a limit or a count kept per peer. The text may carry a port ('192.0.2.1:25', '[2001:db8::1]:25'), brackets and an IPv6 zone, and all three go. An IPv4 address is its dotted quad. An IPv4-mapped IPv6 address (::ffff:a.b.c.d) is that IPv4 address, so a peer reported by a dual-stack socket and by an IPv4 one is the same source. Any other IPv6 address is its first aIPv6PrefixBits bits: lower-case hexadecimal octets, the last one masked, then '/' and the bit count ('20010db8000000a1/64'). RFC 4291 sec.2.5.4 gives a global unicast address a 64-bit interface identifier, so one host may hold every address of its /64. Text that is not an address literal is returned trimmed and in lower case. aIPv6PrefixBits is 1..128; anything else raises EstSocketAddressError rather than widening or narrowing the count.