working version with crypto
[anytun.git] / syncCommand.h
blobb7385139282f8a687ac897f20fd5a21234b9ca61
1 #ifndef _SYNCCOMMAND_H
2 #define _SYNCCOMMAND_H
3 #include <boost/archive/text_oarchive.hpp>
4 #include <boost/archive/text_iarchive.hpp>
6 #include "connectionList.h"
7 #include "threadUtils.hpp"
8 #include "syncConnectionCommand.h"
9 #include "syncRouteCommand.h"
10 #include "syncRtpCommand.h"
11 #include "networkPrefix.h"
12 #include <string>
14 class SyncCommand
16 public:
17 SyncCommand(ConnectionList & cl );
18 SyncCommand(ConnectionList & cl ,u_int16_t mux);
19 SyncCommand(const std::string &);
20 SyncCommand(NetworkPrefix);
21 ~SyncCommand();
23 private:
24 SyncCommand(const SyncCommand &);
25 SyncConnectionCommand * scc_;
26 SyncRouteCommand * src_;
27 SyncRtpCommand * srtpc_;
28 friend class boost::serialization::access;
29 template<class Archive>
30 void serialize(Archive & ar, const unsigned int version)
32 std::string syncstr;
33 if (scc_)
35 syncstr = "connection";
37 if ( src_)
39 syncstr = "route";
41 if ( srtpc_)
43 syncstr = "rtp";
45 ar & syncstr;
46 // std::cout << "syncstr received " <<syncstr << std::endl;
47 if (syncstr == "connection")
48 ar & *scc_;
49 if (syncstr == "route")
50 ar & *src_;
51 if (syncstr == "rtp")
52 ar & *srtpc_;
53 // std::cout << "syncstr done " <<syncstr << std::endl;
58 #endif // _SYNCCOMMAND_H