home *** CD-ROM | disk | FTP | other *** search
/ ftp.muug.mb.ca / 2014.06.ftp.muug.mb.ca.tar / ftp.muug.mb.ca / pub / openh323.tar.gz / openh323.tar / openh323 / src / t38.cxx < prev    next >
C/C++ Source or Header  |  2004-06-22  |  25KB  |  1,030 lines

  1. //
  2. // t38.cxx
  3. //
  4. // Code automatically generated by asnparse.
  5. //
  6.  
  7. #ifdef __GNUC__
  8. #pragma implementation "t38.h"
  9. #endif
  10.  
  11. #include <ptlib.h>
  12. #include "t38.h"
  13.  
  14. #define new PNEW
  15.  
  16.  
  17. #if ! H323_DISABLE_T38
  18.  
  19. //
  20. // Type-of-msg
  21. //
  22.  
  23. T38_Type_of_msg::T38_Type_of_msg(unsigned tag, PASN_Object::TagClass tagClass)
  24.   : PASN_Choice(tag, tagClass, 2, FALSE
  25. #ifndef PASN_NOPRINTON
  26.       , "t30_indicator "
  27.         "data "
  28. #endif
  29.     )
  30. {
  31. }
  32.  
  33.  
  34. #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
  35. T38_Type_of_msg::operator T38_Type_of_msg_t30_indicator &() const
  36. #else
  37. T38_Type_of_msg::operator T38_Type_of_msg_t30_indicator &()
  38. {
  39. #ifndef PASN_LEANANDMEAN
  40.   PAssert(PAssertNULL(choice)->IsDescendant(T38_Type_of_msg_t30_indicator::Class()), PInvalidCast);
  41. #endif
  42.   return *(T38_Type_of_msg_t30_indicator *)choice;
  43. }
  44.  
  45.  
  46. T38_Type_of_msg::operator const T38_Type_of_msg_t30_indicator &() const
  47. #endif
  48. {
  49. #ifndef PASN_LEANANDMEAN
  50.   PAssert(PAssertNULL(choice)->IsDescendant(T38_Type_of_msg_t30_indicator::Class()), PInvalidCast);
  51. #endif
  52.   return *(T38_Type_of_msg_t30_indicator *)choice;
  53. }
  54.  
  55.  
  56. #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
  57. T38_Type_of_msg::operator T38_Type_of_msg_data &() const
  58. #else
  59. T38_Type_of_msg::operator T38_Type_of_msg_data &()
  60. {
  61. #ifndef PASN_LEANANDMEAN
  62.   PAssert(PAssertNULL(choice)->IsDescendant(T38_Type_of_msg_data::Class()), PInvalidCast);
  63. #endif
  64.   return *(T38_Type_of_msg_data *)choice;
  65. }
  66.  
  67.  
  68. T38_Type_of_msg::operator const T38_Type_of_msg_data &() const
  69. #endif
  70. {
  71. #ifndef PASN_LEANANDMEAN
  72.   PAssert(PAssertNULL(choice)->IsDescendant(T38_Type_of_msg_data::Class()), PInvalidCast);
  73. #endif
  74.   return *(T38_Type_of_msg_data *)choice;
  75. }
  76.  
  77.  
  78. BOOL T38_Type_of_msg::CreateObject()
  79. {
  80.   switch (tag) {
  81.     case e_t30_indicator :
  82.       choice = new T38_Type_of_msg_t30_indicator();
  83.       return TRUE;
  84.     case e_data :
  85.       choice = new T38_Type_of_msg_data();
  86.       return TRUE;
  87.   }
  88.  
  89.   choice = NULL;
  90.   return FALSE;
  91. }
  92.  
  93.  
  94. PObject * T38_Type_of_msg::Clone() const
  95. {
  96. #ifndef PASN_LEANANDMEAN
  97.   PAssert(IsClass(T38_Type_of_msg::Class()), PInvalidCast);
  98. #endif
  99.   return new T38_Type_of_msg(*this);
  100. }
  101.  
  102.  
  103. //
  104. // Data-Field
  105. //
  106.  
  107. T38_Data_Field::T38_Data_Field(unsigned tag, PASN_Object::TagClass tagClass)
  108.   : PASN_Array(tag, tagClass)
  109. {
  110. }
  111.  
  112.  
  113. PASN_Object * T38_Data_Field::CreateObject() const
  114. {
  115.   return new T38_Data_Field_subtype;
  116. }
  117.  
  118.  
  119. T38_Data_Field_subtype & T38_Data_Field::operator[](PINDEX i) const
  120. {
  121.   return (T38_Data_Field_subtype &)array[i];
  122. }
  123.  
  124.  
  125. PObject * T38_Data_Field::Clone() const
  126. {
  127. #ifndef PASN_LEANANDMEAN
  128.   PAssert(IsClass(T38_Data_Field::Class()), PInvalidCast);
  129. #endif
  130.   return new T38_Data_Field(*this);
  131. }
  132.  
  133.  
  134. //
  135. // PreCorrigendum-Data-Field
  136. //
  137.  
  138. T38_PreCorrigendum_Data_Field::T38_PreCorrigendum_Data_Field(unsigned tag, PASN_Object::TagClass tagClass)
  139.   : PASN_Array(tag, tagClass)
  140. {
  141. }
  142.  
  143.  
  144. PASN_Object * T38_PreCorrigendum_Data_Field::CreateObject() const
  145. {
  146.   return new T38_PreCorrigendum_Data_Field_subtype;
  147. }
  148.  
  149.  
  150. T38_PreCorrigendum_Data_Field_subtype & T38_PreCorrigendum_Data_Field::operator[](PINDEX i) const
  151. {
  152.   return (T38_PreCorrigendum_Data_Field_subtype &)array[i];
  153. }
  154.  
  155.  
  156. PObject * T38_PreCorrigendum_Data_Field::Clone() const
  157. {
  158. #ifndef PASN_LEANANDMEAN
  159.   PAssert(IsClass(T38_PreCorrigendum_Data_Field::Class()), PInvalidCast);
  160. #endif
  161.   return new T38_PreCorrigendum_Data_Field(*this);
  162. }
  163.  
  164.  
  165. //
  166. // Type-of-msg_t30-indicator
  167. //
  168.  
  169. T38_Type_of_msg_t30_indicator::T38_Type_of_msg_t30_indicator(unsigned tag, PASN_Object::TagClass tagClass)
  170.   : PASN_Enumeration(tag, tagClass, 15, TRUE
  171. #ifndef PASN_NOPRINTON
  172.       , "no-signal "
  173.         "cng "
  174.         "ced "
  175.         "v21-preamble "
  176.         "v27-2400-training "
  177.         "v27-4800-training "
  178.         "v29-7200-training "
  179.         "v29-9600-training "
  180.         "v17-7200-short-training "
  181.         "v17-7200-long-training "
  182.         "v17-9600-short-training "
  183.         "v17-9600-long-training "
  184.         "v17-12000-short-training "
  185.         "v17-12000-long-training "
  186.         "v17-14400-short-training "
  187.         "v17-14400-long-training "
  188. #endif
  189.     )
  190. {
  191. }
  192.  
  193.  
  194. T38_Type_of_msg_t30_indicator & T38_Type_of_msg_t30_indicator::operator=(unsigned v)
  195. {
  196.   SetValue(v);
  197.   return *this;
  198. }
  199.  
  200.  
  201. PObject * T38_Type_of_msg_t30_indicator::Clone() const
  202. {
  203. #ifndef PASN_LEANANDMEAN
  204.   PAssert(IsClass(T38_Type_of_msg_t30_indicator::Class()), PInvalidCast);
  205. #endif
  206.   return new T38_Type_of_msg_t30_indicator(*this);
  207. }
  208.  
  209.  
  210. //
  211. // Type-of-msg_data
  212. //
  213.  
  214. T38_Type_of_msg_data::T38_Type_of_msg_data(unsigned tag, PASN_Object::TagClass tagClass)
  215.   : PASN_Enumeration(tag, tagClass, 8, TRUE
  216. #ifndef PASN_NOPRINTON
  217.       , "v21 "
  218.         "v27-2400 "
  219.         "v27-4800 "
  220.         "v29-7200 "
  221.         "v29-9600 "
  222.         "v17-7200 "
  223.         "v17-9600 "
  224.         "v17-12000 "
  225.         "v17-14400 "
  226. #endif
  227.     )
  228. {
  229. }
  230.  
  231.  
  232. T38_Type_of_msg_data & T38_Type_of_msg_data::operator=(unsigned v)
  233. {
  234.   SetValue(v);
  235.   return *this;
  236. }
  237.  
  238.  
  239. PObject * T38_Type_of_msg_data::Clone() const
  240. {
  241. #ifndef PASN_LEANANDMEAN
  242.   PAssert(IsClass(T38_Type_of_msg_data::Class()), PInvalidCast);
  243. #endif
  244.   return new T38_Type_of_msg_data(*this);
  245. }
  246.  
  247.  
  248. //
  249. // UDPTLPacket_error-recovery
  250. //
  251.  
  252. T38_UDPTLPacket_error_recovery::T38_UDPTLPacket_error_recovery(unsigned tag, PASN_Object::TagClass tagClass)
  253.   : PASN_Choice(tag, tagClass, 2, FALSE
  254. #ifndef PASN_NOPRINTON
  255.       , "secondary_ifp_packets "
  256.         "fec_info "
  257. #endif
  258.     )
  259. {
  260. }
  261.  
  262.  
  263. #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
  264. T38_UDPTLPacket_error_recovery::operator T38_UDPTLPacket_error_recovery_secondary_ifp_packets &() const
  265. #else
  266. T38_UDPTLPacket_error_recovery::operator T38_UDPTLPacket_error_recovery_secondary_ifp_packets &()
  267. {
  268. #ifndef PASN_LEANANDMEAN
  269.   PAssert(PAssertNULL(choice)->IsDescendant(T38_UDPTLPacket_error_recovery_secondary_ifp_packets::Class()), PInvalidCast);
  270. #endif
  271.   return *(T38_UDPTLPacket_error_recovery_secondary_ifp_packets *)choice;
  272. }
  273.  
  274.  
  275. T38_UDPTLPacket_error_recovery::operator const T38_UDPTLPacket_error_recovery_secondary_ifp_packets &() const
  276. #endif
  277. {
  278. #ifndef PASN_LEANANDMEAN
  279.   PAssert(PAssertNULL(choice)->IsDescendant(T38_UDPTLPacket_error_recovery_secondary_ifp_packets::Class()), PInvalidCast);
  280. #endif
  281.   return *(T38_UDPTLPacket_error_recovery_secondary_ifp_packets *)choice;
  282. }
  283.  
  284.  
  285. #if defined(__GNUC__) && __GNUC__ <= 2 && __GNUC_MINOR__ < 9
  286. T38_UDPTLPacket_error_recovery::operator T38_UDPTLPacket_error_recovery_fec_info &() const
  287. #else
  288. T38_UDPTLPacket_error_recovery::operator T38_UDPTLPacket_error_recovery_fec_info &()
  289. {
  290. #ifndef PASN_LEANANDMEAN
  291.   PAssert(PAssertNULL(choice)->IsDescendant(T38_UDPTLPacket_error_recovery_fec_info::Class()), PInvalidCast);
  292. #endif
  293.   return *(T38_UDPTLPacket_error_recovery_fec_info *)choice;
  294. }
  295.  
  296.  
  297. T38_UDPTLPacket_error_recovery::operator const T38_UDPTLPacket_error_recovery_fec_info &() const
  298. #endif
  299. {
  300. #ifndef PASN_LEANANDMEAN
  301.   PAssert(PAssertNULL(choice)->IsDescendant(T38_UDPTLPacket_error_recovery_fec_info::Class()), PInvalidCast);
  302. #endif
  303.   return *(T38_UDPTLPacket_error_recovery_fec_info *)choice;
  304. }
  305.  
  306.  
  307. BOOL T38_UDPTLPacket_error_recovery::CreateObject()
  308. {
  309.   switch (tag) {
  310.     case e_secondary_ifp_packets :
  311.       choice = new T38_UDPTLPacket_error_recovery_secondary_ifp_packets();
  312.       return TRUE;
  313.     case e_fec_info :
  314.       choice = new T38_UDPTLPacket_error_recovery_fec_info();
  315.       return TRUE;
  316.   }
  317.  
  318.   choice = NULL;
  319.   return FALSE;
  320. }
  321.  
  322.  
  323. PObject * T38_UDPTLPacket_error_recovery::Clone() const
  324. {
  325. #ifndef PASN_LEANANDMEAN
  326.   PAssert(IsClass(T38_UDPTLPacket_error_recovery::Class()), PInvalidCast);
  327. #endif
  328.   return new T38_UDPTLPacket_error_recovery(*this);
  329. }
  330.  
  331.  
  332. //
  333. // Data-Field_subtype_field-type
  334. //
  335.  
  336. T38_Data_Field_subtype_field_type::T38_Data_Field_subtype_field_type(unsigned tag, PASN_Object::TagClass tagClass)
  337.   : PASN_Enumeration(tag, tagClass, 7, TRUE
  338. #ifndef PASN_NOPRINTON
  339.       , "hdlc-data "
  340.         "hdlc-sig-end "
  341.         "hdlc-fcs-OK "
  342.         "hdlc-fcs-BAD "
  343.         "hdlc-fcs-OK-sig-end "
  344.         "hdlc-fcs-BAD-sig-end "
  345.         "t4-non-ecm-data "
  346.         "t4-non-ecm-sig-end "
  347. #endif
  348.     )
  349. {
  350. }
  351.  
  352.  
  353. T38_Data_Field_subtype_field_type & T38_Data_Field_subtype_field_type::operator=(unsigned v)
  354. {
  355.   SetValue(v);
  356.   return *this;
  357. }
  358.  
  359.  
  360. PObject * T38_Data_Field_subtype_field_type::Clone() const
  361. {
  362. #ifndef PASN_LEANANDMEAN
  363.   PAssert(IsClass(T38_Data_Field_subtype_field_type::Class()), PInvalidCast);
  364. #endif
  365.   return new T38_Data_Field_subtype_field_type(*this);
  366. }
  367.  
  368.  
  369. //
  370. // PreCorrigendum-Data-Field_subtype_field-type
  371. //
  372.  
  373. T38_PreCorrigendum_Data_Field_subtype_field_type::T38_PreCorrigendum_Data_Field_subtype_field_type(unsigned tag, PASN_Object::TagClass tagClass)
  374.   : PASN_Enumeration(tag, tagClass, 7, FALSE
  375. #ifndef PASN_NOPRINTON
  376.       , "hdlc-data "
  377.         "hdlc-sig-end "
  378.         "hdlc-fcs-OK "
  379.         "hdlc-fcs-BAD "
  380.         "hdlc-fcs-OK-sig-end "
  381.         "hdlc-fcs-BAD-sig-end "
  382.         "t4-non-ecm-data "
  383.         "t4-non-ecm-sig-end "
  384. #endif
  385.     )
  386. {
  387. }
  388.  
  389.  
  390. T38_PreCorrigendum_Data_Field_subtype_field_type & T38_PreCorrigendum_Data_Field_subtype_field_type::operator=(unsigned v)
  391. {
  392.   SetValue(v);
  393.   return *this;
  394. }
  395.  
  396.  
  397. PObject * T38_PreCorrigendum_Data_Field_subtype_field_type::Clone() const
  398. {
  399. #ifndef PASN_LEANANDMEAN
  400.   PAssert(IsClass(T38_PreCorrigendum_Data_Field_subtype_field_type::Class()), PInvalidCast);
  401. #endif
  402.   return new T38_PreCorrigendum_Data_Field_subtype_field_type(*this);
  403. }
  404.  
  405.  
  406. //
  407. // UDPTLPacket_error-recovery_secondary-ifp-packets
  408. //
  409.  
  410. T38_UDPTLPacket_error_recovery_secondary_ifp_packets::T38_UDPTLPacket_error_recovery_secondary_ifp_packets(unsigned tag, PASN_Object::TagClass tagClass)
  411.   : PASN_Array(tag, tagClass)
  412. {
  413. }
  414.  
  415.  
  416. PASN_Object * T38_UDPTLPacket_error_recovery_secondary_ifp_packets::CreateObject() const
  417. {
  418.   return new T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype;
  419. }
  420.  
  421.  
  422. T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype & T38_UDPTLPacket_error_recovery_secondary_ifp_packets::operator[](PINDEX i) const
  423. {
  424.   return (T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype &)array[i];
  425. }
  426.  
  427.  
  428. PObject * T38_UDPTLPacket_error_recovery_secondary_ifp_packets::Clone() const
  429. {
  430. #ifndef PASN_LEANANDMEAN
  431.   PAssert(IsClass(T38_UDPTLPacket_error_recovery_secondary_ifp_packets::Class()), PInvalidCast);
  432. #endif
  433.   return new T38_UDPTLPacket_error_recovery_secondary_ifp_packets(*this);
  434. }
  435.  
  436.  
  437. //
  438. // ArrayOf_PASN_OctetString
  439. //
  440.  
  441. T38_ArrayOf_PASN_OctetString::T38_ArrayOf_PASN_OctetString(unsigned tag, PASN_Object::TagClass tagClass)
  442.   : PASN_Array(tag, tagClass)
  443. {
  444. }
  445.  
  446.  
  447. PASN_Object * T38_ArrayOf_PASN_OctetString::CreateObject() const
  448. {
  449.   return new PASN_OctetString;
  450. }
  451.  
  452.  
  453. PASN_OctetString & T38_ArrayOf_PASN_OctetString::operator[](PINDEX i) const
  454. {
  455.   return (PASN_OctetString &)array[i];
  456. }
  457.  
  458.  
  459. PObject * T38_ArrayOf_PASN_OctetString::Clone() const
  460. {
  461. #ifndef PASN_LEANANDMEAN
  462.   PAssert(IsClass(T38_ArrayOf_PASN_OctetString::Class()), PInvalidCast);
  463. #endif
  464.   return new T38_ArrayOf_PASN_OctetString(*this);
  465. }
  466.  
  467.  
  468. //
  469. // IFPPacket
  470. //
  471.  
  472. T38_IFPPacket::T38_IFPPacket(unsigned tag, PASN_Object::TagClass tagClass)
  473.   : PASN_Sequence(tag, tagClass, 1, FALSE, 0)
  474. {
  475. }
  476.  
  477.  
  478. #ifndef PASN_NOPRINTON
  479. void T38_IFPPacket::PrintOn(ostream & strm) const
  480. {
  481.   int indent = strm.precision() + 2;
  482.   strm << "{\n";
  483.   strm << setw(indent+14) << "type_of_msg = " << setprecision(indent) << m_type_of_msg << '\n';
  484.   if (HasOptionalField(e_data_field))
  485.     strm << setw(indent+13) << "data_field = " << setprecision(indent) << m_data_field << '\n';
  486.   strm << setw(indent-1) << "}";
  487. }
  488. #endif
  489.  
  490.  
  491. PObject::Comparison T38_IFPPacket::Compare(const PObject & obj) const
  492. {
  493. #ifndef PASN_LEANANDMEAN
  494.   PAssert(IsDescendant(T38_IFPPacket::Class()), PInvalidCast);
  495. #endif
  496.   const T38_IFPPacket & other = (const T38_IFPPacket &)obj;
  497.  
  498.   Comparison result;
  499.  
  500.   if ((result = m_type_of_msg.Compare(other.m_type_of_msg)) != EqualTo)
  501.     return result;
  502.   if ((result = m_data_field.Compare(other.m_data_field)) != EqualTo)
  503.     return result;
  504.  
  505.   return PASN_Sequence::Compare(other);
  506. }
  507.  
  508.  
  509. PINDEX T38_IFPPacket::GetDataLength() const
  510. {
  511.   PINDEX length = 0;
  512.   length += m_type_of_msg.GetObjectLength();
  513.   if (HasOptionalField(e_data_field))
  514.     length += m_data_field.GetObjectLength();
  515.   return length;
  516. }
  517.  
  518.  
  519. BOOL T38_IFPPacket::Decode(PASN_Stream & strm)
  520. {
  521.   if (!PreambleDecode(strm))
  522.     return FALSE;
  523.  
  524.   if (!m_type_of_msg.Decode(strm))
  525.     return FALSE;
  526.   if (HasOptionalField(e_data_field) && !m_data_field.Decode(strm))
  527.     return FALSE;
  528.  
  529.   return UnknownExtensionsDecode(strm);
  530. }
  531.  
  532.  
  533. void T38_IFPPacket::Encode(PASN_Stream & strm) const
  534. {
  535.   PreambleEncode(strm);
  536.  
  537.   m_type_of_msg.Encode(strm);
  538.   if (HasOptionalField(e_data_field))
  539.     m_data_field.Encode(strm);
  540.  
  541.   UnknownExtensionsEncode(strm);
  542. }
  543.  
  544.  
  545. PObject * T38_IFPPacket::Clone() const
  546. {
  547. #ifndef PASN_LEANANDMEAN
  548.   PAssert(IsClass(T38_IFPPacket::Class()), PInvalidCast);
  549. #endif
  550.   return new T38_IFPPacket(*this);
  551. }
  552.  
  553.  
  554. //
  555. // PreCorrigendum-IFPPacket
  556. //
  557.  
  558. T38_PreCorrigendum_IFPPacket::T38_PreCorrigendum_IFPPacket(unsigned tag, PASN_Object::TagClass tagClass)
  559.   : PASN_Sequence(tag, tagClass, 1, FALSE, 0)
  560. {
  561. }
  562.  
  563.  
  564. #ifndef PASN_NOPRINTON
  565. void T38_PreCorrigendum_IFPPacket::PrintOn(ostream & strm) const
  566. {
  567.   int indent = strm.precision() + 2;
  568.   strm << "{\n";
  569.   strm << setw(indent+14) << "type_of_msg = " << setprecision(indent) << m_type_of_msg << '\n';
  570.   if (HasOptionalField(e_data_field))
  571.     strm << setw(indent+13) << "data_field = " << setprecision(indent) << m_data_field << '\n';
  572.   strm << setw(indent-1) << "}";
  573. }
  574. #endif
  575.  
  576.  
  577. PObject::Comparison T38_PreCorrigendum_IFPPacket::Compare(const PObject & obj) const
  578. {
  579. #ifndef PASN_LEANANDMEAN
  580.   PAssert(IsDescendant(T38_PreCorrigendum_IFPPacket::Class()), PInvalidCast);
  581. #endif
  582.   const T38_PreCorrigendum_IFPPacket & other = (const T38_PreCorrigendum_IFPPacket &)obj;
  583.  
  584.   Comparison result;
  585.  
  586.   if ((result = m_type_of_msg.Compare(other.m_type_of_msg)) != EqualTo)
  587.     return result;
  588.   if ((result = m_data_field.Compare(other.m_data_field)) != EqualTo)
  589.     return result;
  590.  
  591.   return PASN_Sequence::Compare(other);
  592. }
  593.  
  594.  
  595. PINDEX T38_PreCorrigendum_IFPPacket::GetDataLength() const
  596. {
  597.   PINDEX length = 0;
  598.   length += m_type_of_msg.GetObjectLength();
  599.   if (HasOptionalField(e_data_field))
  600.     length += m_data_field.GetObjectLength();
  601.   return length;
  602. }
  603.  
  604.  
  605. BOOL T38_PreCorrigendum_IFPPacket::Decode(PASN_Stream & strm)
  606. {
  607.   if (!PreambleDecode(strm))
  608.     return FALSE;
  609.  
  610.   if (!m_type_of_msg.Decode(strm))
  611.     return FALSE;
  612.   if (HasOptionalField(e_data_field) && !m_data_field.Decode(strm))
  613.     return FALSE;
  614.  
  615.   return UnknownExtensionsDecode(strm);
  616. }
  617.  
  618.  
  619. void T38_PreCorrigendum_IFPPacket::Encode(PASN_Stream & strm) const
  620. {
  621.   PreambleEncode(strm);
  622.  
  623.   m_type_of_msg.Encode(strm);
  624.   if (HasOptionalField(e_data_field))
  625.     m_data_field.Encode(strm);
  626.  
  627.   UnknownExtensionsEncode(strm);
  628. }
  629.  
  630.  
  631. PObject * T38_PreCorrigendum_IFPPacket::Clone() const
  632. {
  633. #ifndef PASN_LEANANDMEAN
  634.   PAssert(IsClass(T38_PreCorrigendum_IFPPacket::Class()), PInvalidCast);
  635. #endif
  636.   return new T38_PreCorrigendum_IFPPacket(*this);
  637. }
  638.  
  639.  
  640. //
  641. // Data-Field_subtype
  642. //
  643.  
  644. T38_Data_Field_subtype::T38_Data_Field_subtype(unsigned tag, PASN_Object::TagClass tagClass)
  645.   : PASN_Sequence(tag, tagClass, 1, FALSE, 0)
  646. {
  647.   m_field_data.SetConstraints(PASN_Object::FixedConstraint, 1, 65535);
  648. }
  649.  
  650.  
  651. #ifndef PASN_NOPRINTON
  652. void T38_Data_Field_subtype::PrintOn(ostream & strm) const
  653. {
  654.   int indent = strm.precision() + 2;
  655.   strm << "{\n";
  656.   strm << setw(indent+13) << "field_type = " << setprecision(indent) << m_field_type << '\n';
  657.   if (HasOptionalField(e_field_data))
  658.     strm << setw(indent+13) << "field_data = " << setprecision(indent) << m_field_data << '\n';
  659.   strm << setw(indent-1) << "}";
  660. }
  661. #endif
  662.  
  663.  
  664. PObject::Comparison T38_Data_Field_subtype::Compare(const PObject & obj) const
  665. {
  666. #ifndef PASN_LEANANDMEAN
  667.   PAssert(IsDescendant(T38_Data_Field_subtype::Class()), PInvalidCast);
  668. #endif
  669.   const T38_Data_Field_subtype & other = (const T38_Data_Field_subtype &)obj;
  670.  
  671.   Comparison result;
  672.  
  673.   if ((result = m_field_type.Compare(other.m_field_type)) != EqualTo)
  674.     return result;
  675.   if ((result = m_field_data.Compare(other.m_field_data)) != EqualTo)
  676.     return result;
  677.  
  678.   return PASN_Sequence::Compare(other);
  679. }
  680.  
  681.  
  682. PINDEX T38_Data_Field_subtype::GetDataLength() const
  683. {
  684.   PINDEX length = 0;
  685.   length += m_field_type.GetObjectLength();
  686.   if (HasOptionalField(e_field_data))
  687.     length += m_field_data.GetObjectLength();
  688.   return length;
  689. }
  690.  
  691.  
  692. BOOL T38_Data_Field_subtype::Decode(PASN_Stream & strm)
  693. {
  694.   if (!PreambleDecode(strm))
  695.     return FALSE;
  696.  
  697.   if (!m_field_type.Decode(strm))
  698.     return FALSE;
  699.   if (HasOptionalField(e_field_data) && !m_field_data.Decode(strm))
  700.     return FALSE;
  701.  
  702.   return UnknownExtensionsDecode(strm);
  703. }
  704.  
  705.  
  706. void T38_Data_Field_subtype::Encode(PASN_Stream & strm) const
  707. {
  708.   PreambleEncode(strm);
  709.  
  710.   m_field_type.Encode(strm);
  711.   if (HasOptionalField(e_field_data))
  712.     m_field_data.Encode(strm);
  713.  
  714.   UnknownExtensionsEncode(strm);
  715. }
  716.  
  717.  
  718. PObject * T38_Data_Field_subtype::Clone() const
  719. {
  720. #ifndef PASN_LEANANDMEAN
  721.   PAssert(IsClass(T38_Data_Field_subtype::Class()), PInvalidCast);
  722. #endif
  723.   return new T38_Data_Field_subtype(*this);
  724. }
  725.  
  726.  
  727. //
  728. // PreCorrigendum-Data-Field_subtype
  729. //
  730.  
  731. T38_PreCorrigendum_Data_Field_subtype::T38_PreCorrigendum_Data_Field_subtype(unsigned tag, PASN_Object::TagClass tagClass)
  732.   : PASN_Sequence(tag, tagClass, 1, FALSE, 0)
  733. {
  734.   m_field_data.SetConstraints(PASN_Object::FixedConstraint, 1, 65535);
  735. }
  736.  
  737.  
  738. #ifndef PASN_NOPRINTON
  739. void T38_PreCorrigendum_Data_Field_subtype::PrintOn(ostream & strm) const
  740. {
  741.   int indent = strm.precision() + 2;
  742.   strm << "{\n";
  743.   strm << setw(indent+13) << "field_type = " << setprecision(indent) << m_field_type << '\n';
  744.   if (HasOptionalField(e_field_data))
  745.     strm << setw(indent+13) << "field_data = " << setprecision(indent) << m_field_data << '\n';
  746.   strm << setw(indent-1) << "}";
  747. }
  748. #endif
  749.  
  750.  
  751. PObject::Comparison T38_PreCorrigendum_Data_Field_subtype::Compare(const PObject & obj) const
  752. {
  753. #ifndef PASN_LEANANDMEAN
  754.   PAssert(IsDescendant(T38_PreCorrigendum_Data_Field_subtype::Class()), PInvalidCast);
  755. #endif
  756.   const T38_PreCorrigendum_Data_Field_subtype & other = (const T38_PreCorrigendum_Data_Field_subtype &)obj;
  757.  
  758.   Comparison result;
  759.  
  760.   if ((result = m_field_type.Compare(other.m_field_type)) != EqualTo)
  761.     return result;
  762.   if ((result = m_field_data.Compare(other.m_field_data)) != EqualTo)
  763.     return result;
  764.  
  765.   return PASN_Sequence::Compare(other);
  766. }
  767.  
  768.  
  769. PINDEX T38_PreCorrigendum_Data_Field_subtype::GetDataLength() const
  770. {
  771.   PINDEX length = 0;
  772.   length += m_field_type.GetObjectLength();
  773.   if (HasOptionalField(e_field_data))
  774.     length += m_field_data.GetObjectLength();
  775.   return length;
  776. }
  777.  
  778.  
  779. BOOL T38_PreCorrigendum_Data_Field_subtype::Decode(PASN_Stream & strm)
  780. {
  781.   if (!PreambleDecode(strm))
  782.     return FALSE;
  783.  
  784.   if (!m_field_type.Decode(strm))
  785.     return FALSE;
  786.   if (HasOptionalField(e_field_data) && !m_field_data.Decode(strm))
  787.     return FALSE;
  788.  
  789.   return UnknownExtensionsDecode(strm);
  790. }
  791.  
  792.  
  793. void T38_PreCorrigendum_Data_Field_subtype::Encode(PASN_Stream & strm) const
  794. {
  795.   PreambleEncode(strm);
  796.  
  797.   m_field_type.Encode(strm);
  798.   if (HasOptionalField(e_field_data))
  799.     m_field_data.Encode(strm);
  800.  
  801.   UnknownExtensionsEncode(strm);
  802. }
  803.  
  804.  
  805. PObject * T38_PreCorrigendum_Data_Field_subtype::Clone() const
  806. {
  807. #ifndef PASN_LEANANDMEAN
  808.   PAssert(IsClass(T38_PreCorrigendum_Data_Field_subtype::Class()), PInvalidCast);
  809. #endif
  810.   return new T38_PreCorrigendum_Data_Field_subtype(*this);
  811. }
  812.  
  813.  
  814. //
  815. // UDPTLPacket_primary-ifp-packet
  816. //
  817.  
  818. T38_UDPTLPacket_primary_ifp_packet::T38_UDPTLPacket_primary_ifp_packet(unsigned tag, PASN_Object::TagClass tagClass)
  819.   : PASN_OctetString(tag, tagClass)
  820. {
  821. }
  822.  
  823.  
  824. PObject * T38_UDPTLPacket_primary_ifp_packet::Clone() const
  825. {
  826. #ifndef PASN_LEANANDMEAN
  827.   PAssert(IsClass(T38_UDPTLPacket_primary_ifp_packet::Class()), PInvalidCast);
  828. #endif
  829.   return new T38_UDPTLPacket_primary_ifp_packet(*this);
  830. }
  831.  
  832.  
  833. //
  834. // UDPTLPacket_error-recovery_fec-info
  835. //
  836.  
  837. T38_UDPTLPacket_error_recovery_fec_info::T38_UDPTLPacket_error_recovery_fec_info(unsigned tag, PASN_Object::TagClass tagClass)
  838.   : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
  839. {
  840. }
  841.  
  842.  
  843. #ifndef PASN_NOPRINTON
  844. void T38_UDPTLPacket_error_recovery_fec_info::PrintOn(ostream & strm) const
  845. {
  846.   int indent = strm.precision() + 2;
  847.   strm << "{\n";
  848.   strm << setw(indent+15) << "fec_npackets = " << setprecision(indent) << m_fec_npackets << '\n';
  849.   strm << setw(indent+11) << "fec_data = " << setprecision(indent) << m_fec_data << '\n';
  850.   strm << setw(indent-1) << "}";
  851. }
  852. #endif
  853.  
  854.  
  855. PObject::Comparison T38_UDPTLPacket_error_recovery_fec_info::Compare(const PObject & obj) const
  856. {
  857. #ifndef PASN_LEANANDMEAN
  858.   PAssert(IsDescendant(T38_UDPTLPacket_error_recovery_fec_info::Class()), PInvalidCast);
  859. #endif
  860.   const T38_UDPTLPacket_error_recovery_fec_info & other = (const T38_UDPTLPacket_error_recovery_fec_info &)obj;
  861.  
  862.   Comparison result;
  863.  
  864.   if ((result = m_fec_npackets.Compare(other.m_fec_npackets)) != EqualTo)
  865.     return result;
  866.   if ((result = m_fec_data.Compare(other.m_fec_data)) != EqualTo)
  867.     return result;
  868.  
  869.   return PASN_Sequence::Compare(other);
  870. }
  871.  
  872.  
  873. PINDEX T38_UDPTLPacket_error_recovery_fec_info::GetDataLength() const
  874. {
  875.   PINDEX length = 0;
  876.   length += m_fec_npackets.GetObjectLength();
  877.   length += m_fec_data.GetObjectLength();
  878.   return length;
  879. }
  880.  
  881.  
  882. BOOL T38_UDPTLPacket_error_recovery_fec_info::Decode(PASN_Stream & strm)
  883. {
  884.   if (!PreambleDecode(strm))
  885.     return FALSE;
  886.  
  887.   if (!m_fec_npackets.Decode(strm))
  888.     return FALSE;
  889.   if (!m_fec_data.Decode(strm))
  890.     return FALSE;
  891.  
  892.   return UnknownExtensionsDecode(strm);
  893. }
  894.  
  895.  
  896. void T38_UDPTLPacket_error_recovery_fec_info::Encode(PASN_Stream & strm) const
  897. {
  898.   PreambleEncode(strm);
  899.  
  900.   m_fec_npackets.Encode(strm);
  901.   m_fec_data.Encode(strm);
  902.  
  903.   UnknownExtensionsEncode(strm);
  904. }
  905.  
  906.  
  907. PObject * T38_UDPTLPacket_error_recovery_fec_info::Clone() const
  908. {
  909. #ifndef PASN_LEANANDMEAN
  910.   PAssert(IsClass(T38_UDPTLPacket_error_recovery_fec_info::Class()), PInvalidCast);
  911. #endif
  912.   return new T38_UDPTLPacket_error_recovery_fec_info(*this);
  913. }
  914.  
  915.  
  916. //
  917. // UDPTLPacket_error-recovery_secondary-ifp-packets_subtype
  918. //
  919.  
  920. T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype::T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype(unsigned tag, PASN_Object::TagClass tagClass)
  921.   : PASN_OctetString(tag, tagClass)
  922. {
  923. }
  924.  
  925.  
  926. PObject * T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype::Clone() const
  927. {
  928. #ifndef PASN_LEANANDMEAN
  929.   PAssert(IsClass(T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype::Class()), PInvalidCast);
  930. #endif
  931.   return new T38_UDPTLPacket_error_recovery_secondary_ifp_packets_subtype(*this);
  932. }
  933.  
  934.  
  935. //
  936. // UDPTLPacket
  937. //
  938.  
  939. T38_UDPTLPacket::T38_UDPTLPacket(unsigned tag, PASN_Object::TagClass tagClass)
  940.   : PASN_Sequence(tag, tagClass, 0, FALSE, 0)
  941. {
  942.   m_seq_number.SetConstraints(PASN_Object::FixedConstraint, 0, 65535);
  943. }
  944.  
  945.  
  946. #ifndef PASN_NOPRINTON
  947. void T38_UDPTLPacket::PrintOn(ostream & strm) const
  948. {
  949.   int indent = strm.precision() + 2;
  950.   strm << "{\n";
  951.   strm << setw(indent+13) << "seq_number = " << setprecision(indent) << m_seq_number << '\n';
  952.   strm << setw(indent+21) << "primary_ifp_packet = " << setprecision(indent) << m_primary_ifp_packet << '\n';
  953.   strm << setw(indent+17) << "error_recovery = " << setprecision(indent) << m_error_recovery << '\n';
  954.   strm << setw(indent-1) << "}";
  955. }
  956. #endif
  957.  
  958.  
  959. PObject::Comparison T38_UDPTLPacket::Compare(const PObject & obj) const
  960. {
  961. #ifndef PASN_LEANANDMEAN
  962.   PAssert(IsDescendant(T38_UDPTLPacket::Class()), PInvalidCast);
  963. #endif
  964.   const T38_UDPTLPacket & other = (const T38_UDPTLPacket &)obj;
  965.  
  966.   Comparison result;
  967.  
  968.   if ((result = m_seq_number.Compare(other.m_seq_number)) != EqualTo)
  969.     return result;
  970.   if ((result = m_primary_ifp_packet.Compare(other.m_primary_ifp_packet)) != EqualTo)
  971.     return result;
  972.   if ((result = m_error_recovery.Compare(other.m_error_recovery)) != EqualTo)
  973.     return result;
  974.  
  975.   return PASN_Sequence::Compare(other);
  976. }
  977.  
  978.  
  979. PINDEX T38_UDPTLPacket::GetDataLength() const
  980. {
  981.   PINDEX length = 0;
  982.   length += m_seq_number.GetObjectLength();
  983.   length += m_primary_ifp_packet.GetObjectLength();
  984.   length += m_error_recovery.GetObjectLength();
  985.   return length;
  986. }
  987.  
  988.  
  989. BOOL T38_UDPTLPacket::Decode(PASN_Stream & strm)
  990. {
  991.   if (!PreambleDecode(strm))
  992.     return FALSE;
  993.  
  994.   if (!m_seq_number.Decode(strm))
  995.     return FALSE;
  996.   if (!m_primary_ifp_packet.Decode(strm))
  997.     return FALSE;
  998.   if (!m_error_recovery.Decode(strm))
  999.     return FALSE;
  1000.  
  1001.   return UnknownExtensionsDecode(strm);
  1002. }
  1003.  
  1004.  
  1005. void T38_UDPTLPacket::Encode(PASN_Stream & strm) const
  1006. {
  1007.   PreambleEncode(strm);
  1008.  
  1009.   m_seq_number.Encode(strm);
  1010.   m_primary_ifp_packet.Encode(strm);
  1011.   m_error_recovery.Encode(strm);
  1012.  
  1013.   UnknownExtensionsEncode(strm);
  1014. }
  1015.  
  1016.  
  1017. PObject * T38_UDPTLPacket::Clone() const
  1018. {
  1019. #ifndef PASN_LEANANDMEAN
  1020.   PAssert(IsClass(T38_UDPTLPacket::Class()), PInvalidCast);
  1021. #endif
  1022.   return new T38_UDPTLPacket(*this);
  1023. }
  1024.  
  1025.  
  1026. #endif // if ! H323_DISABLE_T38
  1027.  
  1028.  
  1029. // End of t38.cxx
  1030.