From: Vic Lee Date: Tue, 2 Aug 2011 18:03:02 +0000 (+0800) Subject: libfreerdp-core: add initial vchan module. X-Git-Tag: 1.0-beta1~370^2^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=621c349df4622f80e6625673bf037f1cff8b4e27;p=platform%2Fupstream%2Ffreerdp.git libfreerdp-core: add initial vchan module. --- diff --git a/libfreerdp-core/CMakeLists.txt b/libfreerdp-core/CMakeLists.txt index b0895e0..5cfb79c 100644 --- a/libfreerdp-core/CMakeLists.txt +++ b/libfreerdp-core/CMakeLists.txt @@ -80,6 +80,8 @@ set(LIBFREERDP_CORE_SRCS transport.h update.c update.h + vchan.c + vchan.h ) add_library(freerdp-core SHARED ${LIBFREERDP_CORE_SRCS}) diff --git a/libfreerdp-core/freerdp.c b/libfreerdp-core/freerdp.c index d46c9be..24d15cd 100644 --- a/libfreerdp-core/freerdp.c +++ b/libfreerdp-core/freerdp.c @@ -73,7 +73,7 @@ freerdp* freerdp_new() if (instance != NULL) { - rdpRdp* rdp = rdp_new(); + rdpRdp* rdp = rdp_new(instance); instance->rdp = (void*) rdp; instance->input = rdp->input; instance->update = rdp->update; diff --git a/libfreerdp-core/rdp.c b/libfreerdp-core/rdp.c index 1883e39..74d1949 100644 --- a/libfreerdp-core/rdp.c +++ b/libfreerdp-core/rdp.c @@ -391,6 +391,10 @@ void rdp_process_pdu(rdpRdp* rdp, STREAM* s) } } } + else if (channelId != MCS_GLOBAL_CHANNEL_ID) + { + vchan_process(rdp->vchan, s, channelId); + } else { rdp_read_share_control_header(s, &pduLength, &pduType, &rdp->settings->pdu_source); @@ -466,7 +470,7 @@ int rdp_check_fds(rdpRdp* rdp) * @return new RDP module */ -rdpRdp* rdp_new() +rdpRdp* rdp_new(freerdp* instance) { rdpRdp* rdp; @@ -483,6 +487,7 @@ rdpRdp* rdp_new() rdp->update = update_new(rdp); rdp->nego = nego_new(rdp->transport); rdp->mcs = mcs_new(rdp->transport); + rdp->vchan = vchan_new(instance); } return rdp; @@ -503,6 +508,7 @@ void rdp_free(rdpRdp* rdp) input_free(rdp->input); update_free(rdp->update); mcs_free(rdp->mcs); + vchan_free(rdp->vchan); xfree(rdp); } } diff --git a/libfreerdp-core/rdp.h b/libfreerdp-core/rdp.h index 52b0b38..5829d16 100644 --- a/libfreerdp-core/rdp.h +++ b/libfreerdp-core/rdp.h @@ -34,6 +34,7 @@ typedef struct rdp_rdp rdpRdp; #include "transport.h" #include "connection.h" #include "capabilities.h" +#include "vchan.h" #include #include @@ -213,6 +214,7 @@ struct rdp_rdp struct rdp_settings* settings; struct rdp_registry* registry; struct rdp_transport* transport; + struct rdp_vchan* vchan; }; void rdp_read_security_header(STREAM* s, uint16* flags); @@ -239,7 +241,7 @@ void rdp_recv(rdpRdp* rdp); void rdp_set_blocking_mode(rdpRdp* rdp, boolean blocking); int rdp_check_fds(rdpRdp* rdp); -rdpRdp* rdp_new(); +rdpRdp* rdp_new(freerdp* instance); void rdp_free(rdpRdp* rdp); #endif /* __RDP_H */ diff --git a/libfreerdp-core/vchan.c b/libfreerdp-core/vchan.c new file mode 100644 index 0000000..3c2cbb1 --- /dev/null +++ b/libfreerdp-core/vchan.c @@ -0,0 +1,47 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * Virtual Channels + * + * Copyright 2011 Vic Lee + * + * 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. + */ + +#include +#include +#include +#include +#include +#include + +#include "vchan.h" + +void vchan_process(rdpVchan* vchan, STREAM* s, uint16 channel_id) +{ + printf("vchan_process\n"); +} + +rdpVchan* vchan_new(freerdp* instance) +{ + rdpVchan* vchan; + + vchan = xnew(rdpVchan); + vchan->instance = instance; + + return vchan; +} + +void vchan_free(rdpVchan* vchan) +{ + xfree(vchan); +} diff --git a/libfreerdp-core/vchan.h b/libfreerdp-core/vchan.h new file mode 100644 index 0000000..16c6d04 --- /dev/null +++ b/libfreerdp-core/vchan.h @@ -0,0 +1,34 @@ +/** + * FreeRDP: A Remote Desktop Protocol Client + * Virtual Channels + * + * Copyright 2011 Vic Lee + * + * 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. + */ + +#ifndef __VCHAN_H +#define __VCHAN_H + +struct rdp_vchan +{ + freerdp* instance; +}; +typedef struct rdp_vchan rdpVchan; + +void vchan_process(rdpVchan* vchan, STREAM* s, uint16 channel_id); + +rdpVchan* vchan_new(freerdp* instance); +void vchan_free(rdpVchan* vchan); + +#endif /* __VCHAN_H */