Handle MCS_CONNECT_INITIAL.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:29:40 +0000 (23:29 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:29:40 +0000 (23:29 +0000)
mcs.c
proto.h
rdpsrv.c

diff --git a/mcs.c b/mcs.c
index ac8148b..a9fb3d2 100644 (file)
--- a/mcs.c
+++ b/mcs.c
@@ -147,46 +147,37 @@ mcs_send_connect_initial(STREAM mcs_data)
 }
 
 /* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */
-static BOOL
-mcs_recv_connect_response(STREAM mcs_data)
+BOOL
+mcs_recv_connect_initial()
 {
        uint8 result;
        int length;
        STREAM s;
+       char *buf;
 
        s = iso_recv();
        if (s == NULL)
                return False;
 
-       ber_parse_header(s, MCS_CONNECT_RESPONSE, &length);
-
-       ber_parse_header(s, BER_TAG_RESULT, &length);
+       ber_parse_header(s, MCS_CONNECT_INITIAL, &length);
+       printf("parsing MCS_CONNECT_INITIAL (len=%u)\n", length);
+       ber_parse_header(s, BER_TAG_OCTET_STRING, &length);   /* calling domain */
+       in_uint8(s, result);
+       ber_parse_header(s, BER_TAG_OCTET_STRING, &length);   /* called domain */
+       in_uint8(s, result);
+       
+       ber_parse_header(s, BER_TAG_BOOLEAN, &length);
        in_uint8(s, result);
-       if (result != 0)
-       {
-               error("MCS connect: %d\n", result);
-               return False;
-       }
 
-       ber_parse_header(s, BER_TAG_INTEGER, &length);
-       in_uint8s(s, length);   /* connect id */
+       mcs_parse_domain_params(s);
+       mcs_parse_domain_params(s);
        mcs_parse_domain_params(s);
 
        ber_parse_header(s, BER_TAG_OCTET_STRING, &length);
+       in_uint8p(s, buf, length);
 
-       sec_process_mcs_data(s);
-       /*
-          if (length > mcs_data->size)
-          {
-          error("MCS data length %d, expected %d\n", length,
-          mcs_data->size);
-          length = mcs_data->size;
-          }
-
-          in_uint8a(s, mcs_data->data, length);
-          mcs_data->p = mcs_data->data;
-          mcs_data->end = mcs_data->data + length;
-        */
+       printf("Data from MCS connect: '%*s'\n", length, buf);
+       
        return s_check_end(s);
 }
 
diff --git a/proto.h b/proto.h
index 97a628b..3fc91a5 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -38,6 +38,7 @@ void iso_disconnect(void);
 void licence_process(STREAM s);
 /* mcs.c */
 STREAM mcs_init(int length);
+BOOL mcs_recv_connect_initial();
 void mcs_send_to_channel(STREAM s, uint16 channel);
 void mcs_send(STREAM s);
 STREAM mcs_recv(uint16 * channel);
index 561a2e4..e321ba6 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -61,6 +61,8 @@ int create_server_socket()
 
 int serve_client()
 {
+       mcs_recv_connect_initial();
+       
        for ( ;; ) {
                short channel;