Fix AFB_SESSION_CREATE behaviour
[src/app-framework-binder.git] / src / session.c
index 326b16a..e847a6d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 "IoT.bzh"
+ * Copyright (C) 2015, 2016 "IoT.bzh"
  * Author "Fulup Ar Foll"
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -48,6 +48,7 @@ struct afb_event_listener_list
 struct AFB_clientCtx
 {
        unsigned refcount;
+       unsigned loa;
        time_t expiration;    // expiration time of the token
        time_t access;
        char uuid[37];        // long term authentication of remote client
@@ -434,6 +435,18 @@ const char *ctxClientGetToken (struct AFB_clientCtx *clientCtx)
        return clientCtx->token;
 }
 
+unsigned ctxClientGetLOA (struct AFB_clientCtx *clientCtx)
+{
+       assert(clientCtx != NULL);
+       return clientCtx->loa;
+}
+
+void ctxClientSetLOA (struct AFB_clientCtx *clientCtx, unsigned loa)
+{
+       assert(clientCtx != NULL);
+       clientCtx->loa = loa;
+}
+
 void *ctxClientValueGet(struct AFB_clientCtx *clientCtx, int index)
 {
        assert(clientCtx != NULL);