reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
AclStore.hxx
Go to the documentation of this file.
1#if !defined(REPRO_ACLSTORE_HXX)
2#define REPRO_ACLSTORE_HXX
3
4#include <list>
5#include "rutil/Data.hxx"
6#include "rutil/RWMutex.hxx"
10
11namespace repro
12{
13
15{
16 public:
23
32
34 typedef std::vector<TlsPeerNameRecord> TlsPeerNameList;
35 typedef std::vector<AddressRecord> AddressList;
36
38 ~AclStore();
39
40 bool addAcl(const resip::Data& tlsPeerName,
41 const resip::Data& address,
42 const short& mask,
43 const short& port,
44 const short& family,
45 const short& transport);
46
48 const short& port,
49 const short& transport);
50
52 const resip::Data& address,
53 const short& mask,
54 const short& port,
55 const short& family,
56 const short& transport);
57
58 void eraseAcl(const resip::Data& key);
59
62 short getAddressMask( const resip::Data& key );
63
64 Key getFirstTlsPeerNameKey(); // return empty if no more
65 Key getNextTlsPeerNameKey(Key& key); // return empty if no more
66 Key getFirstAddressKey(); // return empty if no more
67 Key getNextAddressKey(Key& key); // return empty if no more
68
69 bool isTlsPeerNameTrusted(const std::list<resip::Data>& tlsPeerNames);
70 bool isAddressTrusted(const resip::Tuple& address);
72
73 private:
74 AbstractDb& mDb;
75
76 Key buildKey(const resip::Data& tlsPeerName,
77 const resip::Data& address,
78 const short& mask,
79 const short& port,
80 const short& family,
81 const short& transport) const;
82
83 bool findTlsPeerNameKey(const Key& key); // move cursor to key
84 bool findAddressKey(const Key& key); // move cursor to key
85
86 resip::RWMutex mMutex;
87 TlsPeerNameList mTlsPeerNameList;
88 TlsPeerNameList::iterator mTlsPeerNameCursor;
89 AddressList mAddressList;
90 AddressList::iterator mAddressCursor;
91};
92
93}
94#endif
95
96/* ====================================================================
97 * The Vovida Software License, Version 1.0
98 *
99 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
100 *
101 * Redistribution and use in source and binary forms, with or without
102 * modification, are permitted provided that the following conditions
103 * are met:
104 *
105 * 1. Redistributions of source code must retain the above copyright
106 * notice, this list of conditions and the following disclaimer.
107 *
108 * 2. Redistributions in binary form must reproduce the above copyright
109 * notice, this list of conditions and the following disclaimer in
110 * the documentation and/or other materials provided with the
111 * distribution.
112 *
113 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
114 * and "Vovida Open Communication Application Library (VOCAL)" must
115 * not be used to endorse or promote products derived from this
116 * software without prior written permission. For written
117 * permission, please contact vocal@vovida.org.
118 *
119 * 4. Products derived from this software may not be called "VOCAL", nor
120 * may "VOCAL" appear in their name, without prior written
121 * permission of Vovida Networks, Inc.
122 *
123 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
124 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
125 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
126 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
127 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
128 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
129 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
130 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
131 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
132 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
133 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
134 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
135 * DAMAGE.
136 *
137 * ====================================================================
138 */
AddressRecord(const resip::Data &printableAddress, const int port, const resip::TransportType type)
Definition AclStore.hxx:27
resip::Data Key
Definition AclStore.hxx:33
void eraseAcl(const resip::Data &tlsPeerName, const resip::Data &address, const short &mask, const short &port, const short &family, const short &transport)
Definition AclStore.cxx:289
resip::Data getTlsPeerName(const resip::Data &key)
Definition AclStore.cxx:461
bool isRequestTrusted(const resip::SipMessage &request)
Definition AclStore.cxx:532
std::vector< TlsPeerNameRecord > TlsPeerNameList
Definition AclStore.hxx:34
short getAddressMask(const resip::Data &key)
Definition AclStore.cxx:485
Key getNextTlsPeerNameKey(Key &key)
Definition AclStore.cxx:381
Key getFirstTlsPeerNameKey()
Definition AclStore.cxx:341
bool isAddressTrusted(const resip::Tuple &address)
Definition AclStore.cxx:516
Key getNextAddressKey(Key &key)
Definition AclStore.cxx:441
resip::Tuple getAddressTuple(const resip::Data &key)
Definition AclStore.cxx:473
std::vector< AddressRecord > AddressList
Definition AclStore.hxx:35
bool isTlsPeerNameTrusted(const std::list< resip::Data > &tlsPeerNames)
Definition AclStore.cxx:497
Key getFirstAddressKey()
Definition AclStore.cxx:401
bool addAcl(const resip::Data &tlsPeerName, const resip::Data &address, const short &mask, const short &port, const short &family, const short &transport)
Definition AclStore.cxx:62
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Wraps the readers/writers mutex implementation on your platform.
Definition RWMutex.hxx:29
Represents a SIP message.
Represents a network address.
Definition Tuple.hxx:59
This Class is used to implement a primitive form of RPC using loose XML formatting.
TransportType
An enumeration of transport protocols.
void list()
Definition userAdmin.cxx:66