http://ptxscriptdb.psycho-chihuahua.net/e107_plugins/docrep_menu/docrep.php?0.view.69.18.
-- rewritten cmpletely for use with PtokaX 0.3.4.0 range management
-- added CIDR support (RFC 1518)
-- removed listing of range bans, added searching instead
-- separate temp. and perm. ban management
-- configurable with LuaSlave
-- full rightclick support
Enjoy!
Quote from: bastya_elvtars on 24 April, 2006, 17:50:25
http://ptxscriptdb.psycho-chihuahua.net/e107_plugins/docrep_menu/docrep.php?0.view.69.18.
-- rewritten cmpletely for use with PtokaX 0.3.4.0 range management
-- added CIDR support (RFC 1518)
-- removed listing of range bans, added searching instead
-- separate temp. and perm. ban management
-- configurable with LuaSlave
-- full rightclick support
Enjoy!
I love this script... very nice work ;)
CIDR --> IP Range conversion works in non-standard way in this script...
? ? ? local sIP=RangeFucker.Calculate(ip)+1
? ? ? local eIP=RangeFucker.Calculate(ip)+2^(32-cidr)-1
will fail to give same IP ranges for 192.168.1.10/24 and 192.168.1.100/24 but they are both the same thing. You can test here (http://grox.net/utils/whatmask/) or here (http://jodies.de/ipcalc).
Check my code here (http://forum.ptokax.org/index.php?topic=4541#msg60082), as far as I tested it's working as it should..
Quote from: GeceBekcisi on 29 May, 2006, 23:19:50
CIDR --> IP Range conversion works in non-standard way in this script...
local sIP=RangeFucker.Calculate(ip)+1
local eIP=RangeFucker.Calculate(ip)+2^(32-cidr)-1
will fail to give same IP ranges for 192.168.1.10/24 and 192.168.1.100/24 but they are both the same thing. You can test here (http://grox.net/utils/whatmask/) or here (http://jodies.de/ipcalc).
Check my code here (http://forum.ptokax.org/index.php?topic=4541#msg60082), as far as I tested it's working as it should..
Well, if this is non-standard, it sure would not be in e. g. OpenBSD's pf in the way it is in my little script. Or, this is a quitem widespread nonstandard thing, I'll leave it as is.
Quote from: bastya_elvtars on 29 May, 2006, 23:42:47
Well, if this is non-standard, it sure would not be in e. g. OpenBSD's pf in the way it is in my little script. Or, this is a quitem widespread nonstandard thing,? I'll leave it as is.
Calculate(ip)+2^(32-cidr)-1 will give you the size of the IP range, and yes, you're true, it's widely believed that this can give you you the IP range but you can't make simple calculations based on that..
Check any CIDR --> IP range tool you can find and try the examples above; 192.168.1.10/24 & 192.168.1.100/24 and compare them with your results...
Your script will produce
192.168.1.10/24 -->
192.168.1.10 - 192.168.2.9192.168.1.100/24 -->
192.168.1.100 - 192.168.2.99where they have to be same and
192.168.1.0 - 192.168.1.255
Yes, true, but from my point of view this is absolutely OK, since I want to get on with this common mistake. I know I should binarize IPs and do bitwise operations to check who belongs under what netmask, but since PtokaX range ban implementation is permissive enough to allow such addressing schemes, I'll stick with this, even though it would be easy to switch, cause this is the more popular one.
Thanks mate, if it's OK for you it's OK for me too.. I was just trying to point that your CIDR support is not RFC-1518 compliant..
Quote from: GeceBekcisi on 30 May, 2006, 00:17:44
Thanks mate, if it's OK for you it's OK for me too.. I was just trying to point that your CIDR support is not RFC-1518 compliant..
Anyhow, supporting CIDR is just eyecandy, very few use it actually. :-)
2.5 is going to come soon. I wrote bitwise routines using LuaBit , will be 5.1 only and will have dotted netmask support as well.