/[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 24 by matty, Sat Jan 6 03:12:10 2001 UTC revision 25 by matty, Sat Jan 6 03:47:04 2001 UTC
# Line 23  Line 23 
23  uint16 mcs_userid;  uint16 mcs_userid;
24    
25  /* Parse an ASN.1 BER header */  /* Parse an ASN.1 BER header */
26  static BOOL ber_parse_header(STREAM s, int tagval, int *length)  static BOOL
27    ber_parse_header(STREAM s, int tagval, int *length)
28  {  {
29          int tag, len;          int tag, len;
30    
# Line 57  static BOOL ber_parse_header(STREAM s, i Line 58  static BOOL ber_parse_header(STREAM s, i
58  }  }
59    
60  /* Output an ASN.1 BER header */  /* Output an ASN.1 BER header */
61  static void ber_out_header(STREAM s, int tagval, int length)  static void
62    ber_out_header(STREAM s, int tagval, int length)
63  {  {
64          if (tagval > 0xff)          if (tagval > 0xff)
65          {          {
# Line 78  static void ber_out_header(STREAM s, int Line 80  static void ber_out_header(STREAM s, int
80  }  }
81    
82  /* Output an ASN.1 BER integer */  /* Output an ASN.1 BER integer */
83  static void ber_out_integer(STREAM s, int value)  static void
84    ber_out_integer(STREAM s, int value)
85  {  {
86          ber_out_header(s, BER_TAG_INTEGER, 2);          ber_out_header(s, BER_TAG_INTEGER, 2);
87          out_uint16_be(s, value);          out_uint16_be(s, value);
88  }  }
89    
90  /* Output a DOMAIN_PARAMS structure (ASN.1 BER) */  /* Output a DOMAIN_PARAMS structure (ASN.1 BER) */
91  static void mcs_out_domain_params(STREAM s, int max_channels, int max_users,  static void
92                                    int max_tokens, int max_pdusize)  mcs_out_domain_params(STREAM s, int max_channels, int max_users,
93                          int max_tokens, int max_pdusize)
94  {  {
95          ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32);          ber_out_header(s, MCS_TAG_DOMAIN_PARAMS, 32);
96          ber_out_integer(s, max_channels);          ber_out_integer(s, max_channels);
# Line 100  static void mcs_out_domain_params(STREAM Line 104  static void mcs_out_domain_params(STREAM
104  }  }
105    
106  /* Parse a DOMAIN_PARAMS structure (ASN.1 BER) */  /* Parse a DOMAIN_PARAMS structure (ASN.1 BER) */
107  static BOOL mcs_parse_domain_params(STREAM s)  static BOOL
108    mcs_parse_domain_params(STREAM s)
109  {  {
110          int length;          int length;
111    
# Line 111  static BOOL mcs_parse_domain_params(STRE Line 116  static BOOL mcs_parse_domain_params(STRE
116  }  }
117    
118  /* Send an MCS_CONNECT_INITIAL message (ASN.1 BER) */  /* Send an MCS_CONNECT_INITIAL message (ASN.1 BER) */
119  static void mcs_send_connect_initial(STREAM mcs_data)  static void
120    mcs_send_connect_initial(STREAM mcs_data)
121  {  {
122          int datalen = mcs_data->end - mcs_data->data;          int datalen = mcs_data->end - mcs_data->data;
123          int length = 7 + 3 * 34 + 4 + datalen;          int length = 7 + 3 * 34 + 4 + datalen;
# Line 138  static void mcs_send_connect_initial(STR Line 144  static void mcs_send_connect_initial(STR
144  }  }
145    
146  /* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */  /* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */
147  static BOOL mcs_recv_connect_response(STREAM mcs_data)  static BOOL
148    mcs_recv_connect_response(STREAM mcs_data)
149  {  {
150          uint8 result;          uint8 result;
151          int length;          int length;
# Line 177  static BOOL mcs_recv_connect_response(ST Line 184  static BOOL mcs_recv_connect_response(ST
184  }  }
185    
186  /* Send an EDrq message (ASN.1 PER) */  /* Send an EDrq message (ASN.1 PER) */
187  static void mcs_send_edrq()  static void
188    mcs_send_edrq()
189  {  {
190          STREAM s;          STREAM s;
191    
# Line 192  static void mcs_send_edrq() Line 200  static void mcs_send_edrq()
200  }  }
201    
202  /* Send an AUrq message (ASN.1 PER) */  /* Send an AUrq message (ASN.1 PER) */
203  static void mcs_send_aurq()  static void
204    mcs_send_aurq()
205  {  {
206          STREAM s;          STREAM s;
207    
# Line 205  static void mcs_send_aurq() Line 214  static void mcs_send_aurq()
214  }  }
215    
216  /* Expect a AUcf message (ASN.1 PER) */  /* Expect a AUcf message (ASN.1 PER) */
217  static BOOL mcs_recv_aucf(uint16 *mcs_userid)  static BOOL
218    mcs_recv_aucf(uint16 *mcs_userid)
219  {  {
220          uint8 opcode, result;          uint8 opcode, result;
221          STREAM s;          STREAM s;
# Line 235  static BOOL mcs_recv_aucf(uint16 *mcs_us Line 245  static BOOL mcs_recv_aucf(uint16 *mcs_us
245  }  }
246    
247  /* Send a CJrq message (ASN.1 PER) */  /* Send a CJrq message (ASN.1 PER) */
248  static void mcs_send_cjrq(uint16 chanid)  static void
249    mcs_send_cjrq(uint16 chanid)
250  {  {
251          STREAM s;          STREAM s;
252    
# Line 250  static void mcs_send_cjrq(uint16 chanid) Line 261  static void mcs_send_cjrq(uint16 chanid)
261  }  }
262    
263  /* Expect a CJcf message (ASN.1 PER) */  /* Expect a CJcf message (ASN.1 PER) */
264  static BOOL mcs_recv_cjcf()  static BOOL
265    mcs_recv_cjcf()
266  {  {
267          uint8 opcode, result;          uint8 opcode, result;
268          STREAM s;          STREAM s;
# Line 281  static BOOL mcs_recv_cjcf() Line 293  static BOOL mcs_recv_cjcf()
293  }  }
294    
295  /* Initialise an MCS transport data packet */  /* Initialise an MCS transport data packet */
296  STREAM mcs_init(int length)  STREAM
297    mcs_init(int length)
298  {  {
299          STREAM s;          STREAM s;
300    
# Line 292  STREAM mcs_init(int length) Line 305  STREAM mcs_init(int length)
305  }  }
306    
307  /* Send an MCS transport data packet */  /* Send an MCS transport data packet */
308  void mcs_send(STREAM s)  void
309    mcs_send(STREAM s)
310  {  {
311          uint16 length;          uint16 length;
312    
# Line 310  void mcs_send(STREAM s) Line 324  void mcs_send(STREAM s)
324  }  }
325    
326  /* Receive an MCS transport data packet */  /* Receive an MCS transport data packet */
327  STREAM mcs_recv()  STREAM
328    mcs_recv()
329  {  {
330          uint8 opcode, appid, length;          uint8 opcode, appid, length;
331          STREAM s;          STREAM s;
# Line 339  STREAM mcs_recv() Line 354  STREAM mcs_recv()
354  }  }
355    
356  /* Establish a connection up to the MCS layer */  /* Establish a connection up to the MCS layer */
357  BOOL mcs_connect(char *server, STREAM mcs_data)  BOOL
358    mcs_connect(char *server, STREAM mcs_data)
359  {  {
360          if (!iso_connect(server))          if (!iso_connect(server))
361                  return False;                  return False;
# Line 370  BOOL mcs_connect(char *server, STREAM mc Line 386  BOOL mcs_connect(char *server, STREAM mc
386  }  }
387    
388  /* Disconnect from the MCS layer */  /* Disconnect from the MCS layer */
389  void mcs_disconnect()  void
390    mcs_disconnect()
391  {  {
392          iso_disconnect();          iso_disconnect();
393  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26