Revision e0a45fb4 nest/cli.h

View differences:

nest/cli.h
33 33
  void (*cleanup)(struct cli *c);
34 34
  void *rover;				/* Private to continuation routine */
35 35
  int last_reply;
36
  int restricted;			/* CLI is restricted to read-only commands */
36 37
  struct linpool *parser_pool;		/* Pool used during parsing */
37 38
  byte *ring_buf;			/* Ring buffer for asynchronous messages */
38 39
  byte *ring_end, *ring_read, *ring_write;	/* Pointers to the ring buffer */
......
60 61
void cli_written(cli *);
61 62
void cli_echo(unsigned int class, byte *msg);
62 63

  
64
static inline int cli_access_restricted(void)
65
{
66
  if (this_cli && this_cli->restricted)
67
    return (cli_printf(this_cli, 8007, "Access denied"), 1);
68
  else
69
    return 0;
70
}
71

  
63 72
/* Functions provided by sysdep layer */
64 73

  
65 74
void cli_write_trigger(cli *);

Also available in: Unified diff