From e191eab68d905bfe14e3590a92fa653f0ae2ebce Mon Sep 17 00:00:00 2001 From: Markus Grüneis Date: Thu, 18 Feb 2010 09:15:27 +0000 Subject: non-functional changes only: use standard writing of stdint.h types; still import from boost (compiler compatibility) --- src/anyrtpproxy/anyrtpproxy.cpp | 4 ++-- src/anyrtpproxy/commandHandler.cpp | 6 +++--- src/anyrtpproxy/connectionList.cpp | 6 +++--- src/anyrtpproxy/connectionList.h | 8 ++++---- src/anyrtpproxy/options.cpp | 8 ++++---- src/anyrtpproxy/options.h | 12 ++++++------ src/anyrtpproxy/portWindow.cpp | 10 +++++----- src/anyrtpproxy/portWindow.h | 14 +++++++------- src/anyrtpproxy/rtpSession.h | 8 ++++---- 9 files changed, 38 insertions(+), 38 deletions(-) (limited to 'src/anyrtpproxy') diff --git a/src/anyrtpproxy/anyrtpproxy.cpp b/src/anyrtpproxy/anyrtpproxy.cpp index 22d7494..1daf35b 100644 --- a/src/anyrtpproxy/anyrtpproxy.cpp +++ b/src/anyrtpproxy/anyrtpproxy.cpp @@ -67,12 +67,12 @@ void listener(RtpSession::proto::socket* sock1, RtpSession::proto::socket* sock2 cLog.msg(Log::PRIO_NOTICE) << "listener(" << call_id << "/" << dir << ") started"; try { - Buffer buf(u_int32_t(MAX_PACKET_SIZE)); + Buffer buf(uint32_t(MAX_PACKET_SIZE)); RtpSession::proto::endpoint remote_end; while(1) { buf.setLength(MAX_PACKET_SIZE); - u_int32_t len=0; + uint32_t len=0; if(dir == 1) { len = 0; //sock1->recvFromNonBlocking(buf.getBuf(), buf.getLength(), remote_end, 1000); } else if(dir == 2) { diff --git a/src/anyrtpproxy/commandHandler.cpp b/src/anyrtpproxy/commandHandler.cpp index 72c3061..a8f1df8 100644 --- a/src/anyrtpproxy/commandHandler.cpp +++ b/src/anyrtpproxy/commandHandler.cpp @@ -76,7 +76,7 @@ void CommandHandler::run(void* s) { CommandHandler* self = reinterpret_cast(s); - Buffer buf(u_int32_t(MAX_COMMAND_LENGTH)); + Buffer buf(uint32_t(MAX_COMMAND_LENGTH)); try { proto::endpoint remote_end; @@ -171,8 +171,8 @@ string CommandHandler::handleRequest(string modifiers, string call_id, string ad bool is_new; RtpSession& session = gRtpSessionTable.getOrNewSession(call_id, is_new); if(is_new) { - u_int16_t port1 = port_window_.newPort(); // TODO: get next available port - u_int16_t port2 = port_window_.newPort(); // TODO: get next available port + uint16_t port1 = port_window_.newPort(); // TODO: get next available port + uint16_t port2 = port_window_.newPort(); // TODO: get next available port if(!port1 || !port2) { if(port1) { port_window_.freePort(port1); } if(port2) { port_window_.freePort(port2); } diff --git a/src/anyrtpproxy/connectionList.cpp b/src/anyrtpproxy/connectionList.cpp index e83a6ba..afda1d8 100644 --- a/src/anyrtpproxy/connectionList.cpp +++ b/src/anyrtpproxy/connectionList.cpp @@ -40,7 +40,7 @@ ConnectionList::~ConnectionList() { } -void ConnectionList::addConnection(ConnectionParam& conn, u_int16_t mux) +void ConnectionList::addConnection(ConnectionParam& conn, uint16_t mux) { } @@ -59,7 +59,7 @@ ConnectionMap::iterator ConnectionList::getEndUnlocked() return connections_.end(); } -const ConnectionMap::iterator ConnectionList::getConnection(u_int16_t mux) +const ConnectionMap::iterator ConnectionList::getConnection(uint16_t mux) { Lock lock(mutex_); ConnectionMap::iterator it = connections_.find(mux); @@ -67,7 +67,7 @@ const ConnectionMap::iterator ConnectionList::getConnection(u_int16_t mux) } -ConnectionParam& ConnectionList::getOrNewConnectionUnlocked(u_int16_t mux) +ConnectionParam& ConnectionList::getOrNewConnectionUnlocked(uint16_t mux) { ConnectionMap::iterator it = connections_.find(mux); return it->second; diff --git a/src/anyrtpproxy/connectionList.h b/src/anyrtpproxy/connectionList.h index 62da471..8df0781 100644 --- a/src/anyrtpproxy/connectionList.h +++ b/src/anyrtpproxy/connectionList.h @@ -39,19 +39,19 @@ #include "../datatypes.h" #include "../connectionParam.h" #include "../networkAddress.h" -typedef std::map ConnectionMap; +typedef std::map ConnectionMap; class ConnectionList { public: ConnectionList(); ~ConnectionList(); - void addConnection(ConnectionParam& conn, u_int16_t mux); - const ConnectionMap::iterator getConnection(u_int16_t mux); + void addConnection(ConnectionParam& conn, uint16_t mux); + const ConnectionMap::iterator getConnection(uint16_t mux); const ConnectionMap::iterator getEnd(); ConnectionMap::iterator getEndUnlocked(); ConnectionMap::iterator getBeginUnlocked(); - ConnectionParam& getOrNewConnectionUnlocked(u_int16_t mux); + ConnectionParam& getOrNewConnectionUnlocked(uint16_t mux); bool empty(); void clear(); Mutex& getMutex(); diff --git a/src/anyrtpproxy/options.cpp b/src/anyrtpproxy/options.cpp index 3fd9975..218fd56 100644 --- a/src/anyrtpproxy/options.cpp +++ b/src/anyrtpproxy/options.cpp @@ -384,23 +384,23 @@ Options& Options::setLocalSyncPort(std::string l) return *this; } -u_int16_t Options::getRtpStartPort() +uint16_t Options::getRtpStartPort() { return rtp_start_port_; } -Options& Options::setRtpStartPort(u_int16_t l) +Options& Options::setRtpStartPort(uint16_t l) { rtp_start_port_ = l; return *this; } -u_int16_t Options::getRtpEndPort() +uint16_t Options::getRtpEndPort() { return rtp_end_port_; } -Options& Options::setRtpEndPort(u_int16_t l) +Options& Options::setRtpEndPort(uint16_t l) { rtp_end_port_ = l; return *this; diff --git a/src/anyrtpproxy/options.h b/src/anyrtpproxy/options.h index 8188831..cf32c87 100644 --- a/src/anyrtpproxy/options.h +++ b/src/anyrtpproxy/options.h @@ -90,10 +90,10 @@ public: Options& setLocalSyncAddr(std::string l); std::string getLocalSyncPort(); Options& setLocalSyncPort(std::string l); - u_int16_t getRtpStartPort(); - Options& setRtpStartPort(u_int16_t l); - u_int16_t getRtpEndPort(); - Options& setRtpEndPort(u_int16_t l); + uint16_t getRtpStartPort(); + Options& setRtpStartPort(uint16_t l); + uint16_t getRtpEndPort(); + Options& setRtpEndPort(uint16_t l); ConnectToList getConnectTo(); private: @@ -129,8 +129,8 @@ private: std::string local_sync_addr_; std::string local_sync_port_; std::string local_addr_; - u_int16_t rtp_start_port_; - u_int16_t rtp_end_port_; + uint16_t rtp_start_port_; + uint16_t rtp_end_port_; ConnectToList connect_to_; Host control_interface_; }; diff --git a/src/anyrtpproxy/portWindow.cpp b/src/anyrtpproxy/portWindow.cpp index ed23686..3ef1767 100644 --- a/src/anyrtpproxy/portWindow.cpp +++ b/src/anyrtpproxy/portWindow.cpp @@ -32,7 +32,7 @@ #include "portWindow.h" -PortWindow::PortWindow(u_int16_t start, u_int16_t end) : start_port_(start), end_port_(end) +PortWindow::PortWindow(uint16_t start, uint16_t end) : start_port_(start), end_port_(end) { } @@ -46,7 +46,7 @@ PortWindow::PortSet::size_type PortWindow::getLength() return ports_.size(); } -bool PortWindow::hasPort(u_int16_t port) +bool PortWindow::hasPort(uint16_t port) { Lock lock(mutex_); @@ -57,7 +57,7 @@ bool PortWindow::hasPort(u_int16_t port) return true; } -bool PortWindow::freePort(u_int16_t port) +bool PortWindow::freePort(uint16_t port) { Lock lock(mutex_); @@ -69,10 +69,10 @@ bool PortWindow::freePort(u_int16_t port) return true; } -u_int16_t PortWindow::newPort() +uint16_t PortWindow::newPort() { Lock lock(mutex_); - u_int16_t port= start_port_; + uint16_t port= start_port_; while(port PortSet; + typedef std::set PortSet; - PortWindow(u_int16_t,u_int16_t); + PortWindow(uint16_t,uint16_t); ~PortWindow(); PortSet::size_type getLength(); - bool hasPort(u_int16_t); - bool freePort(u_int16_t); - u_int16_t newPort(); + bool hasPort(uint16_t); + bool freePort(uint16_t); + uint16_t newPort(); void clear(); private: - u_int16_t start_port_; - u_int16_t end_port_; + uint16_t start_port_; + uint16_t end_port_; ::Mutex mutex_; PortSet ports_; diff --git a/src/anyrtpproxy/rtpSession.h b/src/anyrtpproxy/rtpSession.h index 3247dcc..cfdd36c 100644 --- a/src/anyrtpproxy/rtpSession.h +++ b/src/anyrtpproxy/rtpSession.h @@ -82,13 +82,13 @@ private: // address of local_end1 and local_end2 are always equal std::string local_addr(local_end1_.address().to_string()); - u_int16_t local_port1 = local_end1_.port(); - u_int16_t local_port2 = local_end2_.port(); + uint16_t local_port1 = local_end1_.port(); + uint16_t local_port2 = local_end2_.port(); std::string remote_addr1(remote_end1_.address().to_string()); - u_int16_t remote_port1 = remote_end1_.port(); + uint16_t remote_port1 = remote_end1_.port(); std::string remote_addr2(remote_end2_.address().to_string()); - u_int16_t remote_port2 = remote_end2_.port(); + uint16_t remote_port2 = remote_end2_.port(); ar& dead_; ar& complete_; -- cgit v1.2.3