small cleanup
This commit is contained in:
parent
0cbb382b14
commit
e925db2b98
@ -831,7 +831,7 @@ void commands_builtin_add(struct command_base* cbase)
|
|||||||
ADD_COMMAND("getip", 5, "u", auth_cred_operator, command_getip, "Show IP address for a user" );
|
ADD_COMMAND("getip", 5, "u", auth_cred_operator, command_getip, "Show IP address for a user" );
|
||||||
ADD_COMMAND("help", 4, "?c",auth_cred_guest, command_help, "Show this help message." );
|
ADD_COMMAND("help", 4, "?c",auth_cred_guest, command_help, "Show this help message." );
|
||||||
ADD_COMMAND("kick", 4, "u", auth_cred_operator, command_kick, "Kick a user" );
|
ADD_COMMAND("kick", 4, "u", auth_cred_operator, command_kick, "Kick a user" );
|
||||||
ADD_COMMAND("log", 3, "?m", auth_cred_operator, command_log, "Display log" ); // fail
|
ADD_COMMAND("log", 3, "?m",auth_cred_operator, command_log, "Display log" ); // fail
|
||||||
ADD_COMMAND("myip", 4, "", auth_cred_guest, command_myip, "Show your own IP." );
|
ADD_COMMAND("myip", 4, "", auth_cred_guest, command_myip, "Show your own IP." );
|
||||||
ADD_COMMAND("reload", 6, "", auth_cred_admin, command_reload, "Reload configuration files." );
|
ADD_COMMAND("reload", 6, "", auth_cred_admin, command_reload, "Reload configuration files." );
|
||||||
ADD_COMMAND("shutdown", 8, "", auth_cred_admin, command_shutdown_hub, "Shutdown hub." );
|
ADD_COMMAND("shutdown", 8, "", auth_cred_admin, command_shutdown_hub, "Shutdown hub." );
|
||||||
|
@ -114,13 +114,6 @@ int net_destroy()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_LIBEVENT
|
|
||||||
struct event_base* net_get_evbase()
|
|
||||||
{
|
|
||||||
return net_evbase;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void net_error_out(int fd, const char* func)
|
static void net_error_out(int fd, const char* func)
|
||||||
{
|
{
|
||||||
int err = net_error();
|
int err = net_error();
|
||||||
|
@ -51,8 +51,6 @@ extern int net_initialize();
|
|||||||
*/
|
*/
|
||||||
extern int net_destroy();
|
extern int net_destroy();
|
||||||
|
|
||||||
extern struct event_base* net_get_evbase();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the number of sockets currrently being monitored.
|
* @return the number of sockets currrently being monitored.
|
||||||
*/
|
*/
|
||||||
|
@ -55,7 +55,7 @@ int net_backend_poll_select(struct net_backend* data, int ms)
|
|||||||
struct net_backend_select* backend = (struct net_backend_select*) data;
|
struct net_backend_select* backend = (struct net_backend_select*) data;
|
||||||
|
|
||||||
tval.tv_sec = ms / 1000;
|
tval.tv_sec = ms / 1000;
|
||||||
tval.tv_usec = ((ms % 1000) * 1000); // FIXME: correct?
|
tval.tv_usec = (ms % 1000) * 1000;
|
||||||
|
|
||||||
FD_ZERO(&backend->rfds);
|
FD_ZERO(&backend->rfds);
|
||||||
FD_ZERO(&backend->wfds);
|
FD_ZERO(&backend->wfds);
|
||||||
|
@ -52,15 +52,15 @@ typedef int (*plugin_command_handler)(struct plugin_handle*, struct plugin_user*
|
|||||||
|
|
||||||
struct plugin_command_handle
|
struct plugin_command_handle
|
||||||
{
|
{
|
||||||
void* internal_handle; /**<<< "Internal used by the hub only" */
|
void* internal_handle; /**<<< "Internal used by the hub only" */
|
||||||
struct plugin_handle* handle; /**<<< "The plugin handle this is associated with" */
|
struct plugin_handle* handle; /**<<< "The plugin handle this is associated with" */
|
||||||
const char* prefix; /**<<< "Command prefix, for instance 'help' would be the prefix for the !help command." */
|
const char* prefix; /**<<< "Command prefix, for instance 'help' would be the prefix for the !help command." */
|
||||||
size_t length; /**<<< "Length of the prefix" */
|
size_t length; /**<<< "Length of the prefix" */
|
||||||
const char* args; /**<<< "Argument codes" */
|
const char* args; /**<<< "Argument codes" */
|
||||||
enum auth_credentials cred; /**<<< "Minimum access level for the command" */
|
enum auth_credentials cred; /**<<< "Minimum access level for the command" */
|
||||||
plugin_command_handler handler; /**<<< "Function pointer for the command" */
|
plugin_command_handler handler; /**<<< "Function pointer for the command" */
|
||||||
const char* description; /**<<< "Description for the command" */
|
const char* description; /**<<< "Description for the command" */
|
||||||
const char* origin; /**<<< "Name of plugin where the command originated." */
|
const char* origin; /**<<< "Name of plugin where the command originated." */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PLUGIN_COMMAND_INITIALIZE(PTR, HANDLE, PREFIX, ARGS, CRED, CALLBACK, DESC) \
|
#define PLUGIN_COMMAND_INITIALIZE(PTR, HANDLE, PREFIX, ARGS, CRED, CALLBACK, DESC) \
|
||||||
|
Loading…
Reference in New Issue
Block a user