1 /* 2 Copyright (c) 2003, 2020, Oracle and/or its affiliates. All rights reserved. 3 4 This program is free software; you can redistribute it and/or modify 5 it under the terms of the GNU General Public License, version 2.0, 6 as published by the Free Software Foundation. 7 8 This program is also distributed with certain software (including 9 but not limited to OpenSSL) that is licensed under separate terms, 10 as designated in a particular file or component or in included license 11 documentation. The authors of MySQL hereby grant you an additional 12 permission to link the program and your derivative works with the 13 separately licensed software that they have included with MySQL. 14 15 This program is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License, version 2.0, for more details. 19 20 You should have received a copy of the GNU General Public License 21 along with this program; if not, write to the Free Software 22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 23 */ 24 25 #ifndef MGMAPI_DEBUG_H 26 #define MGMAPI_DEBUG_H 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 /** 33 * Start signal logging. 34 * 35 * @param handle the NDB management handle. 36 * @param nodeId the node Id. 37 * @param reply the reply message. 38 * @return 0 if successful. 39 */ 40 int ndb_mgm_start_signallog(NdbMgmHandle handle, 41 int nodeId, 42 struct ndb_mgm_reply* reply); 43 44 /** 45 * Stop signal logging. 46 * 47 * @param handle the NDB management handle. 48 * @param nodeId the node Id. 49 * @param reply the reply message. 50 * @return 0 if successful. 51 */ 52 int ndb_mgm_stop_signallog(NdbMgmHandle handle, 53 int nodeId, 54 struct ndb_mgm_reply* reply); 55 56 /** 57 * Set the signals to log. 58 * 59 * @param handle the NDB management handle. 60 * @param nodeId the node id. 61 * @param mode the signal log mode. 62 * @param blockNames the block names (space separated). 63 * @param reply the reply message. 64 * @return 0 if successful or an error code. 65 */ 66 int ndb_mgm_log_signals(NdbMgmHandle handle, 67 int nodeId, 68 enum ndb_mgm_signal_log_mode mode, 69 const char* blockNames, 70 struct ndb_mgm_reply* reply); 71 72 /** 73 * Set trace. 74 * 75 * @param handle the NDB management handle. 76 * @param nodeId the node id. 77 * @param traceNumber the trace number. 78 * @param reply the reply message. 79 * @return 0 if successful or an error code. 80 */ 81 int ndb_mgm_set_trace(NdbMgmHandle handle, 82 int nodeId, 83 int traceNumber, 84 struct ndb_mgm_reply* reply); 85 86 /** 87 * Provoke an error. 88 * 89 * @param handle the NDB management handle. 90 * @param nodeId the node id. 91 * @param errorCode the errorCode. 92 * @param reply the reply message. 93 * @return 0 if successful or an error code. 94 */ 95 int ndb_mgm_insert_error(NdbMgmHandle handle, 96 int nodeId, 97 int errorCode, 98 struct ndb_mgm_reply* reply); 99 100 /** 101 * Provoke an error. 102 * 103 * @param handle the NDB management handle. 104 * @param nodeId the node id. 105 * @param errorCode the errorCode. 106 * @param reply the reply message. 107 * @return 0 if successful or an error code. 108 */ 109 int ndb_mgm_insert_error2(NdbMgmHandle handle, 110 int nodeId, 111 int errorCode, 112 int extra, 113 struct ndb_mgm_reply* reply); 114 115 int ndb_mgm_set_int_parameter(NdbMgmHandle handle, 116 int node, 117 int param, 118 unsigned value, 119 struct ndb_mgm_reply* reply); 120 121 int ndb_mgm_set_int64_parameter(NdbMgmHandle handle, 122 int node, 123 int param, 124 unsigned long long value, 125 struct ndb_mgm_reply* reply); 126 127 int ndb_mgm_set_string_parameter(NdbMgmHandle handle, 128 int node, 129 int param, 130 const char * value, 131 struct ndb_mgm_reply* reply); 132 133 Uint64 ndb_mgm_get_session_id(NdbMgmHandle handle); 134 135 struct NdbMgmSession { 136 Uint64 id; 137 Uint32 m_stopSelf; 138 Uint32 m_stop; 139 Uint32 nodeid; 140 Uint32 parser_buffer_len; 141 Uint32 parser_status; 142 }; 143 144 int ndb_mgm_get_session(NdbMgmHandle handle, Uint64 id, 145 struct NdbMgmSession *s, int *len); 146 147 #ifdef __cplusplus 148 } 149 #endif 150 151 152 #endif 153