X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=blobdiff_plain;f=iso.c;h=a098ad5f50826b3e566cf3d849a62816a5488105;hp=9a343ad207f5dce2282a9fded81b85776be1af42;hb=99f2e8c32508ab193c1d42221c86cb7fca4be9ab;hpb=4539b581a53654e64fb3c6d0de04ff31d035b81f diff --git a/iso.c b/iso.c index 9a343ad..a098ad5 100644 --- a/iso.c +++ b/iso.c @@ -22,7 +22,7 @@ /* Send a self-contained ISO PDU */ static void -iso_send_msg(uint8 code) +iso_send_msg(uint8 code, uint8 class) { STREAM s; @@ -34,9 +34,9 @@ iso_send_msg(uint8 code) out_uint8(s, 6); /* hdrlen */ out_uint8(s, code); - out_uint16(s, 0); /* dst_ref */ - out_uint16(s, 0); /* src_ref */ - out_uint8(s, 0); /* class */ + out_uint16(s, 0); /* dst_ref */ + out_uint16_be(s, 0x1234); /* src_ref */ + out_uint8(s, class); /* class */ s_mark_end(s); tcp_send(s); @@ -111,10 +111,8 @@ iso_recv_msg(uint8 * code) if ((version & 3) == 0) { - // FIXME :-) - // rdp5_process(s, version & 0x80); - printf("rdp5_process()\n"); - goto next_packet; + rdp5_process(s, version & 0x80); + return NULL; } in_uint8s(s, 1); /* hdrlen */ @@ -182,10 +180,34 @@ iso_recv(void) return s; } +BOOL +iso_recv_connect(int server_sock) +{ + STREAM s, t; + uint8 code; + + tcp_recv_connect(server_sock); + + s = iso_recv_msg(&code); + if (s == NULL) + return 0; + + if (code != ISO_PDU_CR) + { + error("expected CR, got 0x%x\n", code); + return 0; + } + + DEBUG(("Got ISO connection request\n")); + + iso_send_msg(ISO_PDU_CC, 0); + return 1; +} + /* Disconnect from the ISO layer */ void iso_disconnect(void) { - iso_send_msg(ISO_PDU_DR); + iso_send_msg(ISO_PDU_DR, 0); tcp_disconnect(); }