Deleted Added
full compact
state.c (72445) state.c (142403)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include "telnetd.h"
35
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include "telnetd.h"
35
36RCSID("$Id: state.c,v 1.14 2000/10/02 05:06:02 assar Exp $");
36RCSID("$Id: state.c,v 1.14.12.1 2004/06/21 08:21:58 lha Exp $");
37
38unsigned char doopt[] = { IAC, DO, '%', 'c', 0 };
39unsigned char dont[] = { IAC, DONT, '%', 'c', 0 };
40unsigned char will[] = { IAC, WILL, '%', 'c', 0 };
41unsigned char wont[] = { IAC, WONT, '%', 'c', 0 };
42int not42 = 1;
43
44/*
45 * Buffer for sub-options, and macros
46 * for suboptions buffer manipulations
47 */
37
38unsigned char doopt[] = { IAC, DO, '%', 'c', 0 };
39unsigned char dont[] = { IAC, DONT, '%', 'c', 0 };
40unsigned char will[] = { IAC, WILL, '%', 'c', 0 };
41unsigned char wont[] = { IAC, WONT, '%', 'c', 0 };
42int not42 = 1;
43
44/*
45 * Buffer for sub-options, and macros
46 * for suboptions buffer manipulations
47 */
48unsigned char subbuffer[2048], *subpointer= subbuffer, *subend= subbuffer;
48unsigned char subbuffer[1024*64], *subpointer= subbuffer, *subend= subbuffer;
49
50#define SB_CLEAR() subpointer = subbuffer
51#define SB_TERM() { subend = subpointer; SB_CLEAR(); }
52#define SB_ACCUM(c) if (subpointer < (subbuffer+sizeof subbuffer)) { \
53 *subpointer++ = (c); \
54 }
55#define SB_GET() ((*subpointer++)&0xff)
56#define SB_EOF() (subpointer >= subend)

--- 1222 unchanged lines hidden (view full) ---

1279} /* end of suboption */
1280
1281void
1282doclientstat(void)
1283{
1284 clientstat(TELOPT_LINEMODE, WILL, 0);
1285}
1286
49
50#define SB_CLEAR() subpointer = subbuffer
51#define SB_TERM() { subend = subpointer; SB_CLEAR(); }
52#define SB_ACCUM(c) if (subpointer < (subbuffer+sizeof subbuffer)) { \
53 *subpointer++ = (c); \
54 }
55#define SB_GET() ((*subpointer++)&0xff)
56#define SB_EOF() (subpointer >= subend)

--- 1222 unchanged lines hidden (view full) ---

1279} /* end of suboption */
1280
1281void
1282doclientstat(void)
1283{
1284 clientstat(TELOPT_LINEMODE, WILL, 0);
1285}
1286
1287#undef ADD
1287#define ADD(c) *ncp++ = c
1288#define ADD_DATA(c) { *ncp++ = c; if (c == SE || c == IAC) *ncp++ = c; }
1289
1290void
1291send_status(void)
1292{
1293 unsigned char statusbuf[256];
1294 unsigned char *ncp;

--- 62 unchanged lines hidden ---
1288#define ADD(c) *ncp++ = c
1289#define ADD_DATA(c) { *ncp++ = c; if (c == SE || c == IAC) *ncp++ = c; }
1290
1291void
1292send_status(void)
1293{
1294 unsigned char statusbuf[256];
1295 unsigned char *ncp;

--- 62 unchanged lines hidden ---