reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TrickleIceContents.hxx
Go to the documentation of this file.
1#if !defined(RESIP_TRICKLEICECONTENTS_HXX)
2#define RESIP_TRICKLEICECONTENTS_HXX
3
6#include "rutil/Data.hxx"
7#include "rutil/HashMap.hxx"
9#include "rutil/XMLCursor.hxx"
10
11namespace resip
12{
13
14/* Provides a way to handle the application/trickle-ice-sdpfrag
15 content-type from SIP INFO messages.
16 Attempts to adhere to the IETF RFC 8840
17 https://datatracker.ietf.org/doc/html/rfc8840
18*/
19
21{
22
23 public:
24
26 TrickleIceContents(const HeaderFieldValue& hfv, const Mime& contentTypes);
28 virtual ~TrickleIceContents();
29
31
36 virtual Contents* clone() const override;
37
38 virtual EncodeStream& encodeParsed(EncodeStream& str) const override;
39 virtual void parse(ParseBuffer& pb) override;
40 static const Mime& getStaticType();
41
42 void addAttribute(const Data& key, const Data& value = Data::Empty);
43 void addMedium(const SdpContents::Session::Medium& medium);
44
45 static bool init();
46
47 const SdpContents::Session::MediumContainer& media() const {checkParsed(); return mMedia;}
48
49 const std::list<Data>& getValues(const Data& key) const;
50
51 private:
52 AttributeHelper mAttributeHelper;
54};
55
57
58}
59
60
61#endif
62
63/* ====================================================================
64 *
65 * Copyright (c) 2022, Daniel Pocock, https://danielpocock.com
66 * Copyright (c) 2022, Software Freedom Institute LLC, https://softwarefreedom.institute
67 *
68 * Redistribution and use in source and binary forms, with or without
69 * modification, are permitted provided that the following conditions
70 * are met:
71 *
72 * 1. Redistributions of source code must retain the above copyright
73 * notice, this list of conditions and the following disclaimer.
74 *
75 * 2. Redistributions in binary form must reproduce the above copyright
76 * notice, this list of conditions and the following disclaimer in
77 * the documentation and/or other materials provided with the
78 * distribution.
79 *
80 * 3. Neither the name of the author(s) nor the names of any contributors
81 * may be used to endorse or promote products derived from this software
82 * without specific prior written permission.
83 *
84 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
85 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
86 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
87 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
88 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
89 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
90 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
91 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
92 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
93 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
94 * SUCH DAMAGE.
95 *
96 * ====================================================================
97 *
98 *
99 */
100
Wraps your platform's implementation of hash_map, hash_multimap, and hash_set.
Base class for all SIP body types.
Definition Contents.hxx:51
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
static const Data Empty
Constant that represents a zero-length data.
Definition Data.hxx:882
void checkParsed() const
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Provides string-parsing functionality with protection from buffer overflow.
process m= (media announcement) blocks
std::list< Medium > MediumContainer
virtual Contents * clone() const override
duplicate an TrickleIceContents object
void addMedium(const SdpContents::Session::Medium &medium)
static const Mime & getStaticType()
virtual void parse(ParseBuffer &pb) override
const std::list< Data > & getValues(const Data &key) const
virtual EncodeStream & encodeParsed(EncodeStream &str) const override
TrickleIceContents & operator=(const TrickleIceContents &rhs)
const SdpContents::Session::MediumContainer & media() const
void addAttribute(const Data &key, const Data &value=Data::Empty)
dcm! – add UnusedChecking(_enum) below;
static bool invokeTrickleIceContentsInit
#define EncodeStream