Fixed bug #645: Filter Frontend_net must set proper Origin value.
[metaproxy-moved-to-github.git] / src / origin.cpp
1 /* $Id: origin.cpp,v 1.1 2006-08-30 10:48:52 adam Exp $
2    Copyright (c) 2005-2006, Index Data.
3
4    See the LICENSE file for details
5  */
6
7
8 #include "config.hpp"
9 #include "package.hpp"
10
11 #include <iostream>
12
13 namespace mp = metaproxy_1;
14
15 mp::Origin::Origin() : type(API) 
16
17     origin_id = 0; 
18 }
19
20 void mp::Origin::set_tcpip_address(std::string addr, unsigned long s)
21 {
22     address = addr;
23     origin_id = s;
24     type = TCPIP;
25 }
26
27 std::ostream& std::operator<<(std::ostream& os,  mp::Origin& o)
28 {
29     if (o.address != "")
30         os << o.address;
31     else
32         os << "0";
33     os << ":" << o.origin_id;
34     return os;
35 }
36                 
37 /*
38  * Local variables:
39  * c-basic-offset: 4
40  * indent-tabs-mode: nil
41  * c-file-style: "stroustrup"
42  * End:
43  * vim: shiftwidth=4 tabstop=8 expandtab
44  */