/[rdesktop]/sourceforge.net/branches/seamlessrdp-branch/rdesktop/rdesktop.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

Diff of /sourceforge.net/branches/seamlessrdp-branch/rdesktop/rdesktop.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by matty, Tue Oct 17 06:12:31 2000 UTC revision 24 by matty, Sat Jan 6 03:12:10 2001 UTC
# Line 18  Line 18 
18     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */  */
20    
21  #include <stdlib.h>     /* malloc realloc free */  #include <stdlib.h>             /* malloc realloc free */
22  #include <unistd.h>     /* read close getuid getgid getpid getppid gethostname */  #include <unistd.h>             /* read close getuid getgid getpid getppid gethostname */
23  #include <fcntl.h>      /* open */  #include <fcntl.h>              /* open */
24  #include <pwd.h>        /* getpwuid */  #include <pwd.h>                /* getpwuid */
25  #include <sys/stat.h>   /* stat */  #include <sys/stat.h>           /* stat */
26  #include <sys/time.h>   /* gettimeofday */  #include <sys/time.h>           /* gettimeofday */
27  #include <sys/times.h>  /* times */  #include <sys/times.h>          /* times */
28  #include "rdesktop.h"  #include "rdesktop.h"
29    
30  char username[16];  char username[16];
# Line 68  int main(int argc, char *argv[]) Line 68  int main(int argc, char *argv[])
68          int c;          int c;
69    
70          STATUS("rdesktop: A Remote Desktop Protocol client.\n");          STATUS("rdesktop: A Remote Desktop Protocol client.\n");
71          STATUS("Version "VERSION". Copyright (C) 1999-2000 Matt Chapman.\n");          STATUS("Version " VERSION
72                   ". Copyright (C) 1999-2000 Matt Chapman.\n");
73          STATUS("See http://www.rdesktop.org/ for more information.\n\n");          STATUS("See http://www.rdesktop.org/ for more information.\n\n");
74    
75          flags = RDP_LOGON_NORMAL;          flags = RDP_LOGON_NORMAL;
# Line 186  void generate_random(uint8 *random) Line 187  void generate_random(uint8 *random)
187  {  {
188          struct stat st;          struct stat st;
189          struct tms tmsbuf;          struct tms tmsbuf;
190          uint32 *r = (uint32 *)random;          uint32 *r = (uint32 *) random;
191          int fd;          int fd;
192    
193          /* If we have a kernel random device, use it. */          /* If we have a kernel random device, use it. */
# Line 200  void generate_random(uint8 *random) Line 201  void generate_random(uint8 *random)
201          /* Otherwise use whatever entropy we can gather - ideas welcome. */          /* Otherwise use whatever entropy we can gather - ideas welcome. */
202          r[0] = (getpid()) | (getppid() << 16);          r[0] = (getpid()) | (getppid() << 16);
203          r[1] = (getuid()) | (getgid() << 16);          r[1] = (getuid()) | (getgid() << 16);
204          r[2] = times(&tmsbuf); /* system uptime (clocks) */          r[2] = times(&tmsbuf);  /* system uptime (clocks) */
205          gettimeofday((struct timeval *)&r[3], NULL); /* sec and usec */          gettimeofday((struct timeval *) &r[3], NULL);   /* sec and usec */
206          stat("/tmp", &st);          stat("/tmp", &st);
207          r[5] = st.st_atime;          r[5] = st.st_atime;
208          r[6] = st.st_mtime;          r[6] = st.st_mtime;
# Line 253  void hexdump(unsigned char *p, unsigned Line 254  void hexdump(unsigned char *p, unsigned
254                          thisline = 16;                          thisline = 16;
255    
256                  for (i = 0; i < thisline; i++)                  for (i = 0; i < thisline; i++)
257                          STATUS("%02x ", line[i])                          STATUS("%02x ", line[i]) for (; i < 16; i++)
258                                    STATUS("   ");
                 for (; i < 16; i++)  
                         STATUS("   ");  
259    
260                  for (i = 0; i < thisline; i++)                  for (i = 0; i < thisline; i++)
261                          STATUS("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');                          STATUS("%c",
262                                   (line[i] >= 0x20
263                                    && line[i] < 0x7f) ? line[i] : '.');
264    
265                  STATUS("\n");                  STATUS("\n");
266                  offset += thisline;                  offset += thisline;

Legend:
Removed from v.22  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26