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

Annotation of /jpeg/rdesktop/trunk/rdp5.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 423 - (hide annotations)
Tue Jun 17 08:44:32 2003 UTC (20 years, 11 months ago) by matthewc
Original Path: sourceforge.net/trunk/rdesktop/rdp5.c
File MIME type: text/plain
File size: 2198 byte(s)
Eliminate previous ugly hack for RDP5 packets, in order to make it work
with low encryption.

1 forsberg 343 /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.
3     Protocol services - Multipoint Communications Service
4     Copyright (C) Matthew Chapman 1999-2002
5     Copyright (C) Erik Forsberg 2003
6    
7     This program is free software; you can redistribute it and/or modify
8     it under the terms of the GNU General Public License as published by
9     the Free Software Foundation; either version 2 of the License, or
10     (at your option) any later version.
11    
12     This program is distributed in the hope that it will be useful,
13     but WITHOUT ANY WARRANTY; without even the implied warranty of
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15     GNU General Public License for more details.
16    
17     You should have received a copy of the GNU General Public License
18     along with this program; if not, write to the Free Software
19     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20     */
21    
22     #include "rdesktop.h"
23    
24     extern uint8 *next_packet;
25    
26     void
27 matthewc 423 rdp5_process(STREAM s, BOOL encryption)
28 forsberg 343 {
29     uint16 length, count;
30     uint8 type;
31     uint8 *next;
32    
33     if (encryption)
34     {
35 matthewc 423 in_uint8s(s, 8); /* signature */
36 forsberg 343 sec_decrypt(s->p, s->end - s->p);
37     }
38    
39     #if 0
40     printf("RDP5 data:\n");
41     hexdump(s->p, s->end - s->p);
42     #endif
43    
44     while (s->p < s->end)
45     {
46     in_uint8(s, type);
47     in_uint16_le(s, length);
48     next_packet = next = s->p + length;
49    
50     switch (type)
51     {
52     case 0: /* orders */
53     in_uint16_le(s, count);
54     process_orders(s, count);
55     break;
56     case 1: /* bitmap update (???) */
57     in_uint8s(s, 2); /* part length */
58     process_bitmap_updates(s);
59     break;
60     case 2: /* palette */
61     in_uint8s(s, 2); /* uint16 = 2 */
62     process_palette(s);
63     break;
64 forsberg 411 case 3: /* probably an palette with offset 3. Weird */
65 forsberg 343 break;
66     case 5:
67     process_null_system_pointer_pdu(s);
68     break;
69     case 9:
70     process_colour_pointer_pdu(s);
71     break;
72     case 10:
73     process_cached_pointer_pdu(s);
74     break;
75     default:
76     unimpl("RDP5 opcode %d\n", type);
77     }
78    
79     s->p = next;
80     }
81     }
82    
83     void
84 forsberg 411 rdp5_process_channel(STREAM s, uint16 channelno)
85 forsberg 343 {
86 forsberg 411 rdp5_channel *channel;
87     channel = find_channel_by_channelno(channelno);
88     if (NULL != channel)
89     {
90     channel->channelcallback(s, channelno);
91     }
92 forsberg 343 }

  ViewVC Help
Powered by ViewVC 1.1.26