Files
mars-tinyldap/scan_ldapmessage.c
leitner 2d32361380 check in work in progress.
Please see README.
2002-01-14 16:14:31 +00:00

23 lines
592 B
C

#include "asn1.h"
#include "ldap.h"
int scan_ldapmessage(const char* src,const char* max,
long* messageid,long* op,long* len) {
int res,tmp;
if (!(res=scan_asn1SEQUENCE(src,max,len))) goto error;
if (!(tmp=scan_asn1INTEGER(src+res,max,messageid))) goto error;
res+=tmp;
{
enum asn1_tagclass tc;
enum asn1_tagtype tt;
if (!(tmp=scan_asn1tag(src+res,max,&tc,&tt,op))) goto error;
if (tc!=APPLICATION || tt!=CONSTRUCTED) goto error;
res+=tmp;
if (!(tmp=scan_asn1length(src+res,max,len))) goto error;
res+=tmp;
}
return res;
error:
return 0;
}