root/src/noit_console.h

Revision 30700011fc4916bef71870a2bae7739745a7a2bc, 1.3 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

integrate a full-on telnet server... hey, why not?

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_CONSOLE_H
7 #define _NOIT_CONSOLE_H
8
9 #include "noit_defines.h"
10 #include "eventer/eventer.h"
11 #include "noitedit/histedit.h"
12 #include "noit_console_telnet.h"
13
14 typedef struct __noit_console_closure {
15   eventer_t e;           /* The event it is attached to.  This
16                           * is needed so it can write itself out */
17   int   wants_shutdown;  /* Set this to 1 to have it die */
18
19   /* nice console support */
20   EditLine *el;
21   int   pty_master;
22   int   pty_slave;
23
24   /* Output buffer for non-blocking sends */
25   char *outbuf;
26   int   outbuf_allocd;
27   int   outbuf_len;
28   int   outbuf_completed;
29
30   /* This tracks telnet protocol state (if we're doing telnet) */
31   noit_console_telnet_closure_t telnet;
32
33 } * noit_console_closure_t;;
34
35 API_EXPORT(void) noit_console_init();
36
37 API_EXPORT(int)
38   noit_console_handler(eventer_t e, int mask, void *closure,
39                        struct timeval *now);
40
41
42 API_EXPORT(int)
43   nc_printf(noit_console_closure_t ncct, const char *fmt, ...);
44
45 API_EXPORT(int)
46   nc_vprintf(noit_console_closure_t ncct, const char *fmt, va_list arg);
47
48 API_EXPORT(int)
49   nc_write(noit_console_closure_t ncct, void *buf, int len);
50
51 API_EXPORT(int)
52   noit_console_continue_sending(noit_console_closure_t ncct,
53                                 int *mask);
54 #endif
Note: See TracBrowser for help on using the browser.