xrdp/sesman/chansrv/chansrv.h

83 lines
2.5 KiB
C
Raw Normal View History

2012-07-25 06:16:00 +04:00
/**
* xrdp: A Remote Desktop Protocol server.
*
2013-09-08 10:54:36 +04:00
* Copyright (C) Jay Sorg 2009-2013
* Copyright (C) Laxmikant Rashinkar 2009-2013
2012-07-25 06:16:00 +04:00
*
* 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.
*/
2009-04-19 21:16:46 +04:00
#if !defined(CHANSRV_H)
#define CHANSRV_H
#include "arch.h"
#include "parse.h"
2012-08-20 06:45:31 +04:00
#include "log.h"
2009-04-19 21:16:46 +04:00
struct chan_item
{
int id;
int flags;
char name[16];
2009-04-19 21:16:46 +04:00
};
2017-03-12 19:35:00 +03:00
int
g_is_term(void);
int send_channel_data(int chan_id, const char *data, int size);
2021-05-08 19:58:11 +03:00
int send_rail_drawing_orders(char *data, int size);
2017-03-12 19:35:00 +03:00
int main_cleanup(void);
2021-05-08 19:58:11 +03:00
int add_timeout(int msoffset, void (*callback)(void *data), void *data);
2009-04-19 21:16:46 +04:00
2012-08-09 09:21:32 +04:00
#ifndef GSET_UINT8
#define GSET_UINT8(_ptr, _offset, _data) \
*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))) = (unsigned char)(_data)
2012-08-09 09:21:32 +04:00
#define GGET_UINT8(_ptr, _offset) \
(*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))))
2012-08-09 09:21:32 +04:00
#define GSET_UINT16(_ptr, _offset, _data) \
GSET_UINT8(_ptr, _offset, _data); \
GSET_UINT8(_ptr, (_offset) + 1, (_data) >> 8)
2012-08-09 09:21:32 +04:00
#define GGET_UINT16(_ptr, _offset) \
(GGET_UINT8(_ptr, _offset)) | \
((GGET_UINT8(_ptr, (_offset) + 1)) << 8)
2012-08-09 09:21:32 +04:00
#define GSET_UINT32(_ptr, _offset, _data) \
GSET_UINT16(_ptr, _offset, _data); \
GSET_UINT16(_ptr, (_offset) + 2, (_data) >> 16)
2012-08-09 09:21:32 +04:00
#define GGET_UINT32(_ptr, _offset) \
(GGET_UINT16(_ptr, _offset)) | \
((GGET_UINT16(_ptr, (_offset) + 2)) << 16)
2012-08-09 09:21:32 +04:00
#endif
struct chansrv_drdynvc_procs
{
int (*open_response)(int chan_id, int creation_status);
int (*close_response)(int chan_id);
int (*data_first)(int chan_id, char *data, int bytes, int total_bytes);
int (*data)(int chan_id, char *data, int bytes);
};
int
chansrv_drdynvc_open(const char *name, int flags,
struct chansrv_drdynvc_procs *procs, int *chan_id);
int
chansrv_drdynvc_close(int chan_id);
int
chansrv_drdynvc_data_first(int chan_id, const char *data, int data_bytes,
int total_data_bytes);
int
chansrv_drdynvc_data(int chan_id, const char *data, int data_bytes);
int
chansrv_drdynvc_send_data(int chan_id, const char *data, int data_bytes);
2009-04-19 21:16:46 +04:00
#endif