server session FEATURE option to store user data in a session
diff --git a/src/session.c b/src/session.c
index 49f0591..e2194d9 100644
--- a/src/session.c
+++ b/src/session.c
@@ -212,6 +212,28 @@
return NULL;
}
+API void
+nc_session_set_data(struct nc_session *session, void *data)
+{
+ if (!session) {
+ ERRARG;
+ return;
+ }
+
+ session->data = data;
+}
+
+API void *
+nc_session_get_data(const struct nc_session *session)
+{
+ if (!session) {
+ ERRARG;
+ return NULL;
+ }
+
+ return session->data;
+}
+
NC_MSG_TYPE
nc_send_msg(struct nc_session *session, struct lyd_node *op)
{