1 |
/* |
/* |
2 |
Copyright (c) 1998-2001, Robert O'Callahan |
Copyright (c) 1998-2001, Robert O'Callahan |
3 |
All rights reserved. |
All rights reserved. |
4 |
|
|
5 |
Redistribution and use in source and binary forms, with or without modification, |
Redistribution and use in source and binary forms, with or without modification, |
6 |
are permitted provided that the following conditions are met: |
are permitted provided that the following conditions are met: |
7 |
|
|
8 |
Redistributions of source code must retain the above copyright notice, this list of |
Redistributions of source code must retain the above copyright notice, this list of |
9 |
conditions and the following disclaimer. |
conditions and the following disclaimer. |
10 |
|
|
11 |
Redistributions in binary form must reproduce the above copyright notice, this list |
Redistributions in binary form must reproduce the above copyright notice, this list |
12 |
of conditions and the following disclaimer in the documentation and/or other materials |
of conditions and the following disclaimer in the documentation and/or other materials |
13 |
provided with the distribution. |
provided with the distribution. |
14 |
|
|
15 |
The name of Robert O'Callahan may not be used to endorse or promote products derived from |
The name of Robert O'Callahan may not be used to endorse or promote products derived from |
16 |
this software without specific prior written permission. |
this software without specific prior written permission. |
17 |
|
|
18 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND |
19 |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
20 |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
21 |
THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
22 |
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
23 |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
24 |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
25 |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
26 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 |
*/ |
*/ |
28 |
|
|
29 |
/* |
/* |
30 |
This code is copyright (C) 1998-1999 Robert O'Callahan. |
This code is copyright (C) 1998-1999 Robert O'Callahan. |
31 |
See LICENSE.TXT for the license. |
See LICENSE.TXT for the license. |
32 |
*/ |
*/ |
33 |
|
|
34 |
#ifndef __X11UTIL_H |
#ifndef __X11UTIL_H |
35 |
#define __X11UTIL_H |
#define __X11UTIL_H |
36 |
|
|
37 |
#include "ttxssh.h" |
#include "ttxssh.h" |
38 |
|
|
39 |
typedef struct _X11AuthData { |
typedef struct _X11AuthData { |
40 |
char FAR * local_protocol; |
char FAR * local_protocol; |
41 |
unsigned char FAR * local_data; |
unsigned char FAR * local_data; |
42 |
int local_data_len; |
int local_data_len; |
43 |
char FAR * spoofed_protocol; |
char FAR * spoofed_protocol; |
44 |
unsigned char FAR * spoofed_data; |
unsigned char FAR * spoofed_data; |
45 |
int spoofed_data_len; |
int spoofed_data_len; |
46 |
} X11AuthData; |
} X11AuthData; |
47 |
|
|
48 |
#define X11_get_spoofed_protocol_name(d) ((d)->spoofed_protocol) |
#define X11_get_spoofed_protocol_name(d) ((d)->spoofed_protocol) |
49 |
#define X11_get_spoofed_protocol_data(d) ((d)->spoofed_data) |
#define X11_get_spoofed_protocol_data(d) ((d)->spoofed_data) |
50 |
#define X11_get_spoofed_protocol_data_len(d) ((d)->spoofed_data_len) |
#define X11_get_spoofed_protocol_data_len(d) ((d)->spoofed_data_len) |
51 |
|
|
52 |
void X11_get_DISPLAY_info(char FAR * name_buf, int name_buf_len, int FAR * port); |
void X11_get_DISPLAY_info(char FAR * name_buf, int name_buf_len, int FAR * port); |
53 |
X11AuthData FAR * X11_load_local_auth_data(int screen_num); |
X11AuthData FAR * X11_load_local_auth_data(int screen_num); |
54 |
void FAR * X11_init_unspoofing_filter(struct _TInstVar FAR * pvar, |
void FAR * X11_init_unspoofing_filter(struct _TInstVar FAR * pvar, |
55 |
X11AuthData FAR * auth_data); |
X11AuthData FAR * auth_data); |
56 |
int X11_unspoofing_filter(void FAR * closure, int direction, |
int X11_unspoofing_filter(void FAR * closure, int direction, |
57 |
int FAR * length, unsigned char FAR * FAR * buf); |
int FAR * length, unsigned char FAR * FAR * buf); |
58 |
void X11_dispose_auth_data(X11AuthData FAR * auth_data); |
void X11_dispose_auth_data(X11AuthData FAR * auth_data); |
59 |
|
|
60 |
#endif |
#endif |