session FEATURE add getter for session's termination reason
new nc_session_get_termreason()
diff --git a/src/session.c b/src/session.c
index fd0c0ad..4bdd379 100644
--- a/src/session.c
+++ b/src/session.c
@@ -150,6 +150,17 @@
return session->status;
}
+API NC_SESSION_TERM_REASON
+nc_session_get_termreason(const struct nc_session *session)
+{
+ if (!session) {
+ ERRARG("session");
+ return 0;
+ }
+
+ return session->term_reason;
+}
+
API uint32_t
nc_session_get_id(const struct nc_session *session)
{