syslog-ng source
mqtt-destination.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021 One Identity
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 as published
6  * by the Free Software Foundation, or (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  * As an additional exemption you are allowed to compile & link against the
18  * OpenSSL libraries as published by the OpenSSL project. See the file
19  * COPYING for details.
20  *
21  */
22 
23 
24 #ifndef MQTT_DESTINATION_H_INCLUDED
25 #define MQTT_DESTINATION_H_INCLUDED
26 
27 #include "driver.h"
29 #include "mqtt-options.h"
30 
31 typedef struct
32 {
33  LogThreadedDestDriver super;
34 
35  LogTemplate *message;
36  LogTemplateOptions template_options;
37  LogTemplate *topic_name;
39 
40  MQTTClientOptions options;
42 
43 #define TOPIC_NAME_ERROR mqtt_topic_name_error_quark()
44 
45 GQuark mqtt_topic_name_error_quark(void);
46 
48 {
50 };
51 
52 LogDriver *mqtt_dd_new(GlobalConfig *cfg);
53 
54 void mqtt_dd_set_topic_template(LogDriver *d, LogTemplate *topic);
55 void mqtt_dd_set_fallback_topic(LogDriver *d, const gchar *fallback_topic);
56 void mqtt_dd_set_message_template_ref(LogDriver *d, LogTemplate *message);
57 
58 
59 gboolean mqtt_dd_validate_topic_name(const gchar *name, GError **error);
60 
61 LogTemplateOptions *mqtt_dd_get_template_options(LogDriver *s);
62 MQTTClientOptions *mqtt_dd_get_options(LogDriver *s);
63 
64 #endif /* MQTT_DESTINATION_H_INCLUDED */
const gchar * name
Definition: debugger.c:265
gboolean mqtt_dd_validate_topic_name(const gchar *name, GError **error)
Definition: mqtt-destination.c:252
LogTemplateOptions * mqtt_dd_get_template_options(LogDriver *s)
Definition: mqtt-destination.c:244
void mqtt_dd_set_message_template_ref(LogDriver *d, LogTemplate *message)
Definition: mqtt-destination.c:68
GQuark mqtt_topic_name_error_quark(void)
Definition: mqtt-destination.c:268
MQTTTopicError
Definition: mqtt-destination.h:48
@ TOPIC_LENGTH_ZERO
Definition: mqtt-destination.h:49
LogDriver * mqtt_dd_new(GlobalConfig *cfg)
Definition: mqtt-destination.c:224
MQTTClientOptions * mqtt_dd_get_options(LogDriver *s)
Definition: mqtt-destination.c:274
void mqtt_dd_set_fallback_topic(LogDriver *d, const gchar *fallback_topic)
Definition: mqtt-destination.c:59
void mqtt_dd_set_topic_template(LogDriver *d, LogTemplate *topic)
Definition: mqtt-destination.c:50
Definition: mqtt-destination.h:32
LogTemplate * topic_name
Definition: mqtt-destination.h:37
MQTTClientOptions options
Definition: mqtt-destination.h:40
LogTemplateOptions template_options
Definition: mqtt-destination.h:36
LogTemplate * message
Definition: mqtt-destination.h:35
LogThreadedDestDriver super
Definition: mqtt-destination.h:33
gchar * fallback_topic
Definition: mqtt-destination.h:38
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34