summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Makefile13
-rw-r--r--src/anyrtpproxy/Makefile15
-rw-r--r--src/anyrtpproxy/anyrtpproxy.cpp10
-rw-r--r--src/anyrtpproxy/commandHandler.cpp8
-rw-r--r--src/anyrtpproxy/rtpSession.cpp (renamed from src/rtpSession.cpp)2
-rw-r--r--src/anyrtpproxy/rtpSession.h (renamed from src/rtpSession.h)2
-rw-r--r--src/anyrtpproxy/rtpSessionTable.cpp (renamed from src/rtpSessionTable.cpp)4
-rw-r--r--src/anyrtpproxy/rtpSessionTable.h (renamed from src/rtpSessionTable.h)4
-rw-r--r--src/anyrtpproxy/syncRtpCommand.cpp (renamed from src/syncRtpCommand.cpp)0
-rw-r--r--src/anyrtpproxy/syncRtpCommand.h (renamed from src/syncRtpCommand.h)2
-rw-r--r--src/syncCommand.cpp12
-rw-r--r--src/syncCommand.h9
-rw-r--r--src/syncOnConnect.hpp14
-rw-r--r--src/syncTcpConnection.cpp41
14 files changed, 52 insertions, 84 deletions
diff --git a/src/Makefile b/src/Makefile
index 588e876..5d846f1 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -71,12 +71,8 @@ OBJS = tunDevice.o \
syncQueue.o \
syncCommand.o \
syncRouteCommand.o \
- syncRtpCommand.o \
syncConnectionCommand.o \
- rtpSessionTable.o \
- rtpSession.o \
routingTreeNode.o \
- anyrtpproxy/callIdQueue.o
SYNCOBJS= syncServer.o \
syncClient.o \
@@ -97,11 +93,7 @@ ANYCONFOBJS = log.o \
networkPrefix.o \
connectionList.o \
connectionParam.o \
- rtpSessionTable.o \
- rtpSession.o \
routingTreeNode.o \
- anyrtpproxy/callIdQueue.o \
- syncRtpCommand.o \
anyConfOptions.o \
routingTable.o \
seqWindow.o \
@@ -123,7 +115,7 @@ DEPENDFILE = .depend
.PHONY: dep distclean cleanall clean ctags
-all: dep $(EXECUTABLE) #libAnysync.a #anyrtpproxy
+all: dep $(EXECUTABLE) #libAnysync.a
dep: $(SRCS) $(SYNCSRCS) $(ANYCTRSRCS) $(ANYCONFSRCS)
$(CC) -MM $(SRCS) $(SYNCSRCS) $(ANYCTRSRCS) $(ANYCONFSRCS) > $(DEPENDFILE)
@@ -149,9 +141,6 @@ anytun-config: $(ANYCONFOBJS) anytun-config.o
anytun-controld: $(ANYCTROBJS) anytun-controld.o
$(LD) $(ANYCTROBJS) anytun-controld.o -o $@ $(LDFLAGS)
-anyrtpproxy/callIdQueue.o:
- $(MAKE) --directory=$(CURDIR)/anyrtpproxy callIdQueue.o
-
%.o: %.cpp
$(CXX) $(CXXFLAGS) $< -c
diff --git a/src/anyrtpproxy/Makefile b/src/anyrtpproxy/Makefile
index 90b4645..40ca273 100644
--- a/src/anyrtpproxy/Makefile
+++ b/src/anyrtpproxy/Makefile
@@ -39,23 +39,14 @@ OBJS = anyrtpproxy.o \
../signalController.o \
../log.o \
../buffer.o \
- ../rtpSessionTable.o \
- ../rtpSession.o \
+ rtpSessionTable.o \
+ rtpSession.o \
connectionList.o \
../syncServer.o \
../syncClient.o \
../syncTcpConnection.o \
../syncQueue.o \
- ../seqWindow.o \
- ../connectionParam.o \
- ../routingTable.o \
- ../syncBuffer.o \
- ../syncCommand.o \
- ../syncRouteCommand.o \
- ../syncRtpCommand.o \
- ../syncConnectionCommand.o \
- ../networkAddress.o \
- ../networkPrefix.o \
+ syncRtpCommand.o \
commandHandler.o \
portWindow.o \
callIdQueue.o \
diff --git a/src/anyrtpproxy/anyrtpproxy.cpp b/src/anyrtpproxy/anyrtpproxy.cpp
index 43b4ef9..fdb809e 100644
--- a/src/anyrtpproxy/anyrtpproxy.cpp
+++ b/src/anyrtpproxy/anyrtpproxy.cpp
@@ -43,11 +43,11 @@
#include "../signalController.h"
#include "../buffer.h"
#include "connectionList.h"
-#include "../rtpSessionTable.h"
-#include "../syncCommand.h"
+#include "rtpSessionTable.h"
+#include "syncRtpCommand.h"
#include "../syncQueue.h"
#include "../syncClient.h"
-//#include "../syncOnConnect.h"
+#include "syncOnConnect.hpp"
#include "../threadUtils.hpp"
@@ -104,7 +104,7 @@ void listener(RtpSession::proto::socket* sock1, RtpSession::proto::socket* sock2
session.setRemoteEnd2(remote_end);
if(!gOpt.getNat()) { // with nat enabled sync is not needed
- SyncCommand sc(call_id);
+ SyncRtpCommand sc(call_id);
queue->push(sc);
}
}
@@ -296,7 +296,7 @@ void syncListener(SyncQueue * queue)
SyncServer server(io_service,e);
-// server.onConnect=boost::bind(syncOnConnect,_1);
+ server.onConnect=boost::bind(syncOnConnect,_1);
queue->setSyncServerPtr(&server);
io_service.run();
}
diff --git a/src/anyrtpproxy/commandHandler.cpp b/src/anyrtpproxy/commandHandler.cpp
index c8604d6..01613ec 100644
--- a/src/anyrtpproxy/commandHandler.cpp
+++ b/src/anyrtpproxy/commandHandler.cpp
@@ -42,8 +42,8 @@
#include "../buffer.h"
#include "../log.h"
#include "../syncQueue.h"
-#include "../syncCommand.h"
-#include "../rtpSessionTable.h"
+#include "syncRtpCommand.h"
+#include "rtpSessionTable.h"
#include "callIdQueue.h"
#include "options.h"
@@ -231,7 +231,7 @@ string CommandHandler::handleResponse(string modifiers, string call_id, string a
RtpSession::proto::resolver::query query(addr,port);
session.setRemoteEnd2(*resolver.resolve(query));
session.isComplete(true);
- SyncCommand sc(call_id);
+ SyncRtpCommand sc(call_id);
queue_.push(sc);
ostringstream oss;
@@ -252,7 +252,7 @@ string CommandHandler::handleDelete(string call_id, string from_tag, string to_t
{
RtpSession& session = gRtpSessionTable.getSession(call_id);
session.isDead(true);
- SyncCommand sc(call_id);
+ SyncRtpCommand sc(call_id);
queue_.push(sc);
return RET_OK;
diff --git a/src/rtpSession.cpp b/src/anyrtpproxy/rtpSession.cpp
index b3e688b..a3551e3 100644
--- a/src/rtpSession.cpp
+++ b/src/anyrtpproxy/rtpSession.cpp
@@ -31,7 +31,7 @@
#include "rtpSession.h"
-#include "anyrtpproxy/callIdQueue.h"
+#include "callIdQueue.h"
RtpSession::RtpSession(const std::string& call_id) : in_sync_(false), call_id_(call_id) , dead_(false), complete_(false),
seen1_(false), seen2_(false)
diff --git a/src/rtpSession.h b/src/anyrtpproxy/rtpSession.h
index 1aec46f..3716c9b 100644
--- a/src/rtpSession.h
+++ b/src/anyrtpproxy/rtpSession.h
@@ -34,7 +34,7 @@
#include <boost/asio.hpp>
-#include "threadUtils.hpp"
+#include "../threadUtils.hpp"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
diff --git a/src/rtpSessionTable.cpp b/src/anyrtpproxy/rtpSessionTable.cpp
index b751a50..9237866 100644
--- a/src/rtpSessionTable.cpp
+++ b/src/anyrtpproxy/rtpSessionTable.cpp
@@ -28,8 +28,8 @@
* You should have received a copy of the GNU General Public License
* along with anytun. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "threadUtils.hpp"
-#include "datatypes.h"
+#include "../threadUtils.hpp"
+#include "../datatypes.h"
#include "rtpSessionTable.h"
diff --git a/src/rtpSessionTable.h b/src/anyrtpproxy/rtpSessionTable.h
index 3574723..a37318d 100644
--- a/src/rtpSessionTable.h
+++ b/src/anyrtpproxy/rtpSessionTable.h
@@ -34,8 +34,8 @@
#include <map>
-#include "threadUtils.hpp"
-#include "datatypes.h"
+#include "../threadUtils.hpp"
+#include "../datatypes.h"
#include "rtpSession.h"
typedef std::map<std::string,RtpSession*> RtpSessionMap;
diff --git a/src/syncRtpCommand.cpp b/src/anyrtpproxy/syncRtpCommand.cpp
index f612c8a..f612c8a 100644
--- a/src/syncRtpCommand.cpp
+++ b/src/anyrtpproxy/syncRtpCommand.cpp
diff --git a/src/syncRtpCommand.h b/src/anyrtpproxy/syncRtpCommand.h
index d178e00..282243b 100644
--- a/src/syncRtpCommand.h
+++ b/src/anyrtpproxy/syncRtpCommand.h
@@ -33,7 +33,7 @@
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
-#include "threadUtils.hpp"
+#include "../threadUtils.hpp"
#include "rtpSessionTable.h"
class SyncRtpCommand
diff --git a/src/syncCommand.cpp b/src/syncCommand.cpp
index 94f295c..48bed3a 100644
--- a/src/syncCommand.cpp
+++ b/src/syncCommand.cpp
@@ -34,28 +34,18 @@ SyncCommand::SyncCommand(ConnectionList & cl )
{
scc_ = new SyncConnectionCommand(cl);
src_ = new SyncRouteCommand();
- srtpc_ = new SyncRtpCommand();
}
SyncCommand::SyncCommand(ConnectionList & cl, u_int16_t mux )
{
scc_ = new SyncConnectionCommand(cl,mux);
src_=NULL;
- srtpc_=NULL;
}
SyncCommand::SyncCommand(NetworkPrefix np )
{
scc_ = NULL;
src_ = new SyncRouteCommand(np);
- srtpc_=NULL;
-}
-
-SyncCommand::SyncCommand(const std::string & callid )
-{
- scc_ = NULL;
- src_ = NULL;
- srtpc_= new SyncRtpCommand(callid);
}
SyncCommand::~SyncCommand()
@@ -64,6 +54,4 @@ SyncCommand::~SyncCommand()
delete scc_;
if (src_)
delete src_;
- if (srtpc_)
- delete srtpc_;
}
diff --git a/src/syncCommand.h b/src/syncCommand.h
index 5059693..9f0ef2a 100644
--- a/src/syncCommand.h
+++ b/src/syncCommand.h
@@ -37,7 +37,6 @@
#include "threadUtils.hpp"
#include "syncConnectionCommand.h"
#include "syncRouteCommand.h"
-#include "syncRtpCommand.h"
#include "networkPrefix.h"
#include <string>
@@ -46,7 +45,6 @@ class SyncCommand
public:
SyncCommand(ConnectionList & cl );
SyncCommand(ConnectionList & cl ,u_int16_t mux);
- SyncCommand(const std::string &);
SyncCommand(NetworkPrefix);
~SyncCommand();
@@ -54,7 +52,6 @@ private:
SyncCommand(const SyncCommand &);
SyncConnectionCommand * scc_;
SyncRouteCommand * src_;
- SyncRtpCommand * srtpc_;
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
@@ -68,18 +65,12 @@ private:
{
syncstr = "route";
}
- if ( srtpc_)
- {
- syncstr = "rtp";
- }
ar & syncstr;
// std::cout << "syncstr received " <<syncstr << std::endl;
if (syncstr == "connection")
ar & *scc_;
if (syncstr == "route")
ar & *src_;
- if (syncstr == "rtp")
- ar & *srtpc_;
// std::cout << "syncstr done " <<syncstr << std::endl;
}
};
diff --git a/src/syncOnConnect.hpp b/src/syncOnConnect.hpp
index b0b8963..0b454e7 100644
--- a/src/syncOnConnect.hpp
+++ b/src/syncOnConnect.hpp
@@ -31,6 +31,7 @@
void syncOnConnect(SyncTcpConnection * connptr)
{
+ //TODO Locking here
ConnectionList & cl_(gConnectionList);
ConnectionMap::iterator cit = cl_.getBeginUnlocked();
for (;cit!=cl_.getEndUnlocked();++cit)
@@ -63,18 +64,5 @@ void syncOnConnect(SyncTcpConnection * connptr)
connptr->Send(sout.str());
}
}
- //TODO Locking here
- RtpSessionMap::iterator rit = gRtpSessionTable.getBeginUnlocked();
- for (;rit!=gRtpSessionTable.getEndUnlocked();++rit)
- {
- std::ostringstream sout;
- boost::archive::text_oarchive oa(sout);
- const SyncCommand scom(rit->first);
- oa << scom;
- std::stringstream lengthout;
- lengthout << std::setw(5) << std::setfill('0') << sout.str().size()<< ' ';
- connptr->Send(lengthout.str());
- connptr->Send(sout.str());
- }
}
diff --git a/src/syncTcpConnection.cpp b/src/syncTcpConnection.cpp
index df6f59f..17d3ddd 100644
--- a/src/syncTcpConnection.cpp
+++ b/src/syncTcpConnection.cpp
@@ -1,18 +1,39 @@
+/*
+ * anytun
+ *
+ * The secure anycast tunneling protocol (satp) defines a protocol used
+ * for communication between any combination of unicast and anycast
+ * tunnel endpoints. It has less protocol overhead than IPSec in Tunnel
+ * mode and allows tunneling of every ETHER TYPE protocol (e.g.
+ * ethernet, ip, arp ...). satp directly includes cryptography and
+ * message authentication based on the methodes used by SRTP. It is
+ * intended to deliver a generic, scaleable and secure solution for
+ * tunneling and relaying of packets of any protocol.
+ *
+ *
+ * Copyright (C) 2007-2008 Othmar Gsenger, Erwin Nindl,
+ * Christian Pointner <satp@wirdorange.org>
+ *
+ * This file is part of Anytun.
+ *
+ * Anytun is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3 as
+ * published by the Free Software Foundation.
+ *
+ * Anytun is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with anytun. If not, see <http://www.gnu.org/licenses/>.
+ */
+
#include "syncTcpConnection.h"
#include <boost/bind.hpp>
#include <boost/asio.hpp>
-#include <sstream>
-#include <iostream>
#include <string>
-#include "routingTable.h"
-#include "rtpSessionTable.h"
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-
-#include "syncCommand.h"
-#include "buffer.h"
SyncTcpConnection::proto::socket& SyncTcpConnection::socket()
{