Changes between Version 64 and Version 65 of Projects/OpenLDAP


Ignore:
Timestamp:
Jul 4, 2012, 3:55:01 AM (7 years ago)
Author:
C Rempel
Comment:

/* SLAPD Test Idea */

Legend:

Unmodified
Added
Removed
Modified
  • Projects/OpenLDAP

    v64 v65  
    391391# verify the entry exists
    392392
     393Currently having rtems-shell SLAPD issues, but the general idea would be:
    393394The shell commands required would be
    394395  SHLL [/] slapd -d
    395396  SHLL [/] ldapadd -x -D "cn=Manager,dc=ldapdemo,dc=org" -W -f ldapdemo.ldif
    396397  SHLL [/] ldapsearch -x -b 'dc=ldapdemo,dc=org' '(objectclass=*)'
     398
     399An alternative approach might be to call "main functions".
     400
     401To find "main functions"
     402 openldap$ grep -r "int argc" servers
     403
     404So, the C implementation could look like:
     405
     406 typedef char * string;
     407 
     408 void Init(void)
     409 {
     410  string slapdstr[2];  // Make 2 strings
     411  string ldapaddstr[7];  // Make 7 strings
     412  string ldapsearchstr[5];  // Make 5 strings
     413
     414  slapdstr[0] = "slapd";
     415  slapdstr[1] = "-d";
     416     
     417  ldapaddstr[0] = "ldapadd";
     418  ldapaddstr[1] = "-x";
     419  ldapaddstr[2] = "-D";
     420  ldapaddstr[3] = "\"cn=Manager,dc=ldapdemo,dc=org\"";
     421  ldapaddstr[4] = "-W";
     422  ldapaddstr[5] = "-f";
     423  ldapaddstr[6] = "ldapdemo.ldif";
     424
     425  ldapsearchstr[0] = "ldapsearch";
     426  ldapsearchstr[1] = "-x";
     427  ldapsearchstr[2] = "-b";
     428  ldapsearchstr[3] = "\'dc=ldapdemo,dc=org\'";
     429  ldapsearchstr[4] = "\'(objectclass=*)\'";
     430
     431  main(2, slapdstr);
     432  slapadd(7, ldapaddstr);
     433  slapindex(5, ldapsearchstr);
     434
     435  return 0;
     436} [http://cboard.cprogramming.com/c-programming/62187-array-strings-c.html]
     437
     438Another possibility would be to look into the ldap C API
    397439=  Current / Future Directions  =
    398440