You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

799 lines
21KB

  1. /*
  2. oscpack -- Open Sound Control (OSC) packet manipulation library
  3. http://www.rossbencina.com/code/oscpack
  4. Copyright (c) 2004-2013 Ross Bencina <rossb@audiomulch.com>
  5. Permission is hereby granted, free of charge, to any person obtaining
  6. a copy of this software and associated documentation files
  7. (the "Software"), to deal in the Software without restriction,
  8. including without limitation the rights to use, copy, modify, merge,
  9. publish, distribute, sublicense, and/or sell copies of the Software,
  10. and to permit persons to whom the Software is furnished to do so,
  11. subject to the following conditions:
  12. The above copyright notice and this permission notice shall be
  13. included in all copies or substantial portions of the Software.
  14. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  15. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  16. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  17. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
  18. ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
  19. CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  20. WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  21. */
  22. /*
  23. The text above constitutes the entire oscpack license; however,
  24. the oscpack developer(s) also make the following non-binding requests:
  25. Any person wishing to distribute modifications to the Software is
  26. requested to send the modifications to the original developer so that
  27. they can be incorporated into the canonical version. It is also
  28. requested that these non-binding requests be included whenever the
  29. above license is reproduced.
  30. */
  31. #include "OscReceivedElements.h"
  32. #include "OscHostEndianness.h"
  33. #include <cstddef> // ptrdiff_t
  34. namespace osc{
  35. // return the first 4 byte boundary after the end of a str4
  36. // be careful about calling this version if you don't know whether
  37. // the string is terminated correctly.
  38. static inline const char* FindStr4End( const char *p )
  39. {
  40. if( p[0] == '\0' ) // special case for SuperCollider integer address pattern
  41. return p + 4;
  42. p += 3;
  43. while( *p )
  44. p += 4;
  45. return p + 1;
  46. }
  47. // return the first 4 byte boundary after the end of a str4
  48. // returns 0 if p == end or if the string is unterminated
  49. static inline const char* FindStr4End( const char *p, const char *end )
  50. {
  51. if( p >= end )
  52. return 0;
  53. if( p[0] == '\0' ) // special case for SuperCollider integer address pattern
  54. return p + 4;
  55. p += 3;
  56. end -= 1;
  57. while( p < end && *p )
  58. p += 4;
  59. if( *p )
  60. return 0;
  61. else
  62. return p + 1;
  63. }
  64. // round up to the next highest multiple of 4. unless x is already a multiple of 4
  65. static inline uint32 RoundUp4( uint32 x )
  66. {
  67. return (x + 3) & ~((uint32)0x03);
  68. }
  69. static inline int32 ToInt32( const char *p )
  70. {
  71. #ifdef OSC_HOST_LITTLE_ENDIAN
  72. union{
  73. osc::int32 i;
  74. char c[4];
  75. } u;
  76. u.c[0] = p[3];
  77. u.c[1] = p[2];
  78. u.c[2] = p[1];
  79. u.c[3] = p[0];
  80. return u.i;
  81. #else
  82. return *(int32*)p;
  83. #endif
  84. }
  85. static inline uint32 ToUInt32( const char *p )
  86. {
  87. #ifdef OSC_HOST_LITTLE_ENDIAN
  88. union{
  89. osc::uint32 i;
  90. char c[4];
  91. } u;
  92. u.c[0] = p[3];
  93. u.c[1] = p[2];
  94. u.c[2] = p[1];
  95. u.c[3] = p[0];
  96. return u.i;
  97. #else
  98. return *(uint32*)p;
  99. #endif
  100. }
  101. static inline int64 ToInt64( const char *p )
  102. {
  103. #ifdef OSC_HOST_LITTLE_ENDIAN
  104. union{
  105. osc::int64 i;
  106. char c[8];
  107. } u;
  108. u.c[0] = p[7];
  109. u.c[1] = p[6];
  110. u.c[2] = p[5];
  111. u.c[3] = p[4];
  112. u.c[4] = p[3];
  113. u.c[5] = p[2];
  114. u.c[6] = p[1];
  115. u.c[7] = p[0];
  116. return u.i;
  117. #else
  118. return *(int64*)p;
  119. #endif
  120. }
  121. static inline uint64 ToUInt64( const char *p )
  122. {
  123. #ifdef OSC_HOST_LITTLE_ENDIAN
  124. union{
  125. osc::uint64 i;
  126. char c[8];
  127. } u;
  128. u.c[0] = p[7];
  129. u.c[1] = p[6];
  130. u.c[2] = p[5];
  131. u.c[3] = p[4];
  132. u.c[4] = p[3];
  133. u.c[5] = p[2];
  134. u.c[6] = p[1];
  135. u.c[7] = p[0];
  136. return u.i;
  137. #else
  138. return *(uint64*)p;
  139. #endif
  140. }
  141. //------------------------------------------------------------------------------
  142. bool ReceivedPacket::IsBundle() const
  143. {
  144. return (Size() > 0 && Contents()[0] == '#');
  145. }
  146. //------------------------------------------------------------------------------
  147. bool ReceivedBundleElement::IsBundle() const
  148. {
  149. return (Size() > 0 && Contents()[0] == '#');
  150. }
  151. osc_bundle_element_size_t ReceivedBundleElement::Size() const
  152. {
  153. return ToInt32( sizePtr_ );
  154. }
  155. //------------------------------------------------------------------------------
  156. bool ReceivedMessageArgument::AsBool() const
  157. {
  158. if( !typeTagPtr_ )
  159. throw MissingArgumentException();
  160. else if( *typeTagPtr_ == TRUE_TYPE_TAG )
  161. return true;
  162. else if( *typeTagPtr_ == FALSE_TYPE_TAG )
  163. return false;
  164. else
  165. throw WrongArgumentTypeException();
  166. }
  167. bool ReceivedMessageArgument::AsBoolUnchecked() const
  168. {
  169. if( !typeTagPtr_ )
  170. throw MissingArgumentException();
  171. else if( *typeTagPtr_ == TRUE_TYPE_TAG )
  172. return true;
  173. else
  174. return false;
  175. }
  176. int32 ReceivedMessageArgument::AsInt32() const
  177. {
  178. if (!typeTagPtr_)
  179. throw MissingArgumentException();
  180. else if (*typeTagPtr_ == INT32_TYPE_TAG)
  181. return AsInt32Unchecked();
  182. else if (*typeTagPtr_ == osc::TypeTagValues::FLOAT_TYPE_TAG) // Do conversion for touchOSC's limited values
  183. return static_cast<osc::int32>(AsFloatUnchecked());
  184. else
  185. throw WrongArgumentTypeException();
  186. }
  187. int32 ReceivedMessageArgument::AsInt32Unchecked() const
  188. {
  189. #ifdef OSC_HOST_LITTLE_ENDIAN
  190. union{
  191. osc::int32 i;
  192. char c[4];
  193. } u;
  194. u.c[0] = argumentPtr_[3];
  195. u.c[1] = argumentPtr_[2];
  196. u.c[2] = argumentPtr_[1];
  197. u.c[3] = argumentPtr_[0];
  198. return u.i;
  199. #else
  200. return *(int32*)argument_;
  201. #endif
  202. }
  203. float ReceivedMessageArgument::AsFloat() const
  204. {
  205. if( !typeTagPtr_ )
  206. throw MissingArgumentException();
  207. else if( *typeTagPtr_ == FLOAT_TYPE_TAG )
  208. return AsFloatUnchecked();
  209. else
  210. throw WrongArgumentTypeException();
  211. }
  212. float ReceivedMessageArgument::AsFloatUnchecked() const
  213. {
  214. #ifdef OSC_HOST_LITTLE_ENDIAN
  215. union{
  216. float f;
  217. char c[4];
  218. } u;
  219. u.c[0] = argumentPtr_[3];
  220. u.c[1] = argumentPtr_[2];
  221. u.c[2] = argumentPtr_[1];
  222. u.c[3] = argumentPtr_[0];
  223. return u.f;
  224. #else
  225. return *(float*)argument_;
  226. #endif
  227. }
  228. char ReceivedMessageArgument::AsChar() const
  229. {
  230. if( !typeTagPtr_ )
  231. throw MissingArgumentException();
  232. else if( *typeTagPtr_ == CHAR_TYPE_TAG )
  233. return AsCharUnchecked();
  234. else
  235. throw WrongArgumentTypeException();
  236. }
  237. char ReceivedMessageArgument::AsCharUnchecked() const
  238. {
  239. return (char)ToInt32( argumentPtr_ );
  240. }
  241. uint32 ReceivedMessageArgument::AsRgbaColor() const
  242. {
  243. if( !typeTagPtr_ )
  244. throw MissingArgumentException();
  245. else if( *typeTagPtr_ == RGBA_COLOR_TYPE_TAG )
  246. return AsRgbaColorUnchecked();
  247. else
  248. throw WrongArgumentTypeException();
  249. }
  250. uint32 ReceivedMessageArgument::AsRgbaColorUnchecked() const
  251. {
  252. return ToUInt32( argumentPtr_ );
  253. }
  254. uint32 ReceivedMessageArgument::AsMidiMessage() const
  255. {
  256. if( !typeTagPtr_ )
  257. throw MissingArgumentException();
  258. else if( *typeTagPtr_ == MIDI_MESSAGE_TYPE_TAG )
  259. return AsMidiMessageUnchecked();
  260. else
  261. throw WrongArgumentTypeException();
  262. }
  263. uint32 ReceivedMessageArgument::AsMidiMessageUnchecked() const
  264. {
  265. return ToUInt32( argumentPtr_ );
  266. }
  267. int64 ReceivedMessageArgument::AsInt64() const
  268. {
  269. if( !typeTagPtr_ )
  270. throw MissingArgumentException();
  271. else if( *typeTagPtr_ == INT64_TYPE_TAG )
  272. return AsInt64Unchecked();
  273. else
  274. throw WrongArgumentTypeException();
  275. }
  276. int64 ReceivedMessageArgument::AsInt64Unchecked() const
  277. {
  278. return ToInt64( argumentPtr_ );
  279. }
  280. uint64 ReceivedMessageArgument::AsTimeTag() const
  281. {
  282. if( !typeTagPtr_ )
  283. throw MissingArgumentException();
  284. else if( *typeTagPtr_ == TIME_TAG_TYPE_TAG )
  285. return AsTimeTagUnchecked();
  286. else
  287. throw WrongArgumentTypeException();
  288. }
  289. uint64 ReceivedMessageArgument::AsTimeTagUnchecked() const
  290. {
  291. return ToUInt64( argumentPtr_ );
  292. }
  293. double ReceivedMessageArgument::AsDouble() const
  294. {
  295. if( !typeTagPtr_ )
  296. throw MissingArgumentException();
  297. else if( *typeTagPtr_ == DOUBLE_TYPE_TAG )
  298. return AsDoubleUnchecked();
  299. else
  300. throw WrongArgumentTypeException();
  301. }
  302. double ReceivedMessageArgument::AsDoubleUnchecked() const
  303. {
  304. #ifdef OSC_HOST_LITTLE_ENDIAN
  305. union{
  306. double d;
  307. char c[8];
  308. } u;
  309. u.c[0] = argumentPtr_[7];
  310. u.c[1] = argumentPtr_[6];
  311. u.c[2] = argumentPtr_[5];
  312. u.c[3] = argumentPtr_[4];
  313. u.c[4] = argumentPtr_[3];
  314. u.c[5] = argumentPtr_[2];
  315. u.c[6] = argumentPtr_[1];
  316. u.c[7] = argumentPtr_[0];
  317. return u.d;
  318. #else
  319. return *(double*)argument_;
  320. #endif
  321. }
  322. const char* ReceivedMessageArgument::AsString() const
  323. {
  324. if( !typeTagPtr_ )
  325. throw MissingArgumentException();
  326. else if( *typeTagPtr_ == STRING_TYPE_TAG )
  327. return argumentPtr_;
  328. else
  329. throw WrongArgumentTypeException();
  330. }
  331. const char* ReceivedMessageArgument::AsSymbol() const
  332. {
  333. if( !typeTagPtr_ )
  334. throw MissingArgumentException();
  335. else if( *typeTagPtr_ == SYMBOL_TYPE_TAG )
  336. return argumentPtr_;
  337. else
  338. throw WrongArgumentTypeException();
  339. }
  340. void ReceivedMessageArgument::AsBlob( const void*& data, osc_bundle_element_size_t& size ) const
  341. {
  342. if( !typeTagPtr_ )
  343. throw MissingArgumentException();
  344. else if( *typeTagPtr_ == BLOB_TYPE_TAG )
  345. AsBlobUnchecked( data, size );
  346. else
  347. throw WrongArgumentTypeException();
  348. }
  349. void ReceivedMessageArgument::AsBlobUnchecked( const void*& data, osc_bundle_element_size_t& size ) const
  350. {
  351. // read blob size as an unsigned int then validate
  352. osc_bundle_element_size_t sizeResult = (osc_bundle_element_size_t)ToUInt32( argumentPtr_ );
  353. if( !IsValidElementSizeValue(sizeResult) )
  354. throw MalformedMessageException("invalid blob size");
  355. size = sizeResult;
  356. data = (void*)(argumentPtr_+ osc::OSC_SIZEOF_INT32);
  357. }
  358. std::size_t ReceivedMessageArgument::ComputeArrayItemCount() const
  359. {
  360. // it is only valid to call ComputeArrayItemCount when the argument is the array start marker
  361. if( !IsArrayBegin() )
  362. throw WrongArgumentTypeException();
  363. std::size_t result = 0;
  364. unsigned int level = 0;
  365. const char *typeTag = typeTagPtr_ + 1;
  366. // iterate through all type tags. note that ReceivedMessage::Init
  367. // has already checked that the message is well formed.
  368. while( *typeTag ) {
  369. switch( *typeTag++ ) {
  370. case ARRAY_BEGIN_TYPE_TAG:
  371. level += 1;
  372. break;
  373. case ARRAY_END_TYPE_TAG:
  374. if(level == 0)
  375. return result;
  376. level -= 1;
  377. break;
  378. default:
  379. if( level == 0 ) // only count items at level 0
  380. ++result;
  381. }
  382. }
  383. return result;
  384. }
  385. //------------------------------------------------------------------------------
  386. void ReceivedMessageArgumentIterator::Advance()
  387. {
  388. if( !value_.typeTagPtr_ )
  389. return;
  390. switch( *value_.typeTagPtr_++ ){
  391. case '\0':
  392. // don't advance past end
  393. --value_.typeTagPtr_;
  394. break;
  395. case TRUE_TYPE_TAG:
  396. case FALSE_TYPE_TAG:
  397. case NIL_TYPE_TAG:
  398. case INFINITUM_TYPE_TAG:
  399. // zero length
  400. break;
  401. case INT32_TYPE_TAG:
  402. case FLOAT_TYPE_TAG:
  403. case CHAR_TYPE_TAG:
  404. case RGBA_COLOR_TYPE_TAG:
  405. case MIDI_MESSAGE_TYPE_TAG:
  406. value_.argumentPtr_ += 4;
  407. break;
  408. case INT64_TYPE_TAG:
  409. case TIME_TAG_TYPE_TAG:
  410. case DOUBLE_TYPE_TAG:
  411. value_.argumentPtr_ += 8;
  412. break;
  413. case STRING_TYPE_TAG:
  414. case SYMBOL_TYPE_TAG:
  415. // we use the unsafe function FindStr4End(char*) here because all of
  416. // the arguments have already been validated in
  417. // ReceivedMessage::Init() below.
  418. value_.argumentPtr_ = FindStr4End( value_.argumentPtr_ );
  419. break;
  420. case BLOB_TYPE_TAG:
  421. {
  422. // treat blob size as an unsigned int for the purposes of this calculation
  423. uint32 blobSize = ToUInt32( value_.argumentPtr_ );
  424. value_.argumentPtr_ = value_.argumentPtr_ + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize );
  425. }
  426. break;
  427. case ARRAY_BEGIN_TYPE_TAG:
  428. case ARRAY_END_TYPE_TAG:
  429. // [ Indicates the beginning of an array. The tags following are for
  430. // data in the Array until a close brace tag is reached.
  431. // ] Indicates the end of an array.
  432. // zero length, don't advance argument ptr
  433. break;
  434. default: // unknown type tag
  435. // don't advance
  436. --value_.typeTagPtr_;
  437. break;
  438. }
  439. }
  440. //------------------------------------------------------------------------------
  441. ReceivedMessage::ReceivedMessage( const ReceivedPacket& packet )
  442. : addressPattern_( packet.Contents() )
  443. {
  444. Init( packet.Contents(), packet.Size() );
  445. }
  446. ReceivedMessage::ReceivedMessage( const ReceivedBundleElement& bundleElement )
  447. : addressPattern_( bundleElement.Contents() )
  448. {
  449. Init( bundleElement.Contents(), bundleElement.Size() );
  450. }
  451. bool ReceivedMessage::AddressPatternIsUInt32() const
  452. {
  453. return (addressPattern_[0] == '\0');
  454. }
  455. uint32 ReceivedMessage::AddressPatternAsUInt32() const
  456. {
  457. return ToUInt32( addressPattern_ );
  458. }
  459. void ReceivedMessage::Init( const char *message, osc_bundle_element_size_t size )
  460. {
  461. if( !IsValidElementSizeValue(size) )
  462. throw MalformedMessageException( "invalid message size" );
  463. if( size == 0 )
  464. throw MalformedMessageException( "zero length messages not permitted" );
  465. if( !IsMultipleOf4(size) )
  466. throw MalformedMessageException( "message size must be multiple of four" );
  467. const char *end = message + size;
  468. typeTagsBegin_ = FindStr4End( addressPattern_, end );
  469. if( typeTagsBegin_ == 0 ){
  470. // address pattern was not terminated before end
  471. throw MalformedMessageException( "unterminated address pattern" );
  472. }
  473. if( typeTagsBegin_ == end ){
  474. // message consists of only the address pattern - no arguments or type tags.
  475. typeTagsBegin_ = 0;
  476. typeTagsEnd_ = 0;
  477. arguments_ = 0;
  478. }else{
  479. if( *typeTagsBegin_ != ',' )
  480. throw MalformedMessageException( "type tags not present" );
  481. if( *(typeTagsBegin_ + 1) == '\0' ){
  482. // zero length type tags
  483. typeTagsBegin_ = 0;
  484. typeTagsEnd_ = 0;
  485. arguments_ = 0;
  486. }else{
  487. // check that all arguments are present and well formed
  488. arguments_ = FindStr4End( typeTagsBegin_, end );
  489. if( arguments_ == 0 ){
  490. throw MalformedMessageException( "type tags were not terminated before end of message" );
  491. }
  492. ++typeTagsBegin_; // advance past initial ','
  493. const char *typeTag = typeTagsBegin_;
  494. const char *argument = arguments_;
  495. unsigned int arrayLevel = 0;
  496. do{
  497. switch( *typeTag ){
  498. case TRUE_TYPE_TAG:
  499. case FALSE_TYPE_TAG:
  500. case NIL_TYPE_TAG:
  501. case INFINITUM_TYPE_TAG:
  502. // zero length
  503. break;
  504. // [ Indicates the beginning of an array. The tags following are for
  505. // data in the Array until a close brace tag is reached.
  506. // ] Indicates the end of an array.
  507. case ARRAY_BEGIN_TYPE_TAG:
  508. ++arrayLevel;
  509. // (zero length argument data)
  510. break;
  511. case ARRAY_END_TYPE_TAG:
  512. --arrayLevel;
  513. // (zero length argument data)
  514. break;
  515. case INT32_TYPE_TAG:
  516. case FLOAT_TYPE_TAG:
  517. case CHAR_TYPE_TAG:
  518. case RGBA_COLOR_TYPE_TAG:
  519. case MIDI_MESSAGE_TYPE_TAG:
  520. if( argument == end )
  521. throw MalformedMessageException( "arguments exceed message size" );
  522. argument += 4;
  523. if( argument > end )
  524. throw MalformedMessageException( "arguments exceed message size" );
  525. break;
  526. case INT64_TYPE_TAG:
  527. case TIME_TAG_TYPE_TAG:
  528. case DOUBLE_TYPE_TAG:
  529. if( argument == end )
  530. throw MalformedMessageException( "arguments exceed message size" );
  531. argument += 8;
  532. if( argument > end )
  533. throw MalformedMessageException( "arguments exceed message size" );
  534. break;
  535. case STRING_TYPE_TAG:
  536. case SYMBOL_TYPE_TAG:
  537. if( argument == end )
  538. throw MalformedMessageException( "arguments exceed message size" );
  539. argument = FindStr4End( argument, end );
  540. if( argument == 0 )
  541. throw MalformedMessageException( "unterminated string argument" );
  542. break;
  543. case BLOB_TYPE_TAG:
  544. {
  545. if( argument + osc::OSC_SIZEOF_INT32 > end )
  546. MalformedMessageException( "arguments exceed message size" );
  547. // treat blob size as an unsigned int for the purposes of this calculation
  548. uint32 blobSize = ToUInt32( argument );
  549. argument = argument + osc::OSC_SIZEOF_INT32 + RoundUp4( blobSize );
  550. if( argument > end )
  551. MalformedMessageException( "arguments exceed message size" );
  552. }
  553. break;
  554. default:
  555. throw MalformedMessageException( "unknown type tag" );
  556. }
  557. }while( *++typeTag != '\0' );
  558. typeTagsEnd_ = typeTag;
  559. if( arrayLevel != 0 )
  560. throw MalformedMessageException( "array was not terminated before end of message (expected ']' end of array tag)" );
  561. }
  562. // These invariants should be guaranteed by the above code.
  563. // we depend on them in the implementation of ArgumentCount()
  564. #ifndef NDEBUG
  565. std::ptrdiff_t argumentCount = typeTagsEnd_ - typeTagsBegin_;
  566. assert( argumentCount >= 0 );
  567. assert( argumentCount <= OSC_INT32_MAX );
  568. #endif
  569. }
  570. }
  571. //------------------------------------------------------------------------------
  572. ReceivedBundle::ReceivedBundle( const ReceivedPacket& packet )
  573. : elementCount_( 0 )
  574. {
  575. Init( packet.Contents(), packet.Size() );
  576. }
  577. ReceivedBundle::ReceivedBundle( const ReceivedBundleElement& bundleElement )
  578. : elementCount_( 0 )
  579. {
  580. Init( bundleElement.Contents(), bundleElement.Size() );
  581. }
  582. void ReceivedBundle::Init( const char *bundle, osc_bundle_element_size_t size )
  583. {
  584. if( !IsValidElementSizeValue(size) )
  585. throw MalformedBundleException( "invalid bundle size" );
  586. if( size < 16 )
  587. throw MalformedBundleException( "packet too short for bundle" );
  588. if( !IsMultipleOf4(size) )
  589. throw MalformedBundleException( "bundle size must be multiple of four" );
  590. if( bundle[0] != '#'
  591. || bundle[1] != 'b'
  592. || bundle[2] != 'u'
  593. || bundle[3] != 'n'
  594. || bundle[4] != 'd'
  595. || bundle[5] != 'l'
  596. || bundle[6] != 'e'
  597. || bundle[7] != '\0' )
  598. throw MalformedBundleException( "bad bundle address pattern" );
  599. end_ = bundle + size;
  600. timeTag_ = bundle + 8;
  601. const char *p = timeTag_ + 8;
  602. while( p < end_ ){
  603. if( p + osc::OSC_SIZEOF_INT32 > end_ )
  604. throw MalformedBundleException( "packet too short for elementSize" );
  605. // treat element size as an unsigned int for the purposes of this calculation
  606. uint32 elementSize = ToUInt32( p );
  607. if( (elementSize & ((uint32)0x03)) != 0 )
  608. throw MalformedBundleException( "bundle element size must be multiple of four" );
  609. p += osc::OSC_SIZEOF_INT32 + elementSize;
  610. if( p > end_ )
  611. throw MalformedBundleException( "packet too short for bundle element" );
  612. ++elementCount_;
  613. }
  614. if( p != end_ )
  615. throw MalformedBundleException( "bundle contents " );
  616. }
  617. uint64 ReceivedBundle::TimeTag() const
  618. {
  619. return ToUInt64( timeTag_ );
  620. }
  621. } // namespace osc