libfreerdp-core: implement vchan_process.

This commit is contained in:
Vic Lee 2011-08-03 11:00:56 +08:00
parent adef5dca87
commit 1046141cf2
5 changed files with 29 additions and 1 deletions

View File

@ -65,6 +65,11 @@ boolean freerdp_check_fds(freerdp* instance)
return True; return True;
} }
static int freerdp_send_channel_data(freerdp* instance, int channel_id, uint8* data, int size)
{
return rdp_send_channel_data(instance->rdp, channel_id, data, size);
}
freerdp* freerdp_new() freerdp* freerdp_new()
{ {
freerdp* instance; freerdp* instance;
@ -82,6 +87,7 @@ freerdp* freerdp_new()
instance->Connect = freerdp_connect; instance->Connect = freerdp_connect;
instance->GetFileDescriptor = freerdp_get_fds; instance->GetFileDescriptor = freerdp_get_fds;
instance->CheckFileDescriptor = freerdp_check_fds; instance->CheckFileDescriptor = freerdp_check_fds;
instance->SendChannelData = freerdp_send_channel_data;
} }
return instance; return instance;

View File

@ -448,6 +448,11 @@ static int rdp_recv_callback(rdpTransport* transport, STREAM* s, void* extra)
return 1; return 1;
} }
int rdp_send_channel_data(rdpRdp* rdp, int channel_id, uint8* data, int size)
{
return vchan_send(rdp->vchan, channel_id, data, size);
}
/** /**
* Set non-blocking mode information. * Set non-blocking mode information.
* @param rdp RDP module * @param rdp RDP module

View File

@ -238,6 +238,8 @@ void rdp_send_data_pdu(rdpRdp* rdp, STREAM* s, uint16 type, uint16 channel_id);
void rdp_send(rdpRdp* rdp, STREAM* s); void rdp_send(rdpRdp* rdp, STREAM* s);
void rdp_recv(rdpRdp* rdp); void rdp_recv(rdpRdp* rdp);
int rdp_send_channel_data(rdpRdp* rdp, int channel_id, uint8* data, int size);
void rdp_set_blocking_mode(rdpRdp* rdp, boolean blocking); void rdp_set_blocking_mode(rdpRdp* rdp, boolean blocking);
int rdp_check_fds(rdpRdp* rdp); int rdp_check_fds(rdpRdp* rdp);

View File

@ -26,9 +26,23 @@
#include "vchan.h" #include "vchan.h"
int vchan_send(rdpVchan* vchan, uint16 channel_id, uint8* data, int size)
{
printf("vchan_send\n");
}
void vchan_process(rdpVchan* vchan, STREAM* s, uint16 channel_id) void vchan_process(rdpVchan* vchan, STREAM* s, uint16 channel_id)
{ {
printf("vchan_process\n"); uint32 length;
uint32 flags;
int chunk_length;
stream_read_uint32(s, length);
stream_read_uint32(s, flags);
chunk_length = stream_get_left(s);
IFCALL(vchan->instance->ReceiveChannelData, vchan->instance,
channel_id, stream_get_tail(s), chunk_length, flags, length);
} }
rdpVchan* vchan_new(freerdp* instance) rdpVchan* vchan_new(freerdp* instance)

View File

@ -26,6 +26,7 @@ struct rdp_vchan
}; };
typedef struct rdp_vchan rdpVchan; typedef struct rdp_vchan rdpVchan;
int vchan_send(rdpVchan* vchan, uint16 channel_id, uint8* data, int size);
void vchan_process(rdpVchan* vchan, STREAM* s, uint16 channel_id); void vchan_process(rdpVchan* vchan, STREAM* s, uint16 channel_id);
rdpVchan* vchan_new(freerdp* instance); rdpVchan* vchan_new(freerdp* instance);