Discussion:
How search networkAddress from perl in the LDAP(eDIr)
(too old to reply)
Serg
2006-03-11 19:32:23 UTC
Permalink
I need found user which login from ip: 10.1.1.1
Found from the perl script..
From ldapbrowser i connect to the my eDir and look: not plain text in
the field: networkAdrress. :(

How search from the perl by field networkAddress ??

Serg
Susan Perrin
2006-03-15 20:38:40 UTC
Permalink
Hi

NetworkAddress is defined at
http://developer.novell.com/ndk/doc/ndslib/schm_enu/data/sdk4170.html#sdk4170

Note that it is syntax Net Address which only supports equality matching.

The types are defined at
http://developer.novell.com/ndk/doc/ndslib/nds__enu/data/hniuyp90.html#hniuyp90

The search filter would be (networkaddress=int#octetstring) where int is the
type and octetstring is the ip address in hex, preceeded by \. For
example,if you have a udp connection:

1#\0a\01\01\01

You can use dsbrowse to view the hex value of the octet string following the
tag.

The problem is when the type requires port because you can't know the
localport. This is the case with type 9 tcp. So for example, on my client,
I'm searching with filter => '(networkAddress=9#\\0a\\a5\\c0\\a8\\00\\05)'
which works because my localport happens to be 2725 (my ip is 192.168.0.5).

In the case of NCP servers, the port is 524 \02\0c for the listening port.

So unless you're always connecting with udp, you really can't do it because
the syntax doesn't include substring matching.

Look at dsbrowse to make sure you're using what you think you should be
using, if you're testing.

Thank you
Susan

Loading...