mqtt.h
Go to the documentation of this file.
/* SPDX-FileCopyrightText: 2021-2023 Greenbone AG
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef _GVM_UTIL_MQTT_H
#define _GVM_UTIL_MQTT_H
#include <MQTTClient.h>
#include <glib.h>
#define AUTH_MQTT 1
int
mqtt_init (const char *);
int
mqtt_init_auth (const char *, const char *, const char *);
gboolean
mqtt_is_initialized (void);
void
mqtt_reset (void);
int
mqtt_publish (const char *, const char *);
int
mqtt_publish_single_message_auth (const char *, const char *, const char *,
const char *, const char *);
int
mqtt_publish_single_message (const char *, const char *, const char *);
int
mqtt_subscribe (const char *);
int
mqtt_retrieve_message (char **, int *, char **, int *, const unsigned int);
int
mqtt_unsubscribe (const char *);
#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