summaryrefslogtreecommitdiffstats
path: root/ldif.h
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-21 16:31:06 +0200
committerSimon Rettberg2017-04-21 16:31:06 +0200
commitb61176f17b59a94750dff1f959231dadc4e6078a (patch)
tree88ee419323ba332a1dd06c5aa801c87f59b36bb3 /ldif.h
parentldadp.h: Add missing SearchRequestReference opcode (diff)
downloadldadp-b61176f17b59a94750dff1f959231dadc4e6078a.tar.gz
ldadp-b61176f17b59a94750dff1f959231dadc4e6078a.tar.xz
ldadp-b61176f17b59a94750dff1f959231dadc4e6078a.zip
Update ldap/asn1/... files with current tinyldap
Diffstat (limited to 'ldif.h')
-rw-r--r--ldif.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/ldif.h b/ldif.h
new file mode 100644
index 0000000..fc6496b
--- /dev/null
+++ b/ldif.h
@@ -0,0 +1,32 @@
+#define _FILE_OFFSET_BITS 64
+#include <sys/stat.h>
+#include <inttypes.h>
+#include "asn1.h"
+#include "ldap.h"
+
+/* how many attributes do we allow per record? */
+#define ATTRIBS 100
+
+struct attribute {
+ uint32_t name, value;
+};
+
+struct ldaprec {
+ uint32_t dn;
+ unsigned int n; /* number of attributes */
+ struct attribute a[ATTRIBS];
+ struct ldaprec* next;
+};
+
+extern uint32_t dn, mail, sn, cn, objectClass;
+extern struct ldaprec *first;
+extern unsigned long ldifrecords;
+
+int ldif_parse(const char* filename,off_t fromofs,struct stat* ss);
+
+/* return non-zero if the record matches the search request */
+int ldap_match(struct ldaprec* r,struct SearchRequest* sr);
+int ldap_match_mapped(uint32_t ofs,struct SearchRequest* sr);
+int ldap_match_present(uint32_t ofs,uint32_t attrofs);
+uint32_t ldap_find_attr_value(uint32_t ofs,uint32_t attrofs);
+int ldap_matchfilter_mapped(uint32_t ofs,struct Filter* f);