| 1 | /* ------------------------------------------------------------------------- */ |
|---|
| 2 | /* */ |
|---|
| 3 | /* Copyright (c) 2003 The Open Group */ |
|---|
| 4 | /* */ |
|---|
| 5 | /* Permission is hereby granted, free of charge, to any person obtaining a */ |
|---|
| 6 | /* copy of this software (the "Software"), to deal in the Software without */ |
|---|
| 7 | /* restriction, including without limitation the rights to use, copy, */ |
|---|
| 8 | /* modify, merge, publish, distribute, sublicense, and/or sell copies of */ |
|---|
| 9 | /* the Software, and to permit persons to whom the Software is furnished */ |
|---|
| 10 | /* to do so, subject to the following conditions: */ |
|---|
| 11 | /* */ |
|---|
| 12 | /* The above copyright notice and this permission notice shall be included */ |
|---|
| 13 | /* in all copies or substantial portions of the Software. */ |
|---|
| 14 | /* */ |
|---|
| 15 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS */ |
|---|
| 16 | /* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
|---|
| 17 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
|---|
| 18 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
|---|
| 19 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT */ |
|---|
| 20 | /* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR */ |
|---|
| 21 | /* THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
|---|
| 22 | /* */ |
|---|
| 23 | /* ------------------------------------------------------------------------- */ |
|---|
| 24 | /* */ |
|---|
| 25 | /* File revision information */ |
|---|
| 26 | /* */ |
|---|
| 27 | /* $Source: /tang_cvs/arm4/sdk4/c/include/arm4.h,v $ */ |
|---|
| 28 | /* $Revision: 1.2 $ */ |
|---|
| 29 | /* $Date: 2003/12/03 13:55:14 $ */ |
|---|
| 30 | /* */ |
|---|
| 31 | /* --------------------------------------------------------------- */ |
|---|
| 32 | /* arm4.h - ARM4 standard header file */ |
|---|
| 33 | /* */ |
|---|
| 34 | /* This header file defines all defines, typedefs, structures, */ |
|---|
| 35 | /* and API functions visible for an application which uses an ARM */ |
|---|
| 36 | /* agent. All compiler/platform specifics are handled in a */ |
|---|
| 37 | /* separate header file named <arm4os.h>. */ |
|---|
| 38 | /* */ |
|---|
| 39 | /* NOTE: The ARM4 C language binding differs completely from */ |
|---|
| 40 | /* ARM1 and ARM2 bindings. */ |
|---|
| 41 | /* --------------------------------------------------------------- */ |
|---|
| 42 | |
|---|
| 43 | #ifndef ARM4_H_INCLUDED |
|---|
| 44 | #define ARM4_H_INCLUDED |
|---|
| 45 | |
|---|
| 46 | #ifndef ARM4OS_H_INCLUDED |
|---|
| 47 | #include "arm4os.h" |
|---|
| 48 | #endif /* ARM4OS_H_INCLUDED */ |
|---|
| 49 | |
|---|
| 50 | #ifdef __cplusplus |
|---|
| 51 | extern "C" { |
|---|
| 52 | #endif /* __cplusplus */ |
|---|
| 53 | |
|---|
| 54 | /* --------------------------------------------------------------- */ |
|---|
| 55 | /* ---------------------- defines section ------------------------ */ |
|---|
| 56 | /* --------------------------------------------------------------- */ |
|---|
| 57 | |
|---|
| 58 | /* To improve portability, since it isn't always defined */ |
|---|
| 59 | #ifndef NULL |
|---|
| 60 | #define NULL (void *)0 |
|---|
| 61 | #endif |
|---|
| 62 | |
|---|
| 63 | /* Boolean values */ |
|---|
| 64 | #define ARM_FALSE 0 |
|---|
| 65 | #define ARM_TRUE 1 |
|---|
| 66 | |
|---|
| 67 | /* Transaction status */ |
|---|
| 68 | #define ARM_STATUS_GOOD 0 |
|---|
| 69 | #define ARM_STATUS_ABORTED 1 |
|---|
| 70 | #define ARM_STATUS_FAILED 2 |
|---|
| 71 | #define ARM_STATUS_UNKNOWN 3 |
|---|
| 72 | |
|---|
| 73 | /* -------------- reserved error codes range --------------------- */ |
|---|
| 74 | |
|---|
| 75 | #define ARM_ERROR_CODE_RESERVED_MIN -20999 |
|---|
| 76 | #define ARM_ERROR_CODE_RESERVED_MAX -20000 |
|---|
| 77 | |
|---|
| 78 | /* --------------- known sub-buffer formats ---------------------- */ |
|---|
| 79 | |
|---|
| 80 | #define ARM_SUBBUFFER_USER 3 |
|---|
| 81 | #define ARM_SUBBUFFER_ARRIVAL_TIME 4 |
|---|
| 82 | #define ARM_SUBBUFFER_METRIC_VALUES 5 |
|---|
| 83 | #define ARM_SUBBUFFER_SYSTEM_ADDRESS 6 |
|---|
| 84 | #define ARM_SUBBUFFER_DIAG_DETAIL 7 |
|---|
| 85 | |
|---|
| 86 | #define ARM_SUBBUFFER_APP_IDENTITY 102 |
|---|
| 87 | #define ARM_SUBBUFFER_APP_CONTEXT 103 |
|---|
| 88 | #define ARM_SUBBUFFER_TRAN_IDENTITY 104 |
|---|
| 89 | #define ARM_SUBBUFFER_TRAN_CONTEXT 105 |
|---|
| 90 | #define ARM_SUBBUFFER_METRIC_BINDINGS 106 |
|---|
| 91 | #define ARM_SUBBUFFER_CHARSET 107 |
|---|
| 92 | |
|---|
| 93 | /* -------------------- metric defines --------------------------- */ |
|---|
| 94 | |
|---|
| 95 | #define ARM_METRIC_FORMAT_RESERVED 0 |
|---|
| 96 | #define ARM_METRIC_FORMAT_COUNTER32 1 |
|---|
| 97 | #define ARM_METRIC_FORMAT_COUNTER64 2 |
|---|
| 98 | #define ARM_METRIC_FORMAT_CNTRDIVR32 3 |
|---|
| 99 | #define ARM_METRIC_FORMAT_GAUGE32 4 |
|---|
| 100 | #define ARM_METRIC_FORMAT_GAUGE64 5 |
|---|
| 101 | #define ARM_METRIC_FORMAT_GAUGEDIVR32 6 |
|---|
| 102 | #define ARM_METRIC_FORMAT_NUMERICID32 7 |
|---|
| 103 | #define ARM_METRIC_FORMAT_NUMERICID64 8 |
|---|
| 104 | /* format 9 (string8) is deprecated */ |
|---|
| 105 | #define ARM_METRIC_FORMAT_STRING32 10 |
|---|
| 106 | |
|---|
| 107 | #define ARM_METRIC_USE_GENERAL 0 |
|---|
| 108 | #define ARM_METRIC_USE_TRAN_SIZE 1 |
|---|
| 109 | #define ARM_METRIC_USE_TRAN_STATUS 2 |
|---|
| 110 | |
|---|
| 111 | #define ARM_METRIC_MIN_ARRAY_INDEX 0 |
|---|
| 112 | #define ARM_METRIC_MAX_ARRAY_INDEX 6 |
|---|
| 113 | #define ARM_METRIC_MAX_COUNT 7 |
|---|
| 114 | |
|---|
| 115 | #define ARM_METRIC_STRING32_MAX_CHARS 31 |
|---|
| 116 | #define ARM_METRIC_STRING32_MAX_LENGTH \ |
|---|
| 117 | (ARM_METRIC_STRING32_MAX_CHARS*3+1) |
|---|
| 118 | |
|---|
| 119 | /* ------------------- misc string defines ----------------------- */ |
|---|
| 120 | |
|---|
| 121 | #define ARM_NAME_MAX_CHARS 127 |
|---|
| 122 | #define ARM_NAME_MAX_LENGTH (ARM_NAME_MAX_CHARS*3+1) |
|---|
| 123 | |
|---|
| 124 | #define ARM_DIAG_DETAIL_MAX_CHARS 4095 |
|---|
| 125 | #define ARM_DIAG_DETAIL_MAX_LENGTH (ARM_DIAG_DETAIL_MAX_CHARS*3+1) |
|---|
| 126 | |
|---|
| 127 | #define ARM_MSG_BUFFER_CHARS 255 |
|---|
| 128 | #define ARM_MSG_BUFFER_LENGTH (ARM_MSG_BUFFER_CHARS*3+1) |
|---|
| 129 | |
|---|
| 130 | /* ------------------- properties defines ------------------------ */ |
|---|
| 131 | |
|---|
| 132 | #define ARM_PROPERTY_MIN_ARRAY_INDEX 0 |
|---|
| 133 | #define ARM_PROPERTY_MAX_ARRAY_INDEX 19 |
|---|
| 134 | #define ARM_PROPERTY_MAX_COUNT 20 |
|---|
| 135 | |
|---|
| 136 | #define ARM_PROPERTY_NAME_MAX_CHARS (ARM_NAME_MAX_CHARS) |
|---|
| 137 | #define ARM_PROPERTY_NAME_MAX_LENGTH \ |
|---|
| 138 | (ARM_PROPERTY_NAME_MAX_CHARS*3+1) |
|---|
| 139 | #define ARM_PROPERTY_VALUE_MAX_CHARS 255 |
|---|
| 140 | #define ARM_PROPERTY_VALUE_MAX_LENGTH \ |
|---|
| 141 | (ARM_PROPERTY_VALUE_MAX_CHARS*3+1) |
|---|
| 142 | |
|---|
| 143 | #define ARM_PROPERTY_URI_MAX_CHARS 4095 |
|---|
| 144 | #define ARM_PROPERTY_URI_MAX_LENGTH (ARM_PROPERTY_URI_MAX_CHARS*3+1) |
|---|
| 145 | |
|---|
| 146 | /* -------------- system address format values ------------------- */ |
|---|
| 147 | |
|---|
| 148 | #define ARM_SYSADDR_FORMAT_RESERVED 0 |
|---|
| 149 | #define ARM_SYSADDR_FORMAT_IPV4 1 |
|---|
| 150 | #define ARM_SYSADDR_FORMAT_IPV4PORT 2 |
|---|
| 151 | #define ARM_SYSADDR_FORMAT_IPV6 3 |
|---|
| 152 | #define ARM_SYSADDR_FORMAT_IPV6PORT 4 |
|---|
| 153 | #define ARM_SYSADDR_FORMAT_SNA 5 |
|---|
| 154 | #define ARM_SYSADDR_FORMAT_X25 6 |
|---|
| 155 | #define ARM_SYSADDR_FORMAT_HOSTNAME 7 |
|---|
| 156 | #define ARM_SYSADDR_FORMAT_UUID 8 |
|---|
| 157 | |
|---|
| 158 | /* ------------------ mandatory charsets ------------------------- */ |
|---|
| 159 | |
|---|
| 160 | /* IANA charset MIBenum numbers (http://www.iana.org/) */ |
|---|
| 161 | #define ARM_CHARSET_ASCII 3 /* mandatory */ |
|---|
| 162 | #define ARM_CHARSET_UTF8 106 /* mandatory */ |
|---|
| 163 | #define ARM_CHARSET_UTF16BE 1013 |
|---|
| 164 | #define ARM_CHARSET_UTF16LE 1014 |
|---|
| 165 | /* mandatory on Windows */ |
|---|
| 166 | #define ARM_CHARSET_UTF16 1015 |
|---|
| 167 | #define ARM_CHARSET_IBM037 2028 |
|---|
| 168 | /* mandatory on iSeries */ |
|---|
| 169 | #define ARM_CHARSET_IBM1047 2102 |
|---|
| 170 | /* mandatory on zSeries */ |
|---|
| 171 | |
|---|
| 172 | /* ------------- flags to be passed on API calls ----------------- */ |
|---|
| 173 | |
|---|
| 174 | /* Use ARM_FLAG_NONE instead of zero to be more readable. */ |
|---|
| 175 | #define ARM_FLAG_NONE (0x00000000) |
|---|
| 176 | |
|---|
| 177 | /* ARM_FLAG_TRACE_REQUEST could be used in the following calls to */ |
|---|
| 178 | /* request a trace: */ |
|---|
| 179 | /* - arm_generate_correlator() */ |
|---|
| 180 | /* - arm_start_transaction() */ |
|---|
| 181 | /* - arm_report_transaction() */ |
|---|
| 182 | /* NOTE: The agent need not support instance tracing, so to be */ |
|---|
| 183 | /* sure check the generated correlator using the */ |
|---|
| 184 | /* arm_get_correlator_flags() function. */ |
|---|
| 185 | #define ARM_FLAG_TRACE_REQUEST (0x00000001) |
|---|
| 186 | |
|---|
| 187 | /* ARM_FLAG_BIND_THREAD could be used on arm_start_transaction() */ |
|---|
| 188 | /* call to do an implicit arm_bind_thread(). */ |
|---|
| 189 | #define ARM_FLAG_BIND_THREAD (0x00000002) |
|---|
| 190 | |
|---|
| 191 | /* ARM_FLAG_CORR_IN_PROCESS indicates that a correlator will only */ |
|---|
| 192 | /* be used within the process it was created. So an ARM */ |
|---|
| 193 | /* implementation may optimize the generation of a correlator */ |
|---|
| 194 | /* for that special usage. This flag can be passed to: */ |
|---|
| 195 | /* - arm_generate_correlator() */ |
|---|
| 196 | /* - arm_start_transaction() */ |
|---|
| 197 | /* NOTE: The agent need not support in-process correlation at all. */ |
|---|
| 198 | #define ARM_FLAG_CORR_IN_PROCESS (0x00000004) |
|---|
| 199 | |
|---|
| 200 | /* --------------- correlator defines ---------------------------- */ |
|---|
| 201 | |
|---|
| 202 | #define ARM_CORR_MAX_LENGTH 512 |
|---|
| 203 | /* total max length */ |
|---|
| 204 | |
|---|
| 205 | /* Correlator interface flag numbers. See */ |
|---|
| 206 | /* arm_get_correlator_flags(). */ |
|---|
| 207 | #define ARM_CORR_FLAGNUM_APP_TRACE 1 |
|---|
| 208 | #define ARM_CORR_FLAGNUM_AGENT_TRACE 2 |
|---|
| 209 | |
|---|
| 210 | |
|---|
| 211 | /* Use if no correlator should be provided (e.g., in */ |
|---|
| 212 | /* arm_start_transaction(). */ |
|---|
| 213 | #define ARM_CORR_NONE ((arm_correlator_t *) NULL) |
|---|
| 214 | |
|---|
| 215 | /* --- current time for arm_report_transaction() stop time ------- */ |
|---|
| 216 | |
|---|
| 217 | #define ARM_USE_CURRENT_TIME ((arm_stop_time_t)-1) |
|---|
| 218 | |
|---|
| 219 | /* ------------------ misc defines ------------------------------- */ |
|---|
| 220 | |
|---|
| 221 | /* Use ARM_BUF4_NONE instead of a NULL to be more readable. */ |
|---|
| 222 | #define ARM_BUF4_NONE ((arm_buffer4_t*) NULL) |
|---|
| 223 | |
|---|
| 224 | /* Use ARM_ID_NONE instead of a NULL to be more readable. */ |
|---|
| 225 | #define ARM_ID_NONE ((arm_id_t *) NULL) |
|---|
| 226 | |
|---|
| 227 | /* Use ARM_STRING_NONE instead of a NULL to be more readable. */ |
|---|
| 228 | #define ARM_STRING_NONE ((char *) NULL) |
|---|
| 229 | |
|---|
| 230 | /* --------------------------------------------------------------- */ |
|---|
| 231 | /* --------------- basic typedef section ------------------------- */ |
|---|
| 232 | /* --------------------------------------------------------------- */ |
|---|
| 233 | |
|---|
| 234 | /* Generic data types */ |
|---|
| 235 | /* ARM4_*INT* defines are set in the <arm4os.h> header file. */ |
|---|
| 236 | /* They are platform/compiler-specific. */ |
|---|
| 237 | typedef ARM4_CHAR arm_char_t; |
|---|
| 238 | |
|---|
| 239 | typedef ARM4_INT8 arm_int8_t; |
|---|
| 240 | typedef ARM4_UINT8 arm_uint8_t; |
|---|
| 241 | /* used to define an opaque byte array */ |
|---|
| 242 | |
|---|
| 243 | typedef ARM4_INT16 arm_int16_t; |
|---|
| 244 | typedef ARM4_UINT16 arm_uint16_t; |
|---|
| 245 | |
|---|
| 246 | typedef ARM4_INT32 arm_int32_t; |
|---|
| 247 | typedef ARM4_UINT32 arm_uint32_t; |
|---|
| 248 | |
|---|
| 249 | typedef ARM4_INT64 arm_int64_t; |
|---|
| 250 | typedef ARM4_UINT64 arm_uint64_t; |
|---|
| 251 | |
|---|
| 252 | /* ARM-specific simple types */ |
|---|
| 253 | typedef arm_int32_t arm_boolean_t; |
|---|
| 254 | typedef arm_int32_t arm_error_t; |
|---|
| 255 | |
|---|
| 256 | typedef arm_int64_t arm_arrival_time_t; /* opaque arrival time */ |
|---|
| 257 | typedef arm_int64_t arm_stop_time_t; /* stop time in milli secs */ |
|---|
| 258 | typedef arm_int64_t arm_response_time_t; |
|---|
| 259 | /* response time in nano secs */ |
|---|
| 260 | |
|---|
| 261 | typedef arm_int32_t arm_tran_status_t; /* ARM_TRAN_STATUS_* values */ |
|---|
| 262 | typedef arm_int32_t arm_charset_t; /* IANA MIBenum values */ |
|---|
| 263 | typedef arm_int32_t arm_sysaddr_format_t; /* ARM_SYSADDR_* values */ |
|---|
| 264 | |
|---|
| 265 | /* ARM string buffer types */ |
|---|
| 266 | typedef arm_char_t arm_message_buffer_t[ARM_MSG_BUFFER_LENGTH]; |
|---|
| 267 | |
|---|
| 268 | /* subbuffer types */ |
|---|
| 269 | typedef arm_int32_t arm_subbuffer_format_t; |
|---|
| 270 | |
|---|
| 271 | /* metric types */ |
|---|
| 272 | typedef arm_uint8_t arm_metric_format_t; |
|---|
| 273 | typedef arm_uint8_t arm_metric_slot_t; |
|---|
| 274 | typedef arm_int16_t arm_metric_usage_t; |
|---|
| 275 | |
|---|
| 276 | /* handle types */ |
|---|
| 277 | typedef arm_int64_t arm_app_start_handle_t; |
|---|
| 278 | typedef arm_int64_t arm_tran_start_handle_t; |
|---|
| 279 | typedef arm_int64_t arm_tran_block_handle_t; |
|---|
| 280 | |
|---|
| 281 | /* correlator types */ |
|---|
| 282 | typedef arm_int16_t arm_correlator_length_t; |
|---|
| 283 | |
|---|
| 284 | /* --------------------------------------------------------------- */ |
|---|
| 285 | /* ---------------- compound typedefs section -------------------- */ |
|---|
| 286 | /* --------------------------------------------------------------- */ |
|---|
| 287 | |
|---|
| 288 | /* All IDs are 16 bytes on an 8-byte boundary. */ |
|---|
| 289 | typedef struct arm_id |
|---|
| 290 | { |
|---|
| 291 | union |
|---|
| 292 | { |
|---|
| 293 | arm_uint8_t uint8[16]; |
|---|
| 294 | arm_uint32_t uint32[4]; |
|---|
| 295 | arm_uint64_t uint64[2]; |
|---|
| 296 | } id_u; |
|---|
| 297 | } arm_id_t; |
|---|
| 298 | |
|---|
| 299 | /* Correlator */ |
|---|
| 300 | typedef struct arm_correlator |
|---|
| 301 | { |
|---|
| 302 | arm_uint8_t opaque[ARM_CORR_MAX_LENGTH]; |
|---|
| 303 | } arm_correlator_t; |
|---|
| 304 | |
|---|
| 305 | /* User-defined metrics */ |
|---|
| 306 | typedef arm_int32_t arm_metric_counter32_t; |
|---|
| 307 | typedef arm_int64_t arm_metric_counter64_t; |
|---|
| 308 | typedef arm_int32_t arm_metric_divisor32_t; |
|---|
| 309 | typedef arm_int32_t arm_metric_gauge32_t; |
|---|
| 310 | typedef arm_int64_t arm_metric_gauge64_t; |
|---|
| 311 | typedef arm_int32_t arm_metric_numericID32_t; |
|---|
| 312 | typedef arm_int64_t arm_metric_numericID64_t; |
|---|
| 313 | typedef const arm_char_t *arm_metric_string32_t; |
|---|
| 314 | typedef struct arm_metric_cntrdivr32 |
|---|
| 315 | { |
|---|
| 316 | arm_metric_counter32_t counter; |
|---|
| 317 | arm_metric_divisor32_t divisor; |
|---|
| 318 | } arm_metric_cntrdivr32_t; |
|---|
| 319 | typedef struct arm_metric_gaugedivr32 |
|---|
| 320 | { |
|---|
| 321 | arm_metric_gauge32_t gauge; |
|---|
| 322 | arm_metric_divisor32_t divisor; |
|---|
| 323 | } arm_metric_gaugedivr32_t; |
|---|
| 324 | |
|---|
| 325 | typedef struct arm_metric |
|---|
| 326 | { |
|---|
| 327 | arm_metric_slot_t slot; |
|---|
| 328 | arm_metric_format_t format; |
|---|
| 329 | arm_metric_usage_t usage; |
|---|
| 330 | arm_boolean_t valid; |
|---|
| 331 | union |
|---|
| 332 | { |
|---|
| 333 | arm_metric_counter32_t counter32; |
|---|
| 334 | arm_metric_counter64_t counter64; |
|---|
| 335 | arm_metric_cntrdivr32_t counterdivisor32; |
|---|
| 336 | arm_metric_gauge32_t gauge32; |
|---|
| 337 | arm_metric_gauge64_t gauge64; |
|---|
| 338 | arm_metric_gaugedivr32_t gaugedivisor32; |
|---|
| 339 | arm_metric_numericID32_t numericid32; |
|---|
| 340 | arm_metric_numericID64_t numericid64; |
|---|
| 341 | arm_metric_string32_t string32; |
|---|
| 342 | } metric_u; |
|---|
| 343 | } arm_metric_t; |
|---|
| 344 | |
|---|
| 345 | typedef struct arm_metric_binding |
|---|
| 346 | { |
|---|
| 347 | arm_metric_slot_t slot; |
|---|
| 348 | arm_id_t id; |
|---|
| 349 | } arm_metric_binding_t; |
|---|
| 350 | |
|---|
| 351 | typedef struct arm_property |
|---|
| 352 | { |
|---|
| 353 | const arm_char_t *name; |
|---|
| 354 | const arm_char_t *value; |
|---|
| 355 | } arm_property_t; |
|---|
| 356 | |
|---|
| 357 | /* ------------------------------------------------------------- */ |
|---|
| 358 | /* -------------- sub-buffer typedefs section ------------------ */ |
|---|
| 359 | /* ------------------------------------------------------------- */ |
|---|
| 360 | |
|---|
| 361 | typedef struct arm_subbuffer { |
|---|
| 362 | arm_subbuffer_format_t format; |
|---|
| 363 | /* Format-specific data fields follow here. */ |
|---|
| 364 | } arm_subbuffer_t; |
|---|
| 365 | |
|---|
| 366 | /* This macro could be used avoid a compiler warning if you */ |
|---|
| 367 | /* direct one of the following arm_subbuffer_*_t structure */ |
|---|
| 368 | /* pointers to a function accepting sub-buffer pointers. Any */ |
|---|
| 369 | /* sub-buffer is passed to the ARM API call as a */ |
|---|
| 370 | /* (arm_subbuffer_t *) pointer. Use this macro if you pass a */ |
|---|
| 371 | /* "real" subbuffer to an API function. Note for the special */ |
|---|
| 372 | /* ARM SDK subbuffers the ARM_SDKSB() macro has to be used. */ |
|---|
| 373 | #define ARM_SB(x) (&((x).header)) |
|---|
| 374 | |
|---|
| 375 | /* The user data buffer */ |
|---|
| 376 | typedef struct arm_buffer4 |
|---|
| 377 | { |
|---|
| 378 | arm_int32_t count; |
|---|
| 379 | arm_subbuffer_t **subbuffer_array; |
|---|
| 380 | } arm_buffer4_t; |
|---|
| 381 | |
|---|
| 382 | typedef struct arm_subbuffer_charset |
|---|
| 383 | { |
|---|
| 384 | arm_subbuffer_t header; /* ARM_SUBBUFFER_CHARSET */ |
|---|
| 385 | |
|---|
| 386 | arm_charset_t charset; /* One of the IANA MIBenum values */ |
|---|
| 387 | arm_int32_t flags; |
|---|
| 388 | } arm_subbuffer_charset_t; |
|---|
| 389 | |
|---|
| 390 | typedef struct arm_subbuffer_app_identity |
|---|
| 391 | { |
|---|
| 392 | arm_subbuffer_t header; /* ARM_SUBBUFFER_APP_IDENTITY */ |
|---|
| 393 | |
|---|
| 394 | arm_int32_t identity_property_count; |
|---|
| 395 | const arm_property_t *identity_property_array; |
|---|
| 396 | arm_int32_t context_name_count; |
|---|
| 397 | const arm_char_t **context_name_array; |
|---|
| 398 | } arm_subbuffer_app_identity_t; |
|---|
| 399 | |
|---|
| 400 | typedef struct arm_subbuffer_app_context |
|---|
| 401 | { |
|---|
| 402 | arm_subbuffer_t header; /* ARM_SUBBUFFER_APP_CONTEXT */ |
|---|
| 403 | |
|---|
| 404 | arm_int32_t context_value_count; |
|---|
| 405 | const arm_char_t **context_value_array; |
|---|
| 406 | } arm_subbuffer_app_context_t; |
|---|
| 407 | |
|---|
| 408 | typedef struct arm_subbuffer_tran_identity |
|---|
| 409 | { |
|---|
| 410 | arm_subbuffer_t header; /* ARM_SUBBUFFER_TRAN_IDENTITY */ |
|---|
| 411 | |
|---|
| 412 | arm_int32_t identity_property_count; |
|---|
| 413 | const arm_property_t *identity_property_array; |
|---|
| 414 | arm_int32_t context_name_count; |
|---|
| 415 | const arm_char_t **context_name_array; |
|---|
| 416 | const arm_char_t *uri; |
|---|
| 417 | } arm_subbuffer_tran_identity_t; |
|---|
| 418 | |
|---|
| 419 | typedef struct arm_subbuffer_tran_context |
|---|
| 420 | { |
|---|
| 421 | arm_subbuffer_t header; /* ARM_SUBBUFFER_TRAN_CONTEXT */ |
|---|
| 422 | |
|---|
| 423 | arm_int32_t context_value_count; |
|---|
| 424 | const arm_char_t **context_value_array; |
|---|
| 425 | const arm_char_t *uri; |
|---|
| 426 | } arm_subbuffer_tran_context_t; |
|---|
| 427 | |
|---|
| 428 | typedef struct arm_subbuffer_arrival_time |
|---|
| 429 | { |
|---|
| 430 | arm_subbuffer_t header; /* ARM_SUBBUFFER_ARRIVAL_TIME */ |
|---|
| 431 | |
|---|
| 432 | arm_arrival_time_t opaque_time; |
|---|
| 433 | } arm_subbuffer_arrival_time_t; |
|---|
| 434 | |
|---|
| 435 | typedef struct arm_subbuffer_metric_bindings |
|---|
| 436 | { |
|---|
| 437 | arm_subbuffer_t header; /* ARM_SUBBUFFER_METRIC_BINDINGS */ |
|---|
| 438 | |
|---|
| 439 | arm_int32_t count; |
|---|
| 440 | const arm_metric_binding_t *metric_binding_array; |
|---|
| 441 | } arm_subbuffer_metric_bindings_t; |
|---|
| 442 | |
|---|
| 443 | typedef struct arm_subbuffer_metric_values |
|---|
| 444 | { |
|---|
| 445 | arm_subbuffer_t header; /* ARM_SUBBUFFER_METRIC_VALUES */ |
|---|
| 446 | |
|---|
| 447 | arm_int32_t count; |
|---|
| 448 | const arm_metric_t *metric_value_array; |
|---|
| 449 | } arm_subbuffer_metric_values_t; |
|---|
| 450 | |
|---|
| 451 | typedef struct arm_subbuffer_user |
|---|
| 452 | { |
|---|
| 453 | arm_subbuffer_t header; /* ARM_SUBBUFFER_USER */ |
|---|
| 454 | |
|---|
| 455 | const arm_char_t *name; |
|---|
| 456 | arm_boolean_t id_valid; |
|---|
| 457 | arm_id_t id; |
|---|
| 458 | } arm_subbuffer_user_t; |
|---|
| 459 | |
|---|
| 460 | typedef struct arm_subbuffer_system_address |
|---|
| 461 | { |
|---|
| 462 | arm_subbuffer_t header; /* ARM_SUBBUFFER_SYSTEM_ADDRESS */ |
|---|
| 463 | |
|---|
| 464 | arm_int16_t address_format; |
|---|
| 465 | arm_int16_t address_length; |
|---|
| 466 | const arm_uint8_t *address; |
|---|
| 467 | arm_boolean_t id_valid; |
|---|
| 468 | arm_id_t id; |
|---|
| 469 | } arm_subbuffer_system_address_t; |
|---|
| 470 | |
|---|
| 471 | typedef struct arm_subbuffer_diag_detail |
|---|
| 472 | { |
|---|
| 473 | arm_subbuffer_t header; /* ARM_SUBBUFFER_DIAG_DETAIL */ |
|---|
| 474 | |
|---|
| 475 | const arm_char_t *diag_detail; |
|---|
| 476 | } arm_subbuffer_diag_detail_t; |
|---|
| 477 | |
|---|
| 478 | /* --------------------------------------------------------------- */ |
|---|
| 479 | /* ------------------ ARM4 API section --------------------------- */ |
|---|
| 480 | /* --------------------------------------------------------------- */ |
|---|
| 481 | |
|---|
| 482 | /* register metadata API functions */ |
|---|
| 483 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 484 | arm_register_application( |
|---|
| 485 | const arm_char_t *app_name, |
|---|
| 486 | const arm_id_t *input_app_id, |
|---|
| 487 | const arm_int32_t flags, |
|---|
| 488 | const arm_buffer4_t *buffer4, |
|---|
| 489 | arm_id_t *output_app_id); |
|---|
| 490 | |
|---|
| 491 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 492 | arm_destroy_application( |
|---|
| 493 | const arm_id_t *app_id, |
|---|
| 494 | const arm_int32_t flags, |
|---|
| 495 | const arm_buffer4_t *buffer4); |
|---|
| 496 | |
|---|
| 497 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 498 | arm_register_transaction( |
|---|
| 499 | const arm_id_t *app_id, |
|---|
| 500 | const arm_char_t *tran_name, |
|---|
| 501 | const arm_id_t *input_tran_id, |
|---|
| 502 | const arm_int32_t flags, |
|---|
| 503 | const arm_buffer4_t *buffer4, |
|---|
| 504 | arm_id_t *output_tran_id); |
|---|
| 505 | |
|---|
| 506 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 507 | arm_register_metric( |
|---|
| 508 | const arm_id_t *app_id, |
|---|
| 509 | const arm_char_t *metric_name, |
|---|
| 510 | const arm_metric_format_t metric_format, |
|---|
| 511 | const arm_metric_usage_t metric_usage, |
|---|
| 512 | const arm_char_t *metric_unit, |
|---|
| 513 | const arm_id_t *input_metric_id, |
|---|
| 514 | const arm_int32_t flags, |
|---|
| 515 | const arm_buffer4_t *buffer4, |
|---|
| 516 | arm_id_t *output_metric_id); |
|---|
| 517 | |
|---|
| 518 | /* application instance API functions */ |
|---|
| 519 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 520 | arm_start_application( |
|---|
| 521 | const arm_id_t *app_id, |
|---|
| 522 | const arm_char_t *app_group, |
|---|
| 523 | const arm_char_t *app_instance, |
|---|
| 524 | const arm_int32_t flags, |
|---|
| 525 | const arm_buffer4_t *buffer4, |
|---|
| 526 | arm_app_start_handle_t *app_handle); |
|---|
| 527 | |
|---|
| 528 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 529 | arm_stop_application( |
|---|
| 530 | const arm_app_start_handle_t app_handle, |
|---|
| 531 | const arm_int32_t flags, |
|---|
| 532 | const arm_buffer4_t *buffer4); |
|---|
| 533 | |
|---|
| 534 | /* transaction instance API functions */ |
|---|
| 535 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 536 | arm_start_transaction( |
|---|
| 537 | const arm_app_start_handle_t app_handle, |
|---|
| 538 | const arm_id_t *tran_id, |
|---|
| 539 | const arm_correlator_t *parent_correlator, |
|---|
| 540 | const arm_int32_t flags, |
|---|
| 541 | const arm_buffer4_t *buffer4, |
|---|
| 542 | arm_tran_start_handle_t *tran_handle, |
|---|
| 543 | arm_correlator_t *current_correlator); |
|---|
| 544 | |
|---|
| 545 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 546 | arm_stop_transaction( |
|---|
| 547 | const arm_tran_start_handle_t tran_handle, |
|---|
| 548 | const arm_tran_status_t tran_status, |
|---|
| 549 | const arm_int32_t flags, |
|---|
| 550 | const arm_buffer4_t *buffer4); |
|---|
| 551 | |
|---|
| 552 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 553 | arm_update_transaction( |
|---|
| 554 | const arm_tran_start_handle_t tran_handle, |
|---|
| 555 | const arm_int32_t flags, |
|---|
| 556 | const arm_buffer4_t *buffer4); |
|---|
| 557 | |
|---|
| 558 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 559 | arm_discard_transaction( |
|---|
| 560 | const arm_tran_start_handle_t tran_handle, |
|---|
| 561 | const arm_int32_t flags, |
|---|
| 562 | const arm_buffer4_t *buffer4); |
|---|
| 563 | |
|---|
| 564 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 565 | arm_block_transaction( |
|---|
| 566 | const arm_tran_start_handle_t tran_handle, |
|---|
| 567 | const arm_int32_t flags, |
|---|
| 568 | const arm_buffer4_t *buffer4, |
|---|
| 569 | arm_tran_block_handle_t *block_handle); |
|---|
| 570 | |
|---|
| 571 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 572 | arm_unblock_transaction( |
|---|
| 573 | const arm_tran_start_handle_t tran_handle, |
|---|
| 574 | const arm_tran_block_handle_t block_handle, |
|---|
| 575 | const arm_int32_t flags, |
|---|
| 576 | const arm_buffer4_t *buffer4); |
|---|
| 577 | |
|---|
| 578 | /* thread support API functions */ |
|---|
| 579 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 580 | arm_bind_thread( |
|---|
| 581 | const arm_tran_start_handle_t tran_handle, |
|---|
| 582 | const arm_int32_t flags, |
|---|
| 583 | const arm_buffer4_t *buffer4); |
|---|
| 584 | |
|---|
| 585 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 586 | arm_unbind_thread( |
|---|
| 587 | const arm_tran_start_handle_t tran_handle, |
|---|
| 588 | const arm_int32_t flags, |
|---|
| 589 | const arm_buffer4_t *buffer4); |
|---|
| 590 | |
|---|
| 591 | /* report transaction data API function */ |
|---|
| 592 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 593 | arm_report_transaction( |
|---|
| 594 | const arm_app_start_handle_t app_handle, |
|---|
| 595 | const arm_id_t *tran_id, |
|---|
| 596 | const arm_tran_status_t tran_status, |
|---|
| 597 | const arm_response_time_t response_time, |
|---|
| 598 | const arm_stop_time_t stop_time, |
|---|
| 599 | const arm_correlator_t *parent_correlator, |
|---|
| 600 | const arm_correlator_t *current_correlator, |
|---|
| 601 | const arm_int32_t flags, |
|---|
| 602 | const arm_buffer4_t *buffer4); |
|---|
| 603 | |
|---|
| 604 | /* correlator API functions */ |
|---|
| 605 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 606 | arm_generate_correlator( |
|---|
| 607 | const arm_app_start_handle_t app_handle, |
|---|
| 608 | const arm_id_t *tran_id, |
|---|
| 609 | const arm_correlator_t *parent_correlator, |
|---|
| 610 | const arm_int32_t flags, |
|---|
| 611 | const arm_buffer4_t *buffer4, |
|---|
| 612 | arm_correlator_t *current_correlator); |
|---|
| 613 | |
|---|
| 614 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 615 | arm_get_correlator_length( |
|---|
| 616 | const arm_correlator_t *correlator, |
|---|
| 617 | arm_correlator_length_t *length); |
|---|
| 618 | |
|---|
| 619 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 620 | arm_get_correlator_flags( |
|---|
| 621 | const arm_correlator_t *correlator, |
|---|
| 622 | const arm_int32_t corr_flag_num, |
|---|
| 623 | arm_boolean_t *flag); |
|---|
| 624 | |
|---|
| 625 | /* miscellaneous API functions */ |
|---|
| 626 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 627 | arm_get_arrival_time( |
|---|
| 628 | arm_arrival_time_t *opaque_time); |
|---|
| 629 | |
|---|
| 630 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 631 | arm_get_error_message( |
|---|
| 632 | const arm_charset_t charset, |
|---|
| 633 | const arm_error_t code, |
|---|
| 634 | arm_message_buffer_t msg); |
|---|
| 635 | |
|---|
| 636 | ARM4_API_DYNAMIC(arm_error_t) |
|---|
| 637 | arm_is_charset_supported( |
|---|
| 638 | const arm_charset_t charset, |
|---|
| 639 | arm_boolean_t *supported); |
|---|
| 640 | |
|---|
| 641 | #ifdef __cplusplus |
|---|
| 642 | } |
|---|
| 643 | #endif /* __cplusplus */ |
|---|
| 644 | |
|---|
| 645 | #ifndef ARM4DYN_H_INCLUDED |
|---|
| 646 | #include "arm4dyn.h" |
|---|
| 647 | #endif /* !ARM4DYN_H_INCLUDED */ |
|---|
| 648 | |
|---|
| 649 | #endif /* ARM4_H_INCLUDED */ |
|---|