Wietse Venema wrote:
Postfix address wild-card support
=================================
There is a need for IP address pattern matching that is more
convenient than regular expressions or shell-like patterns.
Specifically, we need patterns for the _numbers_ in an IP address,
instead of patterns for individual characters in a human-readable
string.
In the text below we'll explore the problem, opportunities for
generalization, implementation requirements, and a simple API.
This is my personal opinion - not a statement of "fact".
First, I dislike re-inventing the wheel :-)
I assume the authors took into consideration existing interfaces,
and "pattern matching" tools? A good example would be the PostgreSQL
CIDR data type.
What you propose is in some ways more flexible than Pg but makes
using the Pg data type non trivial.
The other common Postfix backend (MySQL) does not have a CIDR type
but coercion to/from int8 - (with significant bit count) has been used
in the past. This allows bitmask operations to be employed within the
database similar to the Pg implementation.
My only concern with (say) the postgres CIDR model is that its "sigbits"
model does not allow for n.n.n.n-n.n.n.n used quite often in various firewalls.
Personally (even in firewalls) I prefer to use /nn as this is often implemented
far more effctively in say iptables or postgres.
Jacqui