X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.h;h=851c00ba2f4ab4450493d29f878ea65125462588;hp=347dd81ceedc753eb7f89a204ae5372ddb079dc7;hb=e151dbb79eac16326585ec0a33cf48029f5f22f4;hpb=ef81b9f4f0fa6a26043c68d429c0deeb7c949351 diff --git a/command.h b/command.h index 347dd81c..851c00ba 100644 --- a/command.h +++ b/command.h @@ -1,5 +1,23 @@ /** \file command.h The structure of server and afs commands. */ +/** Per connection data available to command handlers. */ +struct command_context { + /** Network address of the peer. */ + const char *peer; + /** The paraslash user that executes this command. */ + struct user *u; + /** Argument count. */ + int argc; + /** Argument vector. */ + char **argv; + /** The command being executed. */ + struct server_command *cmd; + /** File descriptor and crypto keys. */ + struct stream_cipher_context scc; + /** Whether to use the sideband API for this command. */ + bool use_sideband; +}; + /** * Defines one command of para_server. */ @@ -7,7 +25,7 @@ struct server_command { /** The name of the command. */ const char *name; /** Pointer to the function that handles the command. */ - int (*handler)(struct rc4_context *, int, char * const * const); + int (*handler)(struct command_context *); /** The privileges a user must have to execute this command. */ unsigned int perms; /** One-line description of the command. */