CVS: rdesktop proto.h,1.58,1.59 rdp.c,1.50,1.51

Peter Bystr?m <[email protected]>
Newsgroups gmane.network.rdesktop.cvs
Message-ID <[email protected]>
Update of /cvsroot/rdesktop/rdesktop
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12442

Modified Files:
	proto.h rdp.c 
Log Message:
get real ip address, or lp if not avail - volker milde, also part of rdp compression within ifdef 0 from uni patches

Index: proto.h
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/proto.h,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** proto.h	15 Feb 2004 21:19:28 -0000	1.58
--- proto.h	4 Mar 2004 08:11:40 -0000	1.59
***************
*** 140,143 ****
--- 140,144 ----
  BOOL tcp_connect(char *server);
  void tcp_disconnect(void);
+ char *tcp_get_address(void);
  /* xclip.c */
  void ui_clip_format_announce(uint8 * data, uint32 length);

Index: rdp.c
===================================================================
RCS file: /cvsroot/rdesktop/rdesktop/rdp.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** rdp.c	14 Feb 2004 19:30:01 -0000	1.50
--- rdp.c	4 Mar 2004 08:11:40 -0000	1.51
***************
*** 157,160 ****
--- 157,161 ----
  		    char *password, char *program, char *directory)
  {
+ 	char *ipaddr = tcp_get_address();
  	int len_domain = 2 * strlen(domain);
  	int len_user = 2 * strlen(user);
***************
*** 162,166 ****
  	int len_program = 2 * strlen(program);
  	int len_directory = 2 * strlen(directory);
! 	int len_ip = 2 * strlen("127.0.0.1");
  	int len_dll = 2 * strlen("C:\\WINNT\\System32\\mstscax.dll");
  	int packetlen = 0;
--- 163,167 ----
  	int len_program = 2 * strlen(program);
  	int len_directory = 2 * strlen(directory);
! 	int len_ip = 2 * strlen(ipaddr);
  	int len_dll = 2 * strlen("C:\\WINNT\\System32\\mstscax.dll");
  	int packetlen = 0;
***************
*** 170,173 ****
--- 171,179 ----
  	time_t tzone;
  
+ #if 0
+ 	// enable rdp compression
+ 	flags |= RDP_COMPRESSION;
+ #endif
+ 
  	if (!g_use_rdp5 || 1 == g_server_rdp_version)
  	{
***************
*** 267,271 ****
  		out_uint16_le(s, 2);
  		out_uint16_le(s, len_ip + 2);	/* Length of client ip */
! 		rdp_out_unistr(s, "127.0.0.1", len_ip);
  		out_uint16_le(s, len_dll + 2);
  		rdp_out_unistr(s, "C:\\WINNT\\System32\\mstscax.dll", len_dll);
--- 273,277 ----
  		out_uint16_le(s, 2);
  		out_uint16_le(s, len_ip + 2);	/* Length of client ip */
! 		rdp_out_unistr(s, ipaddr, len_ip);
  		out_uint16_le(s, len_dll + 2);
  		rdp_out_unistr(s, "C:\\WINNT\\System32\\mstscax.dll", len_dll);
***************
*** 277,281 ****
  		out_uint8s(s, 62 - 2 * strlen("GTB, normaltid"));
  
- 
  		out_uint32_le(s, 0x0a0000);
  		out_uint32_le(s, 0x050000);
--- 283,286 ----
***************
*** 866,873 ****
  {
  	uint8 data_pdu_type;
  
! 	in_uint8s(s, 8);	/* shareid, pad, streamid, length */
  	in_uint8(s, data_pdu_type);
! 	in_uint8s(s, 3);	/* compress_type, compress_len */
  
  	switch (data_pdu_type)
--- 871,912 ----
  {
  	uint8 data_pdu_type;
+ 	uint8 ctype;
+ 	uint16 clen;
+ 	int roff, rlen, len, ret;
+ 	static struct stream ns;
+ 	static signed char *dict = 0;
  
! 	in_uint8s(s, 6);	/* shareid, pad, streamid */
! 	in_uint16(s, len);
  	in_uint8(s, data_pdu_type);
! 	in_uint8(s, ctype);
! 	in_uint16(s, clen);
! 	clen -= 18;
! 
! #if 0
! 	if (ctype & 0x20)
! 	{
! 		if (!dict)
! 		{
! 			dict = (signed char *) malloc(8200 * sizeof(signed char));
! 			dict = (signed char *) memset(dict, 0, 8200 * sizeof(signed char));
! 		}
! 
! 		ret = decompress(s->p, clen, ctype, (signed char *) dict, &roff, &rlen);
! 
! 		len -= 18;
! 
! 		ns.data = xrealloc(ns.data, len);
! 
! 		ns.data = (unsigned char *) memcpy(ns.data, (unsigned char *) (dict + roff), len);
! 
! 		ns.size = len;
! 		ns.end = ns.data + ns.size;
! 		ns.p = ns.data;
! 		ns.rdp_hdr = ns.p;
! 
! 		s = &ns;
! 	}
! #endif
  
  	switch (data_pdu_type)



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.