Update SENF to compile using g++ 4.3.2 (Ubuntu 8.10)
[senf.git] / PPI / SocketSink.hh
index 6e5cfb9..f7f61a5 100644 (file)
@@ -1,8 +1,8 @@
 // $Id$
 //
-// Copyright (C) 2007 
-// Fraunhofer Institute for Open Communication Systems (FOKUS) 
-// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+// Copyright (C) 2007
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
@@ -35,6 +35,8 @@
 #include "../Socket/CommunicationPolicy.hh"
 #include "Module.hh"
 #include "Connectors.hh"
+#include "../Socket/Protocols/INet/INetAddressing.hh"
+#include "IOEvent.hh"
 
 //#include "SocketSink.mpp"
 ///////////////////////////////hh.p////////////////////////////////////////
@@ -63,18 +65,47 @@ namespace ppi {
                                              \param[in] packet Packet to write */
     };
 
+    class IPv6SourceForcingDgramWriter
+    {
+    public:
+        IPv6SourceForcingDgramWriter();
+        IPv6SourceForcingDgramWriter(senf::INet6Address sourceAddr, senf::INet6SocketAddress destAddr);
+        typedef senf::ClientSocketHandle<
+            senf::MakeSocketPolicy< senf::WriteablePolicy,
+                                    senf::DatagramFramingPolicy>::policy > Handle;
+                                        ///< Handle type supported by this writer
+        
+        void source(senf::INet6Address & source);
+        senf::INet6Address source();
+        void destination(senf::INet6SocketAddress & dest);
+        senf::INet6SocketAddress destination();
+
+        void operator()(Handle handle, Packet packet);
+                                        ///< Write \a packet to \a handle
+                                        /**< Write the complete \a packet as a datagram to \a
+                                             handle.
+                                             \param[in] handle Handle to write data to
+                                             \param[in] packet Packet to write */
+    private:
+        int sendtoandfrom(int sock, const void *data, size_t dataLen, const in6_addr *dst, int port, const in6_addr *src);
+        senf::INet6Address source_;
+        senf::INet6Address destination_;
+        unsigned int protocolId_;
+};    
+    
+    
 }}
 
 namespace senf {
 namespace ppi {
 namespace module {
 
-    /** \brief Output module writing data to a FileHandle using the provided Writer.
+    /** \brief Output %module writing data to a FileHandle using the provided Writer.
         If using the default ConnectedDgramWriter the filehandle must be writable, connected and 
         able to handle complete datagrams.  
         
-        This output module will write data to a FileHandle object using a given \a Writer. This
-        output module is active. This requires the file handle to be able to signal its readiness to
+        This output %module will write data to a FileHandle object using a given \a Writer. This
+        output %module is active. This requires the file handle to be able to signal its readiness to
         accept more data via the Scheduler.
 
         The default \a Writer is senf::ppi::ConnectedDgramWriter which will write out the complete packet to
@@ -87,8 +118,8 @@ namespace module {
           public:
               typedef unspecified Handle;                          // type of handle requested
 
-              SomeWriter();                                          // EITHER default constructible OR
-              SomeWriter(SomeWriter const & other);                    // copy constructible
+              SomeWriter();                                        // EITHER default constructible OR
+              SomeWriter(SomeWriter const & other);                // copy constructible
 
               void operator()(Handle handle, Packet packet);       // insertion function
           };