Dynatrace OneAgent SDK for C/C++  1.7.1.1
onesdk_common.h
Go to the documentation of this file.
1 /*
2  Copyright 2017-2019 Dynatrace LLC
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 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
17 #ifndef ONESDK_COMMON_H_INCLUDED
18 #define ONESDK_COMMON_H_INCLUDED
19 
24 /*========================================================================================================================================*/
25 
26 #include "onesdk/onesdk_config.h"
27 #include "onesdk/onesdk_version.h"
28 
29 /*========================================================================================================================================*/
30 
31 
34 typedef struct onesdk_stub_version {
39 
40 /*========================================================================================================================================*/
41 
48 #define ONESDK_ERROR_GENERIC ((onesdk_result_t)(ONESDK_ERROR_BASE + 1))
49 
50 #define ONESDK_ERROR_INVALID_ARGUMENT ((onesdk_result_t)(ONESDK_ERROR_BASE + 2))
51 
52 #define ONESDK_ERROR_NOT_IMPLEMENTED ((onesdk_result_t)(ONESDK_ERROR_BASE + 3))
53 
54 #define ONESDK_ERROR_NOT_INITIALIZED ((onesdk_result_t)(ONESDK_ERROR_BASE + 4))
55 
56 #define ONESDK_ERROR_OUT_OF_MEMORY ((onesdk_result_t)(ONESDK_ERROR_BASE + 5))
57 
58 #define ONESDK_ERROR_AGENT_NOT_ACTIVE ((onesdk_result_t)(ONESDK_ERROR_BASE + 6))
59 
60 #define ONESDK_ERROR_LOAD_AGENT ((onesdk_result_t)(ONESDK_ERROR_BASE + 7))
61 
62 #define ONESDK_ERROR_INVALID_AGENT_BINARY ((onesdk_result_t)(ONESDK_ERROR_BASE + 8))
63 
64 #define ONESDK_ERROR_UNEXPECTED ((onesdk_result_t)(ONESDK_ERROR_BASE + 9))
65 
67 #define ONESDK_ERROR_ENTRY_ALREADY_EXISTS ((onesdk_result_t)(ONESDK_ERROR_BASE + 10))
68 
69 #define ONESDK_ERROR_FEATURE_LEVEL_NOT_SUPPORTED ((onesdk_result_t)(ONESDK_ERROR_BASE + 11))
70 
71 #define ONESDK_ERROR_INTERFACE_NOT_SUPPORTED ((onesdk_result_t)(ONESDK_ERROR_BASE + 12))
72 
73 #define ONESDK_ERROR_FORK_CHILD ((onesdk_result_t)(ONESDK_ERROR_BASE + 13))
74 
75 #define ONESDK_ERROR_NO_DATA ((onesdk_result_t)(ONESDK_ERROR_BASE + 14))
76 /* NOTE: Extend get_onesdk_specific_error_message() when adding error codes. */
77 
79 #define ONESDK_SUCCESS ((onesdk_result_t)0)
80 
83 /*========================================================================================================================================*/
84 
94 typedef void ONESDK_CALL onesdk_agent_logging_callback_t(char const* message);
95 
96 /*========================================================================================================================================*/
97 
105 #define ONESDK_LOGGING_LEVEL_FINEST 0
106 #define ONESDK_LOGGING_LEVEL_FINER 1
107 #define ONESDK_LOGGING_LEVEL_FINE 2
108 #define ONESDK_LOGGING_LEVEL_CONFIG 3
109 #define ONESDK_LOGGING_LEVEL_INFO 4
110 #define ONESDK_LOGGING_LEVEL_WARNING 5
111 #define ONESDK_LOGGING_LEVEL_SEVERE 6
112 #define ONESDK_LOGGING_LEVEL_DEBUG 7
113 #define ONESDK_LOGGING_LEVEL_NONE 8
120 typedef onesdk_int32_t onesdk_logging_level_t;
121 
122 /*========================================================================================================================================*/
123 
134 
148 #define ONESDK_INVALID_HANDLE 0
149 
150 /*========================================================================================================================================*/
151 
165 #define ONESDK_AGENT_STATE_ACTIVE 0
166 
177 #define ONESDK_AGENT_STATE_TEMPORARILY_INACTIVE 1
178 
186 #define ONESDK_AGENT_STATE_PERMANENTLY_INACTIVE 2
187 
198 #define ONESDK_AGENT_STATE_NOT_INITIALIZED 3
199 
201 #define ONESDK_AGENT_STATE_ERROR (-1)
202 
215 #define ONESDK_AGENT_FORK_STATE_PARENT_INITIALIZED 1
216 
219 #define ONESDK_AGENT_FORK_STATE_PRE_INITIALIZED 2
220 
222 #define ONESDK_AGENT_FORK_STATE_FULLY_INITIALIZED 3
223 
225 #define ONESDK_AGENT_FORK_STATE_NOT_FORKABLE 4
226 
227 
229 #define ONESDK_AGENT_FORK_STATE_ERROR (-1)
230 
234 /*========================================================================================================================================*/
235 
272 #define ONESDK_CHANNEL_TYPE_OTHER 0
273 
279 #define ONESDK_CHANNEL_TYPE_TCP_IP 1
280 
285 #define ONESDK_CHANNEL_TYPE_UNIX_DOMAIN_SOCKET 2
286 
291 #define ONESDK_CHANNEL_TYPE_NAMED_PIPE 3
292 
298 #define ONESDK_CHANNEL_TYPE_IN_PROCESS 4
299 
303 /*========================================================================================================================================*/
304 
314 #define ONESDK_DATABASE_VENDOR_APACHE_HIVE "ApacheHive"
315 #define ONESDK_DATABASE_VENDOR_CLOUDSCAPE "Cloudscape"
317 #define ONESDK_DATABASE_VENDOR_HSQLDB "HSQLDB"
318 #define ONESDK_DATABASE_VENDOR_PROGRESS "Progress"
320 #define ONESDK_DATABASE_VENDOR_MAXDB "MaxDB"
321 #define ONESDK_DATABASE_VENDOR_HANADB "HanaDB"
322 #define ONESDK_DATABASE_VENDOR_INGRES "Ingres"
323 #define ONESDK_DATABASE_VENDOR_FIRST_SQL "FirstSQL"
324 #define ONESDK_DATABASE_VENDOR_ENTERPRISE_DB "EnterpriseDB"
325 #define ONESDK_DATABASE_VENDOR_CACHE "Cache"
326 #define ONESDK_DATABASE_VENDOR_ADABAS "Adabas"
327 #define ONESDK_DATABASE_VENDOR_FIREBIRD "Firebird"
328 #define ONESDK_DATABASE_VENDOR_DB2 "DB2"
329 #define ONESDK_DATABASE_VENDOR_DERBY_CLIENT "Derby Client"
331 #define ONESDK_DATABASE_VENDOR_DERBY_EMBEDDED "Derby Embedded"
332 #define ONESDK_DATABASE_VENDOR_FILEMAKER "Filemaker"
333 #define ONESDK_DATABASE_VENDOR_INFORMIX "Informix"
334 #define ONESDK_DATABASE_VENDOR_INSTANT_DB "InstantDb"
335 #define ONESDK_DATABASE_VENDOR_INTERBASE "Interbase"
336 #define ONESDK_DATABASE_VENDOR_MYSQL "MySQL"
337 #define ONESDK_DATABASE_VENDOR_MARIADB "MariaDB"
338 #define ONESDK_DATABASE_VENDOR_NETEZZA "Netezza"
339 #define ONESDK_DATABASE_VENDOR_ORACLE "Oracle"
340 #define ONESDK_DATABASE_VENDOR_PERVASIVE "Pervasive"
341 #define ONESDK_DATABASE_VENDOR_POINTBASE "Pointbase"
342 #define ONESDK_DATABASE_VENDOR_POSTGRESQL "PostgreSQL"
343 #define ONESDK_DATABASE_VENDOR_SQLSERVER "SQL Server"
344 #define ONESDK_DATABASE_VENDOR_SQLITE "sqlite"
345 #define ONESDK_DATABASE_VENDOR_SYBASE "Sybase"
347 #define ONESDK_DATABASE_VENDOR_TERADATA "Teradata"
348 #define ONESDK_DATABASE_VENDOR_VERTICA "Vertica"
349 #define ONESDK_DATABASE_VENDOR_CASSANDRA "Cassandra"
350 #define ONESDK_DATABASE_VENDOR_H2 "H2"
351 #define ONESDK_DATABASE_VENDOR_COLDFUSION_IMQ "ColdFusion IMQ"
353 #define ONESDK_DATABASE_VENDOR_REDSHIFT "Amazon Redshift"
354 #define ONESDK_DATABASE_VENDOR_COUCHBASE "Couchbase"
359 /*========================================================================================================================================*/
360 
367 #define ONESDK_DYNATRACE_HTTP_HEADER_NAME "X-dynaTrace"
368 
369 /*========================================================================================================================================*/
370 
416 #define ONESDK_INIT_FLAG_FORKABLE ((onesdk_uint32_t) 1)
417 
421 /*========================================================================================================================================*/
422 
434 #define ONESDK_DYNATRACE_MESSAGE_PROPERTY_NAME "dtdTraceTagInfo"
435 
439 #define ONESDK_DYNATRACE_MESSAGE_PROPERTYNAME ONESDK_DYNATRACE_MESSAGE_PROPERTY_NAME
440 
448 #define ONESDK_MESSAGING_DESTINATION_TYPE_QUEUE 1
450 #define ONESDK_MESSAGING_DESTINATION_TYPE_TOPIC 2
462 #define ONESDK_MESSAGING_VENDOR_HORNETQ "HornetQ"
463 #define ONESDK_MESSAGING_VENDOR_ACTIVE_MQ "ActiveMQ"
464 #define ONESDK_MESSAGING_VENDOR_RABBIT_MQ "RabbitMQ"
465 #define ONESDK_MESSAGING_VENDOR_ARTEMIS "Artemis"
466 #define ONESDK_MESSAGING_VENDOR_WEBSPHERE "WebSphere"
467 #define ONESDK_MESSAGING_VENDOR_MQSERIES_JMS "MQSeries JMS"
468 #define ONESDK_MESSAGING_VENDOR_MQSERIES "MQSeries"
469 #define ONESDK_MESSAGING_VENDOR_TIBCO "Tibco"
476 #define ONESDK_TRACE_ID_BUFFER_SIZE 33
477 #define ONESDK_SPAN_ID_BUFFER_SIZE 17
483 typedef onesdk_handle_t onesdk_metric_handle_t;
486 /*========================================================================================================================================*/
487 
488 #if defined(_MSC_VER)
489 #include "onesdk/onesdk_msvc.h"
490 #endif
491 
492 /*========================================================================================================================================*/
493 
494 #endif /* ONESDK_COMMON_H_INCLUDED */
uint32_t onesdk_uint32_t
Unsigned 32 bit integer.
Definition: onesdk_config.h:217
onesdk_handle_t onesdk_tracer_handle_t
A handle that refers to a tracer object.
Definition: onesdk_common.h:135
onesdk_handle_t onesdk_databaseinfo_handle_t
A handle that refers to a database info object.
Definition: onesdk_common.h:136
Workaround for Visual C++ CRT version differences.
onesdk_uint64_t onesdk_handle_t
Type for all SDK handles.
Definition: onesdk_common.h:133
Stores the stub version number.
Definition: onesdk_common.h:34
void onesdk_agent_logging_callback_t(char const *message)
Agent logging function prototype.
Definition: onesdk_common.h:94
onesdk_uint32_t version_minor
ONESDK_STUB_VERSION_MINOR.
Definition: onesdk_common.h:36
Defines the version of the SDK stub. Applications should not include this file directly.
uint64_t onesdk_uint64_t
Unsigned 64 bit integer.
Definition: onesdk_config.h:218
onesdk_handle_t onesdk_webapplicationinfo_handle_t
A handle that refers to a web application info object.
Definition: onesdk_common.h:137
onesdk_handle_t onesdk_messagingsysteminfo_handle_t
A handle that refers to a messaging system info object.
Definition: onesdk_common.h:138
Defines platform/compiler dependent types/constants/macros. Applications should not include this file...
onesdk_uint32_t version_patch
ONESDK_STUB_VERSION_PATCH.
Definition: onesdk_common.h:37
onesdk_uint32_t version_major
ONESDK_STUB_VERSION_MAJOR.
Definition: onesdk_common.h:35