FreeRDP
mcs.c File Reference
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/assert.h>
#include <freerdp/log.h>
#include "gcc.h"
#include "mcs.h"
#include "tpdu.h"
#include "tpkt.h"
#include "client.h"
#include "connection.h"

Macros

#define TAG   FREERDP_TAG("core")
 

Functions

const char * mcs_domain_pdu_string (DomainMCSPDU pdu)
 
static BOOL mcs_merge_domain_parameters (DomainParameters *targetParameters, DomainParameters *minimumParameters, DomainParameters *maximumParameters, DomainParameters *pOutParameters)
 
static BOOL mcs_write_connect_initial (wStream *s, rdpMcs *mcs, wStream *userData)
 
static BOOL mcs_write_connect_response (wStream *s, rdpMcs *mcs, wStream *userData)
 
static BOOL mcs_read_domain_mcspdu_header (wStream *s, DomainMCSPDU domainMCSPDU, UINT16 *length, DomainMCSPDU *actual)
 
static int mcs_initialize_client_channels (rdpMcs *mcs, const rdpSettings *settings)
 
BOOL mcs_write_domain_mcspdu_header (wStream *s, DomainMCSPDU domainMCSPDU, UINT16 length, BYTE options)
 
static BOOL mcs_init_domain_parameters (DomainParameters *domainParameters, UINT32 maxChannelIds, UINT32 maxUserIds, UINT32 maxTokenIds, UINT32 maxMCSPDUsize)
 
static BOOL mcs_read_domain_parameters (wStream *s, DomainParameters *domainParameters)
 
static BOOL mcs_write_domain_parameters (wStream *s, DomainParameters *domainParameters)
 
BOOL mcs_recv_connect_initial (rdpMcs *mcs, wStream *s)
 
static BOOL mcs_send_connect_initial (rdpMcs *mcs)
 
BOOL mcs_recv_connect_response (rdpMcs *mcs, wStream *s)
 
BOOL mcs_send_connect_response (rdpMcs *mcs)
 
BOOL mcs_recv_erect_domain_request (rdpMcs *mcs, wStream *s)
 
BOOL mcs_send_erect_domain_request (rdpMcs *mcs)
 
BOOL mcs_recv_attach_user_request (rdpMcs *mcs, wStream *s)
 
BOOL mcs_send_attach_user_request (rdpMcs *mcs)
 
BOOL mcs_recv_attach_user_confirm (rdpMcs *mcs, wStream *s)
 
BOOL mcs_send_attach_user_confirm (rdpMcs *mcs)
 
BOOL mcs_recv_channel_join_request (rdpMcs *mcs, const rdpSettings *settings, wStream *s, UINT16 *channelId)
 
BOOL mcs_send_channel_join_request (rdpMcs *mcs, UINT16 channelId)
 
BOOL mcs_recv_channel_join_confirm (rdpMcs *mcs, wStream *s, UINT16 *channelId)
 
BOOL mcs_send_channel_join_confirm (rdpMcs *mcs, UINT16 channelId)
 
BOOL mcs_recv_disconnect_provider_ultimatum (rdpMcs *mcs, wStream *s, int *reason)
 
BOOL mcs_send_disconnect_provider_ultimatum (rdpMcs *mcs)
 
BOOL mcs_client_begin (rdpMcs *mcs)
 
rdpMcs * mcs_new (rdpTransport *transport)
 
void mcs_free (rdpMcs *mcs)
 
BOOL mcs_server_apply_to_settings (const rdpMcs *mcs, rdpSettings *settings)
 

Variables

static const BYTE callingDomainSelector [1] = "\x01"
 
static const BYTE calledDomainSelector [1] = "\x01"
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("core")

FreeRDP: A Remote Desktop Protocol Implementation T.125 Multipoint Communication Service (MCS) Protocol

Copyright 2011 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2015 Thincast Technologies GmbH Copyright 2015 DI (FH) Martin Haimberger marti.nosp@m.n.ha.nosp@m.imber.nosp@m.ger@.nosp@m.thinc.nosp@m.ast..nosp@m.com Copyright 2017 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2017 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ mcs_client_begin()

BOOL mcs_client_begin ( rdpMcs *  mcs)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_domain_pdu_string()

const char* mcs_domain_pdu_string ( DomainMCSPDU  pdu)
Here is the caller graph for this function:

◆ mcs_free()

void mcs_free ( rdpMcs *  mcs)

Free MCS module.

Parameters
mcsMCS module to be freed
Here is the caller graph for this function:

◆ mcs_init_domain_parameters()

static BOOL mcs_init_domain_parameters ( DomainParameters domainParameters,
UINT32  maxChannelIds,
UINT32  maxUserIds,
UINT32  maxTokenIds,
UINT32  maxMCSPDUsize 
)
static

Initialize MCS Domain Parameters.

Parameters
domainParametersdomain parameters
maxChannelIdsmax channel ids
maxUserIdsmax user ids
maxTokenIdsmax token ids
maxMCSPDUsizemax MCS PDU size
Here is the caller graph for this function:

◆ mcs_initialize_client_channels()

static int mcs_initialize_client_channels ( rdpMcs *  mcs,
const rdpSettings *  settings 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_merge_domain_parameters()

BOOL mcs_merge_domain_parameters ( DomainParameters targetParameters,
DomainParameters minimumParameters,
DomainParameters maximumParameters,
DomainParameters pOutParameters 
)
static

Merge MCS Domain Parameters.

Parameters
targetParameterstarget parameters
minimumParametersminimum parameters
maximumParametersmaximum parameters
pOutParametersoutput parameters
Returns
TRUE for success, FALSE otherwise
Here is the caller graph for this function:

◆ mcs_new()

rdpMcs* mcs_new ( rdpTransport *  transport)

Instantiate new MCS module.

Parameters
transporttransport
Returns
new MCS module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_read_domain_mcspdu_header()

BOOL mcs_read_domain_mcspdu_header ( wStream s,
DomainMCSPDU  domainMCSPDU,
UINT16 length,
DomainMCSPDU actual 
)
static

Read a DomainMCSPDU header.

Parameters
sstream
domainMCSPDUDomainMCSPDU type
lengthTPKT length
Returns
TRUE for success, FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_read_domain_parameters()

static BOOL mcs_read_domain_parameters ( wStream s,
DomainParameters domainParameters 
)
static

Read MCS Domain Parameters.

Parameters
sstream
domainParametersdomain parameters
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_attach_user_confirm()

BOOL mcs_recv_attach_user_confirm ( rdpMcs *  mcs,
wStream s 
)

Read MCS Attach User Confirm. msdn{cc240525}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_attach_user_request()

BOOL mcs_recv_attach_user_request ( rdpMcs *  mcs,
wStream s 
)

Read MCS Attach User Request. msdn{cc240524}

Parameters
mcsmcs module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_channel_join_confirm()

BOOL mcs_recv_channel_join_confirm ( rdpMcs *  mcs,
wStream s,
UINT16 channelId 
)

Read MCS Channel Join Confirm. msdn{cc240527}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_channel_join_request()

BOOL mcs_recv_channel_join_request ( rdpMcs *  mcs,
const rdpSettings *  settings,
wStream s,
UINT16 channelId 
)

Read MCS Channel Join Request. msdn{cc240526}

Parameters
mcsmcs module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_connect_initial()

BOOL mcs_recv_connect_initial ( rdpMcs *  mcs,
wStream s 
)

Read an MCS Connect Initial PDU. msdn{cc240508}

Parameters
mcsMCS module
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_connect_response()

BOOL mcs_recv_connect_response ( rdpMcs *  mcs,
wStream s 
)

Read MCS Connect Response. msdn{cc240501}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_disconnect_provider_ultimatum()

BOOL mcs_recv_disconnect_provider_ultimatum ( rdpMcs *  mcs,
wStream s,
int *  reason 
)

Receive MCS Disconnect Provider Ultimatum PDU.

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_recv_erect_domain_request()

BOOL mcs_recv_erect_domain_request ( rdpMcs *  mcs,
wStream s 
)

Read MCS Erect Domain Request. msdn{cc240523}

Parameters
mcsMCS module to use
sstream
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_attach_user_confirm()

BOOL mcs_send_attach_user_confirm ( rdpMcs *  mcs)

Send MCS Attach User Confirm. msdn{cc240525}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_attach_user_request()

BOOL mcs_send_attach_user_request ( rdpMcs *  mcs)

Send MCS Attach User Request. msdn{cc240524}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_channel_join_confirm()

BOOL mcs_send_channel_join_confirm ( rdpMcs *  mcs,
UINT16  channelId 
)

Send MCS Channel Join Confirm. msdn{cc240527}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_channel_join_request()

BOOL mcs_send_channel_join_request ( rdpMcs *  mcs,
UINT16  channelId 
)

Send MCS Channel Join Request. msdn{cc240526}

Parameters
mcsmcs module
channelIdchannel id
Returns
TRUE for success, FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_connect_initial()

static BOOL mcs_send_connect_initial ( rdpMcs *  mcs)
static

Send MCS Connect Initial. msdn{cc240508}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_connect_response()

BOOL mcs_send_connect_response ( rdpMcs *  mcs)

Send MCS Connect Response. msdn{cc240501}

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_disconnect_provider_ultimatum()

BOOL mcs_send_disconnect_provider_ultimatum ( rdpMcs *  mcs)

Send MCS Disconnect Provider Ultimatum PDU.

Parameters
mcsmcs module
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_send_erect_domain_request()

BOOL mcs_send_erect_domain_request ( rdpMcs *  mcs)

Send MCS Erect Domain Request. msdn{cc240523}

Parameters
mcsMCS module to use
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_server_apply_to_settings()

BOOL mcs_server_apply_to_settings ( const rdpMcs *  mcs,
rdpSettings *  settings 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_write_connect_initial()

BOOL mcs_write_connect_initial ( wStream s,
rdpMcs *  mcs,
wStream userData 
)
static

Write an MCS Connect Initial PDU. msdn{cc240508}

Parameters
sstream
mcsMCS module
userDataGCC Conference Create Request
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_write_connect_response()

BOOL mcs_write_connect_response ( wStream s,
rdpMcs *  mcs,
wStream userData 
)
static

Write an MCS Connect Response PDU. msdn{cc240508}

Parameters
sstream
mcsMCS module
userDataGCC Conference Create Response
Returns
TRUE for success, FALSE otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_write_domain_mcspdu_header()

BOOL mcs_write_domain_mcspdu_header ( wStream s,
DomainMCSPDU  domainMCSPDU,
UINT16  length,
BYTE  options 
)

Write a DomainMCSPDU header.

Parameters
sstream
domainMCSPDUDomainMCSPDU type
lengthTPKT length
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mcs_write_domain_parameters()

static BOOL mcs_write_domain_parameters ( wStream s,
DomainParameters domainParameters 
)
static

Write MCS Domain Parameters.

Parameters
sstream
domainParametersdomain parameters
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ calledDomainSelector

const BYTE calledDomainSelector[1] = "\x01"
static

◆ callingDomainSelector

const BYTE callingDomainSelector[1] = "\x01"
static

T.125 MCS is defined in:

http://www.itu.int/rec/T-REC-T.125-199802-I/ ITU-T T.125 Multipoint Communication Service Protocol Specification Connect-Initial ::= [APPLICATION 101] IMPLICIT SEQUENCE { callingDomainSelector OCTET_STRING, calledDomainSelector OCTET_STRING, upwardFlag BOOLEAN, targetParameters DomainParameters, minimumParameters DomainParameters, maximumParameters DomainParameters, userData OCTET_STRING }

DomainParameters ::= SEQUENCE { maxChannelIds INTEGER (0..MAX), maxUserIds INTEGER (0..MAX), maxTokenIds INTEGER (0..MAX), numPriorities INTEGER (0..MAX), minThroughput INTEGER (0..MAX), maxHeight INTEGER (0..MAX), maxMCSPDUsize INTEGER (0..MAX), protocolVersion INTEGER (0..MAX) }

Connect-Response ::= [APPLICATION 102] IMPLICIT SEQUENCE { result Result, calledConnectId INTEGER (0..MAX), domainParameters DomainParameters, userData OCTET_STRING }

Result ::= ENUMERATED { rt-successful (0), rt-domain-merging (1), rt-domain-not-hierarchical (2), rt-no-such-channel (3), rt-no-such-domain (4), rt-no-such-user (5), rt-not-admitted (6), rt-other-user-id (7), rt-parameters-unacceptable (8), rt-token-not-available (9), rt-token-not-possessed (10), rt-too-many-channels (11), rt-too-many-tokens (12), rt-too-many-users (13), rt-unspecified-failure (14), rt-user-rejected (15) }

ErectDomainRequest ::= [APPLICATION 1] IMPLICIT SEQUENCE { subHeight INTEGER (0..MAX), subInterval INTEGER (0..MAX) }

AttachUserRequest ::= [APPPLICATION 10] IMPLICIT SEQUENCE { }

AttachUserConfirm ::= [APPLICATION 11] IMPLICIT SEQUENCE { result Result, initiator UserId OPTIONAL }

ChannelJoinRequest ::= [APPLICATION 14] IMPLICIT SEQUENCE { initiator UserId, channelId ChannelId }

ChannelJoinConfirm ::= [APPLICATION 15] IMPLICIT SEQUENCE { result Result, initiator UserId, requested ChannelId, channelId ChannelId OPTIONAL }

SendDataRequest ::= [APPLICATION 25] IMPLICIT SEQUENCE { initiator UserId, channelId ChannelId, dataPriority DataPriority, segmentation Segmentation, userData OCTET_STRING }

DataPriority ::= CHOICE { top NULL, high NULL, medium NULL, low NULL, ... }

Segmentation ::= BIT_STRING { begin (0), end (1) } (SIZE(2))

SendDataIndication ::= SEQUENCE { initiator UserId, channelId ChannelId, reliability BOOLEAN, domainReferenceID INTEGER (0..65535) OPTIONAL, dataPriority DataPriority, segmentation Segmentation, userData OCTET_STRING, totalDataSize INTEGER OPTIONAL, nonStandard SEQUENCE OF NonStandardParameter OPTIONAL, ... }