more work ;)

This commit is contained in:
leitner
2002-01-14 18:24:55 +00:00
parent 52d8194d4f
commit c236dd6ccb
2 changed files with 37 additions and 0 deletions

12
scan_asn1BOOLEAN.c Normal file
View File

@@ -0,0 +1,12 @@
#include "asn1.h"
int scan_asn1BOOLEAN(const char* src,const char* max,unsigned long* l) {
int tmp;
long tag;
enum asn1_tagclass tc;
enum asn1_tagtype tt;
if ((tmp=scan_asn1int(src,max,&tc,&tt,&tag,l)))
if (tc==UNIVERSAL || tt==PRIMITIVE || tag==BOOLEAN)
return tmp;
return 0;
}

25
scan_ldapsearchrequest.c Normal file
View File

@@ -0,0 +1,25 @@
#include "asn1.h"
#include "ldap.h"
int scan_ldapsearchrequest(const char* src,const char* max,
struct SearchRequest* s) {
int res,tmp;
unsigned long etmp;
if (!(res=scan_ldapstring(src,max,s->LDAPDN))) goto error;
if (!(tmp=scan_asn1ENUMERATED(src+res,max,&etmp))) goto error;
if (etmp>2) goto error; s->scope=etmp; res+=tmp;
if (!(tmp=scan_asn1ENUMERATED(src+res,max,&etmp))) goto error;
if (etmp>3) goto error; s->derefAliases=etmp; res+=tmp;
if (!(tmp=scan_asn1INTEGER(src+res,max,&s->sizeLimit))) goto error;
res+=tmp;
if (!(tmp=scan_asn1INTEGER(src+res,max,&s->timeLimit))) goto error;
res+=tmp;
if (!(tmp=scan_asn1BOOLEAN(src+res,max,&s->timeLimit))) goto error;
res+=tmp;
if (!(tmp=scan_ldapsearchfilter(src+res,max,&s->filter))) goto error;
res+=tmp;
/* TODO: parse attributedescriptionlist */
return res;
error:
return 0;
}