|
Omega Security Services 0.7.3
|
Go to the source code of this file.
Data Structures | |
| struct | CmdBase |
| struct | CmdHash |
| struct | HelpEntry |
Defines | |
| #define | CMD_ERR_OK 0 |
| #define | CMD_ERR_INV 1 |
| #define | CMD_ERR_ACC 2 |
| #define | CMD_ERR_PARAMS 3 |
| #define | CMD_ERR_INDEX 4 |
| #define | CMD_ERR_HASH 5 |
| #define | CMD_ADD_HEAD 1 |
| #define | CMD_ADD_TAIL 0 |
| #define | CMD_HASH_KEY 1024 |
Functions | |
| int | HELP_FOREACH (User *, User *) |
| int | do_cmd (char *cmd, User *us, User *u, int ac, char *av) |
| void | ACCESS_DENIED (User *, User *) |
| CmdHash * | CmdHashCreate (User *u) |
| int | AddCmd (User *, char *, char *, void(*fnct)(User *, int, char **), void(*hlp)(User *), int) |
| void | DelCmd (User *, char *, void(*fnct)(User *, int, char **), void(*hlp)(User *)) |
| int | AddHelp (User *u, void(*helpcmd)(User *)) |
| int | DelHelp (User *u, void(*helpcmd)(User *)) |
| char * | CmdErr (int) |
| static void | ClientCmdNull (User *u, char *av) |
Variables | |
| CmdHash * | UserCmdHash [1024] |
| dlink_list | cmd_help [1024] |
| #define CMD_HASH_KEY 1024 |
| int AddCmd | ( | User * | u, |
| char * | name, | ||
| char * | access, | ||
| void(*)(User *, int, char **) | fnct, | ||
| void(*)(User *) | hlp, | ||
| int | log | ||
| ) |
Add a command to our clients command hash.
| u | Pointer to our clients structure |
| name | The name of the command we are using, this is imporntant becuase the command will be issued and looked up via its name. |
| access | Access level required to issue the command. |
| fnct | A pointer to the command's function. |
Definition at line 65 of file cmds.c.
References alog(), CMD_HASH_KEY, DEBUG3, dlink_add_tail(), dlink_create(), HASH, strlcpy(), and UserCmdHash.
Referenced by Module_Init().
| int AddHelp | ( | User * | u, |
| void(*)(User *) | helpcmd | ||
| ) |
Definition at line 111 of file cmds.c.
References alog(), CMD_HASH_KEY, cmd_help, DEBUG3, dlink_add_tail(), dlink_create(), HASH, and HelpEntry::routine.
Referenced by Module_Init().
| static void ClientCmdNull | ( | User * | u, |
| char * | av | ||
| ) | [static] |
| char* CmdErr | ( | int | ) |
Definition at line 305 of file cmds.c.
Referenced by HandleClientCmds().
| CmdHash* CmdHashCreate | ( | User * | u | ) |
| void DelCmd | ( | User * | , |
| char * | , | ||
| void(*)(User *, int, char **) | fnct, | ||
| void(*)(User *) | hlp | ||
| ) |
Definition at line 161 of file cmds.c.
References dlink_delete(), DLINK_FOREACH_SAFE, dlink_free(), HASH, and UserCmdHash.
| int DelHelp | ( | User * | u, |
| void(*)(User *) | helpcmd | ||
| ) |
Definition at line 132 of file cmds.c.
References CMD_HASH_KEY, cmd_help, dlink_delete(), DLINK_FOREACH, dlink_free(), HASH, and HelpEntry::routine.
Referenced by Module_Close().
| int do_cmd | ( | char * | cmd, |
| User * | us, | ||
| User * | u, | ||
| int | argc, | ||
| char * | argv | ||
| ) |
int do_cmd() - Handles a command to a client - do all the santatity checks here.
| cmd | = The command we are actioning on. |
| us | = A pointer to OUR client struct |
| u | = A pointer to the SRC of the command |
| ac | = The argument count being passed into the command handler - used to see if av is null :) |
| av | = The PARAMATERS to the command - the original command. |
Definition at line 220 of file cmds.c.
References alog(), check_access(), CMD_ERR_INDEX, CMD_ERR_OK, CMD_HASH_KEY, cmd_help, debug, DLINK_FOREACH, generictoken(), HASH, LOG_DEBUG2, logcmds, HelpEntry::routine, sendto_logchan(), sendto_one(), and UserCmdHash.
Referenced by HandleClientCmds().
| dlink_list cmd_help[1024] |