/[rdesktop]/sourceforge.net/trunk/rdesktop/mcs.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/trunk/rdesktop/mcs.c

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

revision 409 by forsberg, Fri Jun 6 10:46:00 2003 UTC revision 828 by stargo, Sun Mar 6 21:11:18 2005 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Protocol services - Multipoint Communications Service     Protocol services - Multipoint Communications Service
4     Copyright (C) Matthew Chapman 1999-2002     Copyright (C) Matthew Chapman 1999-2005
5        
6     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 21  Line 21 
21  #include "rdesktop.h"  #include "rdesktop.h"
22    
23  uint16 g_mcs_userid;  uint16 g_mcs_userid;
24  extern BOOL use_rdp5;  extern VCHANNEL g_channels[];
25    extern unsigned int g_num_channels;
26    
27  /* Parse an ASN.1 BER header */  /* Parse an ASN.1 BER header */
28  static BOOL  static BOOL
# Line 153  mcs_recv_connect_response(STREAM mcs_dat Line 154  mcs_recv_connect_response(STREAM mcs_dat
154          int length;          int length;
155          STREAM s;          STREAM s;
156    
157          s = iso_recv();          s = iso_recv(NULL);
158          if (s == NULL)          if (s == NULL)
159                  return False;                  return False;
160    
# Line 226  mcs_recv_aucf(uint16 * mcs_userid) Line 227  mcs_recv_aucf(uint16 * mcs_userid)
227          uint8 opcode, result;          uint8 opcode, result;
228          STREAM s;          STREAM s;
229    
230          s = iso_recv();          s = iso_recv(NULL);
231          if (s == NULL)          if (s == NULL)
232                  return False;                  return False;
233    
# Line 275  mcs_recv_cjcf(void) Line 276  mcs_recv_cjcf(void)
276          uint8 opcode, result;          uint8 opcode, result;
277          STREAM s;          STREAM s;
278    
279          s = iso_recv();          s = iso_recv(NULL);
280          if (s == NULL)          if (s == NULL)
281                  return False;                  return False;
282    
# Line 340  mcs_send(STREAM s) Line 341  mcs_send(STREAM s)
341    
342  /* Receive an MCS transport data packet */  /* Receive an MCS transport data packet */
343  STREAM  STREAM
344  mcs_recv(uint16 * channel)  mcs_recv(uint16 * channel, uint8 * rdpver)
345  {  {
346          uint8 opcode, appid, length;          uint8 opcode, appid, length;
347          STREAM s;          STREAM s;
348    
349          s = iso_recv();          s = iso_recv(rdpver);
350          if (s == NULL)          if (s == NULL)
351                  return NULL;                  return NULL;
352            if (rdpver != NULL)
353                    if (*rdpver != 3)
354                            return s;
355          in_uint8(s, opcode);          in_uint8(s, opcode);
356          appid = opcode >> 2;          appid = opcode >> 2;
357          if (appid != MCS_SDIN)          if (appid != MCS_SDIN)
# Line 359  mcs_recv(uint16 * channel) Line 362  mcs_recv(uint16 * channel)
362                  }                  }
363                  return NULL;                  return NULL;
364          }          }
   
365          in_uint8s(s, 2);        /* userid */          in_uint8s(s, 2);        /* userid */
366          in_uint16_be(s, *channel);          in_uint16_be(s, *channel);
367          in_uint8s(s, 1);        /* flags */          in_uint8s(s, 1);        /* flags */
368          in_uint8(s, length);          in_uint8(s, length);
369          if (length & 0x80)          if (length & 0x80)
370                  in_uint8s(s, 1);        /* second byte of length */                  in_uint8s(s, 1);        /* second byte of length */
   
371          return s;          return s;
372  }  }
373    
# Line 374  mcs_recv(uint16 * channel) Line 375  mcs_recv(uint16 * channel)
375  BOOL  BOOL
376  mcs_connect(char *server, STREAM mcs_data, char *username)  mcs_connect(char *server, STREAM mcs_data, char *username)
377  {  {
378          uint16 num_channels, i;          unsigned int i;
379          rdp5_channel *channel;  
380          if (!iso_connect(server, username))          if (!iso_connect(server, username))
381                  return False;                  return False;
382    
# Line 398  mcs_connect(char *server, STREAM mcs_dat Line 399  mcs_connect(char *server, STREAM mcs_dat
399          if (!mcs_recv_cjcf())          if (!mcs_recv_cjcf())
400                  goto error;                  goto error;
401    
402          if (use_rdp5)          for (i = 0; i < g_num_channels; i++)
403          {          {
404                  num_channels = get_num_channels();                  mcs_send_cjrq(g_channels[i].mcs_id);
405                  for (i = 0; i < num_channels; i++)                  if (!mcs_recv_cjcf())
406                  {                          goto error;
                         channel = find_channel_by_num(i);  
                         mcs_send_cjrq(channel->channelno);  
                         if (!mcs_recv_cjcf())  
                                 goto error;  
                 }  
407          }          }
   
408          return True;          return True;
409    
410        error:        error:

Legend:
Removed from v.409  
changed lines
  Added in v.828

  ViewVC Help
Powered by ViewVC 1.1.26