diff options
Diffstat (limited to 'config_cmds.h')
-rw-r--r-- | config_cmds.h | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/config_cmds.h b/config_cmds.h index a123ec8..e532d64 100644 --- a/config_cmds.h +++ b/config_cmds.h @@ -1,8 +1,13 @@ #ifndef __CONFIG_CMDS_H #define __CONFIG_CMDS_H +#define CMD_T_SIMPLE 0 +#define CMD_T_RPC 1 +#define CMD_T_LUA 2 + typedef struct single_cmd_def { + int type; char *name; void *(*callback)(void *); } single_cmd_def; @@ -15,24 +20,30 @@ typedef struct single_cmd_def //nothing else comaptible will be added, as its not about "standarts" single_cmd_def confgi_cmd_list[] = { - {"DATE",cmd_date}, - {"UPTIME",cmd_uptime}, - {"VERSION",cmd_version}, {"!version",cmd_version}, - {"PING",cmd_ping}, {"!ping",cmd_ping}, - {"LOADAVG",cmd_loadavg}, - {"RUSE",cmd_rusage}, - {"CMD",cmd_cmd}, {"!echo",cmd_cmd}, - {"SHA1",cmd_sha1}, - {"COOKIE",cmd_cookie}, - {"BOTU",cmd_botu}, {"!uptime",cmd_botu}, - {"FIR1P",cmd_fir1p}, - {"RAND",cmd_rand}, - {"RANDC",cmd_rand_libc}, - {"FIR",cmd_fir}, - {"HELP",cmd_help}, - {"SPI",cmd_spi}, - {"STAT",cmd_stat}, - {NULL,NULL} + //simple echo response commands + {CMD_T_SIMPLE,"DATE",cmd_date}, + {CMD_T_SIMPLE,"UPTIME",cmd_uptime}, + {CMD_T_SIMPLE,"VERSION",cmd_version}, {CMD_T_SIMPLE,"!version",cmd_version}, + {CMD_T_SIMPLE,"PING",cmd_ping}, {CMD_T_SIMPLE,"!ping",cmd_ping}, + {CMD_T_SIMPLE,"LOADAVG",cmd_loadavg}, + {CMD_T_SIMPLE,"RUSE",cmd_rusage}, + {CMD_T_SIMPLE,"CMD",cmd_cmd}, {CMD_T_SIMPLE,"!echo",cmd_cmd}, + {CMD_T_SIMPLE,"SHA1",cmd_sha1}, + {CMD_T_SIMPLE,"COOKIE",cmd_cookie}, + {CMD_T_SIMPLE,"BOTU",cmd_botu}, {CMD_T_SIMPLE,"!uptime",cmd_botu}, + {CMD_T_SIMPLE,"FIR1P",cmd_fir1p}, + {CMD_T_SIMPLE,"RAND",cmd_rand}, + {CMD_T_SIMPLE,"RANDC",cmd_rand_libc}, + {CMD_T_SIMPLE,"FIR",cmd_fir}, + {CMD_T_SIMPLE,"HELP",cmd_help}, + {CMD_T_SIMPLE,"SPI",cmd_spi}, + {CMD_T_SIMPLE,"STAT",cmd_stat}, + + //more complicated command + {CMD_T_RPC,"TODO",cmd_todo}, + + + {0,NULL,NULL} }; |