summaryrefslogtreecommitdiffstats
path: root/host-ipmid
diff options
context:
space:
mode:
authorTom <tomjoseph@in.ibm.com>2016-09-06 17:21:23 +0530
committerTom Joseph <tomjoseph@in.ibm.com>2017-01-17 16:52:30 +0530
commit0573237f4521a0087153cded38814461c8978262 (patch)
tree94e7345d7b34c81a436ab6c7e46554762e0a0718 /host-ipmid
parent9e5232e59573ae4ddc6dd2064a813fd650dd0695 (diff)
downloadphosphor-host-ipmid-0573237f4521a0087153cded38814461c8978262.tar.gz
phosphor-host-ipmid-0573237f4521a0087153cded38814461c8978262.zip
Add privilege level for each IPMI command
Change-Id: I07f160c6ea83dc91f46e21f263c4cf994aff081d Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
Diffstat (limited to 'host-ipmid')
-rw-r--r--host-ipmid/ipmid-api.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/host-ipmid/ipmid-api.h b/host-ipmid/ipmid-api.h
index 6bd991f..ded1a6d 100644
--- a/host-ipmid/ipmid-api.h
+++ b/host-ipmid/ipmid-api.h
@@ -7,6 +7,21 @@
extern "C" {
#endif
+/*
+ * Specifies the minimum privilege level required to execute the command
+ * This means the command can be executed at a given privilege level or higher
+ * privilege level. Those commands which can be executed via system interface
+ * only should use SYSTEM_INTERFACE
+ */
+enum CommandPrivilege {
+ PRIVILEGE_CALLBACK = 0x01,
+ PRIVILEGE_USER,
+ PRIVILEGE_OPERATOR,
+ PRIVILEGE_ADMIN,
+ PRIVILEGE_OEM,
+ SYSTEM_INTERFACE = 0xFF,
+};
+
// length of Completion Code and its ALWAYS _1_
#define IPMI_CC_LEN 1
@@ -46,6 +61,8 @@ typedef size_t* ipmi_data_len_t;
// Plugin function return the status code
typedef unsigned char ipmi_ret_t;
+typedef enum CommandPrivilege ipmi_cmd_privilege_t;
+
// This is the callback handler that the plugin registers with IPMID. IPMI
// function router will then make a call to this callback handler with the
// necessary arguments of netfn, cmd, request, response, size and context.
@@ -55,8 +72,9 @@ typedef ipmi_ret_t (*ipmid_callback_t)(ipmi_netfn_t, ipmi_cmd_t, ipmi_request_t,
// This is the constructor function that is called into by each plugin handlers.
// When ipmi sets up the callback handlers, a call is made to this with
// information of netfn, cmd, callback handler pointer and context data.
-void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t,
- ipmi_context_t, ipmid_callback_t);
+void ipmi_register_callback(ipmi_netfn_t, ipmi_cmd_t, ipmi_context_t, ipmid_callback_t,
+ ipmi_cmd_privilege_t);
+
unsigned short get_sel_reserve_id(void);
OpenPOWER on IntegriCloud