Greenbone Vulnerability Management Libraries: util/mqtt.h Source File

Greenbone Vulnerability Management Libraries 23.1.2

mqtt.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021-2023 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 */
5
10
11#ifndef _GVM_UTIL_MQTT_H
12#define _GVM_UTIL_MQTT_H
13
14#include <MQTTClient.h>
15#include <glib.h>
16
17#define AUTH_MQTT 1
18
19int
20 mqtt_init (const char *);
21
22int
23 mqtt_init_auth (const char *, const char *, const char *);
24
25gboolean
26 mqtt_is_initialized (void);
27
28void
29 mqtt_reset (void);
30
31int
32 mqtt_publish (const char *, const char *);
33
34int
35 mqtt_publish_single_message_auth (const char *, const char *, const char *,
36 const char *, const char *);
37
38int
39 mqtt_publish_single_message (const char *, const char *, const char *);
40
41int
42 mqtt_subscribe (const char *);
43
44int
45 mqtt_retrieve_message (char **, int *, char **, int *, const unsigned int);
46
47int
48 mqtt_unsubscribe (const char *);
49
50#endif /* not _GVM_UTIL_MQTT_H */
mqtt_retrieve_message
int mqtt_retrieve_message(char **, int *, char **, int *, const unsigned int)
wait for a given timeout in ms to retrieve any message of subscribed topics
Definition mqtt.c:837
mqtt_publish
int mqtt_publish(const char *, const char *)
Publish a message on topic using the global client.
Definition mqtt.c:498
mqtt_reset
void mqtt_reset(void)
Destroy MQTTClient handle and free mqtt_t.
Definition mqtt.c:212
mqtt_publish_single_message
int mqtt_publish_single_message(const char *, const char *, const char *)
Send a single message.
Definition mqtt.c:527
mqtt_is_initialized
gboolean mqtt_is_initialized(void)
Get the global init status.
Definition mqtt.c:69
mqtt_init
int mqtt_init(const char *)
Init MQTT communication.
Definition mqtt.c:361
mqtt_init_auth
int mqtt_init_auth(const char *, const char *, const char *)
Init MQTT communication.
Definition mqtt.c:375
mqtt_subscribe
int mqtt_subscribe(const char *)
subscribes to a single topic.
Definition mqtt.c:660
mqtt_publish_single_message_auth
int mqtt_publish_single_message_auth(const char *, const char *, const char *, const char *, const char *)
Send a single message with credentials.
Definition mqtt.c:550
mqtt_unsubscribe
int mqtt_unsubscribe(const char *)
unsubscribe a single topic.
Definition mqtt.c:705