-
Notifications
You must be signed in to change notification settings - Fork 4
/
telnet.h
48 lines (39 loc) · 1.24 KB
/
telnet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef _KA9Q_TELNET_H
#define _KA9Q_TELNET_H
#include "core/session.h"
#include "core/sockaddr.h"
#define LINESIZE 256 /* Length of local editing buffer */
/* Telnet command characters */
#define IAC 255 /* Interpret as command */
#define WILL 251
#define WONT 252
#define DO 253
#define DONT 254
/* Telnet options */
#define TN_TRANSMIT_BINARY 0
#define TN_ECHO 1
#define TN_SUPPRESS_GA 3
#define TN_STATUS 5
#define TN_TIMING_MARK 6
#define NOPTIONS 6
/* Telnet protocol control block */
struct telnet {
char local[NOPTIONS]; /* Local option settings */
char remote[NOPTIONS]; /* Remote option settings */
struct session *session; /* Pointer to session structure */
char eolmode; /* Control translation of enter key */
};
extern int Refuse_echo;
extern int Tn_cr_mode;
/* In telnet.c: */
int tel_connect(struct session *sp,struct ksockaddr *fsocket,int len);
void tel_output(int unused,void *p1,void *p2);
void tnrecv(struct telnet *tn);
void doopt(struct telnet *tn,int opt);
void dontopt(struct telnet *tn,int opt);
void willopt(struct telnet *tn,int opt);
void wontopt(struct telnet *tn,int opt);
void answer(struct telnet *tn,int r1,int r2);
/* In ttylink.c: */
void ttylhandle(int s,void *unused,void *p);
#endif /* _KA9Q_TELNET_H */