summaryrefslogtreecommitdiffstats
path: root/sesman/tcp.c
diff options
context:
space:
mode:
authorilsimo <ilsimo>2007-03-25 21:20:20 +0000
committerilsimo <ilsimo>2007-03-25 21:20:20 +0000
commit6cbc09be53e8ee7c35cd3a281360412361ffc6ef (patch)
tree180953811c0d55e9e087660508485e989d59264d /sesman/tcp.c
parent5d29a7127bf08027d7c4b1f226505e2ee854fd3b (diff)
downloadxrdp-proprietary-6cbc09be53e8ee7c35cd3a281360412361ffc6ef.tar.gz
xrdp-proprietary-6cbc09be53e8ee7c35cd3a281360412361ffc6ef.zip
added ListenAddress configuration option
Diffstat (limited to 'sesman/tcp.c')
-rw-r--r--sesman/tcp.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/sesman/tcp.c b/sesman/tcp.c
index 36ea4670..e51fbdf9 100644
--- a/sesman/tcp.c
+++ b/sesman/tcp.c
@@ -21,12 +21,18 @@
*
* @file tcp.c
* @brief Tcp stream funcions
- * @author Jay Sorg
- *
+ * @author Jay Sorg, Simone Fedele
+ *
*/
#include "sesman.h"
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#include <string.h>
+
/*****************************************************************************/
int DEFAULT_CC
tcp_force_recv(int sck, char* data, int len)
@@ -124,3 +130,16 @@ tcp_force_send(int sck, char* data, int len)
return 0;
}
+
+/*****************************************************************************/
+int DEFAULT_CC
+tcp_bind(int sck, char* addr, char* port)
+{
+ struct sockaddr_in s;
+
+ memset(&s, 0, sizeof(struct sockaddr_in));
+ s.sin_family = AF_INET;
+ s.sin_port = htons(atoi(port));
+ s.sin_addr.s_addr = inet_addr(addr);
+ return bind(sck, (struct sockaddr*)&s, sizeof(struct sockaddr_in));
+}