MySQL 9.1.0
Source Code Documentation
audit_api_connection_service.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2024, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is designed to work with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef AUDIT_API_CONNECTION_H
25#define AUDIT_API_CONNECTION_H
26
29
30/**
31 @ingroup group_components_services_inventory
32
33 A service to generate Audit API events of the connection class
34 (MYSQL_AUDIT_CONNECTION_CLASS).
35
36 The emit method generates the event in the synchronous way, causing
37 all subscribers to receive it.
38
39 @sa @ref mysql_audit_api_connection_imp
40*/
41BEGIN_SERVICE_DEFINITION(mysql_audit_api_connection)
42
43/**
44 Method that emits event of the MYSQL_AUDIT_CONNECTION_CLASS class
45 and the specified type.
46
47 @sa mysql_event_connection_subclass_t
48
49 @param thd Session THD that generates connection event.
50 @param type Connection event type.
51
52 @return Plugin that receives Audit API event can return event processing
53 value. The code that generates the event can take custom action
54 based on the returned value. 0 value is returned if no action is
55 required on the event generation side.
56`*/
58
59END_SERVICE_DEFINITION(mysql_audit_api_connection)
60
61/**
62 @ingroup group_components_services_inventory
63
64 A service to generate Audit API events of the connection class
65 (MYSQL_AUDIT_CONNECTION_CLASS) with the explicitly specified error code
66 value.
67
68 This service should ONLY be used if we cannot set the THD's Statement
69 Diagnostic Area result code, which is passed along the audit notification
70 chain. The preferred way of generating the event is to rely on THD's internal
71 data as much as possible (mysql_audit_api_connection service)
72
73 The emit method generates the event in the synchronous way, causing
74 all subscribers to receive it.
75
76 @sa @ref mysql_audit_api_connection_imp
77*/
78BEGIN_SERVICE_DEFINITION(mysql_audit_api_connection_with_error)
79
80/**
81 Method that emits event of the MYSQL_AUDIT_CONNECTION_CLASS class
82 and the specified type with the explicitly specified error code value.
83
84 @sa mysql_event_connection_subclass_t
85
86 @param thd Session THD that generates connection event.
87 @param type Connection event type.
88 @param errcode Error code that replaces Statement Diagnostic Area result
89 value, which is simply bypassed by calling this method.
90
91 @return Plugin that receives Audit API event can return event processing
92 value. The code that generates the event can take custom action
93 based on the returned value. 0 value is returned if no action is
94 required on the event generation side.
95`*/
98 int errcode));
99
100END_SERVICE_DEFINITION(mysql_audit_api_connection_with_error)
101
102#endif /* AUDIT_API_CONNECTION_H */
static char * emit(UDF_INIT *initid, UDF_ARGS *args, char *result, unsigned long *length, unsigned char *null_value, unsigned char *error)
UDF function itself.
Definition: audit_api_message_emit.cc:429
mysql_event_connection_subclass_t
Events for MYSQL_AUDIT_CONNECTION_CLASS event class.
Definition: plugin_audit_connection_types.h:37
required string type
Definition: replication_group_member_actions.proto:34
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:103
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:91
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:86