Custom field validator for IP address with subnet included
Custom field validator for IP address with subnet included

Hi,
I have to use the postgresql field type 'inet'.
This is an field for an IP address with netmask included (ex: 1.1.0.0/16) .
IPv4 and IPv6 did work.
The build in validator for IP did not work with a subnetmask.
It looks like I need a custom field validator.
Can someone give me a hint how to start with this validator or did someone have this already in place?
I have already some php classes in place wich are able to check this but I am not sure who to include this.
Thanks and regards
Axel
Answers
Sorry, I forgot the current code with the standard ip check:
Thanks
Hi,
You'll need a custom validator function for this. You could use a regex if you just need to check for the IP with a netmask, or if you need to confirm that IP is in a certain range a function like this might help.
Allan