/**
* Return the network handle associated with an admin context.
- * @param Admin context handle
+ * @param h Admin context handle
* @return Network, or NULL if no network is associated.
*/
struct network *admin_get_network(admin_handle h)
return TRUE;
}
+/**
+ * Table of administration settings that can be
+ * viewed and changed using the SET command.
+ */
static struct admin_setting {
const char *name;
char *(*get) (admin_handle h);
typedef void (*admin_command_handler) (admin_handle, char **, void *userdata);
+/**
+ * Handle used in the administration subsystem.
+ */
struct admin_handle
{
struct global *global;
#include "ctrlproxy.h"
#include <string.h>
+/**
+ * State data for auto-away.
+ */
struct auto_away_data {
struct auto_away_config *config;
time_t last_message;
return TRUE;
}
+/**
+ * Table of commands of which the result can be cached.
+ */
struct cache_command {
const char *name;
/* Should return FALSE if command couldn't be cached */
cmds = g_list_append(cmds, g_memdup(h, sizeof(*h)));
}
+/**
+ * A CTCP request.
+ */
struct ctcp_request {
struct client *client;
char *destination;
#include <glib.h>
#include <gmodule.h>
+/**
+ * Current version of the plugin API.
+ */
#define CTRLPROXY_PLUGIN_VERSION 3
/**
gint admin_incoming_id;
};
+/**
+ * Plugin description. Required to be defined by all plugins.
+ */
struct plugin_ops {
int version;
char *name;
#ifndef _HELP_H
#define _HELP_H
+/**
+ * Help file.
+ */
typedef struct help
{
#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 8
return TRUE;
}
-/* Hooks that are called when a client is added or removed.
- * Very useful for replication backends */
+/* Hooks that are called when a client is added or removed. */
struct new_client_hook_data {
char *name;
static void handle_insert(int, char **);
static GHashTable *markers = NULL;
+/**
+ * Shell command.
+ */
struct cmd {
const char *name;
void (*handler) (int argc, char **);
#define STATE_DUMP_INTERVAL 1000
+/**
+ * Linestack_file backend data
+ */
struct lf_data {
GIOChannel *line_file;
GIOChannel *state_file;
}
}
+/**
+ * Socks methods.
+ */
static struct socks_method {
gint id;
const char *name;
struct socks_method;
+/**
+ * Client connection that has not been authenticated yet.
+ */
struct pending_client {
GIOChannel *connection;
char *user;
struct log_support_context *log_ctx;
};
-/* Translation table */
+/**
+ * Translation table
+ */
struct log_mapping {
char *command;
char subst;
#include <stdio.h>
+/**
+ * Log file information.
+ */
struct log_file_info {
FILE *file;
time_t last_used;
};
+/**
+ * Common logging data. Contains a cache of log files that have been
+ * written to. Will keep a limited number of file descriptors open,
+ * for performance reasons.
+ */
struct log_support_context {
GHashTable *files;
int num_opened;
} type_settings;
};
+/**
+ * Log file configuration. Contains substitution variable for
+ * the path of the log file and for the format used for various events
+ * when logging.
+ */
struct log_file_config {
const char *logfilename;
const char *nickchange;
};
+/**
+ * Allowed user/password combination for SOCKS.
+ */
struct allow_rule {
char *username;
char *password;
gboolean is_default; /* Whether this is the "default" listener, stored in ~/.ctrlproxy/config */
};
+/**
+ * Auto-away configuration.
+ */
struct auto_away_config {
time_t max_idle_time;
gint client_limit;