Lines Matching refs:Command
24 /* See struct Command below. This structure represent a field in a TPM
25 * command. [name] is the field name. [visible] is 1 if the field is
41 * of a TPM command. [size] is the size of the command buffer in bytes, when
43 * (such as Read and Write). [fields] is a link-list of command fields.
45 typedef struct Command {
50 struct Command* next;
51 } Command;
53 /* Adds a field to a command, and makes its offset visible. The fields must be
56 static void AddVisibleField(Command* cmd, const char* name, int offset) {
71 static void AddInitializedField(Command* cmd, int offset,
83 /* Create a structure representing a TPM command datagram.
85 Command* newCommand(TPM_COMMAND_CODE code, int size) {
86 Command* cmd = (Command*) calloc(1, sizeof(Command));
101 /* BuildXXX builds TPM command XXX.
103 Command* BuildDefineSpaceCommand(void) {
132 Command* cmd = newCommand(TPM_ORD_NV_DefineSpace, size);
152 /* BuildXXX builds TPM command XXX.
154 Command* BuildWriteCommand(void) {
155 Command* cmd = newCommand(TPM_ORD_NV_WriteValue, 0);
164 Command* BuildReadCommand(void) {
166 Command* cmd = newCommand(TPM_ORD_NV_ReadValue, size);
173 Command* BuildPCRReadCommand(void) {
175 Command* cmd = newCommand(TPM_ORD_PcrRead, size);
181 Command* BuildPPAssertCommand(void) {
183 Command* cmd = newCommand(TSC_ORD_PhysicalPresence, size);
191 Command* BuildPPEnableCommand(void) {
193 Command* cmd = newCommand(TSC_ORD_PhysicalPresence, size);
201 Command* BuildFinalizePPCommand(void) {
203 Command* cmd = newCommand(TSC_ORD_PhysicalPresence, size);
213 Command* BuildPPLockCommand(void) {
215 Command* cmd = newCommand(TSC_ORD_PhysicalPresence, size);
223 Command* BuildStartupCommand(void) {
225 Command* cmd = newCommand(TPM_ORD_Startup, size);
233 Command* BuildSaveStateCommand(void) {
235 Command* cmd = newCommand(TPM_ORD_SaveState, size);
240 Command* BuildResumeCommand(void) {
242 Command* cmd = newCommand(TPM_ORD_Startup, size);
250 Command* BuildSelftestfullCommand(void) {
252 Command* cmd = newCommand(TPM_ORD_SelfTestFull, size);
257 Command* BuildContinueSelfTestCommand(void) {
259 Command* cmd = newCommand(TPM_ORD_ContinueSelfTest, size);
264 Command* BuildReadPubekCommand(void) {
266 Command* cmd = newCommand(TPM_ORD_ReadPubek, size);
271 Command* BuildForceClearCommand(void) {
273 Command* cmd = newCommand(TPM_ORD_ForceClear, size);
278 Command* BuildPhysicalEnableCommand(void) {
280 Command* cmd = newCommand(TPM_ORD_PhysicalEnable, size);
285 Command* BuildPhysicalDisableCommand(void) {
287 Command* cmd = newCommand(TPM_ORD_PhysicalDisable, size);
292 Command* BuildPhysicalSetDeactivatedCommand(void) {
294 Command* cmd = newCommand(TPM_ORD_PhysicalSetDeactivated, size);
300 Command* BuildExtendCommand(void) {
302 Command* cmd = newCommand(TPM_ORD_Extend, size);
309 Command* BuildGetFlagsCommand(void) {
315 Command* cmd = newCommand(TPM_ORD_GetCapability, size);
328 Command* BuildGetSTClearFlagsCommand(void) {
334 Command* cmd = newCommand(TPM_ORD_GetCapability, size);
347 Command* BuildGetPermissionsCommand(void) {
353 Command* cmd = newCommand(TPM_ORD_GetCapability, size);
365 Command* BuildGetOwnershipCommand(void) {
371 Command* cmd = newCommand(TPM_ORD_GetCapability, size);
384 Command* BuildGetRandomCommand(void) {
386 Command* cmd = newCommand(TPM_ORD_GetRandom, size);
408 int OutputBytes_(Command* cmd, Field* fld) {
455 void OutputBytes(Command* cmd) {
459 void OutputFieldPointers(Command* cmd, Field* fld) {
472 void OutputCommands(Command* cmd) {
488 Command* (*builders[])(void) = {
523 static void FreeCommands(Command* cmd) {
525 Command* next_command = cmd->next;
533 Command* commands = NULL;
536 Command* cmd = builders[i]();