/[rdesktop]/sourceforge.net/trunk/rdesktop/parse.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /sourceforge.net/trunk/rdesktop/parse.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations)
Wed May 10 07:36:34 2000 UTC (24 years ago) by matty
Original Path: sourceforge.net/branches/RDESKTOP/rdesktop/parse.h
File MIME type: text/plain
File size: 1755 byte(s)
Adding my experimental RDP client to repository.

1 /*
2 rdesktop: A Remote Desktop Protocol client.
3 Protocol services - parsing layer
4 Copyright (C) Matthew Chapman 1999-2000
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20
21 /* Parser state */
22 typedef struct stream
23 {
24 /* Parsing layer */
25 unsigned char *data;
26 unsigned int size;
27 unsigned int offset;
28 unsigned int end;
29 BOOL marshall;
30 BOOL error;
31
32 /* Other layers */
33 int iso_offset;
34 int mcs_offset;
35 int rdp_offset;
36
37 } *STREAM;
38
39 /* Connection state */
40 typedef struct connection
41 {
42 /* Parsing layer */
43 struct stream in;
44 struct stream out;
45
46 /* TCP layer */
47 int tcp_socket;
48
49 /* MCS layer */
50 uint16 mcs_userid;
51
52 } *HCONN;
53
54 #define STREAM_INIT(s,m) { s.data = xmalloc(2048); s.end = s.size = 2048; s.offset = 0; s.marshall = m; s.error = False; }
55 #define STREAM_SIZE(s,l) { if (l > s.size) { s.data = xrealloc(s.data,l); s.end = s.size = l; } }
56 #define REMAINING(s) ( s->end - s->offset )
57 #define PUSH_LAYER(s,v,l) { s.v = s.offset; s.offset += l; }
58 #define POP_LAYER(s,v) { s.offset = s.v; }
59 #define MARK_END(s) { s.end = s.offset; }

  ViewVC Help
Powered by ViewVC 1.1.26