]> git.sesse.net Git - rdpsrv/blob - Xserver/include/extensions/lbxzlib.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / include / extensions / lbxzlib.h
1 /* $XConsortium: lbxzlib.h /main/2 1996/10/27 15:39:45 rws $ */
2 /*
3  * Copyright 1993 Network Computing Devices
4  *
5  * Permission to use, copy, modify, distribute, and sell this software and its
6  * documentation for any purpose is hereby granted without fee, provided that
7  * the above copyright notice appear in all copies and that both that
8  * copyright notice and this permission notice appear in supporting
9  * documentation, and that the name of NCD. not be used in advertising or
10  * publicity pertaining to distribution of the software without specific,
11  * written prior permission.  NCD. makes no representations about the
12  * suitability of this software for any purpose.  It is provided "as is"
13  * without express or implied warranty.
14  *
15  * NCD. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL NCD.
17  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  *
22  * Author:  Dale Tonogai, Network Computing Devices
23  */
24
25 #ifndef _ZLIB_H_
26 #define _ZLIB_H_
27
28 #define ZLIB_STRCOMP_OPT        "XC-ZLIB"
29 #define ZLIB_STRCOMP_OPT_LEN    7
30
31 #define ZLIB_PACKET_HDRLEN      2
32 #define ZLIB_MAX_DATALEN        0xfff
33 #define ZLIB_MAX_PLAIN          270
34 #define ZLIB_MAX_OUTLEN         (ZLIB_MAX_PLAIN << 1)
35
36 #define ZLIB_COMPRESS_FLAG      0x80
37 #define ZLIB_DATALEN_MASK       0x0f
38
39 #define ZLIB_PUT_PKTHDR(p, len, compflag) \
40     { \
41         (p)[0] = ((unsigned)(len)) >> 8 | ((compflag) ? ZLIB_COMPRESS_FLAG : 0);\
42         (p)[1] = (len) & 0xff; \
43     }
44
45 #define ZLIB_GET_DATALEN(p) \
46         ((((unsigned)((p)[0] & ZLIB_DATALEN_MASK)) << 8) | (unsigned)(p)[1])
47
48 #define ZLIB_COMPRESSED(p) ((p)[0] & ZLIB_COMPRESS_FLAG)
49
50 #endif /* _ZLIB_H_ */