diff src/items.rs @ 11:827faa554528

Added items module.
author Marc Brinkmann <git@marcbrinkmann.de>
date Sun, 26 Feb 2017 12:08:11 +0100
parents
children 30831c70e5c0
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/items.rs	Sun Feb 26 12:08:11 2017 +0100
@@ -0,0 +1,70 @@
+use std::marker::PhantomData;
+use constants::{PamItemType, PAM_SERVICE, PAM_USER, PAM_USER_PROMPT, PAM_TTY, PAM_RUSER, PAM_RHOST,
+                PAM_AUTHTOK, PAM_OLDAUTHTOK};
+use module::PamItem;
+pub use conv::PamConv;
+
+
+pub struct PamService {}
+
+impl PamItem for PamService {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_SERVICE
+    }
+}
+
+pub struct PamUser {}
+
+impl PamItem for PamUser {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_USER
+    }
+}
+
+pub struct PamUserPrompt {}
+
+impl PamItem for PamUserPrompt {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_USER_PROMPT
+    }
+}
+
+pub struct PamTty {}
+
+impl PamItem for PamTty {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_TTY
+    }
+}
+
+pub struct PamRUser {}
+
+impl PamItem for PamRUser {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_RUSER
+    }
+}
+
+pub struct PamRHost {}
+
+impl PamItem for PamRHost {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_RHOST
+    }
+}
+
+pub struct PamAuthTok {}
+
+impl PamItem for PamAuthTok {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_AUTHTOK
+    }
+}
+
+pub struct PamOldAuthTok {}
+
+impl PamItem for PamOldAuthTok {
+    fn item_type(_: PhantomData<Self>) -> PamItemType {
+        PAM_OLDAUTHTOK
+    }
+}