}
/* 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);
}