added header file
authorMarc Cromme <marc@indexdata.dk>
Tue, 26 Sep 2006 13:04:07 +0000 (13:04 +0000)
committerMarc Cromme <marc@indexdata.dk>
Tue, 26 Sep 2006 13:04:07 +0000 (13:04 +0000)
src/Makefile.am
src/origin.hpp [new file with mode: 0644]

index 0223e76..c3488de 100644 (file)
@@ -1,4 +1,4 @@
-## $Id: Makefile.am,v 1.55 2006-09-26 13:02:50 marc Exp $
+## $Id: Makefile.am,v 1.56 2006-09-26 13:04:07 marc Exp $
 
 MAINTAINERCLEANFILES = Makefile.in config.in config.hpp
 
@@ -36,6 +36,7 @@ libmetaproxy_la_SOURCES = \
        router.hpp router_chain.hpp router_chain.cpp \
         router_flexml.hpp router_flexml.cpp \
        session.cpp session.hpp \
+       sru_util.cpp sru_util.hpp \
        thread_pool_observer.cpp thread_pool_observer.hpp \
        util.cpp util.hpp \
        xmlutil.cpp xmlutil.hpp
diff --git a/src/origin.hpp b/src/origin.hpp
new file mode 100644 (file)
index 0000000..00df465
--- /dev/null
@@ -0,0 +1,63 @@
+/* $Id: origin.hpp,v 1.1 2006-09-26 13:04:07 marc Exp $
+   Copyright (c) 2005-2006, Index Data.
+
+   See the LICENSE file for details
+ */
+
+#ifndef YP2_ORIGIN_HPP
+#define YP2_ORIGIN_HPP
+
+#include <iosfwd>
+#include <string>
+
+namespace metaproxy_1 {
+    class Origin;
+}
+
+namespace std {
+    std::ostream& operator<<(std::ostream& os, metaproxy_1::Origin& o);
+}
+
+namespace metaproxy_1 {
+    
+    class Origin {
+    public:
+        Origin(std::string server_host = "", unsigned int server_port = 0);
+        
+        /// get function - right val in assignment
+        std::string server_host() const;
+        
+        /// get function - right val in assignment
+        unsigned int server_port() const;
+        
+        /// set client IP info - left val in assignment
+        void set_tcpip_address(std::string addr, unsigned long id);
+
+    private:
+        friend std::ostream& 
+        std::operator<<(std::ostream& os,  metaproxy_1::Origin& o);
+        
+        enum origin_t {
+            API,
+            UNIX,
+            TCPIP
+        } m_type;
+        std::string m_address; // UNIX+TCPIP
+        unsigned long m_origin_id;
+        std::string m_server_host;
+        unsigned int m_server_port;
+    };
+
+}
+
+
+
+#endif
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * c-file-style: "stroustrup"
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */