summaryrefslogtreecommitdiff
path: root/src/ivysocket.c
diff options
context:
space:
mode:
authorsc1999-01-26 08:53:25 +0000
committersc1999-01-26 08:53:25 +0000
commitbc141af57a9ea4b5da4a15eea73e5e4269fc7e65 (patch)
tree53654c22e322e346402b09c8ee804220b8acb1bd /src/ivysocket.c
parent4853dbf7e1e3d69064f6af735acc802b5971b5f5 (diff)
downloadivy-c-bc141af57a9ea4b5da4a15eea73e5e4269fc7e65.zip
ivy-c-bc141af57a9ea4b5da4a15eea73e5e4269fc7e65.tar.gz
ivy-c-bc141af57a9ea4b5da4a15eea73e5e4269fc7e65.tar.bz2
ivy-c-bc141af57a9ea4b5da4a15eea73e5e4269fc7e65.tar.xz
A bit of clean up in headers
Changes in IvyStart and IvyInit: - expanded parsing of IvyStart argument to bus addresses like 123.123,123.122:2019 - socket for receiving broadcast handshakes is now in IvyStart (we thus lose the ability to have "passive" agents (agents that listen but don't say hello))
Diffstat (limited to 'src/ivysocket.c')
-rw-r--r--src/ivysocket.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/ivysocket.c b/src/ivysocket.c
index f46aed5..3a86fcc 100644
--- a/src/ivysocket.c
+++ b/src/ivysocket.c
@@ -1,20 +1,19 @@
/*
* Ivy, C interface
*
- * Copyright (C) 1997-1999
- * Centre d'Études de la Navigation Aérienne
+ * Copyright 1997-1999
+ * Centre d'Etudes de la Navigation Aerienne
*
- * Sockets
+ * Sockets
*
- * Authors: François-Régis Colin <colin@cenatoulouse.dgac.fr>
- * Stéphane Chatty <chatty@cenatoulouse.dgac.fr>
+ * Authors: Francois-Regis Colin <fcolin@cenatoulouse.dgac.fr>
*
* $Id$
- *
- * Please refer to file version.h for the
- * copyright notice regarding this software
*
+ * Please refer to file version.h for the
+ * copyright notice regarding this software
*/
+
#ifdef WIN32
#include <windows.h>
#endif
@@ -276,11 +275,13 @@ char *SocketGetPeerHost( Client client )
if ( host == NULL ) return "can't translate addr";
return host->h_name;
}
+
struct in_addr * SocketGetRemoteAddr( Client client )
{
return &client->from.sin_addr;
}
-void SocketGetRemote( Client client, char **host, unsigned short *port )
+
+void SocketGetRemoteHost (Client client, char **host, unsigned short *port )
{
struct hostent *hostp;
/* extract hostname and port from last message received */
@@ -290,6 +291,7 @@ void SocketGetRemote( Client client, char **host, unsigned short *port )
else *host = hostp->h_name;
*port = ntohs( client->from.sin_port );
}
+
void SocketClose( Client client )
{
(*channel_close)( client->channel );
@@ -302,10 +304,12 @@ void SocketSendRaw( Client client, char *buffer, int len )
if ( err != len )
perror( "*** send ***");
}
+
void SocketSetData( Client client, void *data )
{
client->data = data;
}
+
void SocketSend( Client client, char *fmt, ... )
{
char buffer[4096];
@@ -316,6 +320,7 @@ void SocketSend( Client client, char *fmt, ... )
SocketSendRaw( client, buffer, len );
va_end ( ap );
}
+
void *SocketGetData( Client client )
{
return client->data;