X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.h;h=5e1a4ce3edc1a8812948ada45eecd2f76df4f7be;hp=851c00ba2f4ab4450493d29f878ea65125462588;hb=a7b65e41e2062c44c535f7cb4609e7988fc8ac0d;hpb=e151dbb79eac16326585ec0a33cf48029f5f22f4 diff --git a/command.h b/command.h index 851c00ba..5e1a4ce3 100644 --- a/command.h +++ b/command.h @@ -10,28 +10,15 @@ struct command_context { 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. - */ -struct server_command { - /** The name of the command. */ - const char *name; - /** Pointer to the function that handles the command. */ - int (*handler)(struct command_context *); - /** The privileges a user must have to execute this command. */ - unsigned int perms; - /** One-line description of the command. */ - const char *description; - /** Summary of the command line options. */ - const char *usage; - /** The long help text. */ - const char *help; -}; +int send_sb(struct stream_cipher_context *scc, void *buf, size_t numbytes, + int band, bool dont_free); +__printf_3_4 int send_sb_va(struct stream_cipher_context *scc, int band, + const char *fmt, ...); +int send_strerror(struct command_context *cc, int err); +int recv_sb(struct stream_cipher_context *scc, + enum sb_designator expected_band, + size_t max_size, struct iovec *result);