test_parser.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. /*
  2. * Copyright (C) 2009 Mamadou Diop.
  3. *
  4. * Contact: Mamadou Diop <diopmamadou(at)doubango.org>
  5. *
  6. * This file is part of Open Source Doubango Framework.
  7. *
  8. * DOUBANGO is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * DOUBANGO is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with DOUBANGO.
  20. *
  21. */
  22. #ifndef _TEST_PARSER_H_
  23. #define _TEST_PARSER_H_
  24. char packet_0[] = {
  25. 0x80, 0x88, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa0,
  26. 0xd2, 0xbd, 0x4e, 0x3e, 0xdc, 0xde, 0xc4, 0xc5,
  27. 0xdc, 0xd0, 0xd5, 0x51, 0x53, 0x5d, 0x5f, 0x5b,
  28. 0x46, 0x46, 0x46, 0x5b, 0x44, 0x41, 0x42, 0x4f,
  29. 0x42, 0x47, 0x42, 0x43, 0x59, 0x58, 0x59, 0x5f,
  30. 0x5f, 0x52, 0x59, 0x44, 0x44, 0x5f, 0x51, 0x54,
  31. 0x55, 0x55, 0x51, 0x56, 0x50, 0x52, 0x5e, 0x58,
  32. 0x5d, 0x52, 0x52, 0x50, 0x57, 0x54, 0xd4, 0xd6,
  33. 0xd5, 0x51, 0x53, 0x57, 0xd6, 0xd6, 0xd0, 0xd7,
  34. 0x57, 0x56, 0x57, 0xd0, 0xd3, 0xd6, 0xd5, 0x55,
  35. 0x51, 0x50, 0xd6, 0xdf, 0xd2, 0xd1, 0xd4, 0xd6,
  36. 0xdc, 0xdb, 0xda, 0xdd, 0xd6, 0x55, 0xdc, 0xd0,
  37. 0xd4, 0x5d, 0x44, 0x5c, 0x56, 0xd6, 0xd5, 0xd4,
  38. 0xd5, 0xd7, 0x50, 0xd4, 0x51, 0xd0, 0x61, 0x6f,
  39. 0x76, 0xfe, 0xef, 0xf7, 0x77, 0x66, 0x50, 0xff,
  40. 0xe5, 0xd7, 0x74, 0x4a, 0xc9, 0xf9, 0xf7, 0x5c,
  41. 0x76, 0x5f, 0xf5, 0xf3, 0xdd, 0x4e, 0x42, 0xd8,
  42. 0xf7, 0xc9, 0x50, 0x44, 0x50, 0xcd, 0xc9, 0xd4,
  43. 0x4d, 0x41, 0x57, 0xd1, 0x51, 0x58, 0x44, 0x52,
  44. 0xd3, 0xd1, 0x50, 0x58, 0x5b, 0x55, 0xd4, 0x53,
  45. 0x59, 0x43, 0x47, 0x5f, 0x51, 0x5d, 0x56, 0xd2,
  46. 0xde, 0xd7, 0x52, 0xd5
  47. };
  48. char packet_1[] = {
  49. 0x80, 0x08, 0x00, 0x02, 0x00, 0x00, 0x01, 0x40,
  50. 0xd2, 0xbd, 0x4e, 0x3e, 0xd2, 0xc7, 0xc5, 0xd3,
  51. 0xd1, 0xd6, 0xd5, 0x55, 0xd2, 0xd2, 0xd3, 0xdf,
  52. 0xc4, 0xd9, 0xdb, 0xc6, 0xc6, 0xc9, 0xc1, 0xf5,
  53. 0xcf, 0xf0, 0xcb, 0xe4, 0x7d, 0x14, 0x7a, 0xfd,
  54. 0xfd, 0x62, 0x63, 0x41, 0xee, 0xe7, 0x40, 0x6c,
  55. 0x46, 0xf8, 0xf3, 0x74, 0x7b, 0x58, 0xf3, 0xf1,
  56. 0xd6, 0x5d, 0xc7, 0xfd, 0xff, 0xf5, 0x55, 0xd9,
  57. 0xcb, 0xcb, 0xde, 0xd1, 0xda, 0xca, 0xcd, 0xc5,
  58. 0xc4, 0x41, 0x72, 0x41, 0x55, 0xda, 0x54, 0x5c,
  59. 0x40, 0x59, 0xd1, 0x5f, 0x4b, 0x40, 0x51, 0x52,
  60. 0x45, 0x4b, 0x77, 0x49, 0x4e, 0x4e, 0x48, 0x4a,
  61. 0x75, 0x47, 0x75, 0x7b, 0x72, 0x42, 0x58, 0x4c,
  62. 0x46, 0xd5, 0xc2, 0xd1, 0x5d, 0x44, 0x50, 0xd0,
  63. 0x53, 0x43, 0x41, 0x52, 0x53, 0x5a, 0x44, 0x50,
  64. 0xdd, 0x45, 0x65, 0x7d, 0x74, 0x4c, 0x70, 0x43,
  65. 0x53, 0xc4, 0xc5, 0x5b, 0x5a, 0x5c, 0x51, 0x4f,
  66. 0x70, 0x4a, 0x58, 0x5e, 0x75, 0x76, 0x40, 0x57,
  67. 0x51, 0x46, 0x5e, 0x5c, 0xd5, 0x5c, 0x5c, 0x5e,
  68. 0x5e, 0x4d, 0x41, 0x44, 0xd4, 0xd6, 0xd5, 0x52,
  69. 0x54, 0xdd, 0xd7, 0xd3, 0x56, 0x51, 0x55, 0xdf,
  70. 0x54, 0xd1, 0xd2, 0xda
  71. };
  72. char packet_2[] = {
  73. 0x80, 0x08, 0x00, 0x03, 0x00, 0x00, 0x01, 0xe0,
  74. 0xd2, 0xbd, 0x4e, 0x3e, 0xdb, 0xd1, 0xd5, 0xd0,
  75. 0xd2, 0xd3, 0x57, 0xd5, 0xd6, 0xd6, 0xd1, 0xd5,
  76. 0xd1, 0xdd, 0xd5, 0xd1, 0xd1, 0xd4, 0x5f, 0x56,
  77. 0x5f, 0x5a, 0x53, 0x59, 0x5c, 0x5f, 0x5d, 0x5d,
  78. 0xd6, 0xd0, 0xd8, 0x54, 0xc4, 0xd9, 0xc6, 0xdc,
  79. 0x57, 0x56, 0x56, 0x57, 0x51, 0x54, 0x53, 0x57,
  80. 0x59, 0x44, 0x44, 0x5e, 0x45, 0x45, 0x5a, 0x5e,
  81. 0x53, 0x58, 0x4c, 0x45, 0x59, 0x45, 0x5b, 0x57,
  82. 0x52, 0x5e, 0x5e, 0x59, 0x5c, 0x51, 0xd7, 0xd0,
  83. 0xc5, 0xc1, 0xd8, 0xc1, 0xcd, 0xcd, 0xc2, 0xcd,
  84. 0xc6, 0xcc, 0xc0, 0xc6, 0xc1, 0xc9, 0xcb, 0xdb,
  85. 0xd0, 0xdd, 0xc6, 0xd8, 0xd5, 0x5f, 0x41, 0x46,
  86. 0x4f, 0x74, 0x76, 0x70, 0x72, 0x7f, 0x72, 0x77,
  87. 0x49, 0x4a, 0x76, 0x4a, 0x44, 0x45, 0x44, 0x59,
  88. 0x50, 0x55, 0xd3, 0xd9, 0xcc, 0xf7, 0xf1, 0xca,
  89. 0xc2, 0xf7, 0xf8, 0xe7, 0xe7, 0xe2, 0xee, 0xe9,
  90. 0xed, 0xe4, 0xc2, 0xcb, 0xf7, 0xd2, 0x48, 0x76,
  91. 0x45, 0x77, 0x64, 0x64, 0x4a, 0x51, 0x46, 0x41,
  92. 0xdd, 0xc2, 0xd4, 0x51, 0x50, 0x4a, 0x74, 0x71,
  93. 0x7e, 0x61, 0x67, 0x7e, 0x67, 0x60, 0x67, 0x77,
  94. 0x45, 0x43, 0x5f, 0xc8
  95. };
  96. char packet_3[] = {
  97. 0x80, 0x08, 0x2c, 0x43, 0x11, 0x47, 0x31, 0xa2,
  98. 0x58, 0xf3, 0x3d, 0xea, 0x53, 0x45, 0x56, 0x47,
  99. 0x5f, 0xd4, 0xd4, 0x55, 0x56, 0x58, 0x40, 0x53,
  100. 0x54, 0xd5, 0xc7, 0xc4, 0x57, 0xd5, 0xdd, 0xd9,
  101. 0xde, 0xdd, 0xdc, 0xd4, 0x55, 0x54, 0xdc, 0xcf,
  102. 0xc7, 0x5e, 0x43, 0x5a, 0x5a, 0x43, 0x5b, 0x51,
  103. 0x54, 0x51, 0xd6, 0xd4, 0x5b, 0x53, 0xd3, 0x57,
  104. 0xd5, 0xc0, 0xc7, 0x53, 0x5d, 0xd1, 0xc5, 0xc1,
  105. 0xd9, 0x5d, 0x57, 0xdc, 0xd0, 0xd0, 0x54, 0x45,
  106. 0x44, 0x42, 0x45, 0xd0, 0xd4, 0xd5, 0xd9, 0xc7,
  107. 0x57, 0x5e, 0x5f, 0x47, 0x56, 0xc5, 0xca, 0xc5,
  108. 0xd3, 0xdf, 0x57, 0x43, 0x4b, 0x5a, 0x5c, 0x5f,
  109. 0x45, 0x52, 0xd0, 0xc7, 0xcb, 0xc9, 0xc5, 0x5f,
  110. 0x47, 0x57, 0x55, 0xdc, 0xc7, 0x5d, 0x4b, 0x5a,
  111. 0xdb, 0xcf, 0xc5, 0x52, 0x43, 0x5a, 0x56, 0xde,
  112. 0xdf, 0xd6, 0xd5, 0x45, 0x5b, 0xdc, 0xdb, 0x55,
  113. 0x52, 0x54, 0x51, 0xd5, 0xc4, 0xdf, 0xd1, 0x56,
  114. 0x51, 0xd5, 0xd3, 0xde, 0x54, 0x44, 0x46, 0x52,
  115. 0x56, 0x5b, 0x5a, 0xd3, 0xc3, 0xdf, 0x57, 0xd1,
  116. 0xd9, 0xd6, 0x5f, 0x5f, 0xd4, 0xd6, 0xd5, 0xd1,
  117. 0x53, 0xd4, 0xc1, 0xdb, 0xdd, 0xd8, 0xd7, 0x47,
  118. 0x4b, 0x75, 0x4c, 0x5c
  119. };
  120. char packet_4[] = {
  121. 0x80, 0x08, 0x00, 0x04, 0x00, 0x00, 0x02, 0x80,
  122. 0xd2, 0xbd, 0x4e, 0x3e, 0xff, 0xf3, 0xff, 0xe1,
  123. 0xe7, 0xe4, 0xe5, 0xe2, 0xec, 0xef, 0xeb, 0xe9,
  124. 0x95, 0x97, 0xf8, 0xcc, 0xe4, 0xf9, 0x58, 0x6d,
  125. 0x72, 0x46, 0x7c, 0x62, 0x60, 0x42, 0x40, 0x70,
  126. 0x4e, 0xd3, 0xcb, 0xda, 0xd9, 0x54, 0x57, 0xd6,
  127. 0x4a, 0x62, 0x6e, 0x64, 0x60, 0x15, 0x15, 0x63,
  128. 0x67, 0x62, 0x60, 0x7f, 0x46, 0x46, 0x40, 0xd5,
  129. 0xcf, 0xf6, 0xc9, 0xcb, 0xf0, 0xfd, 0xf8, 0xe6,
  130. 0xec, 0xe9, 0x94, 0x91, 0x96, 0xf7, 0xd0, 0xe7,
  131. 0xf3, 0x7d, 0x6b, 0x7d, 0x5d, 0x65, 0x68, 0x61,
  132. 0x5d, 0x5c, 0x72, 0x43, 0xcd, 0xf6, 0xdf, 0xd2,
  133. 0xd2, 0x51, 0xdf, 0x49, 0x62, 0x14, 0x68, 0x6e,
  134. 0x10, 0x11, 0x69, 0x64, 0x61, 0x6d, 0x64, 0x75,
  135. 0x44, 0x74, 0x5e, 0xcf, 0xff, 0xf1, 0xc1, 0xf7,
  136. 0xf6, 0xe5, 0xe4, 0xe6, 0xe9, 0x91, 0x93, 0x90,
  137. 0x95, 0xce, 0xe5, 0xe0, 0xc7, 0x66, 0x62, 0x45,
  138. 0x75, 0x63, 0x6e, 0x79, 0x55, 0x49, 0x71, 0x53,
  139. 0xca, 0xcb, 0xd0, 0xdb, 0xd3, 0xd5, 0x5b, 0x67,
  140. 0x6b, 0x15, 0x61, 0x69, 0x17, 0x14, 0x6c, 0x66,
  141. 0x6f, 0x62, 0x7f, 0x48, 0x74, 0x75, 0x59, 0xd0,
  142. 0xdb, 0x54, 0xd7, 0xc3
  143. };
  144. char packet_5[] = {
  145. 0x80, 0x08, 0x2c, 0x44, 0x11, 0x47, 0x32, 0x42,
  146. 0x58, 0xf3, 0x3d, 0xea, 0x54, 0xd5, 0xde, 0xc4,
  147. 0xc0, 0xce, 0xd8, 0xd5, 0xdc, 0xde, 0xd4, 0xd9,
  148. 0x54, 0x4d, 0x74, 0x47, 0x44, 0x58, 0xc7, 0xc3,
  149. 0xc4, 0xd4, 0x55, 0x50, 0x43, 0x45, 0xd4, 0xc7,
  150. 0xcf, 0xc0, 0x55, 0x42, 0x48, 0x76, 0x4f, 0xd7,
  151. 0xc7, 0xcf, 0xc6, 0xc6, 0xf5, 0xc6, 0x53, 0x5a,
  152. 0x42, 0x5e, 0x51, 0xd6, 0xc4, 0xde, 0x56, 0x42,
  153. 0x42, 0x5e, 0xd7, 0xd4, 0xdb, 0xcb, 0xda, 0xd6,
  154. 0xd7, 0x53, 0x47, 0x4d, 0xd4, 0xdf, 0xdc, 0xd5,
  155. 0x5a, 0x59, 0x5a, 0x5a, 0xd5, 0xc4, 0xd7, 0x55,
  156. 0xc3, 0xce, 0xde, 0xd2, 0xd6, 0x46, 0x71, 0x7c,
  157. 0x4c, 0xd8, 0xf5, 0xf7, 0xcf, 0x54, 0x56, 0xd5,
  158. 0xdc, 0xda, 0xd7, 0xd7, 0x57, 0x5a, 0x5c, 0x52,
  159. 0x47, 0x5c, 0xd4, 0xd3, 0xd4, 0x47, 0x42, 0x4d,
  160. 0x54, 0xcf, 0xf3, 0xf0, 0xc0, 0xdb, 0xd1, 0x50,
  161. 0x47, 0x5e, 0x58, 0x49, 0x43, 0x5a, 0x54, 0xdc,
  162. 0x56, 0x56, 0xd9, 0xc8, 0xc2, 0xd2, 0x5d, 0x5a,
  163. 0x5a, 0x49, 0x40, 0x57, 0xda, 0xdb, 0xd6, 0x55,
  164. 0xdd, 0xcf, 0xdb, 0x5c, 0x51, 0xd0, 0xd5, 0x5f,
  165. 0x53, 0xd8, 0xc3, 0xc3, 0xd0, 0x5c, 0x5b, 0x44,
  166. 0x4e, 0x74, 0x4f, 0x56
  167. };
  168. char packet_6[] = {
  169. 0x80, 0x08, 0x00, 0x05, 0x00, 0x00, 0x03, 0x20,
  170. 0xd2, 0xbd, 0x4e, 0x3e, 0xca, 0xf0, 0xfd, 0xe2,
  171. 0xea, 0x96, 0x91, 0x91, 0xe7, 0xd9, 0xf9, 0xf9,
  172. 0x48, 0x6b, 0x61, 0x74, 0x66, 0x15, 0x69, 0x74,
  173. 0x42, 0x7d, 0x75, 0xd2, 0xf7, 0xc8, 0xc3, 0xd1,
  174. 0x5f, 0x5f, 0x7d, 0x6f, 0x15, 0x6d, 0x6e, 0x16,
  175. 0x16, 0x68, 0x61, 0x62, 0x6c, 0x66, 0x79, 0x7d,
  176. 0x7f, 0x77, 0x5c, 0xd9, 0xdb, 0x5e, 0x55, 0xcf,
  177. 0xf1, 0xf0, 0xe5, 0xef, 0x95, 0x96, 0x93, 0x97,
  178. 0xcd, 0xc3, 0xe4, 0xf7, 0x64, 0x15, 0x7a, 0x73,
  179. 0x60, 0x68, 0x64, 0xd1, 0x53, 0x4e, 0x5d, 0xf7,
  180. 0xf9, 0xf3, 0xf5, 0xd5, 0xd4, 0x58, 0x67, 0x6e,
  181. 0x6c, 0x61, 0x68, 0x14, 0x68, 0x61, 0x64, 0x63,
  182. 0x61, 0x79, 0x75, 0x4b, 0x4f, 0x44, 0xd7, 0xcb,
  183. 0xc0, 0xd8, 0xf6, 0xe4, 0xe1, 0xe7, 0xed, 0x97,
  184. 0x91, 0x93, 0x9d, 0x96, 0xff, 0xfd, 0xe5, 0xc7,
  185. 0x66, 0x67, 0x4d, 0x4e, 0x64, 0x62, 0x71, 0x54,
  186. 0xd5, 0x5f, 0xd0, 0xce, 0xce, 0xdf, 0x5d, 0x73,
  187. 0x72, 0x73, 0x6c, 0x15, 0x6d, 0x6d, 0x15, 0x14,
  188. 0x69, 0x63, 0x62, 0x62, 0x66, 0x78, 0x72, 0x76,
  189. 0x43, 0x5b, 0xd5, 0xc0, 0xd9, 0xdd, 0xca, 0xf8,
  190. 0xe4, 0xe7, 0xef, 0x96
  191. };
  192. char packet_7[] = {
  193. 0x80, 0x08, 0x2c, 0x45, 0x11, 0x47, 0x32, 0xe2,
  194. 0x58, 0xf3, 0x3d, 0xea, 0xdd, 0xd9, 0xd2, 0xd6,
  195. 0xd0, 0xd6, 0xdf, 0xd7, 0xd7, 0x54, 0xd5, 0x57,
  196. 0x57, 0xd0, 0xd4, 0x55, 0xd5, 0xd8, 0xdb, 0xc0,
  197. 0xc2, 0x53, 0x58, 0x5d, 0x57, 0x5e, 0x47, 0x41,
  198. 0x4a, 0x5f, 0xde, 0xd9, 0x55, 0xd0, 0xc5, 0xdd,
  199. 0xd3, 0xdd, 0xc6, 0xc1, 0xd1, 0x52, 0x5b, 0xd1,
  200. 0xcc, 0xd9, 0x43, 0x7a, 0x78, 0x4e, 0x55, 0xd2,
  201. 0xc5, 0xc3, 0xda, 0xc5, 0xd4, 0xd3, 0xc7, 0xd2,
  202. 0xd9, 0xdb, 0x55, 0x45, 0x59, 0x51, 0x59, 0xd4,
  203. 0xc2, 0xc6, 0xd0, 0xd1, 0x59, 0x48, 0x40, 0x47,
  204. 0x5a, 0x55, 0xd2, 0xdc, 0xd9, 0xc9, 0xf6, 0xd9,
  205. 0x42, 0x72, 0x40, 0xd1, 0x50, 0xd7, 0xc4, 0xc9,
  206. 0xc5, 0xc1, 0xc3, 0x54, 0x5b, 0x48, 0x43, 0x57,
  207. 0xd3, 0xd1, 0x5c, 0x47, 0x47, 0x49, 0x47, 0x59,
  208. 0xd1, 0xf5, 0xd8, 0xd6, 0xdd, 0xd8, 0x5c, 0x53,
  209. 0xc7, 0xc9, 0xc9, 0xc0, 0xd4, 0x4d, 0x4f, 0x47,
  210. 0x50, 0xdf, 0xce, 0xd8, 0x5d, 0x43, 0x40, 0x5f,
  211. 0xd1, 0x56, 0x58, 0xd0, 0xd0, 0xd0, 0xdb, 0x55,
  212. 0x5b, 0x5b, 0xd4, 0xda, 0xc0, 0xc6, 0xd4, 0x58,
  213. 0x5a, 0xd8, 0xc7, 0xdf, 0x54, 0x4a, 0x71, 0x43,
  214. 0xd0, 0xc3, 0xc9, 0xde
  215. };
  216. char packet_8[] = {
  217. 0x80, 0x08, 0x00, 0x06, 0x00, 0x00, 0x03, 0xc0,
  218. 0xd2, 0xbd, 0x4e, 0x3e, 0x90, 0x93, 0x92, 0x92,
  219. 0xe0, 0xf1, 0xff, 0xf6, 0x73, 0x60, 0x73, 0x75,
  220. 0x7f, 0x66, 0x7e, 0x5b, 0xd7, 0x56, 0xd5, 0xd2,
  221. 0xdf, 0xd2, 0xd0, 0x48, 0x78, 0x65, 0x66, 0x6f,
  222. 0x6b, 0x6c, 0x6f, 0x68, 0x6b, 0x6e, 0x6c, 0x62,
  223. 0x65, 0x78, 0x7d, 0x48, 0x4b, 0x4a, 0x42, 0xda,
  224. 0xf4, 0xc0, 0xcf, 0xfd, 0xe6, 0xe0, 0xe3, 0xe9,
  225. 0x91, 0x92, 0x9c, 0x9f, 0x90, 0xe2, 0xe7, 0xfa,
  226. 0xc3, 0x46, 0x75, 0x5f, 0x47, 0x42, 0x48, 0x44,
  227. 0xd3, 0xd0, 0xc5, 0xdf, 0xd2, 0xd8, 0xd8, 0x58,
  228. 0x7c, 0x72, 0x73, 0x7e, 0x60, 0x61, 0x65, 0x67,
  229. 0x60, 0x6d, 0x66, 0x7c, 0x71, 0x7d, 0x7d, 0x4a,
  230. 0xd4, 0xd8, 0xd2, 0xc1, 0xf5, 0xce, 0xdb, 0xf0,
  231. 0xe6, 0xe6, 0xe6, 0xed, 0xea, 0x97, 0x91, 0x92,
  232. 0x9c, 0x97, 0xe4, 0xfb, 0xe4, 0xc1, 0x74, 0x40,
  233. 0x54, 0x50, 0x4e, 0x75, 0x45, 0x54, 0x50, 0x44,
  234. 0x5f, 0x5d, 0x5b, 0x46, 0x73, 0x64, 0x7a, 0x7e,
  235. 0x67, 0x63, 0x66, 0x60, 0x6c, 0x69, 0x6c, 0x60,
  236. 0x64, 0x7a, 0x7b, 0x7c, 0x48, 0x45, 0x5b, 0x59,
  237. 0xd8, 0xca, 0xcc, 0xc3, 0xf0, 0xfa, 0xe5, 0xe1,
  238. 0xed, 0xea, 0x96, 0x91
  239. };
  240. char packet_9[] = {
  241. 0x80, 0x08, 0x2c, 0x46, 0x11, 0x47, 0x33, 0x82,
  242. 0x58, 0xf3, 0x3d, 0xea, 0x5b, 0x47, 0x55, 0xdf,
  243. 0xd1, 0xd5, 0x54, 0xd3, 0xc4, 0x55, 0x5e, 0x56,
  244. 0xd1, 0xd2, 0xde, 0xdd, 0x54, 0x5c, 0x45, 0x5d,
  245. 0x55, 0x5d, 0x59, 0xd6, 0x55, 0x5a, 0xd3, 0xd9,
  246. 0xd0, 0xdc, 0xd8, 0xd8, 0xc6, 0xca, 0xc6, 0xd1,
  247. 0x5a, 0x7f, 0x7e, 0x4f, 0xdd, 0xd9, 0x57, 0x45,
  248. 0x59, 0xd7, 0xdd, 0xc3, 0xc6, 0x54, 0x5c, 0xd4,
  249. 0xdd, 0xdd, 0x5d, 0x43, 0x55, 0xdf, 0xda, 0xcc,
  250. 0xc9, 0x54, 0x4f, 0x5c, 0x55, 0xd2, 0xd0, 0xd1,
  251. 0x52, 0x5f, 0xdd, 0x53, 0x58, 0x53, 0xd6, 0xdd,
  252. 0xd9, 0xdc, 0xc1, 0xd7, 0x4a, 0x4e, 0x47, 0x51,
  253. 0xdf, 0xf5, 0xc6, 0x57, 0x5b, 0x75, 0x74, 0x55,
  254. 0xf6, 0xdb, 0x5e, 0x50, 0xd4, 0xd3, 0x56, 0x58,
  255. 0x5f, 0xd7, 0xdd, 0xde, 0xd2, 0xd5, 0x4d, 0x71,
  256. 0x5f, 0xf4, 0xf2, 0xc0, 0x50, 0x41, 0x5c, 0xd0,
  257. 0xd7, 0xdc, 0xd1, 0x45, 0x4e, 0x5c, 0x54, 0x5e,
  258. 0x77, 0x72, 0x5a, 0xcf, 0xf2, 0xf4, 0xda, 0xd2,
  259. 0xd6, 0x58, 0x5e, 0xdf, 0xc1, 0xc2, 0x57, 0x40,
  260. 0x56, 0xd7, 0xd7, 0xd5, 0x56, 0x45, 0x43, 0x50,
  261. 0xd9, 0xd2, 0x52, 0x5e, 0x5d, 0xd2, 0xd8, 0xd2,
  262. 0x54, 0x58, 0x41, 0x43
  263. };
  264. char packet_10[] = {
  265. 0x80, 0x08, 0x2c, 0x47, 0x11, 0x47, 0x34, 0x22,
  266. 0x58, 0xf3, 0x3d, 0xea, 0x56, 0xd4, 0xd6, 0x58,
  267. 0x42, 0x53, 0xc4, 0xf7, 0xcb, 0xf5, 0xf4, 0xc1,
  268. 0xd0, 0x4d, 0x45, 0xd6, 0x57, 0xd0, 0xd9, 0xdb,
  269. 0x50, 0x44, 0x59, 0x4b, 0x4f, 0xd6, 0xd8, 0x57,
  270. 0x5e, 0xd6, 0x57, 0xd0, 0xc5, 0xdf, 0xc6, 0xcd,
  271. 0xc5, 0x51, 0x50, 0xd0, 0xd6, 0xd2, 0xdb, 0x5d,
  272. 0x75, 0x75, 0x73, 0x75, 0xc0, 0xf7, 0xf0, 0xf6,
  273. 0xc9, 0xd8, 0xd5, 0x57, 0x56, 0x48, 0x70, 0x75,
  274. 0x42, 0x42, 0x5f, 0xd0, 0x5d, 0x5b, 0x5c, 0x55,
  275. 0xd6, 0xc1, 0xcf, 0xd8, 0xd3, 0xd0, 0x45, 0x4f,
  276. 0x54, 0xc6, 0xd0, 0x59, 0x55, 0xc4, 0xd1, 0x5a,
  277. 0x73, 0x7f, 0x47, 0x54, 0xd1, 0xdf, 0xdc, 0xd7,
  278. 0xc7, 0xc8, 0xdb, 0xc7, 0xca, 0xc9, 0xc0, 0xc7,
  279. 0xc1, 0x51, 0x40, 0x5f, 0x52, 0xd7, 0xda, 0xdf,
  280. 0x41, 0x4c, 0x56, 0x54, 0x5f, 0x4a, 0x4a, 0x4e,
  281. 0x5d, 0xc4, 0xc6, 0xcd, 0xc7, 0xd6, 0x52, 0xd4,
  282. 0xc4, 0xc4, 0xc6, 0xd5, 0x5b, 0x41, 0x4e, 0x56,
  283. 0xc4, 0xd8, 0x54, 0x5e, 0x4d, 0x48, 0x76, 0x73,
  284. 0x4d, 0x5b, 0x59, 0xd8, 0xf0, 0xf7, 0xde, 0x52,
  285. 0xd0, 0xc3, 0xfd, 0xfa, 0xfd, 0xc1, 0x40, 0x4a,
  286. 0x5a, 0x45, 0x5d, 0xd0
  287. };
  288. #define MAKE_TEST(n) \
  289. /* deserialize the packet*/ \
  290. if((packet = trtp_rtp_packet_deserialize(packet_##n, sizeof(packet_##n)))){ \
  291. /* serialize the packet */ \
  292. if((buffer = trtp_rtp_packet_serialize(packet))){ \
  293. /* compare data */ \
  294. if(sizeof(packet_##n) != buffer->size){ \
  295. TSK_DEBUG_ERROR("Test-%d: Sizes are different", n); \
  296. } \
  297. else{ \
  298. for(i=0; i<buffer->size; i++){ \
  299. if(packet_##n[i] != ((char*)buffer->data)[i]){ \
  300. TSK_DEBUG_ERROR("Test-%d: Data is different", n); \
  301. break; \
  302. } \
  303. } \
  304. if(i==buffer->size){ \
  305. TSK_DEBUG_INFO("Test-%d: OK", n); \
  306. } \
  307. } \
  308. } \
  309. else{ \
  310. TSK_DEBUG_ERROR("Failed to serialize packet-%d", n); \
  311. } \
  312. \
  313. TSK_OBJECT_SAFE_FREE(buffer); \
  314. TSK_OBJECT_SAFE_FREE(packet); \
  315. } \
  316. else{ \
  317. TSK_DEBUG_ERROR("Failed to deserialize packet-%d", n); \
  318. }
  319. void test_parser()
  320. {
  321. trtp_rtp_packet_t* packet;
  322. tsk_buffer_t* buffer;
  323. tsk_size_t i;
  324. MAKE_TEST(0);
  325. MAKE_TEST(1);
  326. MAKE_TEST(2);
  327. MAKE_TEST(3);
  328. MAKE_TEST(4);
  329. MAKE_TEST(5);
  330. MAKE_TEST(6);
  331. MAKE_TEST(7);
  332. MAKE_TEST(8);
  333. MAKE_TEST(9);
  334. MAKE_TEST(10);
  335. }
  336. #endif /* _TEST_PARSER_H_ */