diff options
| author | Kozlov Dmitry <dima@server> | 2010-11-10 12:53:48 +0300 |
|---|---|---|
| committer | Kozlov Dmitry <dima@server> | 2010-11-10 12:53:48 +0300 |
| commit | b6516bc491fcb7d9344f9cc720e20a5a20f94a32 (patch) | |
| tree | f4ea34419b5cff7af67aacdd44279c0f89df516c /accel-pptpd/cli/cli.h | |
| parent | e2754301d6ff0020c5ff349491ad814cbc70161c (diff) | |
| download | accel-ppp-b6516bc491fcb7d9344f9cc720e20a5a20f94a32.tar.gz accel-ppp-b6516bc491fcb7d9344f9cc720e20a5a20f94a32.zip | |
initial telnet cli support
Diffstat (limited to 'accel-pptpd/cli/cli.h')
| -rw-r--r-- | accel-pptpd/cli/cli.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/accel-pptpd/cli/cli.h b/accel-pptpd/cli/cli.h new file mode 100644 index 00000000..aec62fd3 --- /dev/null +++ b/accel-pptpd/cli/cli.h @@ -0,0 +1,37 @@ +#ifndef __CLI_H +#define __CLI_H + +#include <pcre.h> +#include <list.h> + +#define CLI_CMD_OK 0 +#define CLI_CMD_FAILED -1 +#define CLI_CMD_EXIT -2 +#define CLI_CMD_SYNTAX 1 + +struct cli_simple_cmd_t +{ + struct list_head entry; + int hdr_len; + const char **hdr; + int (*exec)(const char *cmd, char * const *fields, int fields_cnt, void *client); + int (*help)(char * const *fields, int field_cnt, void *client); +}; + +struct cli_regexp_cmd_t +{ + struct list_head entry; + pcre *re; + const char *pattern; + int options; + int (*exec)(const char *cmd, void *client); + int (*help)(char * const *fields, int field_cnt, void *client); +}; + +void cli_register_simple_cmd(struct cli_simple_cmd_t *cmd); +void cli_register_regexp_cmd(struct cli_regexp_cmd_t *cmd); + +int cli_send(void *client, const char *data); + +#endif + |
