From 554f373cfa2e47253072b439ff1ad1e0d14682a7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Collignon?= Date: Mon, 26 Jun 2017 16:26:03 +0200 Subject: [PATCH] added the binding's stub. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Ifa41de28f071d013a4631f69fb238b53c2ab98e1 Signed-off-by: Loïc Collignon --- CMakeLists.txt | 5 +++ binding/CMakeLists.txt | 2 + binding/identity-binding.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++ pam/CMakeLists.txt | 1 + 4 files changed, 104 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 binding/CMakeLists.txt create mode 100644 binding/identity-binding.c create mode 100644 pam/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..87d1329 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.6) +project(agl-identity) + +add_subdirectory(pam) +add_subdirectory(binding) diff --git a/binding/CMakeLists.txt b/binding/CMakeLists.txt new file mode 100644 index 0000000..781e007 --- /dev/null +++ b/binding/CMakeLists.txt @@ -0,0 +1,2 @@ + +add_library(agl-identity SHARED identity-binding.c) \ No newline at end of file diff --git a/binding/identity-binding.c b/binding/identity-binding.c new file mode 100644 index 0000000..a0e9232 --- /dev/null +++ b/binding/identity-binding.c @@ -0,0 +1,96 @@ +#define _GNU_SOURCE +#define AFB_BINDING_PRAGMA_NO_VERBOSE_MACRO + +#include +#include +#include +#include +#include + +// ---------- Verb's declaration ---------------------------------------------- +static void verb_login(struct afb_req req); +static void verb_logout(struct afb_req req); +static void verb_open_session(struct afb_req req); +static void verb_close_session(struct afb_req req); +static void verb_set_data(struct afb_req req); +static void verb_get_data(struct afb_req req); + +// ---------- Binding's metadata ---------------------------------------------- +static const struct afb_auth _afb_auth_v2_identity[] = {}; + +static const struct afb_verb_v2 _afb_verbs_v2_identity[] = +{ + { + .verb = "login", + .callback = verb_login, + .auth = NULL, + .session = 0, + }, + { + .verb = "logout", + .callback = verb_logout, + .auth = NULL, + .session = 0, + }, + { + .verb = "open_session", + .callback = verb_open_session, + .auth = NULL, + .session = 0, + }, + { + .verb = "close_session", + .callback = verb_close_session, + .auth = NULL, + .session = 0, + }, + { + .verb = "get_data", + .callback = verb_get_data, + .auth = NULL, + .session = 0, + }, + { + .verb = "set_data", + .callback = set_data, + .auth = NULL, + .session = 0, + }, + { .verb = NULL } +}; + +static const struct afb_binding_v2 _afb_binding_v2_identity = +{ + .api = "identity", + .specification = NULL, + .verbs = _afb_verbs_v2_identity, + .preinit = NULL, + .init = NULL, + .onevent = NULL +}; + +// ---------- Verb's implementation ------------------------------------------- + +static void verb_login(struct afb_req req) +{ +} + +static void verb_logout(struct afb_req req) +{ +} + +static void verb_open_session(struct afb_req req) +{ +} + +static void verb_close_session(struct afb_req req) +{ +} + +static void verb_get_data(struct afb_req req) +{ +} + +static void verb_set_data(struct afb_req req) +{ +} diff --git a/pam/CMakeLists.txt b/pam/CMakeLists.txt new file mode 100644 index 0000000..3953704 --- /dev/null +++ b/pam/CMakeLists.txt @@ -0,0 +1 @@ +add_library(agl-identity-usbstick-pam SHARED ) \ No newline at end of file -- 2.16.6