MySQL 8.2.0
Source Code Documentation
audit_api_connection_service.h
Go to the documentation of this file.
1/* Copyright (c) 2020, 2023, 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 also distributed 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 included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef AUDIT_API_CONNECTION_H
24#define AUDIT_API_CONNECTION_H
25
28
29/**
30 @ingroup group_components_services_inventory
31
32 A service to generate Audit API events of the connection class
33 (MYSQL_AUDIT_CONNECTION_CLASS).
34
35 The emit method generates the event in the synchronous way, causing
36 all subscribers to receive it.
37
38 @sa @ref mysql_audit_api_connection_imp
39*/
40BEGIN_SERVICE_DEFINITION(mysql_audit_api_connection)
41
42/**
43 Method that emits event of the MYSQL_AUDIT_CONNECTION_CLASS class
44 and the specified type.
45
46 @sa mysql_event_connection_subclass_t
47
48 @param thd Session THD that generates connection event.
49 @param type Connection event type.
50
51 @return Plugin that receives Audit API event can return event processing
52 value. The code that generates the event can take custom action
53 based on the returned value. 0 value is returned if no action is
54 required on the event generation side.
55`*/
57
58END_SERVICE_DEFINITION(mysql_audit_api_connection)
59
60/**
61 @ingroup group_components_services_inventory
62
63 A service to generate Audit API events of the connection class
64 (MYSQL_AUDIT_CONNECTION_CLASS) with the explicitly specified error code
65 value.
66
67 This service should ONLY be used if we cannot set the THD's Statement
68 Diagnostic Area result code, which is passed along the audit notification
69 chain. The preferred way of generating the event is to rely on THD's internal
70 data as much as possible (mysql_audit_api_connection service)
71
72 The emit method generates the event in the synchronous way, causing
73 all subscribers to receive it.
74
75 @sa @ref mysql_audit_api_connection_imp
76*/
77BEGIN_SERVICE_DEFINITION(mysql_audit_api_connection_with_error)
78
79/**
80 Method that emits event of the MYSQL_AUDIT_CONNECTION_CLASS class
81 and the specified type with the explicitly specified error code value.
82
83 @sa mysql_event_connection_subclass_t
84
85 @param thd Session THD that generates connection event.
86 @param type Connection event type.
87 @param errcode Error code that replaces Statement Diagnostic Area result
88 value, which is simply bypassed by calling this method.
89
90 @return Plugin that receives Audit API event can return event processing
91 value. The code that generates the event can take custom action
92 based on the returned value. 0 value is returned if no action is
93 required on the event generation side.
94`*/
97 int errcode));
98
99END_SERVICE_DEFINITION(mysql_audit_api_connection_with_error)
100
101#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:428
mysql_event_connection_subclass_t
Events for MYSQL_AUDIT_CONNECTION_CLASS event class.
Definition: plugin_audit_connection_types.h:36
required string type
Definition: replication_group_member_actions.proto:33
#define DECLARE_METHOD(retval, name, args)
Declares a method as a part of the Service definition.
Definition: service.h:102
#define END_SERVICE_DEFINITION(name)
A macro to end the last Service definition started with the BEGIN_SERVICE_DEFINITION macro.
Definition: service.h:90
#define BEGIN_SERVICE_DEFINITION(name)
Declares a new Service.
Definition: service.h:85