X-Git-Url: https://git.sesse.net/?p=rdpsrv;a=blobdiff_plain;f=mcs.c;h=f6a945a411ae7213a26e10abbbc9cfa0eedf7a1e;hp=4a8fc3fd87379284b5ff4add82e2b62f9cd42745;hb=117cf86d481308c9a3d14267d5f3b9e35f8a7d3a;hpb=3877f62cb1eaadc9389341106befc04eded5ae18 diff --git a/mcs.c b/mcs.c index 4a8fc3f..f6a945a 100644 --- a/mcs.c +++ b/mcs.c @@ -89,6 +89,14 @@ ber_out_integer(STREAM s, int value) out_uint16_be(s, value); } +static void +ber_in_integer(STREAM s, int *value) +{ + int length; + ber_parse_header(s, BER_TAG_INTEGER, &length); + in_uint16_be(s, *value); +} + /* Output a DOMAIN_PARAMS structure (ASN.1 BER) */ static void mcs_out_domain_params(STREAM s, int max_channels, int max_users, int max_tokens, int max_pdusize) @@ -109,10 +117,33 @@ static BOOL mcs_parse_domain_params(STREAM s) { int length; + int max_channels, max_users, max_tokens, max_pdusize; + int num_priorities, min_throughput, max_height; + int ver_protocol; ber_parse_header(s, MCS_TAG_DOMAIN_PARAMS, &length); - in_uint8s(s, length); - + printf("MCS_TAG_DOMAIN_PARAMS, len %u (expected 32)\n", length); + if (length == 32) { + ber_in_integer(s, &max_channels); + ber_in_integer(s, &max_users); + ber_in_integer(s, &max_tokens); + ber_in_integer(s, &num_priorities); + ber_in_integer(s, &min_throughput); + ber_in_integer(s, &max_height); + ber_in_integer(s, &max_pdusize); + ber_in_integer(s, &ver_protocol); + + printf("max_channels=%u\n", max_channels); + printf("max_users=%u\n", max_users); + printf("max_tokens=%u\n", max_tokens); + printf("num_priorities=%u\n", num_priorities); + printf("min_throughput=%u\n", min_throughput); + printf("max_pdusize=%u\n", max_pdusize); + printf("ver_protocol=%u\n", ver_protocol); + } else { + in_uint8s(s, length); + } + return s_check(s); }