1 /*
2  * Copyright (c) 2007-2013 Michael Mondy
3  * Copyright (c) 2012-2016 Harry Reed
4  * Copyright (c) 2013-2018 Charles Anthony
5  * Copyright (c) 2015 Eric Swenson
6  * Copyright (c) 2021 The DPS8M Development Team
7  *
8  * All rights reserved.
9  *
10  * This software is made available under the terms of the ICU
11  * License, version 1.8.1 or later.  For more details, see the
12  * LICENSE.md file at the top-level directory of this distribution.
13  */
14 
15 #ifndef UVUTIL_H
16 # define UVUTIL_H
17 
18 struct uv_access_s
19   {
20     uv_loop_t * loop;
21     int port;
22     char * address;
23 # define PW_SIZE 128
24     char pw[PW_SIZE + 1];
25     char pwBuffer[PW_SIZE + 1];
26     int pwPos;
27 
28     void (* connectPrompt) (uv_tcp_t * client);
29     void (* connected) (uv_tcp_t * client);
30     bool open;
31     uv_tcp_t server;
32     uv_tcp_t * client;
33     bool useTelnet;
34     void * telnetp;
35     bool loggedOn;
36     unsigned char * inBuffer;
37     uint inSize;
38     uint inUsed;
39   };
40 
41 typedef struct uv_access_s uv_access;
42 void accessStartWriteStr (uv_tcp_t * client, char * data);
43 void uv_open_access (uv_access * access);
44 # ifndef QUIET_UNUSED
45 void accessPutStr (uv_access * access, char * str);
46 void accessPutChar (uv_access * access,  char ch);
47 # endif
48 int accessGetChar (uv_access * access);
49 void accessStartWrite (uv_tcp_t * client, char * data, ssize_t datalen);
50 void accessCloseConnection (uv_stream_t* stream);
51 #endif
52