Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 1 | // Copyright (C) 2002 Federico Montesino Pouzols <fedemp@altern.org>. |
| 2 | // |
| 3 | // This program is free software; you can redistribute it and/or modify |
| 4 | // it under the terms of the GNU General Public License as published by |
| 5 | // the Free Software Foundation; either version 2 of the License, or |
| 6 | // (at your option) any later version. |
| 7 | // |
| 8 | // This program is distributed in the hope that it will be useful, |
| 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | // GNU General Public License for more details. |
| 12 | // |
| 13 | // You should have received a copy of the GNU General Public License |
| 14 | // along with this program; if not, write to the Free Software |
| 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 16 | // |
| 17 | // As a special exception, you may use this file as part of a free software |
| 18 | // library without restriction. Specifically, if other files instantiate |
| 19 | // templates or use macros or inline functions from this file, or you compile |
| 20 | // this file and link it with other files to produce an executable, this |
| 21 | // file does not by itself cause the resulting executable to be covered by |
| 22 | // the GNU General Public License. This exception does not however |
| 23 | // invalidate any other reasons why the executable file might be covered by |
| 24 | // the GNU General Public License. |
| 25 | // |
| 26 | // This exception applies only to the code released under the name GNU |
| 27 | // ccRTP. If you copy code from other releases into a copy of GNU |
| 28 | // ccRTP, as the General Public License permits, the exception does |
| 29 | // not apply to the code that you add in this way. To avoid misleading |
| 30 | // anyone as to the status of such modified files, you must delete |
| 31 | // this exception notice from them. |
| 32 | // |
| 33 | // If you write modifications of your own for GNU ccRTP, it is your choice |
| 34 | // whether to permit this exception to apply to your modifications. |
| 35 | // If you do not wish that, delete this exception notice. |
| 36 | // |
| 37 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 38 | #ifndef CCXX_RTP_RTPPKT_H_ |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 39 | #define CCXX_RTP_RTPPKT_H_ |
| 40 | |
| 41 | #include <ccrtp/base.h> |
| 42 | #include <ccrtp/formats.h> |
| 43 | #include <ccrtp/CryptoContext.h> |
| 44 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 45 | NAMESPACE_COMMONCPP |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * @file rtppkt.h |
| 49 | * |
| 50 | * @short RTP packets handling. |
| 51 | **/ |
| 52 | |
| 53 | /** |
| 54 | * @defgroup rtppacket RTP data packets manipulation. |
| 55 | * @{ |
| 56 | **/ |
| 57 | |
| 58 | /** |
| 59 | * @class RTPPacket |
| 60 | * @short A base class for both IncomingRTPPkt and OutgoingRTPPkt. |
| 61 | * |
| 62 | * Provides common low level header structures and related |
| 63 | * methods. This class provides an interface that allows for partial |
| 64 | * and generic manipulation of RTP data packets. Values are returned |
| 65 | * in host order, except raw structures, which are returned as they |
| 66 | * are sent through the network. |
| 67 | * |
| 68 | * @author David Sugar <dyfet@ostel.com> |
| 69 | **/ |
| 70 | |
| 71 | class CryptoContext; |
| 72 | |
| 73 | class __EXPORT RTPPacket |
| 74 | { |
| 75 | private: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 76 | struct RTPFixedHeader; |
| 77 | struct RTPHeaderExt; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 78 | |
| 79 | public: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 80 | /** |
| 81 | * Constructor, construct a packet object given the memory |
| 82 | * zone its content (header and payload) is stored. Commonly |
| 83 | * used to build RTPPacket objects from incoming data. |
| 84 | * |
| 85 | * @param block whole packet |
| 86 | * @param len total length (header + payload + padding) of the |
| 87 | * packet |
| 88 | * @param duplicate whether to memcopy the packet. At present, |
| 89 | * this feature is not used. |
| 90 | * @note used in IncomingRTPPkt. |
| 91 | **/ |
| 92 | RTPPacket(const unsigned char* const block, size_t len, |
| 93 | bool duplicate = false); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 94 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 95 | /** |
| 96 | * Construct a packet object without specifying its real |
| 97 | * content yet. Commonly used for outgoing packets. Header |
| 98 | * fields and payload must be filled in by another methods or |
| 99 | * by a derived constructor. |
| 100 | * |
| 101 | * @param hdrlen length of the header (including CSRC and extension). |
| 102 | * @param plen payload length. |
| 103 | * @param paddinglen pad packet to a multiple of paddinglen |
| 104 | * @note used in OutgoingRTPPkt. |
| 105 | */ |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 106 | RTPPacket(size_t hdrlen, size_t plen, uint8 paddinglen, CryptoContext* pcc= NULL); |
| 107 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 108 | /** |
| 109 | * Get the length of the header, including contributing |
| 110 | * sources identifiers and header extension, if present. |
| 111 | * |
| 112 | * @return number of octets. |
| 113 | **/ |
| 114 | inline uint32 |
| 115 | getHeaderSize() const |
| 116 | { return hdrSize; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 117 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 118 | /** |
| 119 | * @return pointer to the payload section of the packet. |
| 120 | **/ |
| 121 | inline const uint8* const |
| 122 | getPayload() const |
| 123 | { return (uint8*)(buffer + getHeaderSize()); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 124 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 125 | /** |
| 126 | * @return length of the payload section, in octets. |
| 127 | **/ |
| 128 | inline uint32 |
| 129 | getPayloadSize() const |
| 130 | { return payloadSize; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 131 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 132 | /** |
| 133 | * @return value of the PT header field. |
| 134 | **/ |
| 135 | inline PayloadType |
| 136 | getPayloadType() const |
| 137 | { return static_cast<PayloadType>(getHeader()->payload); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 138 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 139 | /** |
| 140 | * @return value of the sequence number header field, in host order. |
| 141 | **/ |
| 142 | inline uint16 |
| 143 | getSeqNum() const |
| 144 | { return cachedSeqNum; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 145 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 146 | /** |
| 147 | * @return packet timestamp in host order. |
| 148 | **/ |
| 149 | inline uint32 |
| 150 | getTimestamp() const |
| 151 | { return cachedTimestamp; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 152 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 153 | /** |
| 154 | * @return RTP protocol version of packet. |
| 155 | **/ |
| 156 | inline uint8 |
| 157 | getProtocolVersion() const |
| 158 | { return getHeader()->version; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 159 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 160 | /** |
| 161 | * Ask whether the packet contains padding bytes at the end |
| 162 | * @return true if the header padding bit is 1. |
| 163 | **/ |
| 164 | inline bool |
| 165 | isPadded() const |
| 166 | { return getHeader()->padding; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 167 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 168 | /** |
| 169 | * Get the number of octets padding the end of the payload |
| 170 | * section. |
| 171 | * |
| 172 | * @return Padding length in octets. |
| 173 | **/ |
| 174 | inline uint8 |
| 175 | getPaddingSize() const |
| 176 | { return buffer[total - 1]; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 177 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 178 | /** |
| 179 | * Ask whether the packet is marked (for isntance, is a new |
| 180 | * talk spurt in some audio profiles). |
| 181 | * |
| 182 | * @return true is the header marker bit is 1. |
| 183 | **/ |
| 184 | inline bool |
| 185 | isMarked() const |
| 186 | { return getHeader()->marker; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 187 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 188 | /** |
| 189 | * Ask whether the packet contains header extensions. |
| 190 | * |
| 191 | * @return true if the header extension bit is 1. |
| 192 | **/ |
| 193 | inline bool |
| 194 | isExtended() const |
| 195 | { return getHeader()->extension; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 196 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 197 | /** |
| 198 | * Get the number of contributing sources specified in the |
| 199 | * packet header. |
| 200 | **/ |
| 201 | inline uint16 |
| 202 | getCSRCsCount() const |
| 203 | { return getHeader()->cc; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 204 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 205 | /** |
| 206 | * Get the 32-bit identifiers of the contributing sources for |
| 207 | * the packet as an array, of length getCSRCsCount(). |
| 208 | * |
| 209 | * @return An array of CSRC identifiers as they are in the |
| 210 | * packet (in network order). |
| 211 | **/ |
| 212 | inline const uint32* |
| 213 | getCSRCs() const |
| 214 | { return static_cast<const uint32*>(&(getHeader()->sources[1])); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 215 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 216 | /** |
| 217 | * Get the first 16 bits (in network order) of the header of |
| 218 | * the RTP header extension. Its meaning is undefined at this |
| 219 | * level. |
| 220 | * |
| 221 | * @return 0 if the packet has no header extension, otherwise |
| 222 | * the first 16 bits of the header extension, in |
| 223 | * network order. |
| 224 | * |
| 225 | * @note 0 could be a valid value for the first 16 bits, in |
| 226 | * that case RTPPacket::isExtended() should be use. |
| 227 | **/ |
| 228 | inline uint16 |
| 229 | getHdrExtUndefined() const |
| 230 | { return (isExtended()? getHeaderExt()->undefined : 0); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 231 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 232 | /** |
| 233 | * Get the length (in octets) of the data contained in the |
| 234 | * header extension. Note that this length does not include |
| 235 | * the four octets at the beginning of the header extension. |
| 236 | * |
| 237 | * @return 0 if the packet has no header extension, otherwise |
| 238 | * the length. |
| 239 | * |
| 240 | * @note 0 is a valid value for this field, so |
| 241 | * RTPPacket::isExtended() should be used. |
| 242 | **/ |
| 243 | inline uint32 |
| 244 | getHdrExtSize() const |
| 245 | { return (isExtended()? |
| 246 | (static_cast<uint32>(ntohs(getHeaderExt()->length)) << 2) : |
| 247 | 0); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 248 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 249 | /** |
| 250 | * Get the content of the header extension. |
| 251 | * |
| 252 | * @return NULL if the packet has no header extension, otherwise |
| 253 | * a pointer to the packet header extension content. |
| 254 | **/ |
| 255 | inline const unsigned char* |
| 256 | getHdrExtContent() const |
| 257 | { return (isExtended() ? |
| 258 | (reinterpret_cast<const unsigned char*>(getHeaderExt()) + |
| 259 | sizeof(RTPHeaderExt)) : |
| 260 | NULL); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 261 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 262 | /** |
| 263 | * Get the raw packet as it will be sent through the network. |
| 264 | * |
| 265 | * @return memory zone where the raw packet structure is |
| 266 | * stored in. |
| 267 | **/ |
| 268 | inline const unsigned char* const |
| 269 | getRawPacket() const |
| 270 | { return buffer; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 271 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 272 | /** |
| 273 | * Get the raw packet length, including header, extension, |
| 274 | * payload and padding. |
| 275 | * |
| 276 | * @return size of the raw packet structure. |
| 277 | **/ |
| 278 | inline uint32 |
| 279 | getRawPacketSize() const |
| 280 | { return total; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 281 | |
| 282 | inline uint32 |
| 283 | getRawPacketSizeSrtp() const |
| 284 | { return total + srtpLength; } |
| 285 | |
| 286 | inline size_t |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 287 | getSizeOfFixedHeader() const |
| 288 | { return sizeof(RTPFixedHeader); } |
| 289 | |
| 290 | /** |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 291 | * Re-compute payload length. |
| 292 | * |
| 293 | * This recomputation may be necessary in case of SRTP. We need to decrypt |
| 294 | * the packet before we can handle padding. See @c takeInDataPacket in |
| 295 | * @c incqueue.cpp |
| 296 | * |
| 297 | * @param padding |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 298 | * If true then set padding flag in RTP header and re-compute |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 299 | * payloadSize. |
| 300 | */ |
| 301 | void reComputePayLength(bool padding); |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 302 | |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 303 | protected: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 304 | /** |
| 305 | * Destructor, free the buffer provided in the constructor. |
| 306 | **/ |
| 307 | inline virtual ~RTPPacket() |
| 308 | { endPacket(); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 309 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 310 | /** |
| 311 | * Free memory allocated for the packet. |
| 312 | **/ |
| 313 | void |
| 314 | endPacket(); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 315 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 316 | /** |
| 317 | * Return low level structure for the header of the packet. |
| 318 | * |
| 319 | * @return RTPFixedHeader pointer to the header of the packet. |
| 320 | **/ |
| 321 | inline RTPFixedHeader* |
| 322 | getHeader() const |
| 323 | { return reinterpret_cast<RTPFixedHeader*>(buffer); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 324 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 325 | inline void |
| 326 | setExtension(bool e) |
| 327 | { getHeader()->extension = e; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 328 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 329 | /** |
| 330 | * Get a pointer to RTPHeaderExt pointing after the RTP header |
| 331 | * (fixed part plus contributing sources). No check for |
| 332 | * for the X bit is done. |
| 333 | * |
| 334 | * @return header extension if present, garbage if not. |
| 335 | **/ |
| 336 | inline const RTPHeaderExt* |
| 337 | getHeaderExt() const |
| 338 | { |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 339 | uint32 fixsize = sizeof(RTPFixedHeader) + (getHeader()->cc << 2); |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 340 | return (reinterpret_cast<RTPHeaderExt*>(buffer + fixsize)); |
| 341 | } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 342 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 343 | /** |
| 344 | * Obtain the absolute timestamp carried in the packet header. |
| 345 | * |
| 346 | * @return 32-bit timestamp in host order. |
| 347 | **/ |
| 348 | inline uint32 |
| 349 | getRawTimestamp() const |
| 350 | { return ntohl(getHeader()->timestamp); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 351 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 352 | inline void |
| 353 | setbuffer(const void* src, size_t len, size_t pos) |
| 354 | { memcpy(buffer + pos,src,len); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 355 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 356 | /// Packet sequence number in host order. |
| 357 | uint16 cachedSeqNum; |
| 358 | /// Packet timestamp in host order (includes initial shift). |
| 359 | uint32 cachedTimestamp; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 360 | |
| 361 | /** |
| 362 | * Offset into packet memory pointing to area for SRTP data. |
| 363 | * |
| 364 | * This offset points to the memory where the SRTP protect will |
| 365 | * store the authentication and MKI data. |
| 366 | */ |
| 367 | uint32 srtpDataOffset; |
| 368 | |
| 369 | /** |
| 370 | * Lebgth of additional SRTP data. |
| 371 | * |
| 372 | * Covers the SRTP authentication and MKI data. |
| 373 | */ |
| 374 | int32 srtpLength; |
| 375 | |
| 376 | /// total length, including header, payload and padding |
| 377 | uint32 total; |
| 378 | |
| 379 | /// note: payload (not full packet) size. |
| 380 | uint32 payloadSize; |
| 381 | |
| 382 | private: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 383 | /// packet in memory |
| 384 | unsigned char* buffer; |
| 385 | /// size of the header, including contributing sources and extensions |
| 386 | uint32 hdrSize; |
| 387 | /// whether the object was contructed with duplicated = true |
| 388 | bool duplicated; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 389 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 390 | #ifdef CCXX_PACKED |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 391 | #pragma pack(1) |
| 392 | #endif |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 393 | /** |
| 394 | * @struct RTPFixedHeader |
| 395 | * @short RTP fixed header as it is send through the network. |
| 396 | * |
| 397 | * A low-level representation for generic RTP packet header as |
| 398 | * defined in RFC 1889. A packet consists of the fixed RTP |
| 399 | * header, a possibly empty list of contributing sources and |
| 400 | * the payload. Header contents are kept in network (big |
| 401 | * endian) order. |
| 402 | **/ |
| 403 | struct RTPFixedHeader |
| 404 | { |
| 405 | #if __BYTE_ORDER == __BIG_ENDIAN |
| 406 | /// For big endian boxes |
| 407 | unsigned char version:2; ///< Version, currently 2 |
| 408 | unsigned char padding:1; ///< Padding bit |
| 409 | unsigned char extension:1; ///< Extension bit |
| 410 | unsigned char cc:4; ///< CSRC count |
| 411 | unsigned char marker:1; ///< Marker bit |
| 412 | unsigned char payload:7; ///< Payload type |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 413 | #else |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 414 | /// For little endian boxes |
| 415 | unsigned char cc:4; ///< CSRC count |
| 416 | unsigned char extension:1; ///< Extension bit |
| 417 | unsigned char padding:1; ///< Padding bit |
| 418 | unsigned char version:2; ///< Version, currently 2 |
| 419 | unsigned char payload:7; ///< Payload type |
| 420 | unsigned char marker:1; ///< Marker bit |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 421 | #endif |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 422 | uint16 sequence; ///< sequence number |
| 423 | uint32 timestamp; ///< timestamp |
| 424 | uint32 sources[1]; ///< contributing sources |
| 425 | }; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 426 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 427 | /** |
| 428 | * @struct RFC2833Payload |
| 429 | * @short a structure defining RFC2833 Telephony events. |
| 430 | * |
| 431 | * structure to define RFC2833 telephony events in RTP. You can |
| 432 | * use this by recasing the pointer returned by getPayload(). |
| 433 | */ |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 434 | |
| 435 | public: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 436 | struct RFC2833Payload |
| 437 | { |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 438 | #if __BYTE_ORDER == __BIG_ENDIAN |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 439 | uint8 event : 8; |
| 440 | bool ebit : 1; |
| 441 | bool rbit : 1; |
| 442 | uint8 vol : 6; |
| 443 | uint16 duration : 16; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 444 | #else |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 445 | uint8 event : 8; |
| 446 | uint8 vol : 6; |
| 447 | bool rbit : 1; |
| 448 | bool ebit : 1; |
| 449 | uint16 duration : 16; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 450 | #endif |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 451 | }; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 452 | |
| 453 | private: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 454 | /** |
| 455 | * @struct RTPHeaderExt |
| 456 | * |
| 457 | * Fixed component of the variable-length header extension, |
| 458 | * appended to the fixed header, after the CSRC list, when X |
| 459 | * == 1. |
| 460 | **/ |
| 461 | struct RTPHeaderExt |
| 462 | { |
| 463 | uint16 undefined; ///< to be defined |
| 464 | uint16 length; ///< number of 32-bit words in the extension |
| 465 | }; |
| 466 | #ifdef CCXX_PACKED |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 467 | #pragma pack() |
| 468 | #endif |
| 469 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 470 | /* definitions for access to most common 2833 fields... */ |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 471 | |
| 472 | public: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 473 | /** |
| 474 | * Fetch a raw 2833 packet. |
| 475 | * |
| 476 | * @return low level 2833 data structure. |
| 477 | */ |
| 478 | inline struct RFC2833Payload *getRaw2833Payload(void) |
| 479 | {return (struct RFC2833Payload *)getPayload();} |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 480 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 481 | /** |
| 482 | * Fetch 2833 duration field. |
| 483 | * |
| 484 | * @return 2833 duration in native host machine byte order. |
| 485 | */ |
| 486 | inline uint16 get2833Duration(void) |
| 487 | {return ntohs(getRaw2833Payload()->duration);} |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 488 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 489 | /** |
| 490 | * Set 2833 duration field. |
| 491 | * |
| 492 | * @param timestamp to use, native host machine byte order. |
| 493 | */ |
| 494 | inline void set2833Duration(uint16 timestamp) |
| 495 | {getRaw2833Payload()->duration = htons(timestamp);} |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 496 | }; |
| 497 | |
| 498 | /** |
| 499 | * @class OutgoingRTPPkt |
| 500 | * @short RTP packets being sent. |
| 501 | * |
| 502 | * This class is intented to construct packet objects just before they |
| 503 | * are inserted into the sending queue, so that they are processed in |
| 504 | * a understandable and format independent manner inside the stack. |
| 505 | * |
| 506 | * @author Federico Montesino Pouzols <fedemp@altern.org> |
| 507 | **/ |
| 508 | class __EXPORT OutgoingRTPPkt : public RTPPacket |
| 509 | { |
| 510 | public: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 511 | /** |
| 512 | * Construct a new packet to be sent, containing several |
| 513 | * contributing source identifiers, header extensions and |
| 514 | * payload. |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 515 | * |
| 516 | * A new copy in memory (holding all this components |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 517 | * along with the fixed header) is created. If the pointer |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 518 | * to the SRTP CryptoContext is not NULL and holds a CryptoContext |
| 519 | * for the SSRC take the SSRC data into account when computing |
| 520 | * the required memory buffer. |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 521 | * |
| 522 | * @param csrcs array of countributing source 32-bit |
| 523 | * identifiers, in host order. |
| 524 | * @param numcsrc number of CSRC identifiers in the array. |
| 525 | * @param hdrext whole header extension. |
| 526 | * @param hdrextlen size of whole header extension, in octets. |
| 527 | * @param data payload. |
| 528 | * @param datalen payload length, in octets. |
| 529 | * @param paddinglen pad packet to a multiple of paddinglen. |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 530 | * @param pcc Pointer to the SRTP CryptoContext, defaults to NULL |
| 531 | * if not specified. |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 532 | * |
| 533 | * @note For efficiency purposes, since this constructor is |
| 534 | * valid for all packets but is too complex for the common |
| 535 | * case, two simpler others are provided. |
| 536 | **/ |
| 537 | OutgoingRTPPkt(const uint32* const csrcs, uint16 numcsrc, |
| 538 | const unsigned char* const hdrext, uint32 hdrextlen, |
| 539 | const unsigned char* const data, size_t datalen, |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 540 | uint8 paddinglen= 0, CryptoContext* pcc= NULL); |
| 541 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 542 | /** |
| 543 | * Construct a new packet to be sent, containing several |
| 544 | * contributing source identifiers and payload. |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 545 | * |
| 546 | * A new copy in |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 547 | * memory (holding all this components along with the fixed |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 548 | * header) is created. If the pointer |
| 549 | * to the SRTP CryptoContext is not NULL and holds a CryptoContext |
| 550 | * for the SSRC take the SSRC data into account when computing |
| 551 | * the required memory buffer. |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 552 | * |
| 553 | * @param csrcs array of countributing source 32-bit |
| 554 | * identifiers, in host order. |
| 555 | * @param numcsrc number of CSRC identifiers in the array. |
| 556 | * @param data payload. |
| 557 | * @param datalen payload length, in octets. |
| 558 | * @param paddinglen pad packet to a multiple of paddinglen. |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 559 | * @param pcc Pointer to the SRTP CryptoContext, defaults to NULL |
| 560 | * if not specified. |
| 561 | **/ |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 562 | OutgoingRTPPkt(const uint32* const csrcs, uint16 numcsrc, |
| 563 | const unsigned char* const data, size_t datalen, |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 564 | uint8 paddinglen= 0, CryptoContext* pcc= NULL); |
| 565 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 566 | /** |
| 567 | * Construct a new packet (fast variant, with no contributing |
| 568 | * sources and no header extension) to be sent. |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 569 | * |
| 570 | * A new copy in |
| 571 | * memory (holding the whole packet) is created. If the pointer |
| 572 | * to the SRTP CryptoContext is not NULL and holds a CryptoContext |
| 573 | * for the SSRC take the SSRC data into account when computing |
| 574 | * the required memory buffer. |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 575 | * |
| 576 | * @param data payload. |
| 577 | * @param datalen payload length, in octets. |
| 578 | * @param paddinglen pad packet to a multiple of paddinglen. |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 579 | * @param pcc Pointer to the SRTP CryptoContext, defaults to NULL |
| 580 | * if not specified. |
| 581 | **/ |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 582 | OutgoingRTPPkt(const unsigned char* const data, size_t datalen, |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 583 | uint8 paddinglen= 0, CryptoContext* pcc= NULL); |
| 584 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 585 | ~OutgoingRTPPkt() |
| 586 | { } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 587 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 588 | /** |
| 589 | * @param pt Packet payload type. |
| 590 | **/ |
| 591 | inline void |
| 592 | setPayloadType(PayloadType pt) |
| 593 | { getHeader()->payload = pt; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 594 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 595 | /** |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 596 | * Sets the sequence number in the header. |
| 597 | * |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 598 | * @param seq Packet sequence number, in host order. |
| 599 | **/ |
| 600 | inline void |
| 601 | setSeqNum(uint16 seq) |
| 602 | { |
| 603 | cachedSeqNum = seq; |
| 604 | getHeader()->sequence = htons(seq); |
| 605 | } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 606 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 607 | /** |
| 608 | * @param pts Packet timestamp, in host order. |
| 609 | **/ |
| 610 | inline void |
| 611 | setTimestamp(uint32 pts) |
| 612 | { |
| 613 | cachedTimestamp = pts; |
| 614 | getHeader()->timestamp = htonl(pts); |
| 615 | } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 616 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 617 | /** |
| 618 | * Set synchronization source numeric identifier. |
| 619 | * |
| 620 | * @param ssrc 32-bit Synchronization SouRCe numeric |
| 621 | * identifier, in host order. |
| 622 | **/ |
| 623 | inline void |
| 624 | setSSRC(uint32 ssrc) const |
| 625 | { getHeader()->sources[0] = htonl(ssrc); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 626 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 627 | /** |
| 628 | * Set synchronization source numeric identifier. Special |
| 629 | * version to save endianness conversion. |
| 630 | * |
| 631 | * @param ssrc 32-bit Synchronization SouRCe numeric |
| 632 | * identifier, in network order. |
| 633 | **/ |
| 634 | inline void |
| 635 | setSSRCNetwork(uint32 ssrc) const |
| 636 | { getHeader()->sources[0] = ssrc; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 637 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 638 | /** |
| 639 | * Specify the value of the marker bit. By default, the marker |
| 640 | * bit of outgoing packets is false/0. This method allows to |
| 641 | * explicity specify and change that value. |
| 642 | * |
| 643 | * @param mark value for the market bit. |
| 644 | */ |
| 645 | inline void |
| 646 | setMarker(bool mark) |
| 647 | { getHeader()->marker = mark; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 648 | |
| 649 | /** |
| 650 | * Called packet is setup. |
| 651 | * |
| 652 | * This private method computes the SRTP data and stores it in the |
| 653 | * packet. Then encrypt the payload data (ex padding). |
| 654 | */ |
| 655 | void protect(uint32 ssrc, CryptoContext* pcc); |
| 656 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 657 | /** |
| 658 | * Outgoing packets are equal if their sequence numbers match. |
| 659 | **/ |
| 660 | inline bool |
| 661 | operator==(const OutgoingRTPPkt &p) const |
| 662 | { return ( this->getSeqNum() == p.getSeqNum() ); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 663 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 664 | /** |
| 665 | * Outgoing packets are not equal if their sequence numbers differ. |
| 666 | **/ |
| 667 | inline bool |
| 668 | operator!=(const OutgoingRTPPkt &p) const |
| 669 | { return ( this->getSeqNum() != p.getSeqNum() ); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 670 | |
| 671 | private: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 672 | /** |
| 673 | * Copy constructor from objects of its same kind, declared |
| 674 | * private to avoid its use. |
| 675 | **/ |
| 676 | OutgoingRTPPkt(const OutgoingRTPPkt &o); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 677 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 678 | /** |
| 679 | * Assignment operator from objects of its same kind, declared |
| 680 | * private to avoid its use. |
| 681 | **/ |
| 682 | OutgoingRTPPkt& |
| 683 | operator=(const OutgoingRTPPkt &o); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 684 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 685 | /** |
| 686 | * Set the list of CSRC identifiers in an RTP packet, |
| 687 | * switching host to network order. |
| 688 | */ |
| 689 | void setCSRCArray(const uint32* const csrcs, uint16 numcsrc); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 690 | |
| 691 | }; |
| 692 | |
| 693 | /** |
| 694 | * @class IncomingRTPPkt |
| 695 | * |
| 696 | * @short RTP packets received from other participants. |
| 697 | * |
| 698 | * This class is intented to construct a packet object just after |
| 699 | * every packet is received by the scheduled queue, so that they are |
| 700 | * processed in an understandable and format independent manner inside |
| 701 | * the stack. |
| 702 | * |
| 703 | * @author Federico Montesino Pouzols <fedemp@altern.org> |
| 704 | */ |
| 705 | class __EXPORT IncomingRTPPkt : public RTPPacket |
| 706 | { |
| 707 | public: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 708 | /** |
| 709 | * Build an RTP packet object from a data buffer. This |
| 710 | * constructor first performs a generic RTP data packet header |
| 711 | * check, whose result can be checked via isHeaderValid(). |
| 712 | * |
| 713 | * @param block pointer to the buffer the whole packet is stored in. |
| 714 | * @param len length of the whole packet, expressed in octets. |
| 715 | * |
| 716 | * @note If check fails, the packet object is |
| 717 | * incomplete. checking isHeaderValid() is recommended before |
| 718 | * using a new RTPPacket object. |
| 719 | **/ |
| 720 | IncomingRTPPkt(const unsigned char* block, size_t len); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 721 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 722 | ~IncomingRTPPkt() |
| 723 | { } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 724 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 725 | /** |
| 726 | * Get validity of this packet |
| 727 | * @return whether the header check performed at construction |
| 728 | * time ended successfully. |
| 729 | **/ |
| 730 | inline bool |
| 731 | isHeaderValid() |
| 732 | { return headerValid; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 733 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 734 | /** |
| 735 | * Get synchronization source numeric identifier. |
| 736 | * |
| 737 | * @return 32-bits Synchronization SouRCe numeric identifier, |
| 738 | * in host order. |
| 739 | **/ |
| 740 | inline uint32 |
| 741 | getSSRC() const |
| 742 | { return cachedSSRC; } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 743 | |
| 744 | /** |
| 745 | * Unprotect a received packet. |
| 746 | * |
| 747 | * Perform SRTP processing on this packet. |
| 748 | * |
| 749 | * @param pcc Pointer to SRTP CryptoContext. |
| 750 | * @return |
| 751 | * one if no errors, -1 if authentication failed, -2 if |
| 752 | * replay check failed |
| 753 | */ |
| 754 | int32 |
| 755 | unprotect(CryptoContext* pcc); |
| 756 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 757 | /** |
| 758 | * Two incoming packets are equal if they come from sources |
| 759 | * with the same SSRC and have the same sequence number. |
| 760 | **/ |
| 761 | inline bool |
| 762 | operator==(const IncomingRTPPkt &p) const |
| 763 | { return ( (this->getSeqNum() == p.getSeqNum()) && |
| 764 | (this->getSSRC() == p.getSSRC()) ); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 765 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 766 | /** |
| 767 | * Two incoming packets are not equal if they come from |
| 768 | * different sources or have different sequence numbers. |
| 769 | **/ |
| 770 | inline bool |
| 771 | operator!=(const IncomingRTPPkt &p) const |
| 772 | { return !( *this == p ); } |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 773 | |
| 774 | private: |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 775 | /** |
| 776 | * Copy constructor from objects of its same kind, declared |
| 777 | * private to avoid its use. |
| 778 | **/ |
| 779 | IncomingRTPPkt(const IncomingRTPPkt &ip); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 780 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 781 | /** |
| 782 | * Assignment operator from objects of its same kind, declared |
| 783 | * private to avoid its use. |
| 784 | */ |
| 785 | IncomingRTPPkt& |
| 786 | operator=(const IncomingRTPPkt &ip); |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 787 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 788 | /// Header validity, checked at construction time. |
| 789 | bool headerValid; |
| 790 | /// SSRC 32-bit identifier in host order. |
| 791 | uint32 cachedSSRC; |
| 792 | // Masks for RTP header validation: types matching RTCP SR or |
| 793 | // RR must be rejected to avoid accepting misaddressed RTCP |
| 794 | // packets. |
| 795 | static const uint16 RTP_INVALID_PT_MASK; |
| 796 | static const uint16 RTP_INVALID_PT_VALUE; |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 797 | }; |
| 798 | |
| 799 | /** @}*/ // rtppacket |
| 800 | |
Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame] | 801 | END_NAMESPACE |
Emeric Vigier | 2f62582 | 2012-08-06 11:09:52 -0400 | [diff] [blame] | 802 | |
| 803 | #endif // ndef CCXX_RTP_RTPPKT_H_ |
| 804 | |
| 805 | /** EMACS ** |
| 806 | * Local variables: |
| 807 | * mode: c++ |
| 808 | * c-basic-offset: 8 |
| 809 | * End: |
| 810 | */ |