reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
IsTrustedNode.cxx
Go to the documentation of this file.
1
#if defined(HAVE_CONFIG_H)
2
#include "config.h"
3
#endif
4
5
#include "
resip/stack/SipMessage.hxx
"
6
#include "
resip/stack/Transport.hxx
"
7
#include "
resip/stack/Helper.hxx
"
8
#include "
repro/monkeys/IsTrustedNode.hxx
"
9
#include "
repro/RequestContext.hxx
"
10
#include "
repro/Proxy.hxx
"
11
#include "
repro/ProxyConfig.hxx
"
12
#include "
repro/AclStore.hxx
"
13
#include <ostream>
14
15
#include "
rutil/Logger.hxx
"
16
#define RESIPROCATE_SUBSYSTEM resip::Subsystem::REPRO
17
18
using namespace
resip
;
19
using namespace
repro
;
20
using namespace
std;
21
22
KeyValueStore::Key
IsTrustedNode::mFromTrustedNodeKey
=
Proxy::allocateRequestKeyValueStoreKey
();
23
24
IsTrustedNode::IsTrustedNode
(
ProxyConfig
& config) :
25
Processor
(
"IsTrustedNode"
),
26
mAclStore(config.getDataStore()->mAclStore)
27
{}
28
29
IsTrustedNode::~IsTrustedNode
()
30
{}
31
32
Processor::processor_action_t
33
IsTrustedNode::process
(
RequestContext
& context)
34
{
35
DebugLog
(<<
"Monkey handling request: "
<< *
this
36
<<
"; reqcontext = "
<< context);
37
38
resip::SipMessage
& request = context.
getOriginalRequest
();
39
40
if
(
mAclStore
.
isRequestTrusted
(request))
41
{
42
context.
getKeyValueStore
().
setBoolValue
(
mFromTrustedNodeKey
,
true
);
43
}
44
else
45
{
46
context.
getKeyValueStore
().
setBoolValue
(
mFromTrustedNodeKey
,
false
);
47
48
// strip PAI headers that we don't trust
49
if
(context.
getProxy
().
isPAssertedIdentityProcessingEnabled
() && request.
exists
(
h_PAssertedIdentities
))
50
{
51
request.
remove
(
h_PAssertedIdentities
);
52
}
53
}
54
55
return
Processor::Continue
;
56
}
57
58
59
/* ====================================================================
60
* The Vovida Software License, Version 1.0
61
*
62
* Copyright (c) 2026, SIP Spectrum, Inc. https://www.sipspectrum.com
63
* Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
64
*
65
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions
67
* are met:
68
*
69
* 1. Redistributions of source code must retain the above copyright
70
* notice, this list of conditions and the following disclaimer.
71
*
72
* 2. Redistributions in binary form must reproduce the above copyright
73
* notice, this list of conditions and the following disclaimer in
74
* the documentation and/or other materials provided with the
75
* distribution.
76
*
77
* 3. The names "VOCAL", "Vovida Open Communication Application Library",
78
* and "Vovida Open Communication Application Library (VOCAL)" must
79
* not be used to endorse or promote products derived from this
80
* software without prior written permission. For written
81
* permission, please contact vocal@vovida.org.
82
*
83
* 4. Products derived from this software may not be called "VOCAL", nor
84
* may "VOCAL" appear in their name, without prior written
85
* permission of Vovida Networks, Inc.
86
*
87
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
88
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
89
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
90
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
91
* NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
92
* IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
93
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
94
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
95
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
96
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
97
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
98
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
99
* DAMAGE.
100
*
101
* ====================================================================
102
*
103
* This software consists of voluntary contributions made by Vovida
104
* Networks, Inc. and many individuals on behalf of Vovida Networks,
105
* Inc. For more information on Vovida Networks, Inc., please see
106
* <http://www.vovida.org/>.
107
*
108
*/
AclStore.hxx
Helper.hxx
IsTrustedNode.hxx
Logger.hxx
DebugLog
#define DebugLog(args_)
Definition
Logger.hxx:128
ProxyConfig.hxx
Proxy.hxx
RequestContext.hxx
SipMessage.hxx
Transport.hxx
repro::AclStore::isRequestTrusted
bool isRequestTrusted(const resip::SipMessage &request)
Definition
AclStore.cxx:532
repro::IsTrustedNode::process
virtual processor_action_t process(RequestContext &)
Definition
IsTrustedNode.cxx:33
repro::IsTrustedNode::mAclStore
AclStore & mAclStore
Definition
IsTrustedNode.hxx:24
repro::IsTrustedNode::mFromTrustedNodeKey
static resip::KeyValueStore::Key mFromTrustedNodeKey
Definition
IsTrustedNode.hxx:16
repro::IsTrustedNode::~IsTrustedNode
virtual ~IsTrustedNode()
Definition
IsTrustedNode.cxx:29
repro::IsTrustedNode::IsTrustedNode
IsTrustedNode(ProxyConfig &config)
Definition
IsTrustedNode.cxx:24
repro::Processor
Definition
Processor.hxx:15
repro::Processor::processor_action_t
processor_action_t
Definition
Processor.hxx:29
repro::Processor::Continue
@ Continue
Definition
Processor.hxx:30
repro::ProxyConfig
Definition
ProxyConfig.hxx:15
repro::Proxy::isPAssertedIdentityProcessingEnabled
bool isPAssertedIdentityProcessingEnabled()
Definition
Proxy.hxx:84
repro::Proxy::allocateRequestKeyValueStoreKey
static resip::KeyValueStore::Key allocateRequestKeyValueStoreKey()
Definition
Proxy.cxx:58
repro::RequestContext
Definition
RequestContext.hxx:29
repro::RequestContext::getOriginalRequest
resip::SipMessage & getOriginalRequest()
Returns the SipMessage associated with the server transaction.
Definition
RequestContext.cxx:837
repro::RequestContext::getProxy
Proxy & getProxy()
Definition
RequestContext.cxx:1053
repro::RequestContext::getKeyValueStore
resip::KeyValueStore & getKeyValueStore()
Definition
RequestContext.hxx:78
resip::KeyValueStore::setBoolValue
void setBoolValue(Key key, bool value)
Definition
KeyValueStore.hxx:36
resip::KeyValueStore::Key
unsigned long Key
Definition
KeyValueStore.hxx:15
resip::SipMessage
Represents a SIP message.
Definition
SipMessage.hxx:175
resip::SipMessage::exists
bool exists(const HeaderBase &headerType) const
Returns true if the given header field is present, false otherwise.
Definition
SipMessage.cxx:1466
resip::SipMessage::remove
void remove(const HeaderBase &headerType)
Prevents a header field from being present when the message is prepared for sending to a transport.
Definition
SipMessage.hxx:770
repro
This Class is used to implement a primitive form of RPC using loose XML formatting.
Definition
AbstractDb.hxx:16
resip
dcm! – add UnusedChecking(_enum) below;
Definition
AbstractFifo.hxx:16
resip::h_PAssertedIdentities
H_PAssertedIdentitys h_PAssertedIdentities
Definition
Headers.cxx:215
repro
monkeys
IsTrustedNode.cxx
Generated by
1.9.8