I need some help to get squid to validate user's IP taken from an (open)LDAP server.

Basically, the LDAP server will have each users  username, password and ip
When connecting to squid,
auth_param basic program /usr/lib/squid/squid_ldap_auth -b "O=XXXXXXX" -f "(&(uid=%s))" -h XXXXXXXX
this is ok and working nicely

Any help on this?
Has to be done via the IP information stored in LDAP. There seems to be lots of ways to validate the IP from a file (txt), but that is not what i need.

Thanks in advance