From fe2e2e4b59454f1dcc23715f57b17db331ad36ff Mon Sep 17 00:00:00 2001 From: Luca Stauble Date: Sat, 4 Feb 2012 01:25:04 +0100 Subject: Add an optional parameter to specify the ip address for reverse connections For security reasons, it can be important to limit which IP addresses a LibVNCClient-based client should listen for reverse connections. This commit adds that option. To preserve binary backwards-compatibility, the field was added to the end of the rfbclient struct, and the function ListenAtTcpPort retains its signature (but calls the new ListenAtTcpPortAndAddress). [jes: shortened the commit subject, added a longer explanation in the commit body and adjusted style] Signed-off-by: Luca Stauble Signed-off-by: Johannes Schindelin --- rfb/rfbclient.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'rfb') diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index b3f2cd7..36ffe13 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -345,6 +345,9 @@ typedef struct _rfbClient { int listenSock; FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate; + + char *listenAddress; + } rfbClient; /* cursor.c */ @@ -541,6 +544,7 @@ extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n); extern rfbBool WriteToRFBServer(rfbClient* client, char *buf, int n); extern int FindFreeTcpPort(void); extern int ListenAtTcpPort(int port); +extern int ListenAtTcpPortAndAddress(int port, const char *address); extern int ConnectClientToTcpAddr(unsigned int host, int port); extern int ConnectClientToTcpAddr6(const char *hostname, int port); extern int ConnectClientToUnixSock(const char *sockFile); -- cgit v1.2.3