From bc141af57a9ea4b5da4a15eea73e5e4269fc7e65 Mon Sep 17 00:00:00 2001 From: sc Date: Tue, 26 Jan 1999 08:53:25 +0000 Subject: 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)) --- src/ivysocket.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/ivysocket.c') 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 - * Stéphane Chatty + * Authors: Francois-Regis Colin * * $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 #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; -- cgit v1.1