EverydayTech Platform - Developer Reference
Complete Source Code Documentation - All Applications
Loading...
Searching...
No Matches
amt.js
Go to the documentation of this file.
1/*
2Copyright 2020-2021 Intel Corporation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15
16@description Intel AMT Communication Stack
17@author Ylian Saint-Hilaire
18@version v0.3.0
19*/
20
21/*jslint node: true */
22/*jshint node: true */
23/*jshint strict:false */
24/*jshint -W097 */
25/*jshint esversion: 6 */
26"use strict";
27
28/**
29 * Construct a AmtStackCreateService object, this is the main Intel AMT communication stack.
30 * @constructor
31 */
32function AmtStackCreateService(wsmanStack) {
33 var obj = new Object();
34 obj._ObjectID = 'AMT'
35 obj.wsman = wsmanStack;
36 obj.pfx = ["http://intel.com/wbem/wscim/1/amt-schema/1/", "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/", "http://intel.com/wbem/wscim/1/ips-schema/1/"];
37 obj.PendingEnums = [];
38 obj.PendingBatchOperations = 0;
39 obj.ActiveEnumsCount = 0;
40 obj.MaxActiveEnumsCount = 1; // Maximum number of enumerations that can be done at the same time.
41 obj.onProcessChanged = null;
42 var _MaxProcess = 0;
43 var _LastProcess = 0;
44
45 // Return the number of pending actions
46 obj.GetPendingActions = function () { return (obj.PendingEnums.length * 2) + (obj.ActiveEnumsCount) + obj.wsman.comm.PendingAjax.length + obj.wsman.comm.ActiveAjaxCount + obj.PendingBatchOperations; }
47
48 // Private Method, Update the current processing status, this gives the application an idea of what progress is being done by the WSMAN stack
49 function _up() {
50 var x = obj.GetPendingActions();
51 if (_MaxProcess < x) _MaxProcess = x;
52 if (obj.onProcessChanged != null && _LastProcess != x) {
53 //console.log("Process Old=" + _LastProcess + ", New=" + x + ", PEnums=" + obj.PendingEnums.length + ", AEnums=" + obj.ActiveEnumsCount + ", PAjax=" + obj.wsman.comm.PendingAjax.length + ", AAjax=" + obj.wsman.comm.ActiveAjaxCount + ", PBatch=" + obj.PendingBatchOperations);
54 _LastProcess = x;
55 obj.onProcessChanged(x, _MaxProcess);
56 }
57 if (x == 0) _MaxProcess = 0;
58 }
59
60 // Perform a WSMAN "SUBSCRIBE" operation.
61 obj.Subscribe = function Subscribe(name, delivery, url, callback, tag, pri, selectors, opaque, user, pass) { obj.wsman.ExecSubscribe(obj.CompleteName(name), delivery, url, function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, response, xstatus, tag); }, 0, pri, selectors, opaque, user, pass); _up(); }
62
63 // Perform a WSMAN "UNSUBSCRIBE" operation.
64 obj.UnSubscribe = function UnSubscribe(name, callback, tag, pri, selectors) { obj.wsman.ExecUnSubscribe(obj.CompleteName(name), function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, response, xstatus, tag); }, 0, pri, selectors); _up(); }
65
66 // Perform a WSMAN "GET" operation.
67 obj.Get = function Get(name, callback, tag, pri) { obj.wsman.ExecGet(obj.CompleteName(name), function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, response, xstatus, tag); }, 0, pri); _up(); }
68
69 // Perform a WSMAN "PUT" operation.
70 obj.Put = function Put(name, putobj, callback, tag, pri, selectors) { obj.wsman.ExecPut(obj.CompleteName(name), putobj, function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, response, xstatus, tag); }, 0, pri, selectors); _up(); }
71
72 // Perform a WSMAN "CREATE" operation.
73 obj.Create = function Create(name, putobj, callback, tag, pri) { obj.wsman.ExecCreate(obj.CompleteName(name), putobj, function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, response, xstatus, tag); }, 0, pri); _up(); }
74
75 // Perform a WSMAN "DELETE" operation.
76 obj.Delete = function Delete(name, putobj, callback, tag, pri) { obj.wsman.ExecDelete(obj.CompleteName(name), putobj, function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, response, xstatus, tag); }, 0, pri); _up(); }
77
78 // Perform a WSMAN method call operation.
79 obj.Exec = function Exec(name, method, args, callback, tag, pri, selectors) { obj.wsman.ExecMethod(obj.CompleteName(name), method, args, function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, obj.CompleteExecResponse(response), xstatus, tag); }, 0, pri, selectors); _up(); }
80
81 // Perform a WSMAN method call operation.
82 obj.ExecWithXml = function ExecWithXml(name, method, args, callback, tag, pri, selectors) { obj.wsman.ExecMethodXml(obj.CompleteName(name), method, execArgumentsToXml(args), function (ws, resuri, response, xstatus) { _up(); callback.call(obj, obj, name, obj.CompleteExecResponse(response), xstatus, tag); }, 0, pri, selectors); _up(); }
83
84 // Perform a WSMAN "ENUMERATE" operation.
85 obj.Enum = function Enum(name, callback, tag, pri) {
86 if (obj.ActiveEnumsCount < obj.MaxActiveEnumsCount) {
87 obj.ActiveEnumsCount++; obj.wsman.ExecEnum(obj.CompleteName(name), function (ws, resuri, response, xstatus, tag0) { _up(); _EnumStartSink(name, response, callback, resuri, xstatus, tag0); }, tag, pri);
88 } else {
89 obj.PendingEnums.push([name, callback, tag, pri]);
90 }
91 _up();
92 }
93
94 // Private method
95 function _EnumStartSink(name, response, callback, resuri, status, tag, pri) {
96 if (status != 200) { callback.call(obj, obj, name, null, status, tag); _EnumDoNext(1); return; }
97 if (response == null || response.Header["Method"] != "EnumerateResponse" || !response.Body["EnumerationContext"]) { callback.call(obj, obj, name, null, 603, tag); _EnumDoNext(1); return; }
98 var enumctx = response.Body["EnumerationContext"];
99 obj.wsman.ExecPull(resuri, enumctx, function (ws, resuri, response, xstatus) { _EnumContinueSink(name, response, callback, resuri, [], xstatus, tag, pri); });
100 }
101
102 // Private method
103 function _EnumContinueSink(name, response, callback, resuri, items, status, tag, pri) {
104 if (status != 200) { callback.call(obj, obj, name, null, status, tag); _EnumDoNext(1); return; }
105 if (response == null || response.Header["Method"] != "PullResponse") { callback.call(obj, obj, name, null, 604, tag); _EnumDoNext(1); return; }
106 for (var i in response.Body["Items"]) {
107 if (response.Body["Items"][i] instanceof Array) {
108 for (var j in response.Body["Items"][i]) { items.push(response.Body["Items"][i][j]); }
109 } else {
110 items.push(response.Body["Items"][i]);
111 }
112 }
113 if (response.Body["EnumerationContext"]) {
114 var enumctx = response.Body["EnumerationContext"];
115 obj.wsman.ExecPull(resuri, enumctx, function (ws, resuri, response, xstatus) { _EnumContinueSink(name, response, callback, resuri, items, xstatus, tag, 1); });
116 } else {
117 _EnumDoNext(1);
118 callback.call(obj, obj, name, items, status, tag);
119 _up();
120 }
121 }
122
123 // Private method
124 function _EnumDoNext(dec) {
125 obj.ActiveEnumsCount -= dec;
126 if (obj.ActiveEnumsCount >= obj.MaxActiveEnumsCount || obj.PendingEnums.length == 0) return;
127 var x = obj.PendingEnums.shift();
128 obj.Enum(x[0], x[1], x[2]);
129 _EnumDoNext(0);
130 }
131
132 // Perform a batch of WSMAN "ENUM" operations.
133 obj.BatchEnum = function (batchname, names, callback, tag, continueOnError, pri) {
134 obj.PendingBatchOperations += (names.length * 2);
135 _BatchNextEnum(batchname, Clone(names), callback, tag, {}, continueOnError, pri); _up();
136 }
137
138 function Clone(v) { return JSON.parse(JSON.stringify(v)); }
139
140 // Request each enum in the batch, stopping if something does not return status 200
141 function _BatchNextEnum(batchname, names, callback, tag, results, continueOnError, pri) {
142 obj.PendingBatchOperations -= 2;
143 var n = names.shift(), f = obj.Enum;
144 if (n[0] == '*') { f = obj.Get; n = n.substring(1); } // If the name starts with a star, do a GET instead of an ENUM. This will reduce round trips.
145 //console.log((f == obj.Get?'Get ':'Enum ') + n);
146 // Perform a GET/ENUM action
147 f(n, function (stack, name, responses, status, tag0) {
148 tag0[2][name] = { response: (responses==null?null:responses.Body), responses: responses, status: status };
149 if (tag0[1].length == 0 || status == 401 || (continueOnError != true && status != 200 && status != 400)) { obj.PendingBatchOperations -= (names.length * 2); _up(); callback.call(obj, obj, batchname, tag0[2], status, tag); }
150 else { _up(); _BatchNextEnum(batchname, names, callback, tag, tag0[2], pri); }
151 }, [batchname, names, results], pri);
152 _up();
153 }
154
155 // Perform a batch of WSMAN "GET" operations.
156 obj.BatchGet = function (batchname, names, callback, tag, pri) {
157 _FetchNext({ name: batchname, names: names, callback: callback, current: 0, responses: {}, tag: tag, pri: pri }); _up();
158 }
159
160 // Private method
161 function _FetchNext(batch) {
162 if (batch.names.length <= batch.current) {
163 batch.callback.call(obj, obj, batch.name, batch.responses, 200, batch.tag);
164 } else {
165 obj.wsman.ExecGet(obj.CompleteName(batch.names[batch.current]), function (ws, resuri, response, xstatus) { _Fetched(batch, response, xstatus); }, batch.pri);
166 batch.current++;
167 }
168 _up();
169 }
170
171 // Private method
172 function _Fetched(batch, response, status) {
173 if (response == null || status != 200) {
174 batch.callback.call(obj, obj, batch.name, null, status, batch.tag);
175 } else {
176 batch.responses[response.Header["Method"]] = response;
177 _FetchNext(batch);
178 }
179 }
180
181 // Private method
182 obj.CompleteName = function(name) {
183 if (name.indexOf("AMT_") == 0) return obj.pfx[0] + name;
184 if (name.indexOf("CIM_") == 0) return obj.pfx[1] + name;
185 if (name.indexOf("IPS_") == 0) return obj.pfx[2] + name;
186 }
187
188 obj.CompleteExecResponse = function (resp) {
189 if (resp && resp != null && resp.Body && (resp.Body["ReturnValue"] != undefined)) { resp.Body.ReturnValueStr = obj.AmtStatusToStr(resp.Body["ReturnValue"]); }
190 return resp;
191 }
192
193 obj.RequestPowerStateChange = function (PowerState, callback_func) {
194 obj.CIM_PowerManagementService_RequestPowerStateChange(PowerState, "<Address xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><ResourceURI xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\"><Selector Name=\"CreationClassName\">CIM_ComputerSystem</Selector><Selector Name=\"Name\">ManagedSystem</Selector></SelectorSet></ReferenceParameters>", null, null, callback_func);
195 }
196
197 obj.RequestOSPowerStateChange = function (PowerState, callback_func) {
198 obj.IPS_PowerManagementService_RequestOSPowerSavingStateChange(PowerState, '<Address xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns="http://schemas.xmlsoap.org/ws/2004/08/addressing"><ResourceURI xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ComputerSystem</ResourceURI><SelectorSet xmlns="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"><Selector Name="CreationClassName">CIM_ComputerSystem</Selector><Selector Name="Name">ManagedSystem</Selector></SelectorSet></ReferenceParameters>', null, null, callback_func);
199 }
200
201 obj.SetBootConfigRole = function (Role, callback_func) {
202 obj.CIM_BootService_SetBootConfigRole("<Address xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\">http://schemas.xmlsoap.org/ws/2004/08/addressing</Address><ReferenceParameters xmlns=\"http://schemas.xmlsoap.org/ws/2004/08/addressing\"><ResourceURI xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\">http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_BootConfigSetting</ResourceURI><SelectorSet xmlns=\"http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd\"><Selector Name=\"InstanceID\">Intel(r) AMT: Boot Configuration 0</Selector></SelectorSet></ReferenceParameters>", Role, callback_func);
203 }
204
205 // Cancel all pending queries with given status
206 obj.CancelAllQueries = function (s) {
207 obj.wsman.CancelAllQueries(s);
208 }
209
210 // Auto generated methods
211 obj.AMT_AgentPresenceWatchdog_RegisterAgent = function (callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "RegisterAgent", {}, callback_func, tag, pri, selectors); }
212 obj.AMT_AgentPresenceWatchdog_AssertPresence = function (SequenceNumber, callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "AssertPresence", { "SequenceNumber": SequenceNumber }, callback_func, tag, pri, selectors); }
213 obj.AMT_AgentPresenceWatchdog_AssertShutdown = function (SequenceNumber, callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "AssertShutdown", { "SequenceNumber": SequenceNumber }, callback_func, tag, pri, selectors); }
214 //obj.AMT_AgentPresenceWatchdog_RegisterAgent = function (callback_func) { obj.Exec("AMT_AgentPresenceWatchdog", "RegisterAgent", {}, callback_func); }
215 //obj.AMT_AgentPresenceWatchdog_AssertPresence = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdog", "AssertPresence", { "SequenceNumber": SequenceNumber }, callback_func); }
216 //obj.AMT_AgentPresenceWatchdog_AssertShutdown = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdog", "AssertShutdown", { "SequenceNumber": SequenceNumber }, callback_func); }
217 obj.AMT_AgentPresenceWatchdog_AddAction = function (OldState, NewState, EventOnTransition, ActionSd, ActionEac, callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "AddAction", { "OldState": OldState, "NewState": NewState, "EventOnTransition": EventOnTransition, "ActionSd": ActionSd, "ActionEac": ActionEac }, callback_func, tag, pri, selectors); }
218 obj.AMT_AgentPresenceWatchdog_DeleteAllActions = function (callback_func, tag, pri, selectors) { obj.Exec("AMT_AgentPresenceWatchdog", "DeleteAllActions", {}, callback_func, tag, pri, selectors); }
219 obj.AMT_AgentPresenceWatchdogAction_GetActionEac = function (callback_func) { obj.Exec("AMT_AgentPresenceWatchdogAction", "GetActionEac", {}, callback_func); }
220 obj.AMT_AgentPresenceWatchdogVA_RegisterAgent = function (callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "RegisterAgent", {}, callback_func); }
221 obj.AMT_AgentPresenceWatchdogVA_AssertPresence = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "AssertPresence", { "SequenceNumber": SequenceNumber }, callback_func); }
222 obj.AMT_AgentPresenceWatchdogVA_AssertShutdown = function (SequenceNumber, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "AssertShutdown", { "SequenceNumber": SequenceNumber }, callback_func); }
223 obj.AMT_AgentPresenceWatchdogVA_AddAction = function (OldState, NewState, EventOnTransition, ActionSd, ActionEac, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "AddAction", { "OldState": OldState, "NewState": NewState, "EventOnTransition": EventOnTransition, "ActionSd": ActionSd, "ActionEac": ActionEac }, callback_func); }
224 obj.AMT_AgentPresenceWatchdogVA_DeleteAllActions = function (_method_dummy, callback_func) { obj.Exec("AMT_AgentPresenceWatchdogVA", "DeleteAllActions", { "_method_dummy": _method_dummy }, callback_func); }
225 obj.AMT_AlarmClockService_AddAlarm = function AlarmClockService_AddAlarm(alarmInstance, callback_func)
226 {
227 var id = alarmInstance.InstanceID;
228 var nm = alarmInstance.ElementName;
229 var start = alarmInstance.StartTime.Datetime;
230 var interval = alarmInstance.Interval ? alarmInstance.Interval.Datetime : undefined;
231 var doc = alarmInstance.DeleteOnCompletion;
232 var tpl = "<d:AlarmTemplate xmlns:d=\"http://intel.com/wbem/wscim/1/amt-schema/1/AMT_AlarmClockService\" xmlns:s=\"http://intel.com/wbem/wscim/1/ips-schema/1/IPS_AlarmClockOccurrence\"><s:InstanceID>" + id + "</s:InstanceID><s:ElementName>" + nm + "</s:ElementName><s:StartTime><p:Datetime xmlns:p=\"http://schemas.dmtf.org/wbem/wscim/1/common\">" + start + "</p:Datetime></s:StartTime>" + ((interval!=undefined)?("<s:Interval><p:Interval xmlns:p=\"http://schemas.dmtf.org/wbem/wscim/1/common\">" + interval + "</p:Interval></s:Interval>"):"") + "<s:DeleteOnCompletion>" + doc + "</s:DeleteOnCompletion></d:AlarmTemplate>"
233 obj.wsman.ExecMethodXml(obj.CompleteName("AMT_AlarmClockService"), "AddAlarm", tpl, callback_func);
234 };
235 obj.AMT_AuditLog_ClearLog = function (callback_func) { obj.Exec("AMT_AuditLog", "ClearLog", {}, callback_func); }
236 obj.AMT_AuditLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_AuditLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
237 obj.AMT_AuditLog_ReadRecords = function (StartIndex, callback_func, tag) { obj.Exec("AMT_AuditLog", "ReadRecords", { "StartIndex": StartIndex }, callback_func, tag); }
238 obj.AMT_AuditLog_SetAuditLock = function (LockTimeoutInSeconds, Flag, Handle, callback_func) { obj.Exec("AMT_AuditLog", "SetAuditLock", { "LockTimeoutInSeconds": LockTimeoutInSeconds, "Flag": Flag, "Handle": Handle }, callback_func); }
239 obj.AMT_AuditLog_ExportAuditLogSignature = function (SigningMechanism, callback_func) { obj.Exec("AMT_AuditLog", "ExportAuditLogSignature", { "SigningMechanism": SigningMechanism }, callback_func); }
240 obj.AMT_AuditLog_SetSigningKeyMaterial = function (SigningMechanismType, SigningKey, LengthOfCertificates, Certificates, callback_func) { obj.Exec("AMT_AuditLog", "SetSigningKeyMaterial", { "SigningMechanismType": SigningMechanismType, "SigningKey": SigningKey, "LengthOfCertificates": LengthOfCertificates, "Certificates": Certificates }, callback_func); }
241 obj.AMT_AuditPolicyRule_SetAuditPolicy = function (Enable, AuditedAppID, EventID, PolicyType, callback_func) { obj.Exec("AMT_AuditPolicyRule", "SetAuditPolicy", { "Enable": Enable, "AuditedAppID": AuditedAppID, "EventID": EventID, "PolicyType": PolicyType }, callback_func); }
242 obj.AMT_AuditPolicyRule_SetAuditPolicyBulk = function (Enable, AuditedAppID, EventID, PolicyType, callback_func) { obj.Exec("AMT_AuditPolicyRule", "SetAuditPolicyBulk", { "Enable": Enable, "AuditedAppID": AuditedAppID, "EventID": EventID, "PolicyType": PolicyType }, callback_func); }
243 obj.AMT_AuthorizationService_AddUserAclEntryEx = function (DigestUsername, DigestPassword, KerberosUserSid, AccessPermission, Realms, callback_func) { obj.Exec("AMT_AuthorizationService", "AddUserAclEntryEx", { "DigestUsername": DigestUsername, "DigestPassword": DigestPassword, "KerberosUserSid": KerberosUserSid, "AccessPermission": AccessPermission, "Realms": Realms }, callback_func); }
244 obj.AMT_AuthorizationService_EnumerateUserAclEntries = function (StartIndex, callback_func) { obj.Exec("AMT_AuthorizationService", "EnumerateUserAclEntries", { "StartIndex": StartIndex }, callback_func); }
245 obj.AMT_AuthorizationService_GetUserAclEntryEx = function (Handle, callback_func, tag) { obj.Exec("AMT_AuthorizationService", "GetUserAclEntryEx", { "Handle": Handle }, callback_func, tag); }
246 obj.AMT_AuthorizationService_UpdateUserAclEntryEx = function (Handle, DigestUsername, DigestPassword, KerberosUserSid, AccessPermission, Realms, callback_func) { obj.Exec("AMT_AuthorizationService", "UpdateUserAclEntryEx", { "Handle": Handle, "DigestUsername": DigestUsername, "DigestPassword": DigestPassword, "KerberosUserSid": KerberosUserSid, "AccessPermission": AccessPermission, "Realms": Realms }, callback_func); }
247 obj.AMT_AuthorizationService_RemoveUserAclEntry = function (Handle, callback_func) { obj.Exec("AMT_AuthorizationService", "RemoveUserAclEntry", { "Handle": Handle }, callback_func); }
248 obj.AMT_AuthorizationService_SetAdminAclEntryEx = function (Username, DigestPassword, callback_func) { obj.Exec("AMT_AuthorizationService", "SetAdminAclEntryEx", { "Username": Username, "DigestPassword": DigestPassword }, callback_func); }
249 obj.AMT_AuthorizationService_GetAdminAclEntry = function (callback_func) { obj.Exec("AMT_AuthorizationService", "GetAdminAclEntry", {}, callback_func); }
250 obj.AMT_AuthorizationService_GetAdminAclEntryStatus = function (callback_func) { obj.Exec("AMT_AuthorizationService", "GetAdminAclEntryStatus", {}, callback_func); }
251 obj.AMT_AuthorizationService_GetAdminNetAclEntryStatus = function (callback_func) { obj.Exec("AMT_AuthorizationService", "GetAdminNetAclEntryStatus", {}, callback_func); }
252 obj.AMT_AuthorizationService_SetAclEnabledState = function (Handle, Enabled, callback_func, tag) { obj.Exec("AMT_AuthorizationService", "SetAclEnabledState", { "Handle": Handle, "Enabled": Enabled }, callback_func, tag); }
253 obj.AMT_AuthorizationService_GetAclEnabledState = function (Handle, callback_func, tag) { obj.Exec("AMT_AuthorizationService", "GetAclEnabledState", { "Handle": Handle }, callback_func, tag); }
254 obj.AMT_EndpointAccessControlService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
255 obj.AMT_EndpointAccessControlService_GetPosture = function (PostureType, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "GetPosture", { "PostureType": PostureType }, callback_func); }
256 obj.AMT_EndpointAccessControlService_GetPostureHash = function (PostureType, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "GetPostureHash", { "PostureType": PostureType }, callback_func); }
257 obj.AMT_EndpointAccessControlService_UpdatePostureState = function (UpdateType, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "UpdatePostureState", { "UpdateType": UpdateType }, callback_func); }
258 obj.AMT_EndpointAccessControlService_GetEacOptions = function (callback_func) { obj.Exec("AMT_EndpointAccessControlService", "GetEacOptions", {}, callback_func); }
259 obj.AMT_EndpointAccessControlService_SetEacOptions = function (EacVendors, PostureHashAlgorithm, callback_func) { obj.Exec("AMT_EndpointAccessControlService", "SetEacOptions", { "EacVendors": EacVendors, "PostureHashAlgorithm": PostureHashAlgorithm }, callback_func); }
260 obj.AMT_EnvironmentDetectionSettingData_SetSystemDefensePolicy = function (Policy, callback_func) { obj.Exec("AMT_EnvironmentDetectionSettingData", "SetSystemDefensePolicy", { "Policy": Policy }, callback_func); }
261 obj.AMT_EnvironmentDetectionSettingData_EnableVpnRouting = function (Enable, callback_func) { obj.Exec("AMT_EnvironmentDetectionSettingData", "EnableVpnRouting", { "Enable": Enable }, callback_func); }
262 obj.AMT_EthernetPortSettings_SetLinkPreference = function (LinkPreference, Timeout, callback_func) { obj.Exec("AMT_EthernetPortSettings", "SetLinkPreference", { "LinkPreference": LinkPreference, "Timeout": Timeout }, callback_func); }
263 obj.AMT_HeuristicPacketFilterStatistics_ResetSelectedStats = function (SelectedStatistics, callback_func) { obj.Exec("AMT_HeuristicPacketFilterStatistics", "ResetSelectedStats", { "SelectedStatistics": SelectedStatistics }, callback_func); }
264 obj.AMT_KerberosSettingData_GetCredentialCacheState = function (callback_func) { obj.Exec("AMT_KerberosSettingData", "GetCredentialCacheState", {}, callback_func); }
265 obj.AMT_KerberosSettingData_SetCredentialCacheState = function (Enable, callback_func) { obj.Exec("AMT_KerberosSettingData", "SetCredentialCacheState", { "Enable": Enable }, callback_func); }
266 obj.AMT_MessageLog_CancelIteration = function (IterationIdentifier, callback_func) { obj.Exec("AMT_MessageLog", "CancelIteration", { "IterationIdentifier": IterationIdentifier }, callback_func); }
267 obj.AMT_MessageLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_MessageLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
268 obj.AMT_MessageLog_ClearLog = function (callback_func) { obj.Exec("AMT_MessageLog", "ClearLog", { }, callback_func); }
269 obj.AMT_MessageLog_GetRecords = function (IterationIdentifier, MaxReadRecords, callback_func, tag) { obj.Exec("AMT_MessageLog", "GetRecords", { "IterationIdentifier": IterationIdentifier, "MaxReadRecords": MaxReadRecords }, callback_func, tag); }
270 obj.AMT_MessageLog_GetRecord = function (IterationIdentifier, PositionToNext, callback_func) { obj.Exec("AMT_MessageLog", "GetRecord", { "IterationIdentifier": IterationIdentifier, "PositionToNext": PositionToNext }, callback_func); }
271 obj.AMT_MessageLog_PositionAtRecord = function (IterationIdentifier, MoveAbsolute, RecordNumber, callback_func) { obj.Exec("AMT_MessageLog", "PositionAtRecord", { "IterationIdentifier": IterationIdentifier, "MoveAbsolute": MoveAbsolute, "RecordNumber": RecordNumber }, callback_func); }
272 obj.AMT_MessageLog_PositionToFirstRecord = function (callback_func, tag) { obj.Exec("AMT_MessageLog", "PositionToFirstRecord", {}, callback_func, tag); }
273 obj.AMT_MessageLog_FreezeLog = function (Freeze, callback_func) { obj.Exec("AMT_MessageLog", "FreezeLog", { "Freeze": Freeze }, callback_func); }
274 obj.AMT_PublicKeyManagementService_AddCRL = function (Url, SerialNumbers, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddCRL", { "Url": Url, "SerialNumbers": SerialNumbers }, callback_func); }
275 obj.AMT_PublicKeyManagementService_ResetCRLList = function (_method_dummy, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "ResetCRLList", { "_method_dummy": _method_dummy }, callback_func); }
276 obj.AMT_PublicKeyManagementService_AddCertificate = function (CertificateBlob, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddCertificate", { "CertificateBlob": CertificateBlob }, callback_func); }
277 obj.AMT_PublicKeyManagementService_AddTrustedRootCertificate = function (CertificateBlob, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddTrustedRootCertificate", { "CertificateBlob": CertificateBlob }, callback_func); }
278 obj.AMT_PublicKeyManagementService_AddKey = function (KeyBlob, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "AddKey", { "KeyBlob": KeyBlob }, callback_func); }
279 obj.AMT_PublicKeyManagementService_GeneratePKCS10Request = function (KeyPair, DNName, Usage, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "GeneratePKCS10Request", { "KeyPair": KeyPair, "DNName": DNName, "Usage": Usage }, callback_func); }
280 obj.AMT_PublicKeyManagementService_GeneratePKCS10RequestEx = function (KeyPair, SigningAlgorithm, NullSignedCertificateRequest, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "GeneratePKCS10RequestEx", { "KeyPair": KeyPair, "SigningAlgorithm": SigningAlgorithm, "NullSignedCertificateRequest": NullSignedCertificateRequest }, callback_func); }
281 obj.AMT_PublicKeyManagementService_GenerateKeyPair = function (KeyAlgorithm, KeyLength, callback_func) { obj.Exec("AMT_PublicKeyManagementService", "GenerateKeyPair", { "KeyAlgorithm": KeyAlgorithm, "KeyLength": KeyLength }, callback_func); }
282 obj.AMT_RedirectionService_RequestStateChange = function (RequestedState, callback_func) { obj.Exec("AMT_RedirectionService", "RequestStateChange", { "RequestedState": RequestedState }, callback_func); }
283 obj.AMT_RedirectionService_TerminateSession = function (SessionType, callback_func) { obj.Exec("AMT_RedirectionService", "TerminateSession", { "SessionType": SessionType }, callback_func); }
284 obj.AMT_RemoteAccessService_AddMpServer = function (AccessInfo, InfoFormat, Port, AuthMethod, Certificate, Username, Password, CN, callback_func) { obj.Exec("AMT_RemoteAccessService", "AddMpServer", { "AccessInfo": AccessInfo, "InfoFormat": InfoFormat, "Port": Port, "AuthMethod": AuthMethod, "Certificate": Certificate, "Username": Username, "Password": Password, "CN": CN }, callback_func); }
285 obj.AMT_RemoteAccessService_AddRemoteAccessPolicyRule = function (Trigger, TunnelLifeTime, ExtendedData, MpServer, InternalMpServer, callback_func) { obj.Exec('AMT_RemoteAccessService', 'AddRemoteAccessPolicyRule', { 'Trigger': Trigger, 'TunnelLifeTime': TunnelLifeTime, 'ExtendedData': ExtendedData, 'MpServer': MpServer, 'InternalMpServer': InternalMpServer }, callback_func); }
286 obj.AMT_RemoteAccessService_CloseRemoteAccessConnection = function (_method_dummy, callback_func) { obj.Exec("AMT_RemoteAccessService", "CloseRemoteAccessConnection", { "_method_dummy": _method_dummy }, callback_func); }
287 obj.AMT_SetupAndConfigurationService_CommitChanges = function (_method_dummy, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "CommitChanges", { "_method_dummy": _method_dummy }, callback_func); }
288 obj.AMT_SetupAndConfigurationService_Unprovision = function (ProvisioningMode, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "Unprovision", { "ProvisioningMode": ProvisioningMode }, callback_func); }
289 obj.AMT_SetupAndConfigurationService_PartialUnprovision = function (_method_dummy, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "PartialUnprovision", { "_method_dummy": _method_dummy }, callback_func); }
290 obj.AMT_SetupAndConfigurationService_ResetFlashWearOutProtection = function (_method_dummy, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "ResetFlashWearOutProtection", { "_method_dummy": _method_dummy }, callback_func); }
291 obj.AMT_SetupAndConfigurationService_ExtendProvisioningPeriod = function (Duration, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "ExtendProvisioningPeriod", { "Duration": Duration }, callback_func); }
292 obj.AMT_SetupAndConfigurationService_SetMEBxPassword = function (Password, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "SetMEBxPassword", { "Password": Password }, callback_func); }
293 obj.AMT_SetupAndConfigurationService_SetTLSPSK = function (PID, PPS, callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "SetTLSPSK", { "PID": PID, "PPS": PPS }, callback_func); }
294 obj.AMT_SetupAndConfigurationService_GetProvisioningAuditRecord = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetProvisioningAuditRecord", {}, callback_func); }
295 obj.AMT_SetupAndConfigurationService_GetUuid = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetUuid", {}, callback_func); }
296 obj.AMT_SetupAndConfigurationService_GetUnprovisionBlockingComponents = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetUnprovisionBlockingComponents", {}, callback_func); }
297 obj.AMT_SetupAndConfigurationService_GetProvisioningAuditRecordV2 = function (callback_func) { obj.Exec("AMT_SetupAndConfigurationService", "GetProvisioningAuditRecordV2", {}, callback_func); }
298 obj.AMT_SystemDefensePolicy_GetTimeout = function (callback_func) { obj.Exec("AMT_SystemDefensePolicy", "GetTimeout", {}, callback_func); }
299 obj.AMT_SystemDefensePolicy_SetTimeout = function (Timeout, callback_func) { obj.Exec("AMT_SystemDefensePolicy", "SetTimeout", { "Timeout": Timeout }, callback_func); }
300 obj.AMT_SystemDefensePolicy_UpdateStatistics = function (NetworkInterface, ResetOnRead, callback_func, tag, pri, selectors) { obj.Exec("AMT_SystemDefensePolicy", "UpdateStatistics", { "NetworkInterface": NetworkInterface, "ResetOnRead": ResetOnRead }, callback_func, tag, pri, selectors); }
301 obj.AMT_SystemPowerScheme_SetPowerScheme = function (callback_func, schemeInstanceId, tag) { obj.Exec("AMT_SystemPowerScheme", "SetPowerScheme", {}, callback_func, tag, 0, { "InstanceID": schemeInstanceId }); }
302 obj.AMT_TimeSynchronizationService_GetLowAccuracyTimeSynch = function (callback_func, tag) { obj.Exec("AMT_TimeSynchronizationService", "GetLowAccuracyTimeSynch", {}, callback_func, tag); }
303 obj.AMT_TimeSynchronizationService_SetHighAccuracyTimeSynch = function (Ta0, Tm1, Tm2, callback_func, tag) { obj.Exec("AMT_TimeSynchronizationService", "SetHighAccuracyTimeSynch", { "Ta0": Ta0, "Tm1": Tm1, "Tm2": Tm2 }, callback_func, tag); }
304 obj.AMT_UserInitiatedConnectionService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("AMT_UserInitiatedConnectionService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
305 obj.AMT_WebUIService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func, tag) { obj.Exec("AMT_WebUIService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func, tag); }
306 obj.AMT_WiFiPortConfigurationService_AddWiFiSettings = function (WiFiEndpoint, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "AddWiFiSettings", { "WiFiEndpoint": WiFiEndpoint, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); }
307 obj.AMT_WiFiPortConfigurationService_UpdateWiFiSettings = function (WiFiEndpointSettings, WiFiEndpointSettingsInput, IEEE8021xSettingsInput, ClientCredential, CACredential, callback_func) { obj.ExecWithXml("AMT_WiFiPortConfigurationService", "UpdateWiFiSettings", { "WiFiEndpointSettings": WiFiEndpointSettings, "WiFiEndpointSettingsInput": WiFiEndpointSettingsInput, "IEEE8021xSettingsInput": IEEE8021xSettingsInput, "ClientCredential": ClientCredential, "CACredential": CACredential }, callback_func); }
308 obj.AMT_WiFiPortConfigurationService_DeleteAllITProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllITProfiles", { "_method_dummy": _method_dummy }, callback_func); }
309 obj.AMT_WiFiPortConfigurationService_DeleteAllUserProfiles = function (_method_dummy, callback_func) { obj.Exec("AMT_WiFiPortConfigurationService", "DeleteAllUserProfiles", { "_method_dummy": _method_dummy }, callback_func); }
310 obj.CIM_Account_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Account", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
311 obj.CIM_AccountManagementService_CreateAccount = function (System, AccountTemplate, callback_func) { obj.Exec("CIM_AccountManagementService", "CreateAccount", { "System": System, "AccountTemplate": AccountTemplate }, callback_func); }
312 obj.CIM_BootConfigSetting_ChangeBootOrder = function (Source, callback_func) { obj.Exec("CIM_BootConfigSetting", "ChangeBootOrder", { "Source": Source }, callback_func); }
313 obj.CIM_BootService_SetBootConfigRole = function (BootConfigSetting, Role, callback_func) { obj.Exec("CIM_BootService", "SetBootConfigRole", { "BootConfigSetting": BootConfigSetting, "Role": Role }, callback_func, 0, 1); }
314 obj.CIM_Card_ConnectorPower = function (Connector, PoweredOn, callback_func) { obj.Exec("CIM_Card", "ConnectorPower", { "Connector": Connector, "PoweredOn": PoweredOn }, callback_func); }
315 obj.CIM_Card_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_Card", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
316 obj.CIM_Chassis_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_Chassis", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
317 obj.CIM_Fan_SetSpeed = function (DesiredSpeed, callback_func) { obj.Exec("CIM_Fan", "SetSpeed", { "DesiredSpeed": DesiredSpeed }, callback_func); }
318 obj.CIM_KVMRedirectionSAP_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_KVMRedirectionSAP", "RequestStateChange", { "RequestedState": RequestedState/*, "TimeoutPeriod": TimeoutPeriod */}, callback_func); }
319 obj.CIM_MediaAccessDevice_LockMedia = function (Lock, callback_func) { obj.Exec("CIM_MediaAccessDevice", "LockMedia", { "Lock": Lock }, callback_func); }
320 obj.CIM_MediaAccessDevice_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_MediaAccessDevice", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
321 obj.CIM_MediaAccessDevice_Reset = function (callback_func) { obj.Exec("CIM_MediaAccessDevice", "Reset", {}, callback_func); }
322 obj.CIM_MediaAccessDevice_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_MediaAccessDevice", "EnableDevice", { "Enabled": Enabled }, callback_func); }
323 obj.CIM_MediaAccessDevice_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_MediaAccessDevice", "OnlineDevice", { "Online": Online }, callback_func); }
324 obj.CIM_MediaAccessDevice_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_MediaAccessDevice", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
325 obj.CIM_MediaAccessDevice_SaveProperties = function (callback_func) { obj.Exec("CIM_MediaAccessDevice", "SaveProperties", {}, callback_func); }
326 obj.CIM_MediaAccessDevice_RestoreProperties = function (callback_func) { obj.Exec("CIM_MediaAccessDevice", "RestoreProperties", {}, callback_func); }
327 obj.CIM_MediaAccessDevice_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_MediaAccessDevice", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
328 obj.CIM_PhysicalFrame_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_PhysicalFrame", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
329 obj.CIM_PhysicalPackage_IsCompatible = function (ElementToCheck, callback_func) { obj.Exec("CIM_PhysicalPackage", "IsCompatible", { "ElementToCheck": ElementToCheck }, callback_func); }
330 obj.CIM_PowerManagementService_RequestPowerStateChange = function (PowerState, ManagedElement, Time, TimeoutPeriod, callback_func) { obj.Exec("CIM_PowerManagementService", "RequestPowerStateChange", { "PowerState": PowerState, "ManagedElement": ManagedElement, "Time": Time, "TimeoutPeriod": TimeoutPeriod }, callback_func, 0, 1); }
331 obj.CIM_PowerSupply_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_PowerSupply", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
332 obj.CIM_PowerSupply_Reset = function (callback_func) { obj.Exec("CIM_PowerSupply", "Reset", {}, callback_func); }
333 obj.CIM_PowerSupply_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_PowerSupply", "EnableDevice", { "Enabled": Enabled }, callback_func); }
334 obj.CIM_PowerSupply_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_PowerSupply", "OnlineDevice", { "Online": Online }, callback_func); }
335 obj.CIM_PowerSupply_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_PowerSupply", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
336 obj.CIM_PowerSupply_SaveProperties = function (callback_func) { obj.Exec("CIM_PowerSupply", "SaveProperties", {}, callback_func); }
337 obj.CIM_PowerSupply_RestoreProperties = function (callback_func) { obj.Exec("CIM_PowerSupply", "RestoreProperties", {}, callback_func); }
338 obj.CIM_PowerSupply_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_PowerSupply", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
339 obj.CIM_Processor_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_Processor", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
340 obj.CIM_Processor_Reset = function (callback_func) { obj.Exec("CIM_Processor", "Reset", {}, callback_func); }
341 obj.CIM_Processor_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_Processor", "EnableDevice", { "Enabled": Enabled }, callback_func); }
342 obj.CIM_Processor_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_Processor", "OnlineDevice", { "Online": Online }, callback_func); }
343 obj.CIM_Processor_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_Processor", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
344 obj.CIM_Processor_SaveProperties = function (callback_func) { obj.Exec("CIM_Processor", "SaveProperties", {}, callback_func); }
345 obj.CIM_Processor_RestoreProperties = function (callback_func) { obj.Exec("CIM_Processor", "RestoreProperties", {}, callback_func); }
346 obj.CIM_Processor_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Processor", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
347 obj.CIM_RecordLog_ClearLog = function (callback_func) { obj.Exec("CIM_RecordLog", "ClearLog", {}, callback_func); }
348 obj.CIM_RecordLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_RecordLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
349 obj.CIM_RedirectionService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_RedirectionService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
350 obj.CIM_Sensor_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_Sensor", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
351 obj.CIM_Sensor_Reset = function (callback_func) { obj.Exec("CIM_Sensor", "Reset", {}, callback_func); }
352 obj.CIM_Sensor_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_Sensor", "EnableDevice", { "Enabled": Enabled }, callback_func); }
353 obj.CIM_Sensor_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_Sensor", "OnlineDevice", { "Online": Online }, callback_func); }
354 obj.CIM_Sensor_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_Sensor", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
355 obj.CIM_Sensor_SaveProperties = function (callback_func) { obj.Exec("CIM_Sensor", "SaveProperties", {}, callback_func); }
356 obj.CIM_Sensor_RestoreProperties = function (callback_func) { obj.Exec("CIM_Sensor", "RestoreProperties", {}, callback_func); }
357 obj.CIM_Sensor_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Sensor", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
358 obj.CIM_StatisticalData_ResetSelectedStats = function (SelectedStatistics, callback_func) { obj.Exec("CIM_StatisticalData", "ResetSelectedStats", { "SelectedStatistics": SelectedStatistics }, callback_func); }
359 obj.CIM_Watchdog_KeepAlive = function (callback_func) { obj.Exec("CIM_Watchdog", "KeepAlive", {}, callback_func); }
360 obj.CIM_Watchdog_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_Watchdog", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
361 obj.CIM_Watchdog_Reset = function (callback_func) { obj.Exec("CIM_Watchdog", "Reset", {}, callback_func); }
362 obj.CIM_Watchdog_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_Watchdog", "EnableDevice", { "Enabled": Enabled }, callback_func); }
363 obj.CIM_Watchdog_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_Watchdog", "OnlineDevice", { "Online": Online }, callback_func); }
364 obj.CIM_Watchdog_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_Watchdog", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
365 obj.CIM_Watchdog_SaveProperties = function (callback_func) { obj.Exec("CIM_Watchdog", "SaveProperties", {}, callback_func); }
366 obj.CIM_Watchdog_RestoreProperties = function (callback_func) { obj.Exec("CIM_Watchdog", "RestoreProperties", {}, callback_func); }
367 obj.CIM_Watchdog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_Watchdog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
368 obj.CIM_WiFiPort_SetPowerState = function (PowerState, Time, callback_func) { obj.Exec("CIM_WiFiPort", "SetPowerState", { "PowerState": PowerState, "Time": Time }, callback_func); }
369 obj.CIM_WiFiPort_Reset = function (callback_func) { obj.Exec("CIM_WiFiPort", "Reset", {}, callback_func); }
370 obj.CIM_WiFiPort_EnableDevice = function (Enabled, callback_func) { obj.Exec("CIM_WiFiPort", "EnableDevice", { "Enabled": Enabled }, callback_func); }
371 obj.CIM_WiFiPort_OnlineDevice = function (Online, callback_func) { obj.Exec("CIM_WiFiPort", "OnlineDevice", { "Online": Online }, callback_func); }
372 obj.CIM_WiFiPort_QuiesceDevice = function (Quiesce, callback_func) { obj.Exec("CIM_WiFiPort", "QuiesceDevice", { "Quiesce": Quiesce }, callback_func); }
373 obj.CIM_WiFiPort_SaveProperties = function (callback_func) { obj.Exec("CIM_WiFiPort", "SaveProperties", {}, callback_func); }
374 obj.CIM_WiFiPort_RestoreProperties = function (callback_func) { obj.Exec("CIM_WiFiPort", "RestoreProperties", {}, callback_func); }
375 obj.CIM_WiFiPort_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("CIM_WiFiPort", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
376 obj.IPS_HostBasedSetupService_Setup = function (NetAdminPassEncryptionType, NetworkAdminPassword, McNonce, Certificate, SigningAlgorithm, DigitalSignature, callback_func) { obj.Exec("IPS_HostBasedSetupService", "Setup", { "NetAdminPassEncryptionType": NetAdminPassEncryptionType, "NetworkAdminPassword": NetworkAdminPassword, "McNonce": McNonce, "Certificate": Certificate, "SigningAlgorithm": SigningAlgorithm, "DigitalSignature": DigitalSignature }, callback_func); }
377 obj.IPS_HostBasedSetupService_AddNextCertInChain = function (NextCertificate, IsLeafCertificate, IsRootCertificate, callback_func) { obj.Exec("IPS_HostBasedSetupService", "AddNextCertInChain", { "NextCertificate": NextCertificate, "IsLeafCertificate": IsLeafCertificate, "IsRootCertificate": IsRootCertificate }, callback_func); }
378 obj.IPS_HostBasedSetupService_AdminSetup = function (NetAdminPassEncryptionType, NetworkAdminPassword, McNonce, SigningAlgorithm, DigitalSignature, callback_func) { obj.Exec("IPS_HostBasedSetupService", "AdminSetup", { "NetAdminPassEncryptionType": NetAdminPassEncryptionType, "NetworkAdminPassword": NetworkAdminPassword, "McNonce": McNonce, "SigningAlgorithm": SigningAlgorithm, "DigitalSignature": DigitalSignature }, callback_func); }
379 obj.IPS_HostBasedSetupService_UpgradeClientToAdmin = function (McNonce, SigningAlgorithm, DigitalSignature, callback_func) { obj.Exec("IPS_HostBasedSetupService", "UpgradeClientToAdmin", { "McNonce": McNonce, "SigningAlgorithm": SigningAlgorithm, "DigitalSignature": DigitalSignature }, callback_func); }
380 obj.IPS_HostBasedSetupService_DisableClientControlMode = function (_method_dummy, callback_func) { obj.Exec("IPS_HostBasedSetupService", "DisableClientControlMode", { "_method_dummy": _method_dummy }, callback_func); }
381 obj.IPS_KVMRedirectionSettingData_TerminateSession = function (callback_func) { obj.Exec("IPS_KVMRedirectionSettingData", "TerminateSession", {}, callback_func); }
382 obj.IPS_KVMRedirectionSettingData_DataChannelRead = function (callback_func) { obj.Exec("IPS_KVMRedirectionSettingData", "DataChannelRead", {}, callback_func); }
383 obj.IPS_KVMRedirectionSettingData_DataChannelWrite = function (Data, callback_func) { obj.Exec("IPS_KVMRedirectionSettingData", "DataChannelWrite", { "DataMessage": Data }, callback_func); }
384 obj.IPS_OptInService_StartOptIn = function (callback_func) { obj.Exec("IPS_OptInService", "StartOptIn", {}, callback_func); }
385 obj.IPS_OptInService_CancelOptIn = function (callback_func) { obj.Exec("IPS_OptInService", "CancelOptIn", {}, callback_func); }
386 obj.IPS_OptInService_SendOptInCode = function (OptInCode, callback_func) { obj.Exec("IPS_OptInService", "SendOptInCode", { "OptInCode": OptInCode }, callback_func); }
387 obj.IPS_OptInService_StartService = function (callback_func) { obj.Exec("IPS_OptInService", "StartService", {}, callback_func); }
388 obj.IPS_OptInService_StopService = function (callback_func) { obj.Exec("IPS_OptInService", "StopService", {}, callback_func); }
389 obj.IPS_OptInService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("IPS_OptInService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
390 obj.IPS_PowerManagementService_RequestOSPowerSavingStateChange = function (PowerState, ManagedElement, Time, TimeoutPeriod, callback_func) { obj.Exec('IPS_PowerManagementService', 'RequestOSPowerSavingStateChange', { 'OSPowerSavingState': PowerState, 'ManagedElement': ManagedElement, 'Time': Time, 'TimeoutPeriod': TimeoutPeriod }, callback_func, 0, 1); }
391 obj.IPS_ProvisioningRecordLog_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("IPS_ProvisioningRecordLog", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
392 obj.IPS_ProvisioningRecordLog_ClearLog = function (_method_dummy, callback_func) { obj.Exec("IPS_ProvisioningRecordLog", "ClearLog", { "_method_dummy": _method_dummy }, callback_func); }
393 obj.IPS_ScreenConfigurationService_SetSessionState = function (SessionState, ConsecutiveRebootsNum, callback_func) { obj.Exec('IPS_ScreenConfigurationService', 'SetSessionState', { 'SessionState': SessionState, 'ConsecutiveRebootsNum': ConsecutiveRebootsNum }, callback_func); }
394 obj.IPS_SecIOService_RequestStateChange = function (RequestedState, TimeoutPeriod, callback_func) { obj.Exec("IPS_SecIOService", "RequestStateChange", { "RequestedState": RequestedState, "TimeoutPeriod": TimeoutPeriod }, callback_func); }
395 obj.IPS_HTTPProxyService_AddProxyAccessPoint = function (AccessInfo, InfoFormat, Port, NetworkDnsSuffix, callback_func) { obj.Exec('IPS_HTTPProxyService', 'AddProxyAccessPoint', { 'AccessInfo': AccessInfo, 'InfoFormat': InfoFormat, 'Port': Port, 'NetworkDnsSuffix': NetworkDnsSuffix }, callback_func); }
396
397 obj.AmtStatusToStr = function (code) { if (obj.AmtStatusCodes[code]) return obj.AmtStatusCodes[code]; else return "UNKNOWN_ERROR" }
398 obj.AmtStatusCodes = {
399 0x0000: "SUCCESS",
400 0x0001: "INTERNAL_ERROR",
401 0x0002: "NOT_READY",
402 0x0003: "INVALID_PT_MODE",
403 0x0004: "INVALID_MESSAGE_LENGTH",
404 0x0005: "TABLE_FINGERPRINT_NOT_AVAILABLE",
405 0x0006: "INTEGRITY_CHECK_FAILED",
406 0x0007: "UNSUPPORTED_ISVS_VERSION",
407 0x0008: "APPLICATION_NOT_REGISTERED",
408 0x0009: "INVALID_REGISTRATION_DATA",
409 0x000A: "APPLICATION_DOES_NOT_EXIST",
410 0x000B: "NOT_ENOUGH_STORAGE",
411 0x000C: "INVALID_NAME",
412 0x000D: "BLOCK_DOES_NOT_EXIST",
413 0x000E: "INVALID_BYTE_OFFSET",
414 0x000F: "INVALID_BYTE_COUNT",
415 0x0010: "NOT_PERMITTED",
416 0x0011: "NOT_OWNER",
417 0x0012: "BLOCK_LOCKED_BY_OTHER",
418 0x0013: "BLOCK_NOT_LOCKED",
419 0x0014: "INVALID_GROUP_PERMISSIONS",
420 0x0015: "GROUP_DOES_NOT_EXIST",
421 0x0016: "INVALID_MEMBER_COUNT",
422 0x0017: "MAX_LIMIT_REACHED",
423 0x0018: "INVALID_AUTH_TYPE",
424 0x0019: "AUTHENTICATION_FAILED",
425 0x001A: "INVALID_DHCP_MODE",
426 0x001B: "INVALID_IP_ADDRESS",
427 0x001C: "INVALID_DOMAIN_NAME",
428 0x001D: "UNSUPPORTED_VERSION",
429 0x001E: "REQUEST_UNEXPECTED",
430 0x001F: "INVALID_TABLE_TYPE",
431 0x0020: "INVALID_PROVISIONING_STATE",
432 0x0021: "UNSUPPORTED_OBJECT",
433 0x0022: "INVALID_TIME",
434 0x0023: "INVALID_INDEX",
435 0x0024: "INVALID_PARAMETER",
436 0x0025: "INVALID_NETMASK",
437 0x0026: "FLASH_WRITE_LIMIT_EXCEEDED",
438 0x0027: "INVALID_IMAGE_LENGTH",
439 0x0028: "INVALID_IMAGE_SIGNATURE",
440 0x0029: "PROPOSE_ANOTHER_VERSION",
441 0x002A: "INVALID_PID_FORMAT",
442 0x002B: "INVALID_PPS_FORMAT",
443 0x002C: "BIST_COMMAND_BLOCKED",
444 0x002D: "CONNECTION_FAILED",
445 0x002E: "CONNECTION_TOO_MANY",
446 0x002F: "RNG_GENERATION_IN_PROGRESS",
447 0x0030: "RNG_NOT_READY",
448 0x0031: "CERTIFICATE_NOT_READY",
449 0x0400: "DISABLED_BY_POLICY",
450 0x0800: "NETWORK_IF_ERROR_BASE",
451 0x0801: "UNSUPPORTED_OEM_NUMBER",
452 0x0802: "UNSUPPORTED_BOOT_OPTION",
453 0x0803: "INVALID_COMMAND",
454 0x0804: "INVALID_SPECIAL_COMMAND",
455 0x0805: "INVALID_HANDLE",
456 0x0806: "INVALID_PASSWORD",
457 0x0807: "INVALID_REALM",
458 0x0808: "STORAGE_ACL_ENTRY_IN_USE",
459 0x0809: "DATA_MISSING",
460 0x080A: "DUPLICATE",
461 0x080B: "EVENTLOG_FROZEN",
462 0x080C: "PKI_MISSING_KEYS",
463 0x080D: "PKI_GENERATING_KEYS",
464 0x080E: "INVALID_KEY",
465 0x080F: "INVALID_CERT",
466 0x0810: "CERT_KEY_NOT_MATCH",
467 0x0811: "MAX_KERB_DOMAIN_REACHED",
468 0x0812: "UNSUPPORTED",
469 0x0813: "INVALID_PRIORITY",
470 0x0814: "NOT_FOUND",
471 0x0815: "INVALID_CREDENTIALS",
472 0x0816: "INVALID_PASSPHRASE",
473 0x0818: "NO_ASSOCIATION",
474 0x081B: "AUDIT_FAIL",
475 0x081C: "BLOCKING_COMPONENT",
476 0x0821: "USER_CONSENT_REQUIRED",
477 0x1000: "APP_INTERNAL_ERROR",
478 0x1001: "NOT_INITIALIZED",
479 0x1002: "LIB_VERSION_UNSUPPORTED",
480 0x1003: "INVALID_PARAM",
481 0x1004: "RESOURCES",
482 0x1005: "HARDWARE_ACCESS_ERROR",
483 0x1006: "REQUESTOR_NOT_REGISTERED",
484 0x1007: "NETWORK_ERROR",
485 0x1008: "PARAM_BUFFER_TOO_SHORT",
486 0x1009: "COM_NOT_INITIALIZED_IN_THREAD",
487 0x100A: "URL_REQUIRED"
488 }
489
490 //
491 // Methods used for getting the event log
492 //
493
494 obj.GetMessageLog = function (func, tag) {
495 obj.AMT_MessageLog_PositionToFirstRecord(_GetMessageLog0, [func, tag, []]);
496 }
497 function _GetMessageLog0(stack, name, responses, status, tag) {
498 if (status != 200 || responses.Body["ReturnValue"] != '0') { tag[0](obj, null, tag[2], status); return; }
499 obj.AMT_MessageLog_GetRecords(responses.Body["IterationIdentifier"], 390, _GetMessageLog1, tag);
500 }
501 function _GetMessageLog1(stack, name, responses, status, tag) {
502 if (status != 200 || responses.Body["ReturnValue"] != '0') { tag[0](obj, null, tag[2], status); return; }
503 var i, j, x, e, AmtMessages = tag[2], t = new Date(), TimeStamp, ra = responses.Body["RecordArray"];
504 if (typeof ra === 'string') { responses.Body["RecordArray"] = [responses.Body["RecordArray"]]; }
505
506 for (i in ra) {
507 e = Buffer.from(ra[i], 'base64');
508 if (e != null) {
509 TimeStamp = ReadIntX(e, 0);
510 if ((TimeStamp > 0) && (TimeStamp < 0xFFFFFFFF)) {
511 x = { 'DeviceAddress': e[4], 'EventSensorType': e[5], 'EventType': e[6], 'EventOffset': e[7], 'EventSourceType': e[8], 'EventSeverity': e[9], 'SensorNumber': e[10], 'Entity': e[11], 'EntityInstance': e[12], 'EventData': [], 'Time': new Date((TimeStamp + (t.getTimezoneOffset() * 60)) * 1000) };
512 for (j = 13; j < 21; j++) { x['EventData'].push(e[j]); }
513 x['EntityStr'] = _SystemEntityTypes[x['Entity']];
514 x['Desc'] = _GetEventDetailStr(x['EventSensorType'], x['EventOffset'], x['EventData'], x['Entity']);
515 if (!x['EntityStr']) x['EntityStr'] = "Unknown";
516 AmtMessages.push(x);
517 }
518 }
519 }
520
521 if (responses.Body["NoMoreRecords"] != true) {
522 obj.AMT_MessageLog_GetRecords(responses.Body["IterationIdentifier"], 390, _GetMessageLog1, [tag[0], AmtMessages, tag[2]]); }
523 else { tag[0](obj, AmtMessages, tag[2], status); }
524 }
525
526 var _EventTrapSourceTypes = "Platform firmware (e.g. BIOS)|SMI handler|ISV system management software|Alert ASIC|IPMI|BIOS vendor|System board set vendor|System integrator|Third party add-in|OSV|NIC|System management card".split('|');
527 var _SystemFirmwareError = "Unspecified.|No system memory is physically installed in the system.|No usable system memory, all installed memory has experienced an unrecoverable failure.|Unrecoverable hard-disk/ATAPI/IDE device failure.|Unrecoverable system-board failure.|Unrecoverable diskette subsystem failure.|Unrecoverable hard-disk controller failure.|Unrecoverable PS/2 or USB keyboard failure.|Removable boot media not found.|Unrecoverable video controller failure.|No video device detected.|Firmware (BIOS) ROM corruption detected.|CPU voltage mismatch (processors that share same supply have mismatched voltage requirements)|CPU speed matching failure".split('|');
528 var _SystemFirmwareProgress = "Unspecified.|Memory initialization.|Starting hard-disk initialization and test|Secondary processor(s) initialization|User authentication|Entering BIOS setup|USB resource configuration|PCI resource configuration|Option ROM initialization|Video initialization|Cache initialization|SM Bus initialization|Keyboard controller initialization|Embedded controller/management controller initialization|Docking station attachment|Enabling docking station|Docking station ejection|Disabling docking station|Calling operating system wake-up vector|Starting operating system boot process|Baseboard or motherboard initialization|reserved|Floppy initialization|Keyboard test|Pointing device test|Primary processor initialization".split('|');
529 var _SystemEntityTypes = "Unspecified|Other|Unknown|Processor|Disk|Peripheral|System management module|System board|Memory module|Processor module|Power supply|Add in card|Front panel board|Back panel board|Power system board|Drive backplane|System internal expansion board|Other system board|Processor board|Power unit|Power module|Power management board|Chassis back panel board|System chassis|Sub chassis|Other chassis board|Disk drive bay|Peripheral bay|Device bay|Fan cooling|Cooling unit|Cable interconnect|Memory device|System management software|BIOS|Intel(r) ME|System bus|Group|Intel(r) ME|External environment|Battery|Processing blade|Connectivity switch|Processor/memory module|I/O module|Processor I/O module|Management controller firmware|IPMI channel|PCI bus|PCI express bus|SCSI bus|SATA/SAS bus|Processor front side bus".split('|');
530 obj.RealmNames = "||Redirection||Hardware Asset|Remote Control|Storage|Event Manager|Storage Admin|Agent Presence Local|Agent Presence Remote|Circuit Breaker|Network Time|General Information|Firmware Update|EIT|LocalUN|Endpoint Access Control|Endpoint Access Control Admin|Event Log Reader|Audit Log|ACL Realm|||Local System".split('|');
531 obj.WatchdogCurrentStates = { 1: "Not Started", 2: "Stopped", 4: "Running", 8: "Expired", 16: "Suspended" };
532 var _OCRProgressEvents = ["Boot parameters received from CSME", "CSME Boot Option % added successfully", "HTTPS URI name resolved", "HTTPS connected successfully", "HTTPSBoot download is completed", "Attempt to boot", "Exit boot services"];
533 var _OCRErrorEvents = ['', "No network connection available", "Name resolution of URI failed", "Connect to URI failed", "OEM app not found at local URI", "HTTPS TLS Auth failed", "HTTPS Digest Auth failed", "Verified boot failed (bad image)", "HTTPS Boot File not found"];
534 var _OCRSource = { 1: '', 2: "HTTPS", 4: "Local PBA", 8: "WinRE" };
535
536 function _GetEventDetailStr(eventSensorType, eventOffset, eventDataField, entity) {
537 if (eventSensorType == 15) {
538 if (eventDataField[0] == 235) return "Invalid Data";
539 if (eventOffset == 0) {
540 return _SystemFirmwareError[eventDataField[1]];
541 } else if (eventOffset == 3) {
542 if ((eventDataField[0] == 170) && (eventDataField[1] == 48)) {
543 return format("AMT One Click Recovery: {0}", _OCRErrorEvents[eventDataField[2]]);
544 } else if ((eventDataField[0] == 170) && (eventDataField[1] == 64)) {
545 if (eventDataField[2] == 1) return "Got an error erasing Device SSD";
546 if (eventDataField[2] == 2) return "Erasing Device TPM is not supported";
547 if (eventDataField[2] == 3) return "Reached Max Counter";
548 } else {
549 return "OEM Specific Firmware Error event";
550 }
551 } else if (eventOffset == 5) {
552 if ((eventDataField[0] == 170) && (eventDataField[1] == 48)) {
553 if (eventDataField[2] == 1) {
554 return format("AMT One Click Recovery: CSME Boot Option {0}:{1} added successfully", (eventDataField[3]), _OCRSource[(eventDataField[3])]);
555 } else if (eventDataField[2] < 7) {
556 return format("AMT One Click Recovery: {0}", _OCRProgressEvents[eventDataField[2]]);
557 } else {
558 return format("AMT One Click Recovery: Unknown progress event {0}", eventDataField[2]);
559 }
560 } else if ((eventDataField[0] == 170) && (eventDataField[1] == 64)) {
561 if (eventDataField[2] == 1) {
562 if (eventDataField[3] == 2) return "Started erasing Device SSD";
563 if (eventDataField[3] == 3) return "Started erasing Device TPM";
564 if (eventDataField[3] == 5) return "Started erasing Device BIOS Reload of Golden Config";
565 }
566 if (eventDataField[2] == 2) {
567 if (eventDataField[3] == 2) return "Erasing Device SSD ended successfully";
568 if (eventDataField[3] == 3) return "Erasing Device TPM ended successfully";
569 if (eventDataField[3] == 5) return "Erasing Device BIOS Reload of Golden Config ended successfully";
570 }
571 if (eventDataField[2] == 3) return "Beginning Platform Erase";
572 if (eventDataField[2] == 4) return "Clear Reserved Parameters";
573 if (eventDataField[2] == 5) return "All setting decremented";
574 } else {
575 return "OEM Specific Firmware Progress event";
576 }
577 } else {
578 return _SystemFirmwareProgress[eventDataField[1]];
579 }
580 }
581
582 if ((eventSensorType == 18) && (eventDataField[0] == 170)) { // System watchdog event
583 return "Agent watchdog " + char2hex(eventDataField[4]) + char2hex(eventDataField[3]) + char2hex(eventDataField[2]) + char2hex(eventDataField[1]) + '-' + char2hex(eventDataField[6]) + char2hex(eventDataField[5]) + '-...' + " changed to " + obj.WatchdogCurrentStates[eventDataField[7]];
584 }
585
586 if ((eventSensorType == 5) && (eventOffset == 0)) { // System chassis
587 return "Case intrusion";
588 }
589
590 if ((eventSensorType == 192) && (eventOffset == 0) && (eventDataField[0] == 170) && (eventDataField[1] == 48)) {
591 if (eventDataField[2] == 0) return "A remote Serial Over LAN session was established.";
592 if (eventDataField[2] == 1) return "Remote Serial Over LAN session finished. User control was restored.";
593 if (eventDataField[2] == 2) return "A remote IDE-Redirection session was established.";
594 if (eventDataField[2] == 3) return "Remote IDE-Redirection session finished. User control was restored.";
595 }
596
597 if (eventSensorType == 36) {
598 var handle = (eventDataField[1] << 24) + (eventDataField[2] << 16) + (eventDataField[3] << 8) + eventDataField[4];
599 var nic = '#' + eventDataField[0];
600 if (eventDataField[0] == 0xAA) nic = "wired"; // TODO: Add wireless *****
601 //if (eventDataField[0] == 0xAA) nic = "wireless";
602
603 if (handle == 4294967293) { return "All received packet filter was matched on " + nic + " interface."; }
604 if (handle == 4294967292) { return "All outbound packet filter was matched on " + nic + " interface."; }
605 if (handle == 4294967290) { return "Spoofed packet filter was matched on " + nic + " interface."; }
606 return "Filter " + handle + " was matched on " + nic + " interface.";
607 }
608
609 if (eventSensorType == 192) {
610 if (eventDataField[2] == 0) return "Security policy invoked. Some or all network traffic (TX) was stopped.";
611 if (eventDataField[2] == 2) return "Security policy invoked. Some or all network traffic (RX) was stopped.";
612 return "Security policy invoked.";
613 }
614
615 if (eventSensorType == 193) {
616 if ((eventDataField[0] == 0xAA) && (eventDataField[1] == 0x30) && (eventDataField[2] == 0x00) && (eventDataField[3] == 0x00)) { return "User request for remote connection."; }
617 if ((eventDataField[0] == 0xAA) && (eventDataField[1] == 0x20) && (eventDataField[2] == 0x03) && (eventDataField[3] == 0x01)) { return "EAC error: attempt to get posture while NAC in Intel® AMT is disabled."; } // eventDataField = 0xAA20030100000000
618 if ((eventDataField[0] == 0xAA) && (eventDataField[1] == 0x20) && (eventDataField[2] == 0x04) && (eventDataField[3] == 0x00)) { return "HWA Error: general error"; } // Used to be "Certificate revoked." but don"t know the source of this.
619 }
620
621 if (eventSensorType == 6) return "Authentication failed " + (eventDataField[1] + (eventDataField[2] << 8)) + " times. The system may be under attack.";
622 if (eventSensorType == 30) return "No bootable media";
623 if (eventSensorType == 32) return "Operating system lockup or power interrupt";
624 if (eventSensorType == 35) {
625 if (eventDataField[0] == 64) return "BIOS POST (Power On Self-Test) Watchdog Timeout."; // 64,2,252,84,89,0,0,0
626 return "System boot failure";
627 }
628 if (eventSensorType == 37) return "System firmware started (at least one CPU is properly executing).";
629 return "Unknown Sensor Type #" + eventSensorType;
630 }
631
632// ###BEGIN###{AuditLog}
633
634 // Useful link: https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Fsecurityadminevents.htm
635
636 var _AmtAuditStringTable =
637 {
638 16: "Security Admin",
639 17: "RCO",
640 18: "Redirection Manager",
641 19: "Firmware Update Manager",
642 20: "Security Audit Log",
643 21: "Network Time",
644 22: "Network Administration",
645 23: "Storage Administration",
646 24: "Event Manager",
647 25: "Circuit Breaker Manager",
648 26: "Agent Presence Manager",
649 27: "Wireless Configuration",
650 28: "EAC",
651 29: "KVM",
652 30: "User Opt-In Events",
653 32: "Screen Blanking",
654 33: "Watchdog Events",
655 1600: "Provisioning Started",
656 1601: "Provisioning Completed",
657 1602: "ACL Entry Added",
658 1603: "ACL Entry Modified",
659 1604: "ACL Entry Removed",
660 1605: "ACL Access with Invalid Credentials",
661 1606: "ACL Entry State",
662 1607: "TLS State Changed",
663 1608: "TLS Server Certificate Set",
664 1609: "TLS Server Certificate Remove",
665 1610: "TLS Trusted Root Certificate Added",
666 1611: "TLS Trusted Root Certificate Removed",
667 1612: "TLS Preshared Key Set",
668 1613: "Kerberos Settings Modified",
669 1614: "Kerberos Main Key Modified",
670 1615: "Flash Wear out Counters Reset",
671 1616: "Power Package Modified",
672 1617: "Set Realm Authentication Mode",
673 1618: "Upgrade Client to Admin Control Mode",
674 1619: "Unprovisioning Started",
675 1700: "Performed Power Up",
676 1701: "Performed Power Down",
677 1702: "Performed Power Cycle",
678 1703: "Performed Reset",
679 1704: "Set Boot Options",
680 1705: "Remote graceful power down initiated",
681 1706: "Remote graceful reset initiated",
682 1707: "Remote Standby initiated",
683 1708: "Remote Hiberate initiated",
684 1709: "Remote NMI initiated",
685 1800: "IDER Session Opened",
686 1801: "IDER Session Closed",
687 1802: "IDER Enabled",
688 1803: "IDER Disabled",
689 1804: "SoL Session Opened",
690 1805: "SoL Session Closed",
691 1806: "SoL Enabled",
692 1807: "SoL Disabled",
693 1808: "KVM Session Started",
694 1809: "KVM Session Ended",
695 1810: "KVM Enabled",
696 1811: "KVM Disabled",
697 1812: "VNC Password Failed 3 Times",
698 1900: "Firmware Updated",
699 1901: "Firmware Update Failed",
700 2000: "Security Audit Log Cleared",
701 2001: "Security Audit Policy Modified",
702 2002: "Security Audit Log Disabled",
703 2003: "Security Audit Log Enabled",
704 2004: "Security Audit Log Exported",
705 2005: "Security Audit Log Recovered",
706 2100: "Intel&reg; ME Time Set",
707 2200: "TCPIP Parameters Set",
708 2201: "Host Name Set",
709 2202: "Domain Name Set",
710 2203: "VLAN Parameters Set",
711 2204: "Link Policy Set",
712 2205: "IPv6 Parameters Set",
713 2300: "Global Storage Attributes Set",
714 2301: "Storage EACL Modified",
715 2302: "Storage FPACL Modified",
716 2303: "Storage Write Operation",
717 2400: "Alert Subscribed",
718 2401: "Alert Unsubscribed",
719 2402: "Event Log Cleared",
720 2403: "Event Log Frozen",
721 2500: "CB Filter Added",
722 2501: "CB Filter Removed",
723 2502: "CB Policy Added",
724 2503: "CB Policy Removed",
725 2504: "CB Default Policy Set",
726 2505: "CB Heuristics Option Set",
727 2506: "CB Heuristics State Cleared",
728 2600: "Agent Watchdog Added",
729 2601: "Agent Watchdog Removed",
730 2602: "Agent Watchdog Action Set",
731 2700: "Wireless Profile Added",
732 2701: "Wireless Profile Removed",
733 2702: "Wireless Profile Updated",
734 2703: "An existing profile sync was modified",
735 2704: "An existing profile link preference was changed",
736 2705: "Wireless profile share with UEFI enabled setting was changed",
737 2800: "EAC Posture Signer SET",
738 2801: "EAC Enabled",
739 2802: "EAC Disabled",
740 2803: "EAC Posture State",
741 2804: "EAC Set Options",
742 2900: "KVM Opt-in Enabled",
743 2901: "KVM Opt-in Disabled",
744 2902: "KVM Password Changed",
745 2903: "KVM Consent Succeeded",
746 2904: "KVM Consent Failed",
747 3000: "Opt-In Policy Change",
748 3001: "Send Consent Code Event",
749 3002: "Start Opt-In Blocked Event",
750 3301: "A user has modified the Watchdog Action settings",
751 3302: "A user has modified a Watchdog to add, remove, or alter the Watchdog Action connected to it"
752 }
753
754 // Return human readable extended audit log data
755 // TODO: Just put some of them here, but many more still need to be added, helpful link here:
756 // https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/default.htm?turl=WordDocuments%2Fsecurityadminevents.htm
757 obj.GetAuditLogExtendedDataStr = function (id, data) {
758 if ((id == 1602 || id == 1604) && data[0] == 0) { return data.splice(2, 2 + data[1]).toString(); } // ACL Entry Added/Removed (Digest)
759 if (id == 1603) { if (data[1] == 0) { return data.splice(3).toString(); } return null; } // ACL Entry Modified
760 if (id == 1605) { return ["Invalid ME access", "Invalid MEBx access"][data[0]]; } // ACL Access with Invalid Credentials
761 if (id == 1606) { var r = ["Disabled", "Enabled"][data[0]]; if (data[1] == 0) { r += ", " + data[3]; } return r; } // ACL Entry State
762 if (id == 1607) { return "Remote " + ["NoAuth", "ServerAuth", "MutualAuth"][data[0]] + ", Local " + ["NoAuth", "ServerAuth", "MutualAuth"][data[1]]; } // TLS State Changed
763 if (id == 1617) { return obj.RealmNames[ReadInt(data, 0)] + ", " + ["NoAuth", "Auth", "Disabled"][data[4]]; } // Set Realm Authentication Mode
764 if (id == 1619) { return ["BIOS", "MEBx", "Local MEI", "Local WSMAN", "Remote WSAMN"][data[0]]; } // Intel AMT Unprovisioning Started
765 if (id == 1900) { return "From " + ReadShort(data, 0) + "." + ReadShort(data, 2) + "." + ReadShort(data, 4) + "." + ReadShort(data, 6) + " to " + ReadShort(data, 8) + "." + ReadShort(data, 10) + "." + ReadShort(data, 12) + "." + ReadShort(data, 14); } // Firmware Updated
766 if (id == 2100) { var t4 = new Date(); t4.setTime(ReadInt(data, 0) * 1000 + (new Date().getTimezoneOffset() * 60000)); return t4.toLocaleString(); } // Intel AMT Time Set
767 if (id == 3000) { return "From " + ["None", "KVM", "All"][data[0]] + " to " + ["None", "KVM", "All"][data[1]]; } // Opt-In Policy Change
768 if (id == 3001) { return ["Success", "Failed 3 times"][data[0]]; } // Send Consent Code Event
769 return null;
770 }
771
772 obj.GetAuditLog = function (func) {
773 obj.AMT_AuditLog_ReadRecords(1, _GetAuditLog0, [func, []]);
774 }
775
776 function MakeToArray(v) { if (!v || v == null || typeof v == 'object') return v; return [v]; }
777 function ReadShort(v, p) { return (v[p] << 8) + v[p + 1]; }
778 function ReadInt(v, p) { return (v[p] * 0x1000000) + (v[p + 1] << 16) + (v[p + 2] << 8) + v[p + 3]; } // We use "*0x1000000" instead of "<<24" because the shift converts the number to signed int32.
779 function ReadIntX(v, p) { return (v[p + 3] * 0x1000000) + (v[p + 2] << 16) + (v[p + 1] << 8) + v[p]; }
780 function btoa(x) { return Buffer.from(x).toString('base64'); }
781 function atob(x) { var z = null; try { z = Buffer.from(x, 'base64').toString(); } catch (e) { console.log(e); } return z; }
782
783 function _GetAuditLog0(stack, name, responses, status, tag) {
784 if (status != 200) { tag[0](obj, [], status); return; }
785 var ptr, i, e, es, x, r = tag[1], t = new Date(), TimeStamp;
786
787 if (responses.Body['RecordsReturned'] > 0) {
788 responses.Body['EventRecords'] = MakeToArray(responses.Body['EventRecords']);
789
790 for (i in responses.Body['EventRecords']) {
791 e = null;
792 try {
793 es = atob(responses.Body['EventRecords'][i]);
794 e = Buffer.from(es);
795 } catch (ex) {
796 console.log(ex + " " + responses.Body['EventRecords'][i])
797 }
798
799 x = { 'AuditAppID': ReadShort(e, 0), 'EventID': ReadShort(e, 2), 'InitiatorType': e[4] };
800 x['AuditApp'] = _AmtAuditStringTable[x['AuditAppID']];
801 x['Event'] = _AmtAuditStringTable[(x['AuditAppID'] * 100) + x['EventID']];
802 if (!x['Event']) x['Event'] = '#' + x['EventID'];
803
804 // Read and process the initiator
805 if (x['InitiatorType'] == 0) {
806 // HTTP digest
807 var userlen = e[5];
808 x['Initiator'] = e.slice(6, 6 + userlen).toString();
809 ptr = 6 + userlen;
810 }
811 if (x['InitiatorType'] == 1) {
812 // Kerberos
813 x['KerberosUserInDomain'] = ReadInt(e, 5);
814 var userlen = e[9];
815 x['Initiator'] = GetSidString(e.slice(10, 10 + userlen));
816 ptr = 10 + userlen;
817 }
818 if (x['InitiatorType'] == 2) {
819 // Local
820 x['Initiator'] = 'Local';
821 ptr = 5;
822 }
823 if (x['InitiatorType'] == 3) {
824 // KVM Default Port
825 x['Initiator'] = 'KVM Default Port';
826 ptr = 5;
827 }
828
829 // Read timestamp
830 TimeStamp = ReadInt(e, ptr);
831 x['Time'] = new Date((TimeStamp + (t.getTimezoneOffset() * 60)) * 1000);
832 ptr += 4;
833
834 // Read network access
835 x['MCLocationType'] = e[ptr++];
836 var netlen = e[ptr++];
837
838 x['NetAddress'] = e.slice(ptr, ptr + netlen).toString();
839
840 // Read extended data
841 ptr += netlen;
842 var exlen = e[ptr++];
843 x['Ex'] = e.slice(ptr, ptr + exlen);
844 x['ExStr'] = obj.GetAuditLogExtendedDataStr((x['AuditAppID'] * 100) + x['EventID'], x['Ex']);
845 r.push(x);
846 }
847 }
848 if (responses.Body['TotalRecordCount'] > r.length) {
849 obj.AMT_AuditLog_ReadRecords(r.length + 1, _GetAuditLog0, [tag[0], r]);
850 } else {
851 tag[0](obj, r, status);
852 }
853 }
854
855 // ###END###{AuditLog}
856
857 /*
858 // ###BEGIN###{Certificates}
859
860 // Forge MD5
861 function hex_md5(str) { return forge.md.md5.create().update(str).digest().toHex(); }
862
863 // ###END###{Certificates}
864
865 // ###BEGIN###{!Certificates}
866
867 // TinyMD5 from https://github.com/jbt/js-crypto
868
869 // Perform MD5 setup
870 var md5_k = [];
871 for (var i = 0; i < 64;) { md5_k[i] = 0 | (Math.abs(Math.sin(++i)) * 4294967296); }
872
873 // Perform MD5 on raw string and return hex
874 function hex_md5(str) {
875 var b, c, d, j,
876 x = [],
877 str2 = unescape(encodeURI(str)),
878 a = str2.length,
879 h = [b = 1732584193, c = -271733879, ~b, ~c],
880 i = 0;
881
882 for (; i <= a;) x[i >> 2] |= (str2.charCodeAt(i) || 128) << 8 * (i++ % 4);
883
884 x[str = (a + 8 >> 6) * 16 + 14] = a * 8;
885 i = 0;
886
887 for (; i < str; i += 16) {
888 a = h; j = 0;
889 for (; j < 64;) {
890 a = [
891 d = a[3],
892 ((b = a[1] | 0) +
893 ((d = (
894 (a[0] +
895 [
896 b & (c = a[2]) | ~b & d,
897 d & b | ~d & c,
898 b ^ c ^ d,
899 c ^ (b | ~d)
900 ][a = j >> 4]
901 ) +
902 (md5_k[j] +
903 (x[[
904 j,
905 5 * j + 1,
906 3 * j + 5,
907 7 * j
908 ][a] % 16 + i] | 0)
909 )
910 )) << (a = [
911 7, 12, 17, 22,
912 5, 9, 14, 20,
913 4, 11, 16, 23,
914 6, 10, 15, 21
915 ][4 * a + j++ % 4]) | d >>> 32 - a)
916 ),
917 b,
918 c
919 ];
920 }
921 for (j = 4; j;) h[--j] = h[j] + a[j];
922 }
923
924 str = '';
925 for (; j < 32;) str += ((h[j >> 3] >> ((1 ^ j++ & 7) * 4)) & 15).toString(16);
926 return str;
927 }
928
929 // ###END###{!Certificates}
930
931 // Perform MD5 on raw string and return raw string result
932 function rstr_md5(str) { return hex2rstr(hex_md5(str)); }
933 */
934 /*
935 Convert arguments into selector set and body XML. Used by AMT_WiFiPortConfigurationService_UpdateWiFiSettings.
936 args = {
937 "WiFiEndpoint": {
938 __parameterType: 'reference',
939 __resourceUri: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint',
940 Name: 'WiFi Endpoint 0'
941 },
942 "WiFiEndpointSettingsInput":
943 {
944 __parameterType: 'instance',
945 __namespace: 'http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings',
946 ElementName: document.querySelector('#editProfile-profileName').value,
947 InstanceID: 'Intel(r) AMT:WiFi Endpoint Settings ' + document.querySelector('#editProfile-profileName').value,
948 AuthenticationMethod: document.querySelector('#editProfile-networkAuthentication').value,
949 //BSSType: 3, // Intel(r) AMT supports only infrastructure networks
950 EncryptionMethod: document.querySelector('#editProfile-encryption').value,
951 SSID: document.querySelector('#editProfile-networkName').value,
952 Priority: 100,
953 PSKPassPhrase: document.querySelector('#editProfile-passPhrase').value
954 },
955 "IEEE8021xSettingsInput": null,
956 "ClientCredential": null,
957 "CACredential": null
958 },
959 */
960 function execArgumentsToXml(args) {
961 if (args === undefined || args === null) return null;
962
963 var result = '';
964 for (var argName in args) {
965 var arg = args[argName];
966 if (!arg) continue;
967 if (arg['__parameterType'] === 'reference') result += referenceToXml(argName, arg);
968 else result += instanceToXml(argName, arg);
969 //if(arg['__isInstance']) result += instanceToXml(argName, arg);
970 }
971 return result;
972 }
973
974 /**
975 * Convert JavaScript object into XML
976
977 <r:WiFiEndpointSettingsInput xmlns:q="http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpointSettings">
978 <q:ElementName>Wireless-Profile-Admin</q:ElementName>
979 <q:InstanceID>Intel(r) AMT:WiFi Endpoint Settings Wireless-Profile-Admin</q:InstanceID>
980 <q:AuthenticationMethod>6</q:AuthenticationMethod>
981 <q:EncryptionMethod>4</q:EncryptionMethod>
982 <q:Priority>100</q:Priority>
983 <q:PSKPassPhrase>P@ssw0rd</q:PSKPassPhrase>
984 </r:WiFiEndpointSettingsInput>
985 */
986 function instanceToXml(instanceName, inInstance) {
987 if (inInstance === undefined || inInstance === null) return null;
988
989 var hasNamespace = !!inInstance['__namespace'];
990 var startTag = hasNamespace ? '<q:' : '<';
991 var endTag = hasNamespace ? '</q:' : '</';
992 var namespaceDef = hasNamespace ? (' xmlns:q="' + inInstance['__namespace'] + '"') : '';
993 var result = '<r:' + instanceName + namespaceDef + '>';
994 if (typeof inInstance == 'string') {
995 result += inInstance;
996 } else {
997 for (var prop in inInstance) {
998 if (!inInstance.hasOwnProperty(prop) || prop.indexOf('__') === 0) continue;
999
1000 if (typeof inInstance[prop] === 'function' || Array.isArray(inInstance[prop])) continue;
1001
1002 if (typeof inInstance[prop] === 'object') {
1003 //result += startTag + prop +'>' + instanceToXml('prop', inInstance[prop]) + endTag + prop +'>';
1004 console.error('only convert one level down...');
1005 }
1006 else {
1007 result += startTag + prop + '>' + inInstance[prop].toString() + endTag + prop + '>';
1008 }
1009 }
1010 }
1011 result += '</r:' + instanceName + '>';
1012 return result;
1013 }
1014
1015
1016 /**
1017 * Convert a selector set into XML. Expect no nesting.
1018 * {
1019 * selectorName : selectorValue,
1020 * selectorName : selectorValue,
1021 * ... ...
1022 * }
1023
1024 <r:WiFiEndpoint>
1025 <a:Address>http://192.168.1.103:16992/wsman</a:Address>
1026 <a:ReferenceParameters>
1027 <w:ResourceURI>http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_WiFiEndpoint</w:ResourceURI>
1028 <w:SelectorSet>
1029 <w:Selector Name="Name">WiFi Endpoint 0</w:Selector>
1030 </w:SelectorSet>
1031 </a:ReferenceParameters>
1032 </r:WiFiEndpoint>
1033
1034 */
1035 function referenceToXml(referenceName, inReference) {
1036 if (inReference === undefined || inReference === null) return null;
1037
1038 var result = '<r:' + referenceName + '><a:Address>/wsman</a:Address><a:ReferenceParameters><w:ResourceURI>' + inReference['__resourceUri'] + '</w:ResourceURI><w:SelectorSet>';
1039 for (var selectorName in inReference) {
1040 if (!inReference.hasOwnProperty(selectorName) || selectorName.indexOf('__') === 0) continue;
1041
1042 if (typeof inReference[selectorName] === 'function' ||
1043 typeof inReference[selectorName] === 'object' ||
1044 Array.isArray(inReference[selectorName]))
1045 continue;
1046
1047 result += '<w:Selector Name="' + selectorName + '">' + inReference[selectorName].toString() + '</w:Selector>';
1048 }
1049
1050 result += '</w:SelectorSet></a:ReferenceParameters></r:' + referenceName + '>';
1051 return result;
1052 }
1053
1054 // Convert a byte array of SID into string
1055 function GetSidString(sid) {
1056 var r = "S-" + sid.charCodeAt(0) + "-" + sid.charCodeAt(7);
1057 for (var i = 2; i < (sid.length / 4) ; i++) r += "-" + ReadIntX(sid, i * 4);
1058 return r;
1059 }
1060
1061 // Convert a SID readable string into bytes
1062 function GetSidByteArray(sidString) {
1063 if (!sidString || sidString == null) return null;
1064 var sidParts = sidString.split('-');
1065
1066 // Make sure the SID has at least 4 parts and starts with 'S'
1067 if (sidParts.length < 4 || (sidParts[0] != 's' && sidParts[0] != 'S')) return null;
1068
1069 // Check that each part of the SID is really an integer
1070 for (var i = 1; i < sidParts.length; i++) { var y = parseInt(sidParts[i]); if (y != sidParts[i]) return null; sidParts[i] = y; }
1071
1072 // Version (8 bit) + Id count (8 bit) + 48 bit in big endian -- DO NOT use bitwise right shift operator. JavaScript converts the number into a 32 bit integer before shifting. In real world, it's highly likely this part is always 0.
1073 var r = String.fromCharCode(sidParts[1]) + String.fromCharCode(sidParts.length - 3) + ShortToStr(Math.floor(sidParts[2] / Math.pow(2, 32))) + IntToStr((sidParts[2]) & 0xFFFF);
1074
1075 // the rest are in 32 bit in little endian
1076 for (var i = 3; i < sidParts.length; i++) r += IntToStrX(sidParts[i]);
1077 return r;
1078 }
1079
1080 return obj;
1081}
1082module.exports = AmtStackCreateService;