diff options
author | sc | 2000-11-28 17:07:47 +0000 |
---|---|---|
committer | sc | 2000-11-28 17:07:47 +0000 |
commit | ee937667fd0ecd82faab4c88d756b906fb625f1a (patch) | |
tree | 19e679318b5cb87e8be1a05a7bbc9ba5568d0814 /comm/Address.h | |
parent | 1326b11d65f7020f5f6c691305d2c090b064bd04 (diff) | |
download | ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.zip ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.tar.gz ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.tar.bz2 ivy-league-ee937667fd0ecd82faab4c88d756b906fb625f1a.tar.xz |
Integration into IvyLeague
Uvh -> Ivl
Multiplexer.* is renamed into Scheduler.*
A few name conflicts in the merger with ex-DNN have been solved
Imakefile is replaced by Makefile
Created InetAddress.* and UnixAddress.* from Address.*
Created IrdaAddress.*
OLD/TextStream has been updated
Diffstat (limited to 'comm/Address.h')
-rw-r--r-- | comm/Address.h | 89 |
1 files changed, 22 insertions, 67 deletions
diff --git a/comm/Address.h b/comm/Address.h index d0e083d..7ca302a 100644 --- a/comm/Address.h +++ b/comm/Address.h @@ -10,47 +10,56 @@ * * $Id$ * $CurLog$ + * Removed smart pointers (S.Sire) + * Changed IvlInetAddress::StrRepr and added GetHostname and GetNoHostname */ #ifndef Address_H_ #define Address_H_ #include "cplus_bugs.h" -#include "ccu/bool.h" -#include "ccu/word.h" -#include "ccu/String.h" +#include "ivl/bool.h" +#include "ivl/word.h" +#include "ivl/String.h" #include <sys/types.h> #include <sys/socket.h> -#include <netinet/in.h> +typedef struct sockaddr SockAddr; + +/***** all this is necessary for function Decode only. This should be investigated */ +#include <netinet/in.h> #ifdef UNIX_SOCK #include <sys/un.h> -#endif - #ifndef AF_UNIX #define AF_UNIX AF_UNSPEC #endif +#endif +#ifdef IRDA_SOCK +#include <linux/irda.h> +#endif union gen_addr { struct sockaddr sa; // default #ifdef UNIX_SOCK struct sockaddr_un su; // unix #endif +#ifdef IRDA_SOCK + struct sockaddr_irda sir; // irda +#endif struct sockaddr_in si; // inet }; +/***** end of part that is necessary for Decode only */ -typedef struct sockaddr SockAddr; -/* this union is useful for adresses returned by system calls */ -typedef union gen_addr GEN_ADDR; +typedef union gen_addr GEN_ADDR; /* useful for adresses returned by system calls */ -class UchAddress { +class IvlAddress { protected: bool Valid; public: - UchAddress (); -virtual ~UchAddress (); + IvlAddress (); +virtual ~IvlAddress (); bool IsValid () const { return Valid; } virtual int Family () = 0; // AF_UNSPEC, AF_UNIX, AF_INET @@ -58,61 +67,7 @@ virtual int Length () = 0; virtual SockAddr* GetSockAddr () = 0; virtual char* StrRepr (char* buf) = 0; -static UchAddress* Decode (GEN_ADDR*, int); -}; - -class UchInetAddress : public UchAddress { -protected: - CcuString HostName; - bool HasHostName; - struct sockaddr_in Addr; - - const char* GetNoHostName (); - -public: - UchInetAddress (); - UchInetAddress (lword, sword); // hostid, port# - UchInetAddress (const char*, sword = 0); // hostname, port# - ~UchInetAddress (); - - int Family (); - int Length (); - SockAddr* GetSockAddr (); -inline sword Port () { return Addr.sin_port; } -inline lword Host () { return Addr.sin_addr.s_addr; } - char* StrRepr (char* buf = 0); - const char* GetHostName (); - -static lword LoopBack (); -}; - -#ifndef INADDR_LOOPBACK -#define INADDR_LOOPBACK (INET_ADDR::LoopBack ()) -#endif - -#define ANYADDR ((lword) INADDR_ANY) -#define LOOPBACK ((lword) INADDR_LOOPBACK) -#define BROADCAST ((lword) INADDR_BROADCAST) - - -#ifdef UNIX_SOCK - -class UchUnixAddress : public UchAddress { -protected: - struct sockaddr_un Addr; - -public: - UchUnixAddress (); - UchUnixAddress (const char*); - ~UchUnixAddress (); - - int Family (); - int Length (); - SockAddr* GetSockAddr (); - char* StrRepr (char* buf); +static IvlAddress* Decode (GEN_ADDR*, int); }; -#endif /* UNIX_ADDR */ - - #endif /* Address_H_ */ |