RTP Trace System  1.0
socketaddress.h
Go to the documentation of this file.
00001 // ##########################################################################
00002 // ####                                                                  ####
00003 // ####                      RTP Audio Server Project                    ####
00004 // ####                    ============================                  ####
00005 // ####                                                                  ####
00006 // #### Socket Address                                                   ####
00007 // ####                                                                  ####
00008 // #### Version 1.00  --  February 16, 2001                              ####
00009 // ####                                                                  ####
00010 // #### Copyright (C) 1999  Thomas Dreibholz                             ####
00011 // ####               2000  Universität Bonn, Abt. IV                    ####
00012 // ####               2001  EMail: dreibh@iem.uni-due.de                 ####
00013 // ####                     WWW:   https://www.uni-due.de/~be0001        ####
00014 // ####                                                                  ####
00015 // ##########################################################################
00016 
00017 
00018 #ifndef SOCKETADDRESS_H
00019 #define SOCKETADDRESS_H
00020 
00021 
00022 #include "system.h"
00023 
00024 
00025 #include <sys/socket.h>
00026 #include <sys/un.h>
00027 
00028 
00029 namespace Coral {
00030 
00031 
00039 class SocketAddress
00040 {
00041    // ====== Reset ==========================================================
00042    public:
00046    virtual void reset() = 0;
00047 
00048 
00049    // ====== Check, if address is valid =====================================
00055    virtual bool isValid() const = 0;
00056 
00057 
00058    // ====== Get address string =============================================
00064    virtual String getAddressString() const = 0;
00065 
00066 
00067    // ====== Get/set system sockaddr structure ==============================
00076    virtual cardinal getSystemAddress(sockaddr*       buffer,
00077                                      const socklen_t length,
00078                                      const cardinal  type) const = 0;
00079 
00087    virtual bool setSystemAddress(sockaddr* address, const socklen_t length) = 0;
00088 
00089 
00090    // ====== Constants ======================================================
00094    static const cardinal MaxSockLen =
00095       (sizeof(sockaddr_un) > sizeof(sockaddr_storage)) ? sizeof(sockaddr_un) : sizeof(sockaddr_storage);
00096 };
00097 
00098 
00102 inline ostream& operator<<(ostream& os, const SocketAddress& sa);
00103 
00104 
00105 }
00106 
00107 
00108 #include "socketaddress.icc"
00109 
00110 
00111 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines