summaryrefslogtreecommitdiff
path: root/indra/llmessage/net.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llmessage/net.h')
-rw-r--r--indra/llmessage/net.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/llmessage/net.h b/indra/llmessage/net.h
index 9f4f5c5821..0d91cf2a2f 100644
--- a/indra/llmessage/net.h
+++ b/indra/llmessage/net.h
@@ -27,6 +27,9 @@
#ifndef LL_NET_H
#define LL_NET_H
+#include "lliosocket.h"
+#include "llapr.h"
+
class LLTimer;
class LLHost;
@@ -46,12 +49,17 @@ S32 receive_packet(int hSocket, char * receiveBuffer);
BOOL send_packet(int hSocket, const char *sendBuffer, int size, U32 recipient, int nPort); // Returns TRUE on success.
//void get_sender(char * tmp);
-LLHost get_sender();
+LLHost get_sender();
U32 get_sender_port();
U32 get_sender_ip(void);
-LLHost get_receiving_interface();
+LLHost get_receiving_interface();
U32 get_receiving_interface_ip(void);
+// Some helpful TCP functions
+LLSocket::ptr_t tcp_open_channel(LLHost host); // Open a TCP channel to a given host
+void tcp_close_channel(LLSocket::ptr_t handle); // Close an open TCP channel
+int tcp_handshake(LLSocket::ptr_t handle, char * dataout, apr_size_t outlen, char * datain, apr_size_t maxinlen); // Do a TCP data handshake
+
const char* u32_to_ip_string(U32 ip); // Returns pointer to internal string buffer, "(bad IP addr)" on failure, cannot nest calls
char* u32_to_ip_string(U32 ip, char *ip_string); // NULL on failure, ip_string on success, you must allocate at least MAXADDRSTR chars
U32 ip_string_to_u32(const char* ip_string); // Wrapper for inet_addr()