2014-05-07 22:27:00 +00:00
|
|
|
/*
|
2020-02-27 23:26:58 +00:00
|
|
|
Copyright (c) 2009-2020 Roger Light <roger@atchoo.org>
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
All rights reserved. This program and the accompanying materials
|
2020-11-25 17:34:21 +00:00
|
|
|
are made available under the terms of the Eclipse Public License 2.0
|
2014-05-07 22:27:00 +00:00
|
|
|
and Eclipse Distribution License v1.0 which accompany this distribution.
|
|
|
|
|
|
|
|
The Eclipse Public License is available at
|
2020-11-25 17:34:21 +00:00
|
|
|
https://www.eclipse.org/legal/epl-2.0/
|
2014-05-07 22:27:00 +00:00
|
|
|
and the Eclipse Distribution License is available at
|
|
|
|
http://www.eclipse.org/org/documents/edl-v10.php.
|
|
|
|
|
2021-01-20 11:46:18 +00:00
|
|
|
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
|
2020-12-01 18:21:59 +00:00
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
Contributors:
|
|
|
|
Roger Light - initial implementation and documentation.
|
|
|
|
*/
|
2016-03-13 18:43:13 +00:00
|
|
|
#ifndef UTIL_MOSQ_H
|
|
|
|
#define UTIL_MOSQ_H
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "tls_mosq.h"
|
|
|
|
#include "mosquitto.h"
|
2015-01-26 20:46:15 +00:00
|
|
|
#include "mosquitto_internal.h"
|
|
|
|
#ifdef WITH_BROKER
|
2016-07-08 09:10:04 +00:00
|
|
|
# include "mosquitto_broker_internal.h"
|
2015-01-26 20:46:15 +00:00
|
|
|
#endif
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2018-12-06 10:45:57 +00:00
|
|
|
int mosquitto__check_keepalive(struct mosquitto *mosq);
|
2015-04-19 21:10:59 +00:00
|
|
|
uint16_t mosquitto__mid_generate(struct mosquitto *mosq);
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2019-09-24 10:54:05 +00:00
|
|
|
int mosquitto__set_state(struct mosquitto *mosq, enum mosquitto_client_state state);
|
|
|
|
enum mosquitto_client_state mosquitto__get_state(struct mosquitto *mosq);
|
|
|
|
|
2019-04-17 09:59:52 +00:00
|
|
|
#ifdef WITH_TLS
|
2018-08-11 16:57:58 +00:00
|
|
|
int mosquitto__hex2bin_sha1(const char *hex, unsigned char **bin);
|
2015-04-19 21:10:59 +00:00
|
|
|
int mosquitto__hex2bin(const char *hex, unsigned char *bin, int bin_max_len);
|
2014-05-07 22:27:00 +00:00
|
|
|
#endif
|
|
|
|
|
2019-02-27 14:15:31 +00:00
|
|
|
int util__random_bytes(void *bytes, int count);
|
|
|
|
|
2019-01-08 12:27:19 +00:00
|
|
|
void util__increment_receive_quota(struct mosquitto *mosq);
|
2019-01-08 18:38:47 +00:00
|
|
|
void util__increment_send_quota(struct mosquitto *mosq);
|
2019-04-13 21:59:29 +00:00
|
|
|
void util__decrement_receive_quota(struct mosquitto *mosq);
|
|
|
|
void util__decrement_send_quota(struct mosquitto *mosq);
|
2020-01-30 18:35:45 +00:00
|
|
|
|
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
#endif
|