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

Add client address parameter to the plugin function mosquitto_auth_unpwd_check? #1252

Closed
leojay opened this issue Apr 30, 2019 · 3 comments
Closed

Comments

@leojay
Copy link

leojay commented Apr 30, 2019

Right now, there is no way to verify the ip address of the client. Do you think ip address can be added to the mosquitto_auth_unpwd_check plugin function?
Or, as an alternative, provide a function to get the address from a mosquitto*?
Thanks!
Leo

@ralight
Copy link
Contributor

ralight commented May 1, 2019

Happily, this is already available in the mosquitto_broker.h header:

/*
 * Function: mosquitto_client_address
 *
 * Retrieve the IP address of the client as a string.
 */
const char *mosquitto_client_address(const struct mosquitto *client);

It isn't installed on the ubuntu or debian packages though, I'll fix that. I can't comment on other packages.

@leojay
Copy link
Author

leojay commented May 5, 2019

But how do I use this function? does that mean I have to link my plugin against libmosquitto.so?

@ralight
Copy link
Contributor

ralight commented May 22, 2019

The function is provided in the mosquitto broker itself and is accessible to the plugin once it has been loaded by the broker. All you should need to do is #include <mosquitto_broker.h> and then call the function.

@ralight ralight closed this as completed Aug 12, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants