reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RRList.hxx
Go to the documentation of this file.
1#ifndef RESIP_DNS_RR_LIST
2#define RESIP_DNS_RR_LIST
3
4#include <vector>
5
8
9namespace resip
10{
11class DnsResourceRecord;
12class DnsHostRecord;
13
14class RRList : public IntrusiveListElement<RRList*>
15{
16 public:
17
19 {
20 public:
21 static const int Reserved = 0;
22 static const int Sip = 1;
23 static const int Stun = 2;
24 static const int Http = 3;
25 static const int Enum = 4;
26 };
27
28 typedef std::vector<DnsResourceRecord*> Records;
30 typedef std::vector<RROverlay>::const_iterator Itr;
31 typedef std::vector<Data> DataArr;
32
33 RRList();
34 explicit RRList(const Data& key, const int rrtype, int ttl, int status);
35 explicit RRList(const Data& key, int rrtype);
36 ~RRList();
37 RRList(const RRFactoryBase* factory,
38 const Data& key,
39 const int rrType,
40 Itr begin,
41 Itr end,
42 int ttl);
43
44 RRList(const DnsHostRecord &record, int ttl);
45 void update(const DnsHostRecord &record, int ttl);
46
47 void update(const RRFactoryBase* factory, Itr begin, Itr end, int ttl);
48 Records records(const int protocol);
49 size_t numRecords() { return mRecords.size(); }
50
51 const Data& key() const { return mKey; }
52 int status() const { return mStatus; }
53 int rrType() const { return mRRType; }
54 uint64_t absoluteExpiry() const { return mAbsoluteExpiry; }
55 uint64_t& absoluteExpiry() { return mAbsoluteExpiry; }
56 void log();
58
59 private:
60
61 struct RecordItem
62 {
63 DnsResourceRecord* record;
64 std::vector<int> blacklistedProtocols;
65 };
66
67 typedef std::vector<RecordItem> RecordArr;
68 typedef RecordArr::iterator RecordItr;
69
70 RecordArr mRecords;
71
72 Data mKey;
73 int mRRType;
74
75 int mStatus; // dns query status.
76 uint64_t mAbsoluteExpiry;
77
78 RecordItr find(const Data&);
79 void clear();
80};
81
82}
83
84#endif
85
86
87/* ====================================================================
88 * The Vovida Software License, Version 1.0
89 *
90 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
91 * Copyright (c) 2010 SIP Spectrum, Inc. All rights reserved.
92 *
93 * Redistribution and use in source and binary forms, with or without
94 * modification, are permitted provided that the following conditions
95 * are met:
96 *
97 * 1. Redistributions of source code must retain the above copyright
98 * notice, this list of conditions and the following disclaimer.
99 *
100 * 2. Redistributions in binary form must reproduce the above copyright
101 * notice, this list of conditions and the following disclaimer in
102 * the documentation and/or other materials provided with the
103 * distribution.
104 *
105 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
106 * and "Vovida Open Communication Application Library (VOCAL)" must
107 * not be used to endorse or promote products derived from this
108 * software without prior written permission. For written
109 * permission, please contact vocal@vovida.org.
110 *
111 * 4. Products derived from this software may not be called "VOCAL", nor
112 * may "VOCAL" appear in their name, without prior written
113 * permission of Vovida Networks, Inc.
114 *
115 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
116 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
117 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
118 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
119 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
120 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
121 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
122 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
123 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
124 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
125 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
126 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
127 * DAMAGE.
128 *
129 * ====================================================================
130 *
131 * This software consists of voluntary contributions made by Vovida
132 * Networks, Inc. and many individuals on behalf of Vovida Networks,
133 * Inc. For more information on Vovida Networks, Inc., please see
134 * <http://www.vovida.org/>.
135 *
136 */
Heritable intrusive doubly linked list element templates.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static const int Reserved
Definition RRList.hxx:21
static const int Stun
Definition RRList.hxx:23
static const int Http
Definition RRList.hxx:24
static const int Enum
Definition RRList.hxx:25
static const int Sip
Definition RRList.hxx:22
std::vector< Data > DataArr
Definition RRList.hxx:31
std::vector< RROverlay >::const_iterator Itr
Definition RRList.hxx:30
int rrType() const
Definition RRList.hxx:53
Records records(const int protocol)
Definition RRList.cxx:121
const Data & key() const
Definition RRList.hxx:51
uint64_t & absoluteExpiry()
Definition RRList.hxx:55
IntrusiveListElement< RRList * > LruList
Definition RRList.hxx:29
int status() const
Definition RRList.hxx:52
EncodeStream & encodeRRList(EncodeStream &strm)
Definition RRList.cxx:155
std::vector< DnsResourceRecord * > Records
Definition RRList.hxx:28
void update(const DnsHostRecord &record, int ttl)
Definition RRList.cxx:59
size_t numRecords()
Definition RRList.hxx:49
uint64_t absoluteExpiry() const
Definition RRList.hxx:54
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t
Definition Stun.hxx:39
#define EncodeStream