github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/include/cli.h (about) 1 /* 2 * Copyright (c) 2013 Intel Corporation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * Unless required by applicable law or agreed to in writing, software 9 * distributed under the License is distributed on an "AS IS" BASIS, 10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 * See the License for the specific language governing permissions and 12 * limitations under the License. 13 */ 14 15 #ifndef _CLI_H_ 16 #define _CLI_H_ 17 18 #if defined(__cplusplus) 19 extern "C" { 20 #endif 21 22 #include "cli_env.h" 23 24 typedef int (*CLI_FUNCTION) (unsigned argc, char *args[]); 25 26 #ifdef CLI_INCLUDE 27 28 void CLI_OpenSession(const char* reason, UINT32 access_level ); 29 BOOLEAN CLI_CloseSession(void); 30 void CLI_EndSession(BOOLEAN cli_retvalue); 31 BOOLEAN CLI_IsSessionActive(void); 32 BOOLEAN CLI_IsSessionActiveOnThisCpu(void); 33 void CLI_PrintSessionReason(void); 34 int CLI_AddCommand(CLI_FUNCTION function, char *path, char *help, char *usage, UINT32 access_level); 35 int CLI_ExecCommand(char *path); 36 void CLI_Prompt(void); 37 void CLI_Init(void); 38 void Cli_emulator_register( GUEST_ID guest_id ); 39 UINT32 Cli_get_level(void); 40 BOOLEAN Cli_set_level( UINT32 level ); 41 42 #else // ! CLI_INCLUDE 43 44 #pragma warning( push ) 45 #pragma warning( disable : 4100 ) 46 INLINE void CLI_OpenSession(const char* reason, UINT32 access_level ){ 47 (void)reason; 48 (void)access_level; 49 } 50 INLINE BOOLEAN CLI_CloseSession(void){ 51 return FALSE; 52 } 53 INLINE void CLI_EndSession(BOOLEAN cli_retvalue){ 54 (void)cli_retvalue; 55 } 56 INLINE BOOLEAN CLI_IsSessionActive(void){ 57 return FALSE; 58 } 59 INLINE BOOLEAN CLI_IsSessionActiveOnThisCpu(void){ 60 return FALSE; 61 } 62 INLINE void CLI_PrintSessionReason(void){ 63 } 64 INLINE int CLI_AddCommand(CLI_FUNCTION function, char *path, char *help, char *usage, UINT32 access_level){ 65 (void)function; 66 (void)path; 67 (void)help; 68 (void)usage; 69 (void)access_level; 70 return -1; 71 } 72 INLINE int CLI_ExecCommand(char *path) { 73 (void)path; 74 return -1; 75 } 76 INLINE void CLI_Prompt(void) { 77 } 78 INLINE void Cli_emulator_register( GUEST_ID guest_id ) { 79 (void)guest_id; 80 } 81 INLINE UINT32 Cli_get_level(void){ return 0; } 82 INLINE BOOLEAN Cli_set_level( UINT32 level ) { 83 (void)level; 84 return FALSE; 85 } 86 #pragma warning( pop ) 87 #endif // CLI_INCLUDE 88 89 90 #if defined(__cplusplus) 91 } 92 #endif 93 94 #endif // _CLI_H_ 95