LDAP *ld;
LDAPControl *tppldapctrl[3], ldapctrl;
char *PortNumber = "123";
int version;
ldapctrl.ldctl_oid = "2.16.840.1.113730.3.4.2";
ldapctrl.ldctl_value.bv_len = strlen(PortNumber);
ldapctrl.ldctl_value.bv_val = PortNumber;
ldapctrl.ldctl_iscritical = 1;
tppldapctrl[0] = &ldapctrl;
tppldapctrl[1] = NULL;
tppldapctrl[2] = NULL;
/*
typedef struct berval {
unsigned long bv_len;
char *bv_val;
};
typedef struct ldapcontrol {
char *ldctl_oid;
struct berval ldctl_value;
char ldctl_iscritical;
} LDAPControl, *PLDAPControl;
*/
ldap_init( "", "" );
version = LDAP_VERSION3;
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version );
ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, tppldapctrl);
ldap_bind_s( ld, "", "",LDAP_AUTH_SIMPLE);
This works, I get the port number on the other computer.
But how to translate that in Perl, that is the question.
In the ldap_set_option (API.pm file), optdata is an integer,
I conclude it should represent an address (?).
Cheers,
Olivier.
Philip Newton wrote:
--Olivier CLERE wrote:
> The "navigator" is Netscape Communicator.From the API.pm, I assume you're using LDAP to talk to Netscape Communicator. This was not clear to me previously.
> Enclosed you will find the API.pm
> file, which is used by my
> program. Inside the ldap_set_option
> function is defined.And indeed it does describe ldap_set_option, but very briefly. And you are right, it says the last parameter is an integer, but it doesn't say where this value comes from.
But in your C code, you say function is called like "ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, tppldapctrl)" -- I wonder what the "tpp" at the beginning of the third parameter stands for. Maybe a (something?) to a pointer to a pointer? Is this also an integer? How do you generate tppldapctrl from ldapctrl or from tableau?
Cheers,
Philip
===========================================
Olivier CLERE
Intégration de Systèmes de Communication
Groupe CS Communications & Systems
88, rue Brillat-Savarin 75013 PARIS
E-mail: [EMAIL PROTECTED]
===========================================
---
You are currently subscribed to perl-win32-users as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]
