1 /** \file command.h The structure of server and afs commands. */
3 /** Per connection data available to command handlers. */
4 struct command_context
{
5 /** Network address of the peer. */
7 /** The paraslash user that executes this command. */
11 /** Argument vector. */
13 /** The command being executed. */
14 struct server_command
*cmd
;
15 /** File descriptor and crypto keys. */
16 struct stream_cipher_context scc
;
20 * Defines one command of para_server.
22 struct server_command
{
23 /** The name of the command. */
25 /** Pointer to the function that handles the command. */
26 int (*handler
)(struct command_context
*);
27 /** The privileges a user must have to execute this command. */
29 /** One-line description of the command. */
30 const char *description
;
31 /** Summary of the command line options. */
33 /** The long help text. */
37 int send_sb(struct stream_cipher_context
*scc
, void *buf
, size_t numbytes
,
38 int band
, bool dont_free
);
39 __printf_3_4
int send_sb_va(struct stream_cipher_context
*scc
, int band
,
40 const char *fmt
, ...);
41 int send_strerror(struct command_context
*cc
, int err
);
42 int recv_sb(struct stream_cipher_context
*scc
,
43 enum sb_designator expected_band
,
44 size_t max_size
, struct iovec
*result
);