2020-02-06 16:43:29 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2021-03-21 09:17:53 +00:00
|
|
|
#include "misc_mosq.h"
|
2020-02-06 16:43:29 +00:00
|
|
|
#include "mosquitto_broker_internal.h"
|
|
|
|
#include "mosquitto_internal.h"
|
2021-03-21 09:17:53 +00:00
|
|
|
#include "util_mosq.h"
|
2020-02-06 16:43:29 +00:00
|
|
|
|
2021-03-29 16:07:40 +00:00
|
|
|
#ifndef UNUSED
|
|
|
|
# define UNUSED(A) (void)(A)
|
|
|
|
#endif
|
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
struct mosquitto *context__init(mosq_sock_t sock)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(sock);
|
|
|
|
|
2020-02-06 16:43:29 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
int db__message_store(const struct mosquitto *source, struct mosquitto_msg_store *stored, uint32_t message_expiry_interval, dbid_t store_id, enum mosquitto_msg_origin origin)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(source);
|
|
|
|
UNUSED(stored);
|
|
|
|
UNUSED(message_expiry_interval);
|
|
|
|
UNUSED(store_id);
|
|
|
|
UNUSED(origin);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void db__msg_store_ref_inc(struct mosquitto_msg_store *store)
|
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(store);
|
2020-02-06 16:43:29 +00:00
|
|
|
}
|
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
int handle__packet(struct mosquitto *context)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(context);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-10-17 00:23:08 +00:00
|
|
|
int log__printf(struct mosquitto *mosq, unsigned int level, const char *fmt, ...)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(mosq);
|
|
|
|
UNUSED(level);
|
|
|
|
UNUSED(fmt);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
FILE *mosquitto__fopen(const char *path, const char *mode, bool restrict_read)
|
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(path);
|
|
|
|
UNUSED(mode);
|
|
|
|
UNUSED(restrict_read);
|
2020-02-06 16:43:29 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq)
|
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(mosq);
|
2020-02-06 16:43:29 +00:00
|
|
|
return mosq_cs_new;
|
|
|
|
}
|
|
|
|
|
2021-01-06 11:40:08 +00:00
|
|
|
int mux__add_out(struct mosquitto *mosq)
|
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(mosq);
|
2021-01-06 11:40:08 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-12-27 23:03:38 +00:00
|
|
|
int mux__remove_out(struct mosquitto *mosq)
|
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(mosq);
|
2020-12-27 23:03:38 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-02-06 16:43:29 +00:00
|
|
|
ssize_t net__read(struct mosquitto *mosq, void *buf, size_t count)
|
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(mosq);
|
|
|
|
UNUSED(buf);
|
|
|
|
UNUSED(count);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2021-01-03 20:52:45 +00:00
|
|
|
ssize_t net__write(struct mosquitto *mosq, const void *buf, size_t count)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(mosq);
|
|
|
|
UNUSED(buf);
|
|
|
|
UNUSED(count);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
int retain__store(const char *topic, struct mosquitto_msg_store *stored, char **split_topics)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(topic);
|
|
|
|
UNUSED(stored);
|
|
|
|
UNUSED(split_topics);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
int sub__add(struct mosquitto *context, const char *sub, uint8_t qos, uint32_t identifier, int options, struct mosquitto__subhier **root)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(context);
|
|
|
|
UNUSED(sub);
|
|
|
|
UNUSED(qos);
|
|
|
|
UNUSED(identifier);
|
|
|
|
UNUSED(options);
|
|
|
|
UNUSED(root);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
int sub__messages_queue(const char *source_id, const char *topic, uint8_t qos, int retain, struct mosquitto_msg_store **stored)
|
2020-02-06 16:43:29 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(source_id);
|
|
|
|
UNUSED(topic);
|
|
|
|
UNUSED(qos);
|
|
|
|
UNUSED(retain);
|
|
|
|
UNUSED(stored);
|
2020-02-06 16:43:29 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2020-10-12 23:07:28 +00:00
|
|
|
|
2020-11-06 15:16:07 +00:00
|
|
|
int keepalive__update(struct mosquitto *context)
|
2020-10-12 23:07:28 +00:00
|
|
|
{
|
2021-01-21 13:33:54 +00:00
|
|
|
UNUSED(context);
|
2020-10-12 23:07:28 +00:00
|
|
|
return 0;
|
|
|
|
}
|
2021-09-23 14:04:11 +00:00
|
|
|
|
|
|
|
void db__msg_add_to_inflight_stats(struct mosquitto_msg_data *msg_data, struct mosquitto_client_msg *msg)
|
|
|
|
{
|
|
|
|
UNUSED(msg_data);
|
|
|
|
UNUSED(msg);
|
|
|
|
}
|
|
|
|
|
|
|
|
void db__msg_add_to_queued_stats(struct mosquitto_msg_data *msg_data, struct mosquitto_client_msg *msg)
|
|
|
|
{
|
|
|
|
UNUSED(msg_data);
|
|
|
|
UNUSED(msg);
|
|
|
|
}
|