2005-03-19 22:16:49 +00:00
|
|
|
/* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */
|
|
|
|
|
|
|
|
#ifndef _XWRELAY_PRIV_H_
|
|
|
|
#define _XWRELAY_PRIV_H_
|
|
|
|
|
2005-07-05 21:57:00 +00:00
|
|
|
#include <time.h>
|
2007-12-01 15:00:30 +00:00
|
|
|
#include "lstnrmgr.h"
|
2009-08-21 12:00:09 +00:00
|
|
|
#include "xwrelay.h"
|
2005-07-05 21:57:00 +00:00
|
|
|
|
2009-02-28 16:15:59 +00:00
|
|
|
typedef unsigned char HostID; /* see HOST_ID_SERVER */
|
2005-03-19 22:16:49 +00:00
|
|
|
|
2005-10-02 16:08:42 +00:00
|
|
|
typedef enum {
|
2005-10-30 05:10:26 +00:00
|
|
|
XW_LOGERROR
|
|
|
|
,XW_LOGINFO
|
|
|
|
,XW_LOGVERBOSE0
|
|
|
|
,XW_LOGVERBOSE1
|
2005-10-02 16:08:42 +00:00
|
|
|
} XW_LogLevel;
|
|
|
|
|
|
|
|
void logf( XW_LogLevel level, const char* format, ... );
|
2005-03-19 22:16:49 +00:00
|
|
|
|
2009-12-04 08:03:27 +00:00
|
|
|
void denyConnection( int socket, XWREASON err );
|
2008-12-30 05:13:30 +00:00
|
|
|
bool send_with_length_unsafe( int socket, unsigned char* buf, int bufLen );
|
2005-07-06 01:36:52 +00:00
|
|
|
|
2009-03-10 12:52:17 +00:00
|
|
|
time_t uptime(void);
|
2005-06-23 04:26:44 +00:00
|
|
|
|
2010-10-04 20:03:00 -07:00
|
|
|
void blockSignals( void ); /* call from all but main thread */
|
|
|
|
|
2009-07-29 04:25:21 +00:00
|
|
|
int GetNSpawns(void);
|
|
|
|
|
2007-12-01 15:00:30 +00:00
|
|
|
int make_socket( unsigned long addr, unsigned short port );
|
|
|
|
|
2010-09-21 06:38:43 -07:00
|
|
|
int read_packet( int sock, unsigned char* buf, int buflen );
|
|
|
|
|
2009-08-21 12:00:09 +00:00
|
|
|
const char* cmdToStr( XWRELAY_Cmd cmd );
|
|
|
|
|
2007-12-01 15:00:30 +00:00
|
|
|
extern class ListenerMgr g_listeners;
|
|
|
|
|
2005-03-19 22:16:49 +00:00
|
|
|
#endif
|