]> git.sesse.net Git - rdpsrv/commitdiff
First implementation of MCS_CONNECT_RESPONSE (send error for now)
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:42:56 +0000 (23:42 +0000)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Thu, 3 Feb 2005 23:42:56 +0000 (23:42 +0000)
mcs.c
proto.h
rdpsrv.c

diff --git a/mcs.c b/mcs.c
index a9fb3d261bd2955635e1f5bf3bf783fc57217fe7..24a2e767166ccd35b0630c376562ea7ac99cdad6 100644 (file)
--- a/mcs.c
+++ b/mcs.c
@@ -116,36 +116,6 @@ mcs_parse_domain_params(STREAM s)
        return s_check(s);
 }
 
-/* Send an MCS_CONNECT_INITIAL message (ASN.1 BER) */
-static void
-mcs_send_connect_initial(STREAM mcs_data)
-{
-       int datalen = mcs_data->end - mcs_data->data;
-       int length = 9 + 3 * 34 + 4 + datalen;
-       STREAM s;
-
-       s = iso_init(length + 5);
-
-       ber_out_header(s, MCS_CONNECT_INITIAL, length);
-       ber_out_header(s, BER_TAG_OCTET_STRING, 1);     /* calling domain */
-       out_uint8(s, 1);
-       ber_out_header(s, BER_TAG_OCTET_STRING, 1);     /* called domain */
-       out_uint8(s, 1);
-
-       ber_out_header(s, BER_TAG_BOOLEAN, 1);
-       out_uint8(s, 0xff);     /* upward flag */
-
-       mcs_out_domain_params(s, 34, 2, 0, 0xffff);     /* target params */
-       mcs_out_domain_params(s, 1, 1, 1, 0x420);       /* min params */
-       mcs_out_domain_params(s, 0xffff, 0xfc17, 0xffff, 0xffff);       /* max params */
-
-       ber_out_header(s, BER_TAG_OCTET_STRING, datalen);
-       out_uint8p(s, mcs_data->data, datalen);
-
-       s_mark_end(s);
-       iso_send(s);
-}
-
 /* Expect a MCS_CONNECT_RESPONSE message (ASN.1 BER) */
 BOOL
 mcs_recv_connect_initial()
@@ -181,6 +151,22 @@ mcs_recv_connect_initial()
        return s_check_end(s);
 }
 
+void
+mcs_send_connect_response()
+{
+       STREAM s;
+
+       s = iso_init(2048);  // FIXME
+
+       ber_out_header(s, MCS_CONNECT_RESPONSE, 2048);
+       ber_out_header(s, BER_TAG_RESULT, 1);
+       out_uint8(s, 1);  // success
+       
+       s_mark_end(s);
+       iso_send(s);
+
+}
+
 /* Send an EDrq message (ASN.1 PER) */
 static void
 mcs_send_edrq(void)
diff --git a/proto.h b/proto.h
index 3fc91a5d907b944ddc94a6cb29a8ecfe2e8fc7d2..dfc9827acb4ff5ffda75988312fa7dff2b572a3b 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -39,6 +39,7 @@ void licence_process(STREAM s);
 /* mcs.c */
 STREAM mcs_init(int length);
 BOOL mcs_recv_connect_initial();
+void mcs_send_connect_response();
 void mcs_send_to_channel(STREAM s, uint16 channel);
 void mcs_send(STREAM s);
 STREAM mcs_recv(uint16 * channel);
index e321ba6342c3b8806fc57bb9f6c4bcabda2c47eb..bb5b1db4727dae82a7484d714216d1cffcff0146 100644 (file)
--- a/rdpsrv.c
+++ b/rdpsrv.c
@@ -62,6 +62,7 @@ int create_server_socket()
 int serve_client()
 {
        mcs_recv_connect_initial();
+       mcs_send_connect_response();
        
        for ( ;; ) {
                short channel;