Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend mosquittopp API #2930

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/mosquitto/libmosquittopp.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ mosqpp_EXPORT int lib_init();
mosqpp_EXPORT int lib_cleanup();
mosqpp_EXPORT int topic_matches_sub(const char *sub, const char *topic, bool *result);
mosqpp_EXPORT int topic_matches_sub_with_pattern(const char *sub, const char *topic, const char *clientid, const char *username, bool *result);
mosqpp_EXPORT int pub_topic_check(const char *topic);
mosqpp_EXPORT int sub_topic_check(const char *topic);
mosqpp_EXPORT int sub_matches_acl(const char *acl, const char *sub, bool *result);
mosqpp_EXPORT int sub_matches_acl_with_pattern(const char *acl, const char *sub, const char *clientid, const char *username, bool *result);
mosqpp_EXPORT int validate_utf8(const char *str, int len);
Expand Down Expand Up @@ -123,6 +125,7 @@ class mosqpp_EXPORT mosquittopp {
int tls_opts_set(int cert_reqs, const char *tls_version=NULL, const char *ciphers=NULL);
int tls_insecure_set(bool value);
int tls_psk_set(const char *psk, const char *identity, const char *ciphers=NULL);
void *ssl_get();
int opts_set(enum mosq_opt_t option, void *value);
int int_option(enum mosq_opt_t option, int value);
int string_option(enum mosq_opt_t option, const char *value);
Expand Down
15 changes: 15 additions & 0 deletions lib/cpp/mosquittopp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,16 @@ int topic_matches_sub_with_pattern(const char *sub, const char *topic, const cha
return mosquitto_topic_matches_sub_with_pattern(sub, topic, clientid, username, result);
}

int pub_topic_check(const char *topic)
{
return mosquitto_pub_topic_check(topic);
}

int sub_topic_check(const char *topic)
{
return mosquitto_sub_topic_check(topic);
}

int sub_matches_acl(const char *acl, const char *sub, bool *result)
{
return mosquitto_sub_matches_acl(acl, sub, result);
Expand Down Expand Up @@ -510,4 +520,9 @@ int mosquittopp::tls_psk_set(const char *psk, const char *identity, const char *
return mosquitto_tls_psk_set(m_mosq, psk, identity, ciphers);
}

void *mosquittopp::ssl_get()
{
return mosquitto_ssl_get(m_mosq);
}

}