s4:rpc_server: add dcesrv_call_auth_info()
[samba.git] / source4 / rpc_server / dcerpc_server.c
index 828a936c0b8e36465f67e0100ae256cf6ea0b719..8f48814366b810074fe014b6fbce97b5a2a0bd54 100644 (file)
@@ -3233,3 +3233,20 @@ _PUBLIC_ struct auth_session_info *dcesrv_call_session_info(struct dcesrv_call_s
 {
        return dce_call->context->conn->auth_state.session_info;
 }
+
+/**
+ * retrieve auth type/level from a dce_call
+ */
+_PUBLIC_ void dcesrv_call_auth_info(struct dcesrv_call_state *dce_call,
+                                   enum dcerpc_AuthType *auth_type,
+                                   enum dcerpc_AuthLevel *auth_level)
+{
+       struct dcesrv_auth *auth = &dce_call->conn->auth_state;
+
+       if (auth_type != NULL) {
+               *auth_type = auth->auth_type;
+       }
+       if (auth_level != NULL) {
+               *auth_level = auth->auth_level;
+       }
+}