aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-tcp-stream.h
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-tcp-stream.h')
-rw-r--r--camel/camel-tcp-stream.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/camel/camel-tcp-stream.h b/camel/camel-tcp-stream.h
index 5134aea7c6..e6651e6ccd 100644
--- a/camel/camel-tcp-stream.h
+++ b/camel/camel-tcp-stream.h
@@ -88,6 +88,17 @@ typedef struct _CamelSockOptData {
} value;
} CamelSockOptData;
+typedef enum {
+ CAMEL_TCP_ADDRESS_IPV4
+} CamelTcpAddressFamily;
+
+typedef struct {
+ CamelTcpAddressFamily family;
+ gushort port, length;
+ guint8 address[1];
+} CamelTcpAddress;
+
+
struct _CamelTcpStream
{
CamelStream parent_object;
@@ -102,7 +113,8 @@ typedef struct {
int (*getsockopt) (CamelTcpStream *stream, CamelSockOptData *data);
int (*setsockopt) (CamelTcpStream *stream, const CamelSockOptData *data);
- gpointer (*get_socket) (CamelTcpStream *stream);
+ CamelTcpAddress * (*get_local_address) (CamelTcpStream *stream);
+ CamelTcpAddress * (*get_remote_address) (CamelTcpStream *stream);
} CamelTcpStreamClass;
/* Standard Camel function */
@@ -113,7 +125,13 @@ int camel_tcp_stream_connect (CamelTcpStream *stream, struct hostent
int camel_tcp_stream_getsockopt (CamelTcpStream *stream, CamelSockOptData *data);
int camel_tcp_stream_setsockopt (CamelTcpStream *stream, const CamelSockOptData *data);
-gpointer camel_tcp_stream_get_socket (CamelTcpStream *stream);
+CamelTcpAddress *camel_tcp_stream_get_local_address (CamelTcpStream *stream);
+CamelTcpAddress *camel_tcp_stream_get_remote_address (CamelTcpStream *stream);
+
+CamelTcpAddress *camel_tcp_address_new (CamelTcpAddressFamily family,
+ gushort port, gushort length,
+ gpointer address);
+void camel_tcp_address_free (CamelTcpAddress *address);
#ifdef __cplusplus
}