From 4cefa1ecc4ef0b8103aac20d37d96a10f39ce182 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Sat, 6 Mar 2021 21:23:39 +0100 Subject: [PATCH] Add basic LDAP structs --- src/domain/messages.rs | 28 ++++++++++++++++++++++++++++ src/domain/mod.rs | 1 + 2 files changed, 29 insertions(+) create mode 100644 src/domain/messages.rs create mode 100644 src/domain/mod.rs diff --git a/src/domain/messages.rs b/src/domain/messages.rs new file mode 100644 index 0000000..a0d5df8 --- /dev/null +++ b/src/domain/messages.rs @@ -0,0 +1,28 @@ + +struct LdapMessage { + message_id: u32, + operation: LdapOperation, +} + +enum LdapOperation { + BindRequest(BindRequest), + BindResponse(BindResponse), + //UnbindRequest(UnbindRequest), +} + +struct BindRequest { + version: u8, + name: String, + authentication: AuthenticationChoice, +} + +enum AuthenticationChoice { + Simple(String), + // Sasl +} + +struct BindResponse { + result_code: u8, + matched_dn: String, + diagnostic_message: String, +} diff --git a/src/domain/mod.rs b/src/domain/mod.rs new file mode 100644 index 0000000..87a2b7b --- /dev/null +++ b/src/domain/mod.rs @@ -0,0 +1 @@ +mod messages;