reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
CommandServer.hxx
Go to the documentation of this file.
1#if !defined(CommandServer_hxx)
2#define CommandServer_hxx
3
4#include <rutil/Data.hxx>
7#include <rutil/XMLCursor.hxx>
11#include "repro/Proxy.hxx"
12
13namespace resip
14{
15class SipStack;
16}
17
18namespace repro
19{
20class ReproRunner;
21class WebAdmin;
22
25{
26public:
29 int port,
30 resip::IpVersion version,
32#ifdef BUILD_QPID_PROTON
34#endif
35 virtual ~CommandServer();
36
37 // thread safe
38 virtual void sendResponse(unsigned int connectionId,
39 unsigned int requestId,
41 unsigned int resultCode,
42 const resip::Data& resultText);
43
45
46protected:
47 virtual void handleRequest(unsigned int connectionId,
48 unsigned int requestId,
49 const resip::Data& request);
50
51 // Handlers
52 virtual void onDnsCacheDumpRetrieved(std::pair<unsigned long, unsigned long> key, const resip::Data& dnsEntryStrings);
53
54private:
55 void handleGetStackInfoRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
56 void handleGetStackStatsRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
57 void handleResetStackStatsRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
58 void handleLogDnsCacheRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
59 void handleClearDnsCacheRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
60 void handleGetDnsCacheRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
61 void handleGetCongestionStatsRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
62 void handleSetCongestionToleranceRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
63 void handleShutdownRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
64 void handleGetProxyConfigRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
65 void handleRestartRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
66 void handleAddTransportRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
67 void handleRemoveTransportRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
68 void handleHttpRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
69
70 void xmlToMap(std::map<resip::Data, resip::Data>& m, std::set<resip::Data> keys, resip::XMLCursor& xml);
71
72 ReproRunner& mReproRunner;
73 WebAdmin* mWebAdmin;
74 resip::Mutex mStatisticsWaitersMutex;
75 typedef std::list<std::pair<unsigned int, unsigned int> > StatisticsWaitersList;
76 StatisticsWaitersList mStatisticsWaiters;
77};
78
79}
80
81#endif
82
83/* ====================================================================
84 * The Vovida Software License, Version 1.0
85 *
86 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
87 * Copyright (c) 2010 SIP Spectrum, Inc. All rights reserved.
88 * Copyright (c) 2022 Daniel Pocock https://danielpocock.com
89 * Copyright (c) 2022 Software Freedom Institute LLC https://softwarefreedom.institute
90 *
91 * Redistribution and use in source and binary forms, with or without
92 * modification, are permitted provided that the following conditions
93 * are met:
94 *
95 * 1. Redistributions of source code must retain the above copyright
96 * notice, this list of conditions and the following disclaimer.
97 *
98 * 2. Redistributions in binary form must reproduce the above copyright
99 * notice, this list of conditions and the following disclaimer in
100 * the documentation and/or other materials provided with the
101 * distribution.
102 *
103 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
104 * and "Vovida Open Communication Application Library (VOCAL)" must
105 * not be used to endorse or promote products derived from this
106 * software without prior written permission. For written
107 * permission, please contact vocal@vovida.org.
108 *
109 * 4. Products derived from this software may not be called "VOCAL", nor
110 * may "VOCAL" appear in their name, without prior written
111 * permission of Vovida Networks, Inc.
112 *
113 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
114 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
115 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
116 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
117 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
118 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
119 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
120 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
121 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
122 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
123 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
124 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
125 * DAMAGE.
126 *
127 * ====================================================================
128 *
129 * This software consists of voluntary contributions made by Vovida
130 * Networks, Inc. and many individuals on behalf of Vovida Networks,
131 * Inc. For more information on Vovida Networks, Inc., please see
132 * <http://www.vovida.org/>.
133 *
134 */
virtual void sendResponse(unsigned int connectionId, unsigned int requestId, const resip::Data &responseData, unsigned int resultCode, const resip::Data &resultText)
virtual void handleStatisticsMessage(resip::StatisticsMessage &statsMessage)
virtual void onDnsCacheDumpRetrieved(std::pair< unsigned long, unsigned long > key, const resip::Data &dnsEntryStrings)
virtual void handleRequest(unsigned int connectionId, unsigned int requestId, const resip::Data &request)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;
std::mutex Mutex
A semaphore that can be locked by only one thread at a time.
Definition Mutex.hxx:37
IpVersion
An enumeration of IP versions.
void list()
Definition userAdmin.cxx:66