xrdp/sesman/chansrv/chansrv.h

79 lines
2.0 KiB
C
Raw Normal View History

2012-07-25 10:16:00 +08:00
/**
* xrdp: A Remote Desktop Protocol server.
*
* Copyright (C) Jay Sorg 2009-2012
*
* 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-20 01:16:46 +08:00
#if !defined(CHANSRV_H)
#define CHANSRV_H
#include "arch.h"
#include "parse.h"
2012-08-20 10:45:31 +08:00
#include "log.h"
2009-04-20 01:16:46 +08:00
2012-08-20 10:45:31 +08:00
struct chan_out_data
{
struct stream* s;
struct chan_out_data* next;
};
2009-04-20 01:16:46 +08:00
struct chan_item
{
int id;
int flags;
char name[16];
2012-08-20 10:45:31 +08:00
struct chan_out_data* head;
struct chan_out_data* tail;
2009-04-20 01:16:46 +08:00
};
int APP_CC
send_channel_data(int chan_id, char* data, int size);
2009-09-02 10:52:30 +08:00
int APP_CC
main_cleanup(void);
2009-04-20 01:16:46 +08:00
2009-09-02 10:52:30 +08:00
#define LOG_LEVEL 5
2009-08-27 10:15:49 +08:00
#define LOG(_a, _params) \
{ \
if (_a < LOG_LEVEL) \
{ \
2010-08-16 12:05:03 +08:00
g_write("xrdp-chansrv [%10.10u]: ", g_time3()); \
2009-08-27 10:15:49 +08:00
g_writeln _params ; \
} \
}
#define LOGM(_args) do { log_message _args ; } while (0)
2012-08-09 13:21:32 +08:00
#ifndef GSET_UINT8
#define GSET_UINT8(_ptr, _offset, _data) \
*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))) = (unsigned char)(_data)
#define GGET_UINT8(_ptr, _offset) \
(*((unsigned char*) (((unsigned char*)(_ptr)) + (_offset))))
#define GSET_UINT16(_ptr, _offset, _data) \
GSET_UINT8(_ptr, _offset, _data); \
GSET_UINT8(_ptr, (_offset) + 1, (_data) >> 8)
#define GGET_UINT16(_ptr, _offset) \
(GGET_UINT8(_ptr, _offset)) | \
((GGET_UINT8(_ptr, (_offset) + 1)) << 8)
#define GSET_UINT32(_ptr, _offset, _data) \
GSET_UINT16(_ptr, _offset, _data); \
GSET_UINT16(_ptr, (_offset) + 2, (_data) >> 16)
#define GGET_UINT32(_ptr, _offset) \
(GGET_UINT16(_ptr, _offset)) | \
((GGET_UINT16(_ptr, (_offset) + 2)) << 16)
#endif
2009-04-20 01:16:46 +08:00
#endif