SocketOptions.h

Go to the documentation of this file.
00001 /****************** <VPR heading BEGIN do not edit this line> *****************
00002  *
00003  * VR Juggler Portable Runtime
00004  *
00005  * Original Authors:
00006  *   Allen Bierbaum, Patrick Hartling, Kevin Meinert, Carolina Cruz-Neira
00007  *
00008  * -----------------------------------------------------------------
00009  * File:          $RCSfile$
00010  * Date modified: $Date: 2006-04-14 14:29:27 -0500 (Fri, 14 Apr 2006) $
00011  * Version:       $Revision: 18637 $
00012  * -----------------------------------------------------------------
00013  *
00014  ****************** <VPR heading END do not edit this line> ******************/
00015 
00016 /*************** <auto-copyright.pl BEGIN do not edit this line> **************
00017  *
00018  * VR Juggler is (C) Copyright 1998-2005 by Iowa State University
00019  *
00020  * Original Authors:
00021  *   Allen Bierbaum, Christopher Just,
00022  *   Patrick Hartling, Kevin Meinert,
00023  *   Carolina Cruz-Neira, Albert Baker
00024  *
00025  * This library is free software; you can redistribute it and/or
00026  * modify it under the terms of the GNU Library General Public
00027  * License as published by the Free Software Foundation; either
00028  * version 2 of the License, or (at your option) any later version.
00029  *
00030  * This library is distributed in the hope that it will be useful,
00031  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00032  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00033  * Library General Public License for more details.
00034  *
00035  * You should have received a copy of the GNU Library General Public
00036  * License along with this library; if not, write to the
00037  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00038  * Boston, MA 02111-1307, USA.
00039  *
00040  *************** <auto-copyright.pl END do not edit this line> ***************/
00041 
00042 #ifndef _VPR_SOCKET_OPTIONS_H_
00043 #define _VPR_SOCKET_OPTIONS_H_
00044 
00045 #include <vpr/vprConfig.h>
00046 
00047 #include <vpr/IO/Socket/InetAddr.h>
00048 #include <vpr/IO/Socket/McastReq.h>
00049 #include <vpr/Util/ReturnStatus.h>
00050 
00051 
00052 namespace vpr
00053 {
00054 
00056 namespace SocketOptions
00057 {
00064    enum Types
00065    {
00066       Linger,           
00067       ReuseAddr,        
00068       KeepAlive,        
00069       RecvBufferSize,   
00070       SendBufferSize,   
00071       IpTimeToLive,     
00072       IpTypeOfService,  
00073       AddMember,        
00074       DropMember,       
00075       Broadcast,        
00076       McastInterface,   
00077       McastTimeToLive,  
00078       McastLoopback,    
00079       NoDelay,          
00080       MaxSegment        
00081    };
00082 
00084    enum TypeOfService
00085    {
00086       LowDelay,     
00087       Throughput,   
00088       Reliability,  
00089       LowCost       
00090    };
00091 
00096    struct Linger
00097    {
00098       bool       enabled;
00099       vpr::Int32 seconds;
00100    };
00101 
00108    struct Data
00109    {
00110       Uint32        ip_ttl;
00111       TypeOfService type_of_service;
00112       bool          reuse_addr;
00113       bool          keep_alive;
00114       bool          no_delay;
00115       bool          broadcast;
00116       size_t        max_segment;
00117       size_t        recv_buffer_size;
00118       size_t        send_buffer_size;
00119       struct Linger linger;
00120       InetAddr      mcast_if;
00121       Uint8         mcast_ttl;
00122       Uint8         mcast_loopback;
00123       McastReq      mcast_add_member;
00124       McastReq      mcast_drop_member;
00125    };
00126 }
00127 
00132 class VPR_CLASS_API SocketOptionWrapper
00133 {
00134 public:
00135    virtual ~SocketOptionWrapper()
00136    {
00137       /* Do nothing. */ ;
00138    }
00139 
00140 protected:
00152    virtual vpr::ReturnStatus getOption(const vpr::SocketOptions::Types option,
00153                                        struct vpr::SocketOptions::Data& data) const = 0;
00154 
00163    virtual vpr::ReturnStatus setOption(const vpr::SocketOptions::Types option,
00164                                        const struct vpr::SocketOptions::Data& data) = 0;
00165 };
00166 
00167 } // End of vpr namespace
00168 
00169 
00170 #endif  /* _VPR_SOCKET_OPTIONS_H_ */

Generated on Thu Jan 4 10:52:11 2007 for VR Juggler Portable Runtime by  doxygen 1.5.1