PageRenderTime 111ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 2ms

/epan/dissectors/packet-ansi_a.c

https://github.com/labx-technologies-llc/wireshark
C | 12314 lines | 8618 code | 2590 blank | 1106 comment | 392 complexity | 0e55385666d58e100917bf601fb15a56 MD5 | raw file
Possible License(s): GPL-2.0, BSD-3-Clause
  1. /* packet-ansi_a.c
  2. * Routines for ANSI A Interface (IS-634/IOS) dissection
  3. *
  4. * Copyright 2003, Michael Lum <mlum [AT] telostech.com>
  5. * In association with Telos Technology Inc.
  6. * Copyright 2008, Michael Lum <michael.lum [AT] utstar.com>
  7. * In association with UTStarcom Inc.
  8. * Copyright 2008, Michael Lum <michael.lum [AT] starsolutions.com>
  9. * In association with Star Solutions
  10. *
  11. * Title 3GPP2 Other
  12. *
  13. * Inter-operability Specification (IOS) for CDMA
  14. * 2000 Access Network Interfaces
  15. * 3GPP2 A.S0001-1 TIA/EIA-2001
  16. *
  17. * $Id$
  18. *
  19. * Wireshark - Network traffic analyzer
  20. * By Gerald Combs <gerald@wireshark.org>
  21. * Copyright 1998 Gerald Combs
  22. *
  23. * This program is free software; you can redistribute it and/or
  24. * modify it under the terms of the GNU General Public License
  25. * as published by the Free Software Foundation; either version 2
  26. * of the License, or (at your option) any later version.
  27. *
  28. * This program is distributed in the hope that it will be useful,
  29. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  30. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  31. * GNU General Public License for more details.
  32. *
  33. * You should have received a copy of the GNU General Public License
  34. * along with this program; if not, write to the Free Software
  35. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  36. */
  37. #include "config.h"
  38. #include <string.h>
  39. #include <epan/packet.h>
  40. #include <epan/prefs.h>
  41. #include <epan/tap.h>
  42. #include <epan/strutil.h>
  43. #include <epan/wmem/wmem.h>
  44. #include <epan/expert.h>
  45. #include <epan/base64.h>
  46. #include "packet-rtp.h"
  47. #include "packet-bssap.h"
  48. #include "packet-ansi_a.h"
  49. /*
  50. * IOS 4, probably most common
  51. */
  52. static gint global_a_variant = A_VARIANT_IOS401;
  53. /* PROTOTYPES/FORWARDS */
  54. void proto_register_ansi_a(void);
  55. void proto_reg_handoff_ansi_a(void);
  56. static const gchar *
  57. my_try_val_to_str_idx(guint32 val, const ext_value_string_t *vs, gint *dec_idx)
  58. {
  59. gint i = 0;
  60. while (vs[i].strptr)
  61. {
  62. if (vs[i].value == val)
  63. {
  64. *dec_idx = vs[i].dec_index;
  65. return(vs[i].strptr);
  66. }
  67. i++;
  68. }
  69. *dec_idx = -1;
  70. return(NULL);
  71. }
  72. const ext_value_string_t ansi_a_ios401_bsmap_strings[] =
  73. {
  74. { 0x69, "Additional Service Notification", 0 },
  75. { 0x65, "ADDS Page", 1 },
  76. { 0x66, "ADDS Page Ack", 2 },
  77. { 0x67, "ADDS Transfer", 3 },
  78. { 0x68, "ADDS Transfer Ack", 4 },
  79. { 0x02, "Assignment Complete", 5 },
  80. { 0x03, "Assignment Failure", 6 },
  81. { 0x01, "Assignment Request", 7 },
  82. { 0x45, "Authentication Request", 8 },
  83. { 0x46, "Authentication Response", 9 },
  84. { 0x48, "Base Station Challenge", 10 },
  85. { 0x49, "Base Station Challenge Response", 11 },
  86. { 0x40, "Block", 12 },
  87. { 0x41, "Block Acknowledge", 13 },
  88. { 0x09, "BS Service Request", 14 },
  89. { 0x0A, "BS Service Response", 15 },
  90. { 0x20, "Clear Command", 16 },
  91. { 0x21, "Clear Complete", 17 },
  92. { 0x22, "Clear Request", 18 },
  93. { 0x57, "Complete Layer 3 Information", 19 },
  94. { 0x60, "Feature Notification", 20 },
  95. { 0x61, "Feature Notification Ack", 21 },
  96. { 0x13, "Handoff Command", 22 },
  97. { 0x15, "Handoff Commenced", 23 },
  98. { 0x14, "Handoff Complete", 24 },
  99. { 0x16, "Handoff Failure", 25 },
  100. { 0x17, "Handoff Performed", 26 },
  101. { 0x10, "Handoff Request", 27 },
  102. { 0x12, "Handoff Request Acknowledge", 28 },
  103. { 0x11, "Handoff Required", 29 },
  104. { 0x1A, "Handoff Required Reject", 30 },
  105. { 0x6C, "PACA Command", 31 },
  106. { 0x6D, "PACA Command Ack", 32 },
  107. { 0x6E, "PACA Update", 33 },
  108. { 0x6F, "PACA Update Ack", 34 },
  109. { 0x52, "Paging Request", 35 },
  110. { 0x53, "Privacy Mode Command", 36 },
  111. { 0x55, "Privacy Mode Complete", 37 },
  112. { 0x23, "Radio Measurements for Position Request", 38 },
  113. { 0x25, "Radio Measurements for Position Response", 39 },
  114. { 0x56, "Rejection", 40 },
  115. { 0x05, "Registration Request", 41 },
  116. { 0x30, "Reset", 42 },
  117. { 0x31, "Reset Acknowledge", 43 },
  118. { 0x34, "Reset Circuit", 44 },
  119. { 0x35, "Reset Circuit Acknowledge", 45 },
  120. { 0x47, "SSD Update Request", 46 },
  121. { 0x4A, "SSD Update Response", 47 },
  122. { 0x6A, "Status Request", 48 },
  123. { 0x6B, "Status Response", 49 },
  124. { 0x39, "Transcoder Control Acknowledge", 50 },
  125. { 0x38, "Transcoder Control Request", 51 },
  126. { 0x42, "Unblock", 52 },
  127. { 0x43, "Unblock Acknowledge", 53 },
  128. { 0x0B, "User Zone Reject", 54 },
  129. { 0x04, "User Zone Update", 55 },
  130. { 0, NULL, 0 }
  131. };
  132. const ext_value_string_t ansi_a_ios401_dtap_strings[] =
  133. {
  134. { 0x62, "Additional Service Request", 0 },
  135. { 0x53, "ADDS Deliver", 1 },
  136. { 0x54, "ADDS Deliver Ack", 2 },
  137. { 0x26, "Alert With Information", 3 },
  138. { 0x45, "Authentication Request", 4 },
  139. { 0x46, "Authentication Response", 5 },
  140. { 0x48, "Base Station Challenge", 6 },
  141. { 0x49, "Base Station Challenge Response", 7 },
  142. { 0x24, "CM Service Request", 8 },
  143. { 0x25, "CM Service Request Continuation", 9 },
  144. { 0x07, "Connect", 10 },
  145. { 0x10, "Flash with Information", 11 },
  146. { 0x50, "Flash with Information Ack", 12 },
  147. { 0x02, "Location Updating Accept", 13 },
  148. { 0x04, "Location Updating Reject", 14 },
  149. { 0x08, "Location Updating Request", 15 },
  150. { 0x27, "Paging Response", 16 },
  151. { 0x2B, "Parameter Update Confirm", 17 },
  152. { 0x2C, "Parameter Update Request", 18 },
  153. { 0x56, "Rejection", 19 },
  154. { 0x03, "Progress", 20 },
  155. { 0x70, "Service Redirection", 21 },
  156. { 0x2E, "Service Release", 22 },
  157. { 0x2F, "Service Release Complete", 23 },
  158. { 0x47, "SSD Update Request", 24 },
  159. { 0x4A, "SSD Update Response", 25 },
  160. { 0x6A, "Status Request", 26 },
  161. { 0x6B, "Status Response", 27 },
  162. { 0x0B, "User Zone Reject", 28 },
  163. { 0x0C, "User Zone Update", 29 },
  164. { 0x0D, "User Zone Update Request", 30 },
  165. { 0, NULL, 0 }
  166. };
  167. const ext_value_string_t ansi_a_ios401_elem_1_strings[] =
  168. {
  169. { 0x20, "Access Network Identifiers", 0 },
  170. { 0x3D, "ADDS User Part", 1 },
  171. { 0x25, "AMPS Hard Handoff Parameters", 2 },
  172. { 0x30, "Anchor PDSN Address", 3 },
  173. { 0x7C, "Anchor P-P Address", 4 },
  174. { 0x41, "Authentication Challenge Parameter", 5 },
  175. { 0x28, "Authentication Confirmation Parameter (RANDC)", 6 },
  176. { 0x59, "Authentication Data", 7 },
  177. { 0x4A, "Authentication Event", 8 },
  178. { 0x40, "Authentication Parameter COUNT", 9 },
  179. { 0x42, "Authentication Response Parameter", 10 },
  180. { 0x37, "Band Class", 11 },
  181. { 0x5B, "Called Party ASCII Number", 12 },
  182. { 0x5E, "Called Party BCD Number", 13 },
  183. { 0x4B, "Calling Party ASCII Number", 14 },
  184. { 0x04, "Cause", 15 },
  185. { 0x08, "Cause Layer 3", 16 },
  186. { 0x0C, "CDMA Serving One Way Delay", 17 },
  187. { 0x05, "Cell Identifier", 18 },
  188. { 0x1A, "Cell Identifier List", 19 },
  189. { 0x23, "Channel Number", 20 },
  190. { 0x0B, "Channel Type", 21 },
  191. { 0x19, "Circuit Group", 22 },
  192. { 0x01, "Circuit Identity Code", 23 },
  193. { 0x24, "Circuit Identity Code Extension", 24 },
  194. { 0x12, "Classmark Information Type 2", 25 },
  195. { 0x29, "Downlink Radio Environment", 26 },
  196. { 0x2B, "Downlink Radio Environment List", 27 },
  197. { 0x0A, "Encryption Information", 28 },
  198. { 0x10, "Extended Handoff Direction Parameters", 29 },
  199. { 0x2C, "Geographic Location", 30 },
  200. { 0x5A, "Special Service Call Indicator", 31 },
  201. { 0x26, "Handoff Power Level", 32 },
  202. { 0x16, "Hard Handoff Parameters", 33 },
  203. { 0x2E, "Information Element Requested", 34 },
  204. { 0x09, "IS-2000 Channel Identity", 35 },
  205. { 0x27, "IS-2000 Channel Identity 3X", 36 },
  206. { 0x11, "IS-2000 Mobile Capabilities", 37 },
  207. { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record", 38 },
  208. { 0x0E, "IS-2000 Service Configuration Record", 39 },
  209. { 0x62, "IS-95/IS-2000 Cause Value", 40 },
  210. { 0x67, "IS-2000 Redirection Record", 41 },
  211. { 0x22, "IS-95 Channel Identity", 42 },
  212. { 0x64, "IS-95 MS Measured Channel Identity", 43 },
  213. { 0x17, "Layer 3 Information", 44 },
  214. { 0x13, "Location Area Information", 45 },
  215. { 0x38, "Message Waiting Indication", 46 },
  216. { 0x0D, "Mobile Identity", 47 },
  217. { 0x15, "MS Information Records (Forward)", 48 },
  218. { 0xA0, "Origination Continuation Indicator", 49 },
  219. { 0x5F, "PACA Order", 50 },
  220. { 0x60, "PACA Reorigination Indicator", 51 },
  221. { 0x4E, "PACA Timestamp", 52 },
  222. { 0x70, "Packet Session Parameters", 53 },
  223. { 0x14, "PDSN IP Address", 54 },
  224. { 0xA2, "Power Down Indicator", 55 },
  225. { 0x06, "Priority", 56 },
  226. { 0x3B, "Protocol Revision", 57 },
  227. { 0x18, "Protocol Type", 58 },
  228. { 0x2D, "PSMM Count", 59 },
  229. { 0x07, "Quality of Service Parameters", 60 },
  230. { 0x1D, "Radio Environment and Resources", 61 },
  231. { 0x1F, "Registration Type", 62 },
  232. { 0x44, "Reject Cause", 63 },
  233. { 0x1B, "Response Request", 64 },
  234. { 0x68, "Return Cause", 65 },
  235. { 0x21, "RF Channel Identity", 66 },
  236. { 0x03, "Service Option", 67 },
  237. { 0x1E, "Service Option Connection Identifier (SOCI)", 68 },
  238. { 0x2A, "Service Option List", 69 },
  239. { 0x69, "Service Redirection Info", 70 },
  240. { 0x71, "Service Reference Identifier (SR_ID)", 71 },
  241. { 0x32, "SID", 72 },
  242. { 0x34, "Signal", 73 },
  243. { 0x35, "Slot Cycle Index", 74 },
  244. { 0x31, "Software Version", 75 },
  245. { 0x39, "Source RNC to Target RNC Transparent Container", 76 },
  246. { 0x14, "Source PDSN Address", 77 },
  247. { 0x33, "Tag", 78 },
  248. { 0x3A, "Target RNC to Source RNC Transparent Container", 79 },
  249. { 0x36, "Transcoder Mode", 80 }, /* XXX 0x1C in IOS 4.0.1 */
  250. { 0x02, "User Zone ID", 81 },
  251. { 0xA1, "Voice Privacy Request", 82 },
  252. { 0x15, "MS Information Records (Reverse)", 88 },
  253. { 0, NULL, 0 }
  254. };
  255. const ext_value_string_t ansi_a_ios501_bsmap_strings[] =
  256. {
  257. { 0x69, "Additional Service Notification", 0 },
  258. { 0x65, "ADDS Page", 1 },
  259. { 0x66, "ADDS Page Ack", 2 },
  260. { 0x67, "ADDS Transfer", 3 },
  261. { 0x68, "ADDS Transfer Ack", 4 },
  262. { 0x02, "Assignment Complete", 5 },
  263. { 0x03, "Assignment Failure", 6 },
  264. { 0x01, "Assignment Request", 7 },
  265. { 0x45, "Authentication Request", 8 },
  266. { 0x46, "Authentication Response", 9 },
  267. { 0x48, "Base Station Challenge", 10 },
  268. { 0x49, "Base Station Challenge Response", 11 },
  269. { 0x40, "Block", 12 },
  270. { 0x41, "Block Acknowledge", 13 },
  271. { 0x09, "BS Service Request", 14 },
  272. { 0x0A, "BS Service Response", 15 },
  273. { 0x20, "Clear Command", 16 },
  274. { 0x21, "Clear Complete", 17 },
  275. { 0x22, "Clear Request", 18 },
  276. { 0x57, "Complete Layer 3 Information", 19 },
  277. { 0x60, "Feature Notification", 20 },
  278. { 0x61, "Feature Notification Ack", 21 },
  279. { 0x13, "Handoff Command", 22 },
  280. { 0x15, "Handoff Commenced", 23 },
  281. { 0x14, "Handoff Complete", 24 },
  282. { 0x16, "Handoff Failure", 25 },
  283. { 0x17, "Handoff Performed", 26 },
  284. { 0x10, "Handoff Request", 27 },
  285. { 0x12, "Handoff Request Acknowledge", 28 },
  286. { 0x11, "Handoff Required", 29 },
  287. { 0x1A, "Handoff Required Reject", 30 },
  288. { 0x6C, "PACA Command", 31 },
  289. { 0x6D, "PACA Command Ack", 32 },
  290. { 0x6E, "PACA Update", 33 },
  291. { 0x6F, "PACA Update Ack", 34 },
  292. { 0x52, "Paging Request", 35 },
  293. { 0x53, "Privacy Mode Command", 36 },
  294. { 0x55, "Privacy Mode Complete", 37 },
  295. { 0x23, "Radio Measurements for Position Request", 38 },
  296. { 0x25, "Radio Measurements for Position Response", 39 },
  297. { 0x56, "Rejection", 40 },
  298. { 0x05, "Registration Request", 41 },
  299. { 0x30, "Reset", 42 },
  300. { 0x31, "Reset Acknowledge", 43 },
  301. { 0x34, "Reset Circuit", 44 },
  302. { 0x35, "Reset Circuit Acknowledge", 45 },
  303. { 0x47, "SSD Update Request", 46 },
  304. { 0x4A, "SSD Update Response", 47 },
  305. { 0x6A, "Status Request", 48 },
  306. { 0x6B, "Status Response", 49 },
  307. { 0x39, "Transcoder Control Acknowledge", 50 },
  308. { 0x38, "Transcoder Control Request", 51 },
  309. { 0x42, "Unblock", 52 },
  310. { 0x43, "Unblock Acknowledge", 53 },
  311. { 0x0B, "User Zone Reject", 54 },
  312. { 0x04, "User Zone Update", 55 },
  313. { 0x58, "Bearer Update Request", 56 },
  314. { 0x59, "Bearer Update Response", 58 },
  315. { 0x5A, "Bearer Update Required", 57 },
  316. { 0x71, "Mobile Station Registered Notification", 59 },
  317. { 0x07, "BS Authentication Request", 60 },
  318. { 0x08, "BS Authentication Request Ack", 61 },
  319. { 0, NULL, 0 }
  320. };
  321. const ext_value_string_t ansi_a_ios501_dtap_strings[] =
  322. {
  323. { 0x62, "Additional Service Request", 0 },
  324. { 0x53, "ADDS Deliver", 1 },
  325. { 0x54, "ADDS Deliver Ack", 2 },
  326. { 0x26, "Alert With Information", 3 },
  327. { 0x45, "Authentication Request", 4 },
  328. { 0x46, "Authentication Response", 5 },
  329. { 0x48, "Base Station Challenge", 6 },
  330. { 0x49, "Base Station Challenge Response", 7 },
  331. { 0x24, "CM Service Request", 8 },
  332. { 0x25, "CM Service Request Continuation", 9 },
  333. { 0x07, "Connect", 10 },
  334. { 0x10, "Flash with Information", 11 },
  335. { 0x50, "Flash with Information Ack", 12 },
  336. { 0x02, "Location Updating Accept", 13 },
  337. { 0x04, "Location Updating Reject", 14 },
  338. { 0x08, "Location Updating Request", 15 },
  339. { 0x27, "Paging Response", 16 },
  340. { 0x2B, "Parameter Update Confirm", 17 },
  341. { 0x2C, "Parameter Update Request", 18 },
  342. { 0x56, "Rejection", 19 },
  343. { 0x03, "Progress", 20 },
  344. { 0x70, "Service Redirection", 21 },
  345. { 0x2E, "Service Release", 22 },
  346. { 0x2F, "Service Release Complete", 23 },
  347. { 0x47, "SSD Update Request", 24 },
  348. { 0x4A, "SSD Update Response", 25 },
  349. { 0x6A, "Status Request", 26 },
  350. { 0x6B, "Status Response", 27 },
  351. { 0x0B, "User Zone Reject", 28 },
  352. { 0x0C, "User Zone Update", 29 },
  353. { 0x0D, "User Zone Update Request", 30 },
  354. { 0, NULL, 0 }
  355. };
  356. /*
  357. * ORDER MUST MATCH
  358. * ansi_a_ios401_elem_1_strings when the same element
  359. * is being described.
  360. */
  361. const ext_value_string_t ansi_a_ios501_elem_1_strings[] =
  362. {
  363. { 0x20, "Access Network Identifiers", 0 },
  364. { 0x3D, "ADDS User Part", 1 },
  365. { 0x25, "AMPS Hard Handoff Parameters", 2 },
  366. { 0x30, "Anchor PDSN Address", 3 },
  367. { 0x7C, "Anchor P-P Address", 4 },
  368. { 0x41, "Authentication Challenge Parameter", 5 },
  369. { 0x28, "Authentication Confirmation Parameter (RANDC)", 6 },
  370. { 0x59, "Authentication Data", 7 },
  371. { 0x4A, "Authentication Event", 8 },
  372. { 0x40, "Authentication Parameter COUNT", 9 },
  373. { 0x42, "Authentication Response Parameter", 10 },
  374. { 0x37, "Band Class", 11 },
  375. { 0x5B, "Called Party ASCII Number", 12 },
  376. { 0x5E, "Called Party BCD Number", 13 },
  377. { 0x4B, "Calling Party ASCII Number", 14 },
  378. { 0x04, "Cause", 15 },
  379. { 0x08, "Cause Layer 3", 16 },
  380. { 0x0C, "CDMA Serving One Way Delay", 17 },
  381. { 0x05, "Cell Identifier", 18 },
  382. { 0x1A, "Cell Identifier List", 19 },
  383. { 0x23, "Channel Number", 20 },
  384. { 0x0B, "Channel Type", 21 },
  385. { 0x19, "Circuit Group", 22 },
  386. { 0x01, "Circuit Identity Code", 23 },
  387. { 0x24, "Circuit Identity Code Extension", 24 },
  388. { 0x12, "Classmark Information Type 2", 25 },
  389. { 0x29, "Downlink Radio Environment", 26 },
  390. { 0x2B, "Downlink Radio Environment List", 27 },
  391. { 0x0A, "Encryption Information", 28 },
  392. { 0x10, "Extended Handoff Direction Parameters", 29 },
  393. { 0x2C, "Geographic Location", 30 },
  394. { 0x5A, "Special Service Call Indicator", 31 },
  395. { 0x26, "Handoff Power Level", 32 },
  396. { 0x16, "Hard Handoff Parameters", 33 },
  397. { 0x2E, "Information Element Requested", 34 },
  398. { 0x09, "IS-2000 Channel Identity", 35 },
  399. { 0x27, "IS-2000 Channel Identity 3X", 36 },
  400. { 0x11, "IS-2000 Mobile Capabilities", 37 },
  401. { 0x0F, "IS-2000 Non-Negotiable Service Configuration Record", 38 },
  402. { 0x0E, "IS-2000 Service Configuration Record", 39 },
  403. { 0x62, "IS-95/IS-2000 Cause Value", 40 },
  404. { 0x67, "IS-2000 Redirection Record", 41 },
  405. { 0x22, "IS-95 Channel Identity", 42 },
  406. { 0x64, "IS-95 MS Measured Channel Identity", 43 },
  407. { 0x17, "Layer 3 Information", 44 },
  408. { 0x13, "Location Area Information", 45 },
  409. { 0x38, "Message Waiting Indication", 46 },
  410. { 0x0D, "Mobile Identity", 47 },
  411. { 0x15, "MS Information Records (Forward)", 48 },
  412. { 0xA0, "Origination Continuation Indicator", 49 },
  413. { 0x5F, "PACA Order", 50 },
  414. { 0x60, "PACA Reorigination Indicator", 51 },
  415. { 0x4E, "PACA Timestamp", 52 },
  416. { 0x70, "Packet Session Parameters", 53 },
  417. { 0x14, "PDSN IP Address", 54 },
  418. { 0xA2, "Power Down Indicator", 55 },
  419. { 0x06, "Priority", 56 },
  420. { 0x3B, "Protocol Revision", 57 },
  421. { 0x18, "Protocol Type", 58 },
  422. { 0x2D, "PSMM Count", 59 },
  423. { 0x07, "Quality of Service Parameters", 60 },
  424. { 0x1D, "Radio Environment and Resources", 61 },
  425. { 0x1F, "Registration Type", 62 },
  426. { 0x44, "Reject Cause", 63 },
  427. { 0x1B, "Response Request", 64 },
  428. { 0x68, "Return Cause", 65 },
  429. { 0x21, "RF Channel Identity", 66 },
  430. { 0x03, "Service Option", 67 },
  431. { 0x1E, "Service Option Connection Identifier (SOCI)", 68 },
  432. { 0x2A, "Service Option List", 69 },
  433. { 0x69, "Service Redirection Info", 70 },
  434. { 0x71, "Service Reference Identifier (SR_ID)", 71 },
  435. { 0x32, "SID", 72 },
  436. { 0x34, "Signal", 73 },
  437. { 0x35, "Slot Cycle Index", 74 },
  438. { 0x31, "Software Version", 75 },
  439. { 0x39, "Source RNC to Target RNC Transparent Container", 76 },
  440. { 0x14, "Source PDSN Address", 77 },
  441. { 0x33, "Tag", 78 },
  442. { 0x3A, "Target RNC to Source RNC Transparent Container", 79 },
  443. { 0x36, "Transcoder Mode", 80 }, /* XXX 0x1C in IOS 4.0.1 */
  444. { 0x02, "User Zone ID", 81 },
  445. { 0xA1, "Voice Privacy Request", 82 },
  446. { 0x45, "A2p Bearer Session-Level Parameters", 83 },
  447. { 0x46, "A2p Bearer Format-Specific Parameters", 84 },
  448. { 0x73, "MS Designated Frequency", 85 },
  449. { 0x7D, "Mobile Subscription Information", 86 },
  450. { 0x72, "Public Long Code Mask Identification", 87 },
  451. { 0x15, "MS Information Records (Reverse)", 88 },
  452. { 0, NULL, 0 }
  453. };
  454. /*
  455. * From Table 3.7.5-1 C.S0005-D v1.0 L3
  456. */
  457. #define ANSI_FWD_MS_INFO_REC_DISPLAY 0x01
  458. #define ANSI_FWD_MS_INFO_REC_CLD_PN 0x02
  459. #define ANSI_FWD_MS_INFO_REC_CLG_PN 0x03
  460. #define ANSI_FWD_MS_INFO_REC_CONN_N 0x04
  461. #define ANSI_FWD_MS_INFO_REC_SIGNAL 0x05
  462. #define ANSI_FWD_MS_INFO_REC_MW 0x06
  463. #define ANSI_FWD_MS_INFO_REC_SC 0x07
  464. #define ANSI_FWD_MS_INFO_REC_CLD_PSA 0x08
  465. #define ANSI_FWD_MS_INFO_REC_CLG_PSA 0x09
  466. #define ANSI_FWD_MS_INFO_REC_CONN_SA 0x0a
  467. #define ANSI_FWD_MS_INFO_REC_RED_N 0x0b
  468. #define ANSI_FWD_MS_INFO_REC_RED_SA 0x0c
  469. #define ANSI_FWD_MS_INFO_REC_MP 0x0d
  470. #define ANSI_FWD_MS_INFO_REC_PA 0x0e
  471. #define ANSI_FWD_MS_INFO_REC_LC 0x0f
  472. #define ANSI_FWD_MS_INFO_REC_EDISPLAY 0x10
  473. #define ANSI_FWD_MS_INFO_REC_NNSC 0x13
  474. #define ANSI_FWD_MS_INFO_REC_MC_EDISPLAY 0x14
  475. #define ANSI_FWD_MS_INFO_REC_CWI 0x15
  476. #define ANSI_FWD_MS_INFO_REC_EMC_EDISPLAY 0x16
  477. #define ANSI_FWD_MS_INFO_REC_ERTI 0xfe
  478. static const value_string ansi_fwd_ms_info_rec_str[] = {
  479. { ANSI_FWD_MS_INFO_REC_DISPLAY, "Display" },
  480. { ANSI_FWD_MS_INFO_REC_CLD_PN, "Called Party Number" },
  481. { ANSI_FWD_MS_INFO_REC_CLG_PN, "Calling Party Number" },
  482. { ANSI_FWD_MS_INFO_REC_CONN_N, "Connected Number" },
  483. { ANSI_FWD_MS_INFO_REC_SIGNAL, "Signal" },
  484. { ANSI_FWD_MS_INFO_REC_MW, "Message Waiting" },
  485. { ANSI_FWD_MS_INFO_REC_SC, "Service Configuration" },
  486. { ANSI_FWD_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
  487. { ANSI_FWD_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
  488. { ANSI_FWD_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
  489. { ANSI_FWD_MS_INFO_REC_RED_N, "Redirecting Number" },
  490. { ANSI_FWD_MS_INFO_REC_RED_SA, "Redirecting Subaddress" },
  491. { ANSI_FWD_MS_INFO_REC_MP, "Meter Pulses" },
  492. { ANSI_FWD_MS_INFO_REC_PA, "Parametric Alerting" },
  493. { ANSI_FWD_MS_INFO_REC_LC, "Line Control" },
  494. { ANSI_FWD_MS_INFO_REC_EDISPLAY, "Extended Display" },
  495. { ANSI_FWD_MS_INFO_REC_NNSC, "Non-Negotiable Service Configuration" },
  496. { ANSI_FWD_MS_INFO_REC_MC_EDISPLAY, "Multiple Character Extended Display" },
  497. { ANSI_FWD_MS_INFO_REC_CWI, "Call Waiting Indicator" },
  498. { ANSI_FWD_MS_INFO_REC_EMC_EDISPLAY, "Enhanced Multiple Character Extended Display" },
  499. { ANSI_FWD_MS_INFO_REC_ERTI, "Extended Record Type International" },
  500. { 0, NULL }
  501. };
  502. #define NUM_FWD_MS_INFO_REC (sizeof(ansi_fwd_ms_info_rec_str)/sizeof(value_string))
  503. static gint ett_ansi_fwd_ms_info_rec[NUM_FWD_MS_INFO_REC];
  504. /*
  505. * From Table 2.7.4-1 C.S0005-D v1.0 L3
  506. */
  507. #define ANSI_REV_MS_INFO_REC_KEYPAD_FAC 0x03
  508. #define ANSI_REV_MS_INFO_REC_CLD_PN 0x04
  509. #define ANSI_REV_MS_INFO_REC_CLG_PN 0x05
  510. #define ANSI_REV_MS_INFO_REC_CALL_MODE 0x07
  511. #define ANSI_REV_MS_INFO_REC_TERM_INFO 0x08
  512. #define ANSI_REV_MS_INFO_REC_ROAM_INFO 0x09
  513. #define ANSI_REV_MS_INFO_REC_SECUR_STS 0x0a
  514. #define ANSI_REV_MS_INFO_REC_CONN_N 0x0b
  515. #define ANSI_REV_MS_INFO_REC_IMSI 0x0c
  516. #define ANSI_REV_MS_INFO_REC_ESN 0x0d
  517. #define ANSI_REV_MS_INFO_REC_BAND_INFO 0x0e
  518. #define ANSI_REV_MS_INFO_REC_POWER_INFO 0x0f
  519. #define ANSI_REV_MS_INFO_REC_OP_MODE_INFO 0x10
  520. #define ANSI_REV_MS_INFO_REC_SO_INFO 0x11
  521. #define ANSI_REV_MS_INFO_REC_MO_INFO 0x12
  522. #define ANSI_REV_MS_INFO_REC_SC_INFO 0x13
  523. #define ANSI_REV_MS_INFO_REC_CLD_PSA 0x14
  524. #define ANSI_REV_MS_INFO_REC_CLG_PSA 0x15
  525. #define ANSI_REV_MS_INFO_REC_CONN_SA 0x16
  526. #define ANSI_REV_MS_INFO_REC_PCI 0x17
  527. #define ANSI_REV_MS_INFO_REC_IMSI_M 0x18
  528. #define ANSI_REV_MS_INFO_REC_IMSI_T 0x19
  529. #define ANSI_REV_MS_INFO_REC_CAP_INFO 0x1a
  530. #define ANSI_REV_MS_INFO_REC_CCC_INFO 0x1b
  531. #define ANSI_REV_MS_INFO_REC_EMO_INFO 0x1c
  532. #define ANSI_REV_MS_INFO_REC_GEO_CAP 0x1e
  533. #define ANSI_REV_MS_INFO_REC_BAND_SUB 0x1f
  534. #define ANSI_REV_MS_INFO_REC_GECO 0x20
  535. #define ANSI_REV_MS_INFO_REC_HOOK 0x21
  536. #define ANSI_REV_MS_INFO_REC_QOS_PARAM 0x22
  537. #define ANSI_REV_MS_INFO_REC_ENCRYPT_CAP 0x23
  538. #define ANSI_REV_MS_INFO_REC_SMI_CAP 0x24
  539. #define ANSI_REV_MS_INFO_REC_UIM_ID 0x25
  540. #define ANSI_REV_MS_INFO_REC_ESN_ME 0x26
  541. #define ANSI_REV_MS_INFO_REC_MEID 0x27
  542. #define ANSI_REV_MS_INFO_REC_EKEYPAD_FAC 0x28
  543. #define ANSI_REV_MS_INFO_REC_SYNC_ID 0x29
  544. #define ANSI_REV_MS_INFO_REC_ERTI 0xfe
  545. static const value_string ansi_rev_ms_info_rec_str[] = {
  546. { ANSI_REV_MS_INFO_REC_KEYPAD_FAC, "Keypad Facility" },
  547. { ANSI_REV_MS_INFO_REC_CLD_PN, "Called Party Number" },
  548. { ANSI_REV_MS_INFO_REC_CLG_PN, "Calling Party Number" },
  549. { ANSI_REV_MS_INFO_REC_CALL_MODE, "Call Mode" },
  550. { ANSI_REV_MS_INFO_REC_TERM_INFO, "Terminal Information" },
  551. { ANSI_REV_MS_INFO_REC_ROAM_INFO, "Roaming Information" },
  552. { ANSI_REV_MS_INFO_REC_SECUR_STS, "Security Status" },
  553. { ANSI_REV_MS_INFO_REC_CONN_N, "Connected Number" },
  554. { ANSI_REV_MS_INFO_REC_IMSI, "IMSI" },
  555. { ANSI_REV_MS_INFO_REC_ESN, "ESN" },
  556. { ANSI_REV_MS_INFO_REC_BAND_INFO, "Band Class Information" },
  557. { ANSI_REV_MS_INFO_REC_POWER_INFO, "Power Class Information" },
  558. { ANSI_REV_MS_INFO_REC_OP_MODE_INFO, "Operating Mode Information" },
  559. { ANSI_REV_MS_INFO_REC_SO_INFO, "Service Option Information" },
  560. { ANSI_REV_MS_INFO_REC_MO_INFO, "Multiplex Option Information" },
  561. { ANSI_REV_MS_INFO_REC_SC_INFO, "Service Configuration Information" },
  562. { ANSI_REV_MS_INFO_REC_CLD_PSA, "Called Party Subaddress" },
  563. { ANSI_REV_MS_INFO_REC_CLG_PSA, "Calling Party Subaddress" },
  564. { ANSI_REV_MS_INFO_REC_CONN_SA, "Connected Subaddress" },
  565. { ANSI_REV_MS_INFO_REC_PCI, "Power Control Information" },
  566. { ANSI_REV_MS_INFO_REC_IMSI_M, "IMSI_M" },
  567. { ANSI_REV_MS_INFO_REC_IMSI_T, "IMSI_T" },
  568. { ANSI_REV_MS_INFO_REC_CAP_INFO, "Capability Information" },
  569. { ANSI_REV_MS_INFO_REC_CCC_INFO, "Channel Configuration Capability Information" },
  570. { ANSI_REV_MS_INFO_REC_EMO_INFO, "Extended Multiplex Option Information" },
  571. { ANSI_REV_MS_INFO_REC_GEO_CAP, "Geo-Location Capability" },
  572. { ANSI_REV_MS_INFO_REC_BAND_SUB, "Band Subclass Information" },
  573. { ANSI_REV_MS_INFO_REC_GECO, "Global Emergency Call" },
  574. { ANSI_REV_MS_INFO_REC_HOOK, "Hook Status" },
  575. { ANSI_REV_MS_INFO_REC_QOS_PARAM, "QoS Parameters" },
  576. { ANSI_REV_MS_INFO_REC_ENCRYPT_CAP, "Encryption Capability" },
  577. { ANSI_REV_MS_INFO_REC_SMI_CAP, "Signaling Message Integrity Capability" },
  578. { ANSI_REV_MS_INFO_REC_UIM_ID, "UIM_ID" },
  579. { ANSI_REV_MS_INFO_REC_ESN_ME, "ESN_ME" },
  580. { ANSI_REV_MS_INFO_REC_MEID, "MEID" },
  581. { ANSI_REV_MS_INFO_REC_EKEYPAD_FAC, "Extended Keypad Facility" },
  582. { ANSI_REV_MS_INFO_REC_SYNC_ID, "SYNC_ID" },
  583. { ANSI_REV_MS_INFO_REC_ERTI, "Extended Record Type International" },
  584. { 0, NULL }
  585. };
  586. #define NUM_REV_MS_INFO_REC (sizeof(ansi_rev_ms_info_rec_str)/sizeof(value_string))
  587. static gint ett_ansi_rev_ms_info_rec[NUM_REV_MS_INFO_REC];
  588. /*
  589. * C.S0057 Table 1.5-1
  590. */
  591. static const gchar *band_class_str[] = {
  592. "800 MHz Cellular System",
  593. "1.850 to 1.990 GHz Broadband PCS",
  594. "872 to 960 MHz TACS Band",
  595. "832 to 925 MHz JTACS Band",
  596. "1.750 to 1.870 GHz Korean PCS",
  597. "450 MHz NMT",
  598. "2 GHz IMT-2000",
  599. "Upper 700 MHz",
  600. "1.710 to 1.880 GHz PCS",
  601. "880 to 960 MHz",
  602. "Secondary 800 MHz",
  603. "400 MHz European PAMR",
  604. "800 MHz European PAMR",
  605. "2.5 GHz IMT-2000 Extension",
  606. "US PCS 1.9 GHz",
  607. "AWS",
  608. "US 2.5 GHz",
  609. "US 2.5 GHz Forward Link Only",
  610. "700 MHz Public Safety",
  611. "Lower 700 MHz"
  612. };
  613. #define NUM_BAND_CLASS_STR (sizeof(band_class_str)/sizeof(gchar *))
  614. static const gchar *cell_disc_str[] = {
  615. "whole Cell Global Identification (CGI)",
  616. "LAC/CI",
  617. "Cell Identity (CI)",
  618. "None",
  619. "Location Area Identification (LAI)",
  620. "Location Area Code (LAC)",
  621. "ALL",
  622. "IS-41 whole Cell Global Identification (ICGI)",
  623. "Enhanced whole Cell Global Identification (ECGI)"
  624. };
  625. #define NUM_CELL_DISC_STR (sizeof(cell_disc_str)/sizeof(gchar *))
  626. /* Initialize the protocol and registered fields */
  627. static int proto_a_bsmap = -1;
  628. static int proto_a_dtap = -1;
  629. const ext_value_string_t *ansi_a_bsmap_strings = NULL;
  630. const ext_value_string_t *ansi_a_dtap_strings = NULL;
  631. const ext_value_string_t *ansi_a_elem_1_strings = NULL;
  632. static int ansi_a_tap = -1;
  633. /* static int hf_ansi_a_none = -1; */
  634. static int hf_ansi_a_bsmap_msgtype = -1;
  635. static int hf_ansi_a_dtap_msgtype = -1;
  636. static int hf_ansi_a_length = -1;
  637. static int hf_ansi_a_elem_id = -1;
  638. static int hf_ansi_a_esn = -1;
  639. static int hf_ansi_a_imsi = -1;
  640. static int hf_ansi_a_min = -1;
  641. static int hf_ansi_a_meid = -1;
  642. static int hf_ansi_a_cld_party_bcd_num = -1;
  643. #ifdef MAYBE_USED_FOR_OLDER_CODECS
  644. static int hf_ansi_a_clg_party_bcd_num = -1;
  645. #endif
  646. static int hf_ansi_a_cld_party_ascii_num = -1;
  647. static int hf_ansi_a_clg_party_ascii_num = -1;
  648. static int hf_ansi_a_cell_ci = -1;
  649. static int hf_ansi_a_cell_lac = -1;
  650. static int hf_ansi_a_cell_mscid = -1;
  651. static int hf_ansi_a_pdsn_ip_addr = -1;
  652. static int hf_ansi_a_s_pdsn_ip_addr = -1;
  653. static int hf_ansi_a_anchor_ip_addr = -1;
  654. static int hf_ansi_a_anchor_pp_ip_addr = -1;
  655. static int hf_ansi_a_a2p_bearer_ipv4_addr = -1;
  656. static int hf_ansi_a_a2p_bearer_ipv6_addr = -1;
  657. static int hf_ansi_a_a2p_bearer_udp_port = -1;
  658. static int hf_ansi_a_so = -1;
  659. static int hf_ansi_a_cause_1 = -1; /* 1 octet cause */
  660. static int hf_ansi_a_cause_2 = -1; /* 2 octet cause */
  661. static int hf_ansi_a_meid_configured = -1;
  662. /* Initialize the subtree pointers */
  663. static gint ett_bsmap = -1;
  664. static gint ett_dtap = -1;
  665. static gint ett_elems = -1;
  666. static gint ett_elem = -1;
  667. static gint ett_dtap_oct_1 = -1;
  668. static gint ett_cm_srvc_type = -1;
  669. static gint ett_ansi_ms_info_rec_reserved = -1;
  670. static gint ett_ansi_enc_info = -1;
  671. static gint ett_scm = -1;
  672. static gint ett_cell_list = -1;
  673. static gint ett_bearer_list = -1;
  674. static gint ett_re_list = -1;
  675. static gint ett_so_list = -1;
  676. static gint ett_adds_user_part = -1;
  677. static gint ett_scr = -1;
  678. static gint ett_srvc_con_rec = -1;
  679. static gint ett_cm2_band_class = -1;
  680. static gint ett_vp_algs = -1;
  681. static expert_field ei_ansi_a_extraneous_data = EI_INIT;
  682. static char a_bigbuf[1024];
  683. static dissector_handle_t rtp_handle=NULL;
  684. static dissector_handle_t data_handle;
  685. static dissector_handle_t dtap_handle;
  686. static dissector_table_t is637_dissector_table; /* IS-637-A Transport Layer (SMS) */
  687. static dissector_table_t is683_dissector_table; /* IS-683-A (OTA) */
  688. static dissector_table_t is801_dissector_table; /* IS-801 (PLD) */
  689. static proto_tree *g_tree;
  690. static address rtp_src_addr;
  691. static guint32 rtp_ipv4_addr;
  692. static struct e_in6_addr rtp_ipv6_addr;
  693. static guint16 rtp_port;
  694. static gboolean a_meid_configured = FALSE;
  695. typedef struct ansi_a_dgt_set_t
  696. {
  697. /*
  698. * would typically be 15 but to allow MEID decoding this
  699. * needs to have room for full hexadecimal representation
  700. */
  701. unsigned char out[16];
  702. }
  703. ansi_a_dgt_set_t;
  704. /*
  705. * As per A.S0001 Called Party BCD Number
  706. */
  707. static ansi_a_dgt_set_t Dgt_tbcd = {
  708. {
  709. /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
  710. '0','1','2','3','4','5','6','7','8','9','*','#','a','b','c', 0
  711. }
  712. };
  713. static ansi_a_dgt_set_t Dgt_msid = {
  714. {
  715. /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
  716. '0','1','2','3','4','5','6','7','8','9','?','?','?','?','?', 0
  717. }
  718. };
  719. static ansi_a_dgt_set_t Dgt_meid = {
  720. {
  721. /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
  722. '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
  723. }
  724. };
  725. /* FUNCTIONS */
  726. /*
  727. * Unpack BCD input pattern into output ASCII pattern
  728. *
  729. * Input Pattern is supplied using the same format as the digits
  730. *
  731. * Returns: length of unpacked pattern
  732. */
  733. static int
  734. my_dgt_tbcd_unpack(
  735. char *out, /* ASCII pattern out */
  736. guchar *in, /* packed pattern in */
  737. int num_octs, /* Number of octets to unpack */
  738. ansi_a_dgt_set_t *dgt /* Digit definitions */
  739. )
  740. {
  741. int cnt = 0;
  742. unsigned char i;
  743. while (num_octs)
  744. {
  745. /*
  746. * unpack first value in byte
  747. */
  748. i = *in++;
  749. *out++ = dgt->out[i & 0x0f];
  750. cnt++;
  751. /*
  752. * unpack second value in byte
  753. */
  754. i >>= 4;
  755. if ((num_octs == 1) && (i == 0x0f)) /* odd number bytes - hit filler */
  756. break;
  757. *out++ = dgt->out[i];
  758. cnt++;
  759. num_octs--;
  760. }
  761. *out = '\0';
  762. return(cnt);
  763. }
  764. static const gchar *
  765. ansi_a_so_int_to_str(
  766. gint32 so)
  767. {
  768. const gchar *str = NULL;
  769. switch (so)
  770. {
  771. case 1: str = "Basic Variable Rate Voice Service (8 kbps)"; break;
  772. case 2: str = "Mobile Station Loopback (8 kbps)"; break;
  773. case 3: str = "(EVRC) Enhanced Variable Rate Voice Service (8 kbps)"; break;
  774. case 4: str = "Asynchronous Data Service (9.6 kbps)"; break;
  775. case 5: str = "Group 3 Facsimile (9.6 kbps)"; break;
  776. case 6: str = "Short Message Services (Rate Set 1)"; break;
  777. case 7: str = "Packet Data Service: Internet or ISO Protocol Stack (9.6 kbps)"; break;
  778. case 8: str = "Packet Data Service: CDPD Protocol Stack (9.6 kbps)"; break;
  779. case 9: str = "Mobile Station Loopback (13 kbps)"; break;
  780. case 10: str = "STU-III Transparent Service"; break;
  781. case 11: str = "STU-III Non-Transparent Service"; break;
  782. case 12: str = "Asynchronous Data Service (14.4 or 9.6 kbps)"; break;
  783. case 13: str = "Group 3 Facsimile (14.4 or 9.6 kbps)"; break;
  784. case 14: str = "Short Message Services (Rate Set 2)"; break;
  785. case 15: str = "Packet Data Service: Internet or ISO Protocol Stack (14.4 kbps)"; break;
  786. case 16: str = "Packet Data Service: CDPD Protocol Stack (14.4 kbps)"; break;
  787. case 17: str = "High Rate Voice Service (13 kbps)"; break;
  788. case 32768: str = "QCELP (13 kbps)"; break;
  789. case 32798: /* 0x801e */ str = "Qualcomm Loopback"; break;
  790. case 32799: /* 0x801f */ str = "Qualcomm Markov 8 kbps Loopback"; break;
  791. case 32800: /* 0x8020 */ str = "Qualcomm Packet Data"; break;
  792. case 32801: /* 0x8021 */ str = "Qualcomm Async Data"; break;
  793. case 18: str = "Over-the-Air Parameter Administration (Rate Set 1)"; break;
  794. case 19: str = "Over-the-Air Parameter Administration (Rate Set 2)"; break;
  795. case 20: str = "Group 3 Analog Facsimile (Rate Set 1)"; break;
  796. case 21: str = "Group 3 Analog Facsimile (Rate Set 2)"; break;
  797. case 22: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS1 reverse)"; break;
  798. case 23: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS1 forward, RS2 reverse)"; break;
  799. case 24: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS1 reverse)"; break;
  800. case 25: str = "High Speed Packet Data Service: Internet or ISO Protocol Stack (RS2 forward, RS2 reverse)"; break;
  801. case 26: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS1 reverse)"; break;
  802. case 27: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS1 forward, RS2 reverse)"; break;
  803. case 28: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS1 reverse)"; break;
  804. case 29: str = "High Speed Packet Data Service: CDPD Protocol Stack (RS2 forward, RS2 reverse)"; break;
  805. case 30: str = "Supplemental Channel Loopback Test for Rate Set 1"; break;
  806. case 31: str = "Supplemental Channel Loopback Test for Rate Set 2"; break;
  807. case 32: str = "Test Data Service Option (TDSO)"; break;
  808. case 33: str = "cdma2000 High Speed Packet Data Service, Internet or ISO Protocol Stack"; break;
  809. case 34: str = "cdma2000 High Speed Packet Data Service, CDPD Protocol Stack"; break;
  810. case 35: str = "Location Services (PDS), Rate Set 1 (9.6 kbps)"; break;
  811. case 36: str = "Location Services (PDS), Rate Set 2 (14.4 kbps)"; break;
  812. case 37: str = "ISDN Interworking Service (64 kbps)"; break;
  813. case 38: str = "GSM Voice"; break;
  814. case 39: str = "GSM Circuit Data"; break;
  815. case 40: str = "GSM Packet Data"; break;
  816. case 41: str = "GSM Short Message Service"; break;
  817. case 42: str = "None Reserved for MC-MAP standard service options"; break;
  818. case 54: str = "Markov Service Option (MSO)"; break;
  819. case 55: str = "Loopback Service Option (LSO)"; break;
  820. case 56: str = "Selectable Mode Vocoder"; break;
  821. case 57: str = "32 kbps Circuit Video Conferencing"; break;
  822. case 58: str = "64 kbps Circuit Video Conferencing"; break;
  823. case 59: str = "HRPD Accounting Records Identifier"; break;
  824. case 60: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Removal"; break;
  825. case 61: str = "Link Layer Assisted Robust Header Compression (LLA ROHC) - Header Compression"; break;
  826. case 62: str = "- 4099 None Reserved for standard service options"; break;
  827. case 68: str = "(EVRC-B NB) Enhanced Variable Rate Voice Service"; break;
  828. case 70: str = "(EVRC-B WB) Enhanced Variable Rate Voice Service"; break;
  829. case 73: str = "(EVRC-NW) Enhanced Variable Rate Voice Service"; break;
  830. case 4100: str = "Asynchronous Data Service, Revision 1 (9.6 or 14.4 kbps)"; break;
  831. case 4101: str = "Group 3 Facsimile, Revision 1 (9.6 or 14.4 kbps)"; break;
  832. case 4102: str = "Reserved for standard service option"; break;
  833. case 4103: str = "Packet Data Service: Internet or ISO Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
  834. case 4104: str = "Packet Data Service: CDPD Protocol Stack, Revision 1 (9.6 or 14.4 kbps)"; break;
  835. default:
  836. if ((so >= 4105) && (so <= 32767)) { str = "Reserved for standard service options"; }
  837. else if ((so >= 32769) && (so <= 32771)) { str = "Proprietary QUALCOMM Incorporated"; }
  838. else if ((so >= 32772) && (so <= 32775)) { str = "Proprietary OKI Telecom"; }
  839. else if ((so >= 32776) && (so <= 32779)) { str = "Proprietary Lucent Technologies"; }
  840. else if ((so >= 32780) && (so <=32783)) { str = "Nokia"; }
  841. else if ((so >= 32784) && (so <=32787)) { str = "NORTEL NETWORKS"; }
  842. else if ((so >= 32788) && (so <=32791)) { str = "Sony Electronics Inc."; }
  843. else if ((so >= 32792) && (so <=32795)) { str = "Motorola"; }
  844. else if ((so >= 32796) && (so <=32799)) { str = "QUALCOMM Incorporated"; }
  845. else if ((so >= 32800) && (so <=32803)) { str = "QUALCOMM Incorporated"; }
  846. else if ((so >= 32804) && (so <=32807)) { str = "QUALCOMM Incorporated"; }
  847. else if ((so >= 32808) && (so <=32811)) { str = "QUALCOMM Incorporated"; }
  848. else if ((so >= 32812) && (so <=32815)) { str = "Lucent Technologies"; }
  849. else if ((so >= 32816) && (so <=32819)) { str = "Denso International"; }
  850. else if ((so >= 32820) && (so <=32823)) { str = "Motorola"; }
  851. else if ((so >= 32824) && (so <=32827)) { str = "Denso International"; }
  852. else if ((so >= 32828) && (so <=32831)) { str = "Denso International"; }
  853. else if ((so >= 32832) && (so <=32835)) { str = "Denso International"; }
  854. else if ((so >= 32836) && (so <=32839)) { str = "NEC America"; }
  855. else if ((so >= 32840) && (so <=32843)) { str = "Samsung Electronics"; }
  856. else if ((so >= 32844) && (so <=32847)) { str = "Texas Instruments Incorporated"; }
  857. else if ((so >= 32848) && (so <=32851)) { str = "Toshiba Corporation"; }
  858. else if ((so >= 32852) && (so <=32855)) { str = "LG Electronics Inc."; }
  859. else if ((so >= 32856) && (so <=32859)) { str = "VIA Telecom Inc."; }
  860. else { str = "Reserved"; }
  861. break;
  862. }
  863. return(str);
  864. }
  865. /* ELEMENT FUNCTIONS */
  866. #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
  867. if ((edc_len) > (edc_max_len)) \
  868. { \
  869. proto_tree_add_text(tree, tvb, \
  870. curr_offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
  871. curr_offset += ((edc_len) - (edc_max_len)); \
  872. }
  873. #define EXTRANEOUS_DATA_CHECK_EXPERT(edc_len, edc_max_len) \
  874. if ((edc_len) > (edc_max_len)) \
  875. { \
  876. proto_tree_add_expert(tree, pinfo, &ei_ansi_a_extraneous_data, \
  877. tvb, curr_offset, (edc_len) - (edc_max_len)); \
  878. curr_offset += ((edc_len) - (edc_max_len)); \
  879. }
  880. #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
  881. if ((sdc_len) < (sdc_min_len)) \
  882. { \
  883. proto_tree_add_text(tree, tvb, \
  884. curr_offset, (sdc_len), "Short Data (?)"); \
  885. curr_offset += (sdc_len); \
  886. return(curr_offset - offset); \
  887. }
  888. #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
  889. if ((edc_len) != (edc_eq_len)) \
  890. { \
  891. proto_tree_add_text(tree, tvb, \
  892. asn1->offset, (edc_len), "Unexpected Data Length"); \
  893. asn1->offset += (edc_len); \
  894. return; \
  895. }
  896. #define NO_MORE_DATA_CHECK(nmdc_len) \
  897. if ((nmdc_len) == (curr_offset - offset)) return(nmdc_len);
  898. /*
  899. * IOS 6.2.2.6
  900. */
  901. static guint8
  902. elem_chan_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  903. {
  904. guint32 value;
  905. guint32 curr_offset;
  906. curr_offset = offset;
  907. value = tvb_get_ntohs(tvb, curr_offset);
  908. switch (global_a_variant)
  909. {
  910. case A_VARIANT_IOS401:
  911. proto_tree_add_text(tree,
  912. tvb, curr_offset, 2,
  913. "Channel Number: %u",
  914. value);
  915. g_snprintf(add_string, string_len, " - (%u)", value);
  916. break;
  917. case A_VARIANT_IOS501:
  918. other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
  919. proto_tree_add_text(tree,
  920. tvb, curr_offset, 1,
  921. "%s : Reserved",
  922. a_bigbuf);
  923. other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
  924. proto_tree_add_text(tree, tvb, curr_offset, 1,
  925. "%s : ARFCN (MSB): %u",
  926. a_bigbuf,
  927. value & 0x07ff);
  928. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  929. proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
  930. "%s : ARFCN (LSB)",
  931. a_bigbuf);
  932. g_snprintf(add_string, string_len, " - (ARFCN: %u)", value & 0x07ff);
  933. break;
  934. }
  935. curr_offset += 2;
  936. /* no length check possible */
  937. return(curr_offset - offset);
  938. }
  939. /*
  940. * IOS 6.2.2.7
  941. */
  942. static guint8
  943. elem_chan_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  944. {
  945. guint8 oct;
  946. guint32 curr_offset;
  947. const gchar *str = NULL;
  948. gboolean data;
  949. curr_offset = offset;
  950. data = FALSE;
  951. oct = tvb_get_guint8(tvb, curr_offset);
  952. switch (oct)
  953. {
  954. case 0: str = "No Alert"; break;
  955. case 1: str = "Speech"; break;
  956. case 2: str = "Data"; data = TRUE; break;
  957. case 3: str = "Signaling"; break;
  958. default:
  959. str = "Unknown";
  960. break;
  961. }
  962. proto_tree_add_text(tree,
  963. tvb, curr_offset, 1,
  964. "Speech or Data Indicator: %s",
  965. str);
  966. g_snprintf(add_string, string_len, " - (%s)", str);
  967. curr_offset++;
  968. NO_MORE_DATA_CHECK(len);
  969. oct = tvb_get_guint8(tvb, curr_offset);
  970. switch (oct)
  971. {
  972. case 0: str = "Reserved (invalid)"; break;
  973. case 1: str = "DCCH"; break;
  974. case 2: str = "Reserved for future use (invalid)"; break;
  975. case 8: str = "Full rate TCH channel Bm"; break;
  976. case 9: str = "Half rate TCH channel Lm"; break;
  977. default:
  978. str = "Unknown";
  979. break;
  980. }
  981. proto_tree_add_text(tree,
  982. tvb, curr_offset, 1,
  983. "Channel Rate and Type: %s",
  984. str);
  985. curr_offset++;
  986. NO_MORE_DATA_CHECK(len);
  987. oct = tvb_get_guint8(tvb, curr_offset);
  988. if (data)
  989. {
  990. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  991. proto_tree_add_text(tree,
  992. tvb, curr_offset, 1,
  993. "%s : Extension",
  994. a_bigbuf);
  995. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  996. proto_tree_add_text(tree,
  997. tvb, curr_offset, 1,
  998. "%s : %sTransparent service",
  999. a_bigbuf,
  1000. (oct & 0x40) ? "Non-" : "");
  1001. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  1002. proto_tree_add_text(tree,
  1003. tvb, curr_offset, 1,
  1004. "%s : Reserved",
  1005. a_bigbuf);
  1006. }
  1007. else
  1008. {
  1009. switch (oct)
  1010. {
  1011. case 0: str = "No Resources Required (invalid)"; break;
  1012. case 1: str = "Reserved"; break;
  1013. case 2: str = "Reserved"; break;
  1014. case 3: str = "TIA/EIA-IS-2000 8 kb/s vocoder"; break;
  1015. case 4: str = "8 kb/s enhanced vocoder (EVRC)"; break;
  1016. case 5: str = "13 kb/s vocoder"; break;
  1017. case 6: str = "ADPCM"; break;
  1018. default:
  1019. str = "Reserved";
  1020. break;
  1021. }
  1022. proto_tree_add_text(tree,
  1023. tvb, curr_offset, 1,
  1024. "Speech Encoding Algorithm/data rate + Transparency Indicator: %s",
  1025. str);
  1026. }
  1027. curr_offset++;
  1028. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  1029. return(curr_offset - offset);
  1030. }
  1031. /*
  1032. * IOS 5 4.2.83
  1033. */
  1034. static guint8
  1035. elem_return_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
  1036. {
  1037. guint8 oct;
  1038. const gchar *str;
  1039. guint32 curr_offset;
  1040. curr_offset = offset;
  1041. oct = tvb_get_guint8(tvb, curr_offset);
  1042. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1043. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1044. "%s : Reserved",
  1045. a_bigbuf);
  1046. switch (oct & 0x0f)
  1047. {
  1048. case 0: str = "Normal access"; break;
  1049. case 1: str = "Service redirection failed as a result of system not found"; break;
  1050. case 2: str = "Service redirection failed as a result of protocol mismatch"; break;
  1051. case 3: str = "Service redirection failed as a result of registration rejection"; break;
  1052. case 4: str = "Service redirection failed as a result of wrong SID"; break;
  1053. case 5: str = "Service redirection failed as a result of wrong NID"; break;
  1054. default:
  1055. str = "Reserved";
  1056. break;
  1057. }
  1058. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  1059. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1060. "%s : Return Cause: %s",
  1061. a_bigbuf,
  1062. str);
  1063. curr_offset++;
  1064. /* no length check possible */
  1065. return(curr_offset - offset);
  1066. }
  1067. /*
  1068. * IOS 6.2.2.8
  1069. */
  1070. static guint8
  1071. elem_rf_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  1072. {
  1073. guint8 oct;
  1074. guint32 value;
  1075. guint32 curr_offset;
  1076. curr_offset = offset;
  1077. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1078. "Color Code");
  1079. curr_offset++;
  1080. oct = tvb_get_guint8(tvb, curr_offset);
  1081. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  1082. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1083. "%s : Reserved",
  1084. a_bigbuf);
  1085. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  1086. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1087. "%s : N-AMPS",
  1088. a_bigbuf);
  1089. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  1090. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1091. "%s : ANSI/EIA/TIA-553",
  1092. a_bigbuf);
  1093. curr_offset++;
  1094. oct = tvb_get_guint8(tvb, curr_offset);
  1095. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  1096. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1097. "%s : Reserved",
  1098. a_bigbuf);
  1099. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  1100. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1101. "%s : Timeslot Number",
  1102. a_bigbuf);
  1103. curr_offset++;
  1104. value = tvb_get_ntohs(tvb, curr_offset);
  1105. other_decode_bitfield_value(a_bigbuf, value >> 8, 0xf8, 8);
  1106. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1107. "%s : Reserved",
  1108. a_bigbuf);
  1109. other_decode_bitfield_value(a_bigbuf, value >> 8, 0x07, 8);
  1110. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1111. "%s : ARFCN (MSB): %u",
  1112. a_bigbuf,
  1113. value & 0x07ff);
  1114. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  1115. proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
  1116. "%s : ARFCN (LSB)",
  1117. a_bigbuf);
  1118. g_snprintf(add_string, string_len, " - (ARFCN: %u)", value & 0x07ff);
  1119. curr_offset += 2;
  1120. /* no length check possible */
  1121. return(curr_offset - offset);
  1122. }
  1123. /*
  1124. * IOS 5 4.2.86
  1125. */
  1126. static guint8
  1127. elem_sr_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  1128. {
  1129. guint8 oct;
  1130. guint32 curr_offset;
  1131. curr_offset = offset;
  1132. oct = tvb_get_guint8(tvb, curr_offset);
  1133. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  1134. proto_tree_add_text(tree,
  1135. tvb, curr_offset, 1,
  1136. "%s : Reserved",
  1137. a_bigbuf);
  1138. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1139. proto_tree_add_text(tree,
  1140. tvb, curr_offset, 1,
  1141. "%s : SR_ID: %u",
  1142. a_bigbuf,
  1143. oct & 0x07);
  1144. g_snprintf(add_string, string_len, " - (%u)", oct);
  1145. curr_offset++;
  1146. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  1147. return(curr_offset - offset);
  1148. }
  1149. /*
  1150. * IOS 6.2.2.9
  1151. */
  1152. static guint8
  1153. elem_sid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  1154. {
  1155. guint32 value;
  1156. guint32 curr_offset;
  1157. curr_offset = offset;
  1158. value = tvb_get_ntohs(tvb, curr_offset);
  1159. other_decode_bitfield_value(a_bigbuf, value >> 8, 0x80, 8);
  1160. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1161. "%s : Reserved",
  1162. a_bigbuf);
  1163. other_decode_bitfield_value(a_bigbuf, value >> 8, 0x7f, 8);
  1164. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1165. "%s : SID (MSB), %u",
  1166. a_bigbuf,
  1167. value & 0x7fff);
  1168. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  1169. proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
  1170. "%s : SID (LSB)",
  1171. a_bigbuf);
  1172. g_snprintf(add_string, string_len, " - (SID: %u)", value & 0x7fff);
  1173. curr_offset += 2;
  1174. /* no length check possible */
  1175. return(curr_offset - offset);
  1176. }
  1177. /*
  1178. * IOS 6.2.2.10
  1179. */
  1180. static guint8
  1181. elem_is95_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  1182. {
  1183. guint8 oct;
  1184. guint32 value;
  1185. guint32 curr_offset;
  1186. curr_offset = offset;
  1187. oct = tvb_get_guint8(tvb, curr_offset);
  1188. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  1189. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1190. "%s : Hard Handoff",
  1191. a_bigbuf);
  1192. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  1193. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1194. "%s : Number of Channels to Add: %u",
  1195. a_bigbuf,
  1196. (oct & 0x70) >> 4);
  1197. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  1198. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1199. "%s : Frame Offset: (%u), %.2f ms",
  1200. a_bigbuf,
  1201. oct & 0x0f,
  1202. (oct & 0x0f) * 1.25);
  1203. curr_offset++;
  1204. NO_MORE_DATA_CHECK(len);
  1205. SHORT_DATA_CHECK(len - (curr_offset - offset), 4);
  1206. do
  1207. {
  1208. oct = tvb_get_guint8(tvb, curr_offset);
  1209. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1210. "Walsh Code Channel Index: %u",
  1211. oct);
  1212. curr_offset++;
  1213. oct = tvb_get_guint8(tvb, curr_offset);
  1214. other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
  1215. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1216. "%s : Pilot PN Code (LSB)",
  1217. a_bigbuf);
  1218. curr_offset++;
  1219. value = oct;
  1220. oct = tvb_get_guint8(tvb, curr_offset);
  1221. value |= ((guint32) (oct & 0x80)) << 1;
  1222. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  1223. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1224. "%s : Pilot PN Code (MSB): %u",
  1225. a_bigbuf,
  1226. value);
  1227. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  1228. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1229. "%s : Power Combined",
  1230. a_bigbuf);
  1231. other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
  1232. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1233. "%s : Frequency Included",
  1234. a_bigbuf);
  1235. other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
  1236. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1237. "%s : Reserved",
  1238. a_bigbuf);
  1239. value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
  1240. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1241. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1242. "%s : ARFCN (MSB): %u",
  1243. a_bigbuf,
  1244. value);
  1245. curr_offset++;
  1246. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  1247. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1248. "%s : ARFCN (LSB)",
  1249. a_bigbuf);
  1250. if (add_string[0] == '\0')
  1251. {
  1252. g_snprintf(add_string, string_len, " - (ARFCN: %u)", value);
  1253. }
  1254. curr_offset++;
  1255. }
  1256. while ((len - (curr_offset - offset)) >= 4);
  1257. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  1258. return(curr_offset - offset);
  1259. }
  1260. /*
  1261. * IOS 6.2.2.11
  1262. * UNUSED
  1263. */
  1264. /*
  1265. * IOS 6.2.2.12
  1266. */
  1267. static guint8
  1268. elem_enc_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  1269. {
  1270. guint8 oct;
  1271. guint8 oct_len;
  1272. guint32 curr_offset;
  1273. const gchar *str;
  1274. guint8 num_recs;
  1275. proto_tree *subtree;
  1276. proto_item *item;
  1277. curr_offset = offset;
  1278. num_recs = 0;
  1279. while ((len - (curr_offset - offset)) >= 2)
  1280. {
  1281. num_recs++;
  1282. oct = tvb_get_guint8(tvb, curr_offset);
  1283. switch ((oct & 0x7c) >> 2)
  1284. {
  1285. case 0: str = "Not Used - Invalid value"; break;
  1286. case 1: str = "SME Key: Signaling Message Encryption Key"; break;
  1287. case 2: str = "Reserved (VPM: Voice Privacy Mask)"; break;
  1288. case 3: str = "Reserved"; break;
  1289. case 4: str = "Private Longcode"; break;
  1290. case 5: str = "Data Key (ORYX)"; break;
  1291. case 6: str = "Initial RAND"; break;
  1292. default:
  1293. str = "Reserved";
  1294. break;
  1295. }
  1296. item =
  1297. proto_tree_add_text(tree,
  1298. tvb, curr_offset, 1,
  1299. "Encryption Info [%u]: (%u) %s",
  1300. num_recs,
  1301. (oct & 0x7c) >> 2,
  1302. str);
  1303. subtree = proto_item_add_subtree(item, ett_ansi_enc_info);
  1304. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  1305. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1306. "%s : Extension",
  1307. a_bigbuf);
  1308. other_decode_bitfield_value(a_bigbuf, oct, 0x7c, 8);
  1309. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1310. "%s : Encryption Parameter Identifier: (%u) %s",
  1311. a_bigbuf,
  1312. (oct & 0x7c) >> 2,
  1313. str);
  1314. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  1315. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1316. "%s : Status: %s",
  1317. a_bigbuf,
  1318. (oct & 0x02) ? "active" : "inactive");
  1319. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  1320. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1321. "%s : Available: algorithm is %savailable",
  1322. a_bigbuf,
  1323. (oct & 0x01) ? "" : "not ");
  1324. curr_offset++;
  1325. oct_len = tvb_get_guint8(tvb, curr_offset);
  1326. proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
  1327. curr_offset, 1, oct_len);
  1328. curr_offset++;
  1329. if (oct_len > 0)
  1330. {
  1331. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  1332. proto_tree_add_text(subtree, tvb, curr_offset, oct_len,
  1333. "Encryption Parameter value");
  1334. curr_offset += oct_len;
  1335. }
  1336. }
  1337. g_snprintf(add_string, string_len, " - %u record%s",
  1338. num_recs, plurality(num_recs, "", "s"));
  1339. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  1340. return(curr_offset - offset);
  1341. }
  1342. /*
  1343. * IOS 6.2.2.13
  1344. * NO ASSOCIATED DATA
  1345. */
  1346. /*
  1347. * IOS 6.2.2.14
  1348. * A3/A7
  1349. */
  1350. /*
  1351. * IOS 6.2.2.15
  1352. */
  1353. static guint8
  1354. elem_cm_info_type_2(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  1355. {
  1356. guint8 oct, oct2;
  1357. guint8 num_bands, band_class_count;
  1358. guint32 curr_offset;
  1359. gint band_class;
  1360. proto_tree *subtree;
  1361. proto_item *item;
  1362. const gchar *str;
  1363. curr_offset = offset;
  1364. oct = tvb_get_guint8(tvb, curr_offset);
  1365. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  1366. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1367. "%s : Mobile P_REV: %u",
  1368. a_bigbuf,
  1369. (oct & 0xe0) >> 5);
  1370. g_snprintf(add_string, string_len, " - P_REV (%u)", (oct & 0xe0) >> 5);
  1371. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  1372. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1373. "%s : Reserved",
  1374. a_bigbuf);
  1375. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1376. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1377. "%s : See List of Entries",
  1378. a_bigbuf);
  1379. switch (oct & 0x07)
  1380. {
  1381. case 0: str = "Class 1, vehicle and portable"; break;
  1382. case 1: str = "Class 2, portable"; break;
  1383. case 2: str = "Class 3, handheld"; break;
  1384. case 3: str = "Class 4, handheld"; break;
  1385. case 4: str = "Class 5, handheld"; break;
  1386. case 5: str = "Class 6, handheld"; break;
  1387. case 6: str = "Class 7, handheld"; break;
  1388. default:
  1389. str = "Class 8, handheld";
  1390. break;
  1391. }
  1392. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1393. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1394. "%s : RF Power Capability: %s",
  1395. a_bigbuf,
  1396. str);
  1397. curr_offset++;
  1398. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1399. "Reserved");
  1400. curr_offset++;
  1401. oct = tvb_get_guint8(tvb, curr_offset);
  1402. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  1403. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1404. "%s : NAR_AN_CAP: N-AMPS %ssupported",
  1405. a_bigbuf,
  1406. (oct & 0x80) ? "" : "not ");
  1407. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  1408. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1409. "%s : IS-95: %ssupported",
  1410. a_bigbuf,
  1411. (oct & 0x40) ? "" : "not ");
  1412. other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
  1413. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1414. "%s : Slotted: mobile is %sin slotted mode",
  1415. a_bigbuf,
  1416. (oct & 0x20) ? "" : "not ");
  1417. other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
  1418. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1419. "%s : Reserved",
  1420. a_bigbuf);
  1421. other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
  1422. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1423. "%s : DTX: mobile is %scapable of DTX",
  1424. a_bigbuf,
  1425. (oct & 0x04) ? "" : "not ");
  1426. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  1427. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1428. "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
  1429. a_bigbuf,
  1430. (oct & 0x02) ? "" : "not ");
  1431. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  1432. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1433. "%s : Reserved",
  1434. a_bigbuf);
  1435. curr_offset++;
  1436. NO_MORE_DATA_CHECK(len);
  1437. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1438. "Reserved");
  1439. curr_offset++;
  1440. NO_MORE_DATA_CHECK(len);
  1441. oct = tvb_get_guint8(tvb, curr_offset);
  1442. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  1443. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1444. "%s : Reserved",
  1445. a_bigbuf);
  1446. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  1447. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1448. "%s : Mobile Term: mobile is %scapable of receiving incoming calls",
  1449. a_bigbuf,
  1450. (oct & 0x02) ? "" : "not ");
  1451. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  1452. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1453. "%s : PACA Supported Indicator (PSI): mobile station %s PACA",
  1454. a_bigbuf,
  1455. (oct & 0x01) ? "supports" : "does not support");
  1456. curr_offset++;
  1457. NO_MORE_DATA_CHECK(len);
  1458. oct = tvb_get_guint8(tvb, curr_offset);
  1459. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1460. "SCM Length: %u",
  1461. oct);
  1462. curr_offset++;
  1463. oct = tvb_get_guint8(tvb, curr_offset);
  1464. item =
  1465. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1466. "Station Class Mark: %u",
  1467. oct);
  1468. /*
  1469. * following SCM decode is from:
  1470. * 3GPP2 C.S0005-0 section 2.3.3
  1471. * 3GPP2 C.S0072-0 section 2.1.2
  1472. */
  1473. subtree = proto_item_add_subtree(item, ett_scm);
  1474. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  1475. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1476. "%s : Extended SCM Indicator: %s",
  1477. a_bigbuf,
  1478. (oct & 0x80) ? "Band Classes 1,4" : "Other bands");
  1479. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  1480. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1481. "%s : %s",
  1482. a_bigbuf,
  1483. (oct & 0x40) ? "Dual Mode" : "CDMA Only");
  1484. other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
  1485. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1486. "%s : %s",
  1487. a_bigbuf,
  1488. (oct & 0x20) ? "Slotted" : "Non-Slotted");
  1489. if (oct & 0x10)
  1490. {
  1491. str = "";
  1492. g_strlcat(add_string, " (MEID configured)", string_len);
  1493. a_meid_configured = TRUE;
  1494. }
  1495. else
  1496. {
  1497. str = "not ";
  1498. }
  1499. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  1500. proto_tree_add_boolean_format(subtree, hf_ansi_a_meid_configured, tvb,
  1501. curr_offset, 1, a_meid_configured,
  1502. "%s : MEID %sconfigured",
  1503. a_bigbuf,
  1504. str);
  1505. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1506. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1507. "%s : 25 MHz Bandwidth",
  1508. a_bigbuf);
  1509. other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
  1510. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1511. "%s : %s Transmission",
  1512. a_bigbuf,
  1513. (oct & 0x04) ? "Discontinuous" : "Continuous");
  1514. switch (oct & 0x03)
  1515. {
  1516. case 0x00: str = "Class I"; break;
  1517. case 0x01: str = "Class II"; break;
  1518. case 0x02: str = "Class III"; break;
  1519. case 0x03: str = "Reserved"; break;
  1520. }
  1521. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  1522. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  1523. "%s : Power Class for Band Class 0 Analog Operation: %s",
  1524. a_bigbuf,
  1525. str);
  1526. curr_offset++;
  1527. NO_MORE_DATA_CHECK(len);
  1528. band_class_count = tvb_get_guint8(tvb, curr_offset);
  1529. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1530. "Count of Band Class Entries: %u",
  1531. band_class_count);
  1532. curr_offset++;
  1533. oct = tvb_get_guint8(tvb, curr_offset);
  1534. proto_tree_add_text(tree, tvb, curr_offset, 1,
  1535. "Band Class Entry Length: %u",
  1536. oct);
  1537. curr_offset++;
  1538. NO_MORE_DATA_CHECK(len);
  1539. if (oct > 0)
  1540. {
  1541. SHORT_DATA_CHECK(len - (curr_offset - offset), 3);
  1542. num_bands = 0;
  1543. do
  1544. {
  1545. item =
  1546. proto_tree_add_text(tree, tvb, curr_offset, 3,
  1547. "Band Class Entry [%u]",
  1548. num_bands + 1);
  1549. subtree = proto_item_add_subtree(item, ett_cm2_band_class);
  1550. oct = tvb_get_guint8(tvb, curr_offset);
  1551. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  1552. proto_tree_add_text(subtree,
  1553. tvb, curr_offset, 1,
  1554. "%s : Reserved",
  1555. a_bigbuf);
  1556. band_class = oct & 0x1f;
  1557. if ((band_class < 0) || (band_class >= (gint) NUM_BAND_CLASS_STR))
  1558. {
  1559. str = "Reserved";
  1560. }
  1561. else
  1562. {
  1563. str = band_class_str[band_class];
  1564. }
  1565. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  1566. proto_tree_add_text(subtree,
  1567. tvb, curr_offset, 1,
  1568. "%s : Band Class: %s",
  1569. a_bigbuf,
  1570. str);
  1571. curr_offset++;
  1572. oct2 = tvb_get_guint8(tvb, curr_offset);
  1573. oct = tvb_get_guint8(tvb, curr_offset+1);
  1574. if (oct < 4)
  1575. {
  1576. other_decode_bitfield_value(a_bigbuf, oct2, 0x80, 8);
  1577. proto_tree_add_text(subtree,
  1578. tvb, curr_offset, 1,
  1579. "%s : Band Class Air Interfaces OP_MODE0 (CDMA mode in Band Class 1 and Band Class 4)",
  1580. a_bigbuf);
  1581. other_decode_bitfield_value(a_bigbuf, oct2, 0x40, 8);
  1582. proto_tree_add_text(subtree,
  1583. tvb, curr_offset, 1,
  1584. "%s : Band Class Air Interfaces OP_MODE1 (CDMA mode in Band Class 0 and Band Class 3)",
  1585. a_bigbuf);
  1586. other_decode_bitfield_value(a_bigbuf, oct2, 0x20, 8);
  1587. proto_tree_add_text(subtree,
  1588. tvb, curr_offset, 1,
  1589. "%s : Band Class Air Interfaces OP_MODE2 (Analog mode)",
  1590. a_bigbuf);
  1591. other_decode_bitfield_value(a_bigbuf, oct2, 0x10, 8);
  1592. proto_tree_add_text(subtree,
  1593. tvb, curr_offset, 1,
  1594. "%s : Band Class Air Interfaces OP_MODE3 (Wide analog mode)",
  1595. a_bigbuf);
  1596. other_decode_bitfield_value(a_bigbuf, oct2, 0x08, 8);
  1597. proto_tree_add_text(subtree,
  1598. tvb, curr_offset, 1,
  1599. "%s : Band Class Air Interfaces OP_MODE4 (Narrow analog mode)",
  1600. a_bigbuf);
  1601. }
  1602. else
  1603. {
  1604. other_decode_bitfield_value(a_bigbuf, oct2, 0x80, 8);
  1605. proto_tree_add_text(subtree,
  1606. tvb, curr_offset, 1,
  1607. "%s : Band Class Air Interfaces OP_MODE0 (CDMA mode)",
  1608. a_bigbuf);
  1609. other_decode_bitfield_value(a_bigbuf, oct2, 0x40, 8);
  1610. proto_tree_add_text(subtree,
  1611. tvb, curr_offset, 1,
  1612. "%s : Band Class Air Interfaces OP_MODE1 (CDMA mode)",
  1613. a_bigbuf);
  1614. other_decode_bitfield_value(a_bigbuf, oct2, 0x20, 8);
  1615. proto_tree_add_text(subtree,
  1616. tvb, curr_offset, 1,
  1617. "%s : Band Class Air Interfaces OP_MODE2 (Analog mode)",
  1618. a_bigbuf);
  1619. other_decode_bitfield_value(a_bigbuf, oct2, 0x10, 8);
  1620. proto_tree_add_text(subtree,
  1621. tvb, curr_offset, 1,
  1622. "%s : Band Class Air Interfaces OP_MODE3 (Wide analog mode)",
  1623. a_bigbuf);
  1624. other_decode_bitfield_value(a_bigbuf, oct2, 0x08, 8);
  1625. proto_tree_add_text(subtree,
  1626. tvb, curr_offset, 1,
  1627. "%s : Band Class Air Interfaces OP_MODE4 (Narrow analog mode)",
  1628. a_bigbuf);
  1629. }
  1630. other_decode_bitfield_value(a_bigbuf, oct2, 0x07, 8);
  1631. proto_tree_add_text(subtree,
  1632. tvb, curr_offset, 1,
  1633. "%s : Reserved",
  1634. a_bigbuf);
  1635. curr_offset++;
  1636. proto_tree_add_text(subtree,
  1637. tvb, curr_offset, 1,
  1638. "Band Class MS Protocol Level: %u",
  1639. oct);
  1640. curr_offset++;
  1641. proto_item_append_text(item, ": (%d)", band_class);
  1642. num_bands++;
  1643. }
  1644. while (((len - (curr_offset - offset)) >= 3) &&
  1645. (num_bands < band_class_count));
  1646. }
  1647. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  1648. return(curr_offset - offset);
  1649. }
  1650. /*
  1651. * IOS 6.2.2.16
  1652. */
  1653. static guint8
  1654. elem_mid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  1655. {
  1656. guint8 oct;
  1657. guint8 *poctets;
  1658. guint32 value;
  1659. guint32 curr_offset;
  1660. const gchar *str;
  1661. curr_offset = offset;
  1662. oct = tvb_get_guint8(tvb, curr_offset);
  1663. switch (oct & 0x07)
  1664. {
  1665. case 1:
  1666. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1667. proto_tree_add_text(tree,
  1668. tvb, curr_offset, 1,
  1669. "%s : MEID Hex Digit 1: %X",
  1670. a_bigbuf,
  1671. (oct & 0xf0) >> 4);
  1672. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1673. proto_tree_add_text(tree,
  1674. tvb, curr_offset, 1,
  1675. "%s : Odd/Even Indicator: %s",
  1676. a_bigbuf,
  1677. (oct & 0x08) ? "ODD" : "EVEN");
  1678. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1679. proto_tree_add_text(tree,
  1680. tvb, curr_offset, 1,
  1681. "%s : Type of Identity: MEID",
  1682. a_bigbuf);
  1683. a_bigbuf[0] = Dgt_meid.out[(oct & 0xf0) >> 4];
  1684. curr_offset++;
  1685. poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
  1686. my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
  1687. &Dgt_meid);
  1688. curr_offset += len - (curr_offset - offset);
  1689. proto_tree_add_string_format(tree,
  1690. hf_ansi_a_meid,
  1691. tvb, offset + 1, len - 1,
  1692. a_bigbuf,
  1693. "MEID: %s",
  1694. a_bigbuf);
  1695. g_snprintf(add_string, string_len, " - %s (%s)",
  1696. "MEID",
  1697. a_bigbuf);
  1698. break;
  1699. case 2:
  1700. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  1701. proto_tree_add_text(tree,
  1702. tvb, curr_offset, 1,
  1703. "%s : Reserved",
  1704. a_bigbuf);
  1705. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1706. proto_tree_add_text(tree,
  1707. tvb, curr_offset, 1,
  1708. "%s : Type of Identity: Broadcast",
  1709. a_bigbuf);
  1710. curr_offset++;
  1711. oct = tvb_get_guint8(tvb, curr_offset);
  1712. switch ((oct & 0xc0) >> 6)
  1713. {
  1714. case 0: str = "Normal"; break;
  1715. case 1: str = "Interactive"; break;
  1716. case 2: str = "Urgent"; break;
  1717. default:
  1718. str = "Emergency";
  1719. break;
  1720. }
  1721. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  1722. proto_tree_add_text(tree,
  1723. tvb, curr_offset, 1,
  1724. "%s : Priority: %s",
  1725. a_bigbuf,
  1726. str);
  1727. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  1728. proto_tree_add_text(tree,
  1729. tvb, curr_offset, 1,
  1730. "%s : Message ID: %u",
  1731. a_bigbuf,
  1732. oct & 0x3f);
  1733. curr_offset++;
  1734. oct = tvb_get_guint8(tvb, curr_offset);
  1735. proto_tree_add_text(tree,
  1736. tvb, curr_offset, 1,
  1737. "Zone ID: %u",
  1738. oct);
  1739. g_snprintf(add_string, string_len, " - Broadcast (Zone ID: %u)", oct);
  1740. curr_offset++;
  1741. value = tvb_get_ntohs(tvb, curr_offset);
  1742. switch (value)
  1743. {
  1744. case 0x0000: str = "Unknown or unspecified"; break;
  1745. case 0x0001: str = "Emergency Broadcasts"; break;
  1746. case 0x0002: str = "Administrative"; break;
  1747. case 0x0003: str = "Maintenance"; break;
  1748. case 0x0004: str = "General News - Local"; break;
  1749. case 0x0005: str = "General News - Regional"; break;
  1750. case 0x0006: str = "General News - National"; break;
  1751. case 0x0007: str = "General News - International"; break;
  1752. case 0x0008: str = "Business/Financial News - Local"; break;
  1753. case 0x0009: str = "Business/Financial News - Regional"; break;
  1754. case 0x000A: str = "Business/Financial News - National"; break;
  1755. case 0x000B: str = "Business/Financial News - International"; break;
  1756. case 0x000C: str = "Sports News - Local"; break;
  1757. case 0x000D: str = "Sports News - Regional"; break;
  1758. case 0x000E: str = "Sports News - National"; break;
  1759. case 0x000F: str = "Sports News - International"; break;
  1760. case 0x0010: str = "Entertainment News - Local"; break;
  1761. case 0x0011: str = "Entertainment News - Regional"; break;
  1762. case 0x0012: str = "Entertainment News - National"; break;
  1763. case 0x0013: str = "Entertainment News - International"; break;
  1764. case 0x0014: str = "Local Weather"; break;
  1765. case 0x0015: str = "Area Traffic Reports"; break;
  1766. case 0x0016: str = "Local Airport Flight Schedules"; break;
  1767. case 0x0017: str = "Restaurants"; break;
  1768. case 0x0018: str = "Lodgings"; break;
  1769. case 0x0019: str = "Retail Directory"; break;
  1770. case 0x001A: str = "Advertisements"; break;
  1771. case 0x001B: str = "Stock Quotes"; break;
  1772. case 0x001C: str = "Employment Opportunities"; break;
  1773. case 0x001D: str = "Medical/Health/Hospitals"; break;
  1774. case 0x001E: str = "Technology News"; break;
  1775. case 0x001F: str = "Multi-category"; break;
  1776. default:
  1777. if ((value >= 0x0020) && (value <= 0x8000)) { str = "Reserved for standard service categories"; }
  1778. else { str = "Reserved for proprietary service categories"; }
  1779. break;
  1780. }
  1781. proto_tree_add_text(tree,
  1782. tvb, curr_offset, 2,
  1783. "Service: (%u) %s",
  1784. value,
  1785. str);
  1786. curr_offset += 2;
  1787. oct = tvb_get_guint8(tvb, curr_offset);
  1788. switch (oct)
  1789. {
  1790. case 0: str = "Unknown or unspecified"; break;
  1791. case 1: str = "English"; break;
  1792. case 2: str = "French"; break;
  1793. case 3: str = "Spanish"; break;
  1794. case 4: str = "Japanese"; break;
  1795. case 5: str = "Korean"; break;
  1796. case 6: str = "Chinese"; break;
  1797. case 7: str = "Hebrew"; break;
  1798. default:
  1799. str = "Reserved";
  1800. break;
  1801. }
  1802. proto_tree_add_text(tree,
  1803. tvb, curr_offset, 1,
  1804. "Language: (%u) %s",
  1805. oct,
  1806. str);
  1807. curr_offset++;
  1808. break;
  1809. case 0:
  1810. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1811. proto_tree_add_text(tree,
  1812. tvb, curr_offset, 1,
  1813. "%s : Unused",
  1814. a_bigbuf);
  1815. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1816. proto_tree_add_text(tree,
  1817. tvb, curr_offset, 1,
  1818. "%s : Odd/Even Indicator: %s",
  1819. a_bigbuf,
  1820. (oct & 0x08) ? "ODD" : "EVEN");
  1821. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1822. proto_tree_add_text(tree,
  1823. tvb, curr_offset, 1,
  1824. "%s : Type of Identity: No Identity Code",
  1825. a_bigbuf);
  1826. g_snprintf(add_string, string_len, " - No Identity Code");
  1827. curr_offset++;
  1828. if (len > 1)
  1829. {
  1830. proto_tree_add_text(tree, tvb, curr_offset, len - 1,
  1831. "Format not supported");
  1832. }
  1833. curr_offset += len - 1;
  1834. break;
  1835. case 6:
  1836. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1837. proto_tree_add_text(tree,
  1838. tvb, curr_offset, 1,
  1839. "%s : Identity Digit 1: %c",
  1840. a_bigbuf,
  1841. Dgt_msid.out[(oct & 0xf0) >> 4]);
  1842. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1843. proto_tree_add_text(tree,
  1844. tvb, curr_offset, 1,
  1845. "%s : Odd/Even Indicator: %s",
  1846. a_bigbuf,
  1847. (oct & 0x08) ? "ODD" : "EVEN");
  1848. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1849. proto_tree_add_text(tree,
  1850. tvb, curr_offset, 1,
  1851. "%s : Type of Identity: %s",
  1852. a_bigbuf,
  1853. ((oct & 0x07) == 1) ? "MIN" : "IMSI");
  1854. a_bigbuf[0] = Dgt_msid.out[(oct & 0xf0) >> 4];
  1855. curr_offset++;
  1856. poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
  1857. my_dgt_tbcd_unpack(&a_bigbuf[1], poctets, len - (curr_offset - offset),
  1858. &Dgt_msid);
  1859. proto_tree_add_string_format(tree,
  1860. ((oct & 0x07) == 1) ? hf_ansi_a_min : hf_ansi_a_imsi,
  1861. tvb, curr_offset, len - (curr_offset - offset),
  1862. a_bigbuf,
  1863. "BCD Digits: %s",
  1864. a_bigbuf);
  1865. g_snprintf(add_string, string_len, " - %s (%s)",
  1866. ((oct & 0x07) == 1) ? "MIN" : "IMSI",
  1867. a_bigbuf);
  1868. curr_offset += len - (curr_offset - offset);
  1869. break;
  1870. case 3:
  1871. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1872. proto_tree_add_text(tree,
  1873. tvb, curr_offset, 1,
  1874. "%s : Unused",
  1875. a_bigbuf);
  1876. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1877. proto_tree_add_text(tree,
  1878. tvb, curr_offset, 1,
  1879. "%s : Odd/Even Indicator: %s",
  1880. a_bigbuf,
  1881. (oct & 0x08) ? "ODD" : "EVEN");
  1882. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1883. proto_tree_add_text(tree,
  1884. tvb, curr_offset, 1,
  1885. "%s : Type of Identity: Interface Directory Number",
  1886. a_bigbuf);
  1887. g_snprintf(add_string, string_len, " - Interface Directory Number");
  1888. curr_offset++;
  1889. if (len > 1)
  1890. {
  1891. proto_tree_add_text(tree, tvb, curr_offset, len - 1,
  1892. "Format not supported");
  1893. }
  1894. curr_offset += len - 1;
  1895. break;
  1896. case 4:
  1897. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1898. proto_tree_add_text(tree,
  1899. tvb, curr_offset, 1,
  1900. "%s : Unused",
  1901. a_bigbuf);
  1902. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1903. proto_tree_add_text(tree,
  1904. tvb, curr_offset, 1,
  1905. "%s : Odd/Even Indicator: %s",
  1906. a_bigbuf,
  1907. (oct & 0x08) ? "ODD" : "EVEN");
  1908. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1909. proto_tree_add_text(tree,
  1910. tvb, curr_offset, 1,
  1911. "%s : Type of Identity: TMSI",
  1912. a_bigbuf);
  1913. g_snprintf(add_string, string_len, " - TMSI");
  1914. curr_offset++;
  1915. if (len > 1)
  1916. {
  1917. proto_tree_add_text(tree, tvb, curr_offset, len - 1,
  1918. "Format not supported");
  1919. }
  1920. curr_offset += len - 1;
  1921. break;
  1922. case 5:
  1923. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  1924. proto_tree_add_text(tree,
  1925. tvb, curr_offset, 1,
  1926. "%s : Unused",
  1927. a_bigbuf);
  1928. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  1929. proto_tree_add_text(tree,
  1930. tvb, curr_offset, 1,
  1931. "%s : Odd/Even Indicator: %s",
  1932. a_bigbuf,
  1933. (oct & 0x08) ? "ODD" : "EVEN");
  1934. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1935. proto_tree_add_text(tree,
  1936. tvb, curr_offset, 1,
  1937. "%s : Type of Identity: ESN",
  1938. a_bigbuf);
  1939. curr_offset++;
  1940. value = tvb_get_ntohl(tvb, curr_offset);
  1941. proto_tree_add_uint(tree, hf_ansi_a_esn,
  1942. tvb, curr_offset, 4,
  1943. value);
  1944. g_snprintf(add_string, string_len, " - %sESN (0x%04x)",
  1945. a_meid_configured ? "p" : "",
  1946. value);
  1947. curr_offset += 4;
  1948. break;
  1949. default:
  1950. proto_tree_add_text(tree, tvb, curr_offset, len,
  1951. "Format Unknown");
  1952. g_snprintf(add_string, string_len, " - Format Unknown");
  1953. curr_offset += len;
  1954. break;
  1955. }
  1956. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  1957. return(curr_offset - offset);
  1958. }
  1959. /*
  1960. * IOS 6.2.2.17
  1961. */
  1962. static guint8
  1963. elem_sci(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  1964. {
  1965. guint8 oct;
  1966. guint32 curr_offset;
  1967. curr_offset = offset;
  1968. oct = tvb_get_guint8(tvb, curr_offset);
  1969. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  1970. proto_tree_add_text(tree,
  1971. tvb, curr_offset, 1,
  1972. "%s : Reserved",
  1973. a_bigbuf);
  1974. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  1975. proto_tree_add_text(tree,
  1976. tvb, curr_offset, 1,
  1977. "%s : Slot Cycle Index: %u",
  1978. a_bigbuf,
  1979. oct & 0x07);
  1980. g_snprintf(add_string, string_len, " - (%u)", oct & 0x07);
  1981. curr_offset++;
  1982. /* no length check possible */
  1983. return(curr_offset - offset);
  1984. }
  1985. /*
  1986. * IOS 6.2.2.18
  1987. */
  1988. static guint8
  1989. elem_prio(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  1990. {
  1991. guint8 oct;
  1992. guint32 curr_offset;
  1993. curr_offset = offset;
  1994. oct = tvb_get_guint8(tvb, curr_offset);
  1995. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  1996. proto_tree_add_text(tree,
  1997. tvb, curr_offset, 1,
  1998. "%s : Reserved",
  1999. a_bigbuf);
  2000. other_decode_bitfield_value(a_bigbuf, oct, 0x3c, 8);
  2001. proto_tree_add_text(tree,
  2002. tvb, curr_offset, 1,
  2003. "%s : Call Priority Level: %u",
  2004. a_bigbuf,
  2005. (oct & 0x3c) >> 2);
  2006. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  2007. proto_tree_add_text(tree,
  2008. tvb, curr_offset, 1,
  2009. "%s : Queuing %sallowed",
  2010. a_bigbuf,
  2011. (oct & 0x02) ? "" : "not ");
  2012. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  2013. proto_tree_add_text(tree,
  2014. tvb, curr_offset, 1,
  2015. "%s : Preemption %sallowed",
  2016. a_bigbuf,
  2017. (oct & 0x01) ? "" : "not ");
  2018. g_snprintf(add_string, string_len, " - (%u)", (oct & 0x3c) >> 2);
  2019. curr_offset++;
  2020. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2021. return(curr_offset - offset);
  2022. }
  2023. /*
  2024. * IOS 5 4.2.79
  2025. */
  2026. static guint8
  2027. elem_p_rev(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2028. {
  2029. guint8 oct;
  2030. guint32 curr_offset;
  2031. curr_offset = offset;
  2032. oct = tvb_get_guint8(tvb, curr_offset);
  2033. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2034. "MOB_P_REV");
  2035. g_snprintf(add_string, string_len, " - (%u)", oct);
  2036. curr_offset++;
  2037. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2038. return(curr_offset - offset);
  2039. }
  2040. /*
  2041. * IOS 6.2.2.19
  2042. */
  2043. static guint8
  2044. elem_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2045. {
  2046. guint8 oct;
  2047. guint32 value;
  2048. guint32 curr_offset;
  2049. const gchar *str = NULL;
  2050. curr_offset = offset;
  2051. oct = tvb_get_guint8(tvb, curr_offset);
  2052. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  2053. proto_tree_add_text(tree,
  2054. tvb, curr_offset, 1,
  2055. "%s : Extension",
  2056. a_bigbuf);
  2057. if (oct & 0x80)
  2058. {
  2059. /* 2 octet cause */
  2060. if ((oct & 0x0f) == 0x00)
  2061. {
  2062. /* national cause */
  2063. switch ((oct & 0x70) >> 4)
  2064. {
  2065. case 0: str = "Normal Event"; break;
  2066. case 1: str = "Normal Event"; break;
  2067. case 2: str = "Resource Unavailable"; break;
  2068. case 3: str = "Service or option not available"; break;
  2069. case 4: str = "Service or option not implemented"; break;
  2070. case 5: str = "Invalid message (e.g., parameter out of range)"; break;
  2071. case 6: str = "Protocol error"; break;
  2072. default:
  2073. str = "Interworking";
  2074. break;
  2075. }
  2076. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  2077. proto_tree_add_text(tree,
  2078. tvb, curr_offset, 1,
  2079. "%s : Cause Class: %s",
  2080. a_bigbuf,
  2081. str);
  2082. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  2083. proto_tree_add_text(tree,
  2084. tvb, curr_offset, 1,
  2085. "%s : National Cause",
  2086. a_bigbuf);
  2087. curr_offset++;
  2088. value = tvb_get_guint8(tvb, curr_offset);
  2089. proto_tree_add_uint_format(tree, hf_ansi_a_cause_2, tvb,
  2090. curr_offset, 1,
  2091. ((oct & 0x7f) << 8) | value,
  2092. "Cause Value");
  2093. curr_offset++;
  2094. g_snprintf(add_string, string_len, " - (National Cause)");
  2095. }
  2096. else
  2097. {
  2098. value = tvb_get_guint8(tvb, curr_offset + 1);
  2099. other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
  2100. proto_tree_add_uint_format(tree, hf_ansi_a_cause_2, tvb,
  2101. curr_offset, 1,
  2102. ((oct & 0x7f) << 8) | value,
  2103. "%s : Cause (MSB): %u",
  2104. a_bigbuf,
  2105. ((oct & 0x7f) << 8) | value);
  2106. curr_offset++;
  2107. other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
  2108. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2109. "%s : Cause (LSB)",
  2110. a_bigbuf);
  2111. curr_offset++;
  2112. }
  2113. }
  2114. else
  2115. {
  2116. switch (oct)
  2117. {
  2118. case 0x00: str = "Radio interface message failure"; break;
  2119. case 0x01: str = "Radio interface failure"; break;
  2120. case 0x02: str = "Uplink Quality"; break;
  2121. case 0x03: str = "Uplink strength"; break;
  2122. case 0x04: str = "Downlink quality"; break;
  2123. case 0x05: str = "Downlink strength"; break;
  2124. case 0x06: str = "Distance"; break;
  2125. case 0x07: str = "OAM&P intervention"; break;
  2126. case 0x08: str = "MS busy"; break;
  2127. case 0x09: str = "Call processing"; break;
  2128. case 0x0A: str = "Reversion to old channel"; break;
  2129. case 0x0B: str = "Handoff successful"; break;
  2130. case 0x0C: str = "No response from MS"; break;
  2131. case 0x0D: str = "Timer expired"; break;
  2132. case 0x0E: str = "Better cell (power budget)"; break;
  2133. case 0x0F: str = "Interference"; break;
  2134. case 0x10: str = "Packet call going dormant"; break;
  2135. case 0x11: str = "Service option not available"; break;
  2136. case 0x12: str = "Invalid Call"; break;
  2137. case 0x13: str = "Successful operation"; break;
  2138. case 0x14: str = "Normal call release"; break;
  2139. /* IOS 5 */
  2140. case 0x15: str = "Short data burst authentication failure"; break;
  2141. case 0x17: str = "Time critical relocation/handoff"; break;
  2142. case 0x18: str = "Network optimization"; break;
  2143. case 0x19: str = "Power down from dormant state"; break;
  2144. case 0x1A: str = "Authentication failure"; break;
  2145. case 0x1B: str = "Inter-BS Soft Handoff Drop Target"; break;
  2146. case 0x1D: str = "Intra-BS Soft Handoff Drop Target"; break;
  2147. /* IOS 5 */
  2148. case 0x1E: str = "Autonomous Registration by the Network"; break;
  2149. case 0x20: str = "Equipment failure"; break;
  2150. case 0x21: str = "No radio resource available"; break;
  2151. case 0x22: str = "Requested terrestrial resource unavailable"; break;
  2152. /* IOS 5 */
  2153. case 0x23: str = "A2p RTP Payload Type not available"; break;
  2154. case 0x24: str = "A2p Bearer Format Address Type not available"; break;
  2155. case 0x25: str = "BS not equipped"; break;
  2156. case 0x26: str = "MS not equipped (or incapable)"; break;
  2157. /* IOS 5 */
  2158. case 0x27: str = "2G only sector"; break;
  2159. case 0x28: str = "3G only sector"; break;
  2160. case 0x29: str = "PACA Call Queued"; break;
  2161. /* IOS 5 */
  2162. case 0x2A: str = "Handoff Blocked"; break;
  2163. case 0x2B: str = "Alternate signaling type reject"; break;
  2164. /* IOS 5 */
  2165. case 0x2C: str = "A2p Resource not available"; break;
  2166. case 0x2D: str = "PACA Queue Overflow"; break;
  2167. case 0x2E: str = "PACA Cancel Request Rejected"; break;
  2168. case 0x30: str = "Requested transcoding/rate adaptation unavailable"; break;
  2169. case 0x31: str = "Lower priority radio resources not available"; break;
  2170. case 0x32: str = "PCF resources not available"; break; /* IOS 4 */
  2171. case 0x33: str = "TFO Control request Failed"; break;
  2172. /* IOS 5 */
  2173. case 0x34: str = "MS rejected order"; break;
  2174. case 0x40: str = "Ciphering algorithm not supported"; break;
  2175. case 0x41: str = "Private Long Code not available or not supported."; break;
  2176. case 0x42: str = "Requested MUX option or rates not available."; break;
  2177. case 0x43: str = "Requested Privacy Configuration unavailable"; break;
  2178. /* IOS 5 */
  2179. case 0x45: str = "PDS-related capability not available or not supported"; break;
  2180. case 0x50: str = "Terrestrial circuit already allocated"; break;
  2181. case 0x60: str = "Protocol Error between BS and MSC"; break;
  2182. case 0x71: str = "ADDS message too long for delivery on the paging channel"; break;
  2183. case 0x72: str = "MS-to-IWF TCP connection failure"; break;
  2184. case 0x73: str = "ATH0 (Modem hang up) Command"; break;
  2185. case 0x74: str = "+FSH/+FHNG (Fax session ended) Command"; break;
  2186. case 0x75: str = "No carrier"; break;
  2187. case 0x76: str = "PPP protocol failure"; break;
  2188. case 0x77: str = "PPP session closed by the MS"; break;
  2189. case 0x78: str = "Do not notify MS"; break;
  2190. case 0x79: str = "PCF (or PDSN) resources are not available"; break;
  2191. case 0x7A: str = "Data ready to send"; break;
  2192. /* IOS 5 */
  2193. case 0x7B: str = "Concurrent authentication"; break;
  2194. case 0x7F: str = "Handoff procedure time-out"; break;
  2195. default:
  2196. str = "Reserved for future use";
  2197. break;
  2198. }
  2199. other_decode_bitfield_value(a_bigbuf, oct, 0x7f, 8);
  2200. proto_tree_add_uint_format(tree, hf_ansi_a_cause_1, tvb,
  2201. curr_offset, 1, oct,
  2202. "%s : Cause: (%u) %s",
  2203. a_bigbuf,
  2204. oct & 0x7f,
  2205. str);
  2206. curr_offset++;
  2207. g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, str);
  2208. }
  2209. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2210. return(curr_offset - offset);
  2211. }
  2212. /*
  2213. * IOS 6.2.2.20
  2214. * Formats everything after the discriminator, shared function.
  2215. */
  2216. static guint8
  2217. elem_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc)
  2218. {
  2219. guint32 value;
  2220. guint32 market_id;
  2221. guint32 switch_num;
  2222. guint32 curr_offset;
  2223. curr_offset = offset;
  2224. switch (disc)
  2225. {
  2226. case 0x02:
  2227. value = tvb_get_ntohs(tvb, curr_offset);
  2228. proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
  2229. curr_offset, 2, value);
  2230. curr_offset += 2;
  2231. g_snprintf(add_string, string_len, " - CI (%u)", value);
  2232. break;
  2233. case 0x05:
  2234. value = tvb_get_ntohs(tvb, curr_offset);
  2235. proto_tree_add_uint(tree, hf_ansi_a_cell_lac, tvb,
  2236. curr_offset, 2, value);
  2237. curr_offset += 2;
  2238. g_snprintf(add_string, string_len, " - LAC (%u)", value);
  2239. break;
  2240. case 0x07:
  2241. market_id = tvb_get_ntohs(tvb, curr_offset);
  2242. switch_num = tvb_get_guint8(tvb, curr_offset + 2);
  2243. value = tvb_get_ntoh24(tvb, curr_offset);
  2244. proto_tree_add_uint_format(tree, hf_ansi_a_cell_mscid, tvb,
  2245. curr_offset, 3, value,
  2246. "Market ID %u Switch Number %u",
  2247. market_id, switch_num);
  2248. curr_offset += 3;
  2249. value = tvb_get_ntohs(tvb, curr_offset);
  2250. proto_tree_add_uint(tree, hf_ansi_a_cell_ci, tvb,
  2251. curr_offset, 2, value);
  2252. curr_offset += 2;
  2253. g_snprintf(add_string, string_len, " - Market ID (%u) Switch Number (%u) CI (%u)",
  2254. market_id,
  2255. switch_num,
  2256. value);
  2257. break;
  2258. default:
  2259. proto_tree_add_text(tree, tvb, curr_offset, len,
  2260. "Cell ID - Non IOS format");
  2261. curr_offset += len;
  2262. break;
  2263. }
  2264. return(curr_offset - offset);
  2265. }
  2266. static guint8
  2267. elem_cell_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2268. {
  2269. guint8 oct;
  2270. guint32 curr_offset;
  2271. const gchar *str = NULL;
  2272. curr_offset = offset;
  2273. oct = tvb_get_guint8(tvb, curr_offset);
  2274. if (oct >= (gint) NUM_CELL_DISC_STR)
  2275. {
  2276. str = "Unknown";
  2277. }
  2278. else
  2279. {
  2280. str = cell_disc_str[oct];
  2281. }
  2282. proto_tree_add_text(tree,
  2283. tvb, curr_offset, 1,
  2284. "Cell Identification Discriminator: (%u) %s",
  2285. oct,
  2286. str);
  2287. curr_offset++;
  2288. curr_offset +=
  2289. elem_cell_id_aux(tvb, tree, curr_offset, len - (curr_offset - offset), add_string, string_len, oct);
  2290. /* no length check possible */
  2291. return(curr_offset - offset);
  2292. }
  2293. /*
  2294. * IOS 6.2.2.21
  2295. */
  2296. static guint8
  2297. elem_cell_id_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2298. {
  2299. guint8 oct;
  2300. guint16 consumed;
  2301. guint8 num_cells;
  2302. guint32 curr_offset;
  2303. proto_item *item = NULL;
  2304. proto_tree *subtree = NULL;
  2305. const gchar *str = NULL;
  2306. curr_offset = offset;
  2307. oct = tvb_get_guint8(tvb, curr_offset);
  2308. if (oct >= (gint) NUM_CELL_DISC_STR)
  2309. {
  2310. str = "Unknown";
  2311. }
  2312. else
  2313. {
  2314. str = cell_disc_str[oct];
  2315. }
  2316. proto_tree_add_text(tree,
  2317. tvb, curr_offset, 1,
  2318. "Cell Identification Discriminator: (%u) %s",
  2319. oct,
  2320. str);
  2321. curr_offset++;
  2322. NO_MORE_DATA_CHECK(len);
  2323. num_cells = 0;
  2324. do
  2325. {
  2326. item =
  2327. proto_tree_add_text(tree,
  2328. tvb, curr_offset, -1,
  2329. "Cell [%u]",
  2330. num_cells + 1);
  2331. subtree = proto_item_add_subtree(item, ett_cell_list);
  2332. add_string[0] = '\0';
  2333. consumed =
  2334. elem_cell_id_aux(tvb, subtree, curr_offset, len - (curr_offset - offset), add_string, string_len, oct);
  2335. if (add_string[0] != '\0')
  2336. {
  2337. proto_item_append_text(item, "%s", add_string);
  2338. }
  2339. proto_item_set_len(item, consumed);
  2340. curr_offset += consumed;
  2341. num_cells++;
  2342. }
  2343. while ((len - (curr_offset - offset)) > 0);
  2344. g_snprintf(add_string, string_len, " - %u cell%s",
  2345. num_cells, plurality(num_cells, "", "s"));
  2346. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2347. return(curr_offset - offset);
  2348. }
  2349. /*
  2350. * IOS 6.2.2.22
  2351. */
  2352. static guint8
  2353. elem_cic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  2354. {
  2355. guint32 value;
  2356. guint32 curr_offset;
  2357. curr_offset = offset;
  2358. value = tvb_get_ntohs(tvb, curr_offset);
  2359. other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
  2360. proto_tree_add_text(tree,
  2361. tvb, curr_offset, 2,
  2362. "%s : PCM Multiplexer: %u",
  2363. a_bigbuf,
  2364. (value & 0xffe0) >> 5);
  2365. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  2366. proto_tree_add_text(tree,
  2367. tvb, curr_offset, 2,
  2368. "%s : Timeslot: %u",
  2369. a_bigbuf,
  2370. value & 0x001f);
  2371. curr_offset += 2;
  2372. g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
  2373. /* no length check possible */
  2374. return(curr_offset - offset);
  2375. }
  2376. /*
  2377. * IOS 6.2.2.23
  2378. */
  2379. static guint8
  2380. elem_cic_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  2381. {
  2382. guint8 oct;
  2383. guint32 value;
  2384. guint32 curr_offset;
  2385. const gchar *str;
  2386. curr_offset = offset;
  2387. value = tvb_get_ntohs(tvb, curr_offset);
  2388. other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
  2389. proto_tree_add_text(tree,
  2390. tvb, curr_offset, 2,
  2391. "%s : PCM Multiplexer: %u",
  2392. a_bigbuf,
  2393. (value & 0xffe0) >> 5);
  2394. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  2395. proto_tree_add_text(tree,
  2396. tvb, curr_offset, 2,
  2397. "%s : Timeslot: %u",
  2398. a_bigbuf,
  2399. value & 0x001f);
  2400. curr_offset += 2;
  2401. g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
  2402. oct = tvb_get_guint8(tvb, curr_offset);
  2403. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  2404. proto_tree_add_text(tree,
  2405. tvb, curr_offset, 1,
  2406. "%s : Reserved",
  2407. a_bigbuf);
  2408. switch (oct & 0x0f)
  2409. {
  2410. case 0x00: str = "Full-rate"; break;
  2411. default:
  2412. str = "Reserved";
  2413. break;
  2414. }
  2415. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  2416. proto_tree_add_text(tree,
  2417. tvb, curr_offset, 1,
  2418. "%s : Circuit Mode: %s",
  2419. a_bigbuf,
  2420. str);
  2421. curr_offset++;
  2422. /* no length check possible */
  2423. return(curr_offset - offset);
  2424. }
  2425. /*
  2426. * IOS 5 4.2.21
  2427. */
  2428. static guint8
  2429. elem_ssci(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  2430. {
  2431. guint8 oct;
  2432. guint32 curr_offset;
  2433. curr_offset = offset;
  2434. oct = tvb_get_guint8(tvb, curr_offset);
  2435. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  2436. proto_tree_add_text(tree,
  2437. tvb, curr_offset, 1,
  2438. "%s : Reserved",
  2439. a_bigbuf);
  2440. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  2441. proto_tree_add_text(tree,
  2442. tvb, curr_offset, 1,
  2443. "%s : Mobile Originated Position Determination",
  2444. a_bigbuf);
  2445. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  2446. proto_tree_add_text(tree,
  2447. tvb, curr_offset, 1,
  2448. "%s : Global Emergency Call Indication",
  2449. a_bigbuf);
  2450. curr_offset++;
  2451. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2452. return(curr_offset - offset);
  2453. }
  2454. /*
  2455. * IOS 6.2.2.24
  2456. * UNUSED
  2457. */
  2458. #define ANSI_A_CELL_ID_LEN(_disc) ((_disc == 7) ? 5 : 2)
  2459. /*
  2460. * IOS 6.2.2.25
  2461. * Formats everything no length check
  2462. */
  2463. static guint8
  2464. elem_downlink_re_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2465. {
  2466. guint8 oct;
  2467. guint8 disc;
  2468. guint16 consumed;
  2469. guint8 num_cells;
  2470. guint8 curr_cell;
  2471. guint32 value;
  2472. guint32 curr_offset;
  2473. proto_item *item = NULL;
  2474. proto_tree *subtree = NULL;
  2475. const gchar *str;
  2476. curr_offset = offset;
  2477. num_cells = tvb_get_guint8(tvb, curr_offset);
  2478. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2479. "Number of Cells: %u",
  2480. num_cells);
  2481. curr_offset++;
  2482. NO_MORE_DATA_CHECK(len);
  2483. disc = tvb_get_guint8(tvb, curr_offset);
  2484. if (disc >= (gint) NUM_CELL_DISC_STR)
  2485. {
  2486. str = "Unknown";
  2487. }
  2488. else
  2489. {
  2490. str = cell_disc_str[disc];
  2491. }
  2492. proto_tree_add_text(tree,
  2493. tvb, curr_offset, 1,
  2494. "Cell Identification Discriminator: (%u) %s",
  2495. disc,
  2496. str);
  2497. curr_offset++;
  2498. NO_MORE_DATA_CHECK(len);
  2499. SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 3 + ANSI_A_CELL_ID_LEN(disc));
  2500. curr_cell = 0;
  2501. do
  2502. {
  2503. curr_cell++;
  2504. item =
  2505. proto_tree_add_text(tree,
  2506. tvb, curr_offset, -1,
  2507. "Cell [%u]",
  2508. curr_cell);
  2509. subtree = proto_item_add_subtree(item, ett_cell_list);
  2510. add_string[0] = '\0';
  2511. consumed =
  2512. elem_cell_id_aux(tvb, subtree, curr_offset,
  2513. len - (curr_offset - offset), add_string, string_len, disc);
  2514. if (add_string[0] != '\0')
  2515. {
  2516. proto_item_append_text(item, "%s", add_string);
  2517. }
  2518. proto_item_set_len(item, consumed);
  2519. curr_offset += consumed;
  2520. oct = tvb_get_guint8(tvb, curr_offset);
  2521. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  2522. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2523. "%s : Reserved",
  2524. a_bigbuf);
  2525. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  2526. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2527. "%s : Downlink Signal Strength Raw: %u",
  2528. a_bigbuf,
  2529. oct & 0x3f);
  2530. curr_offset++;
  2531. value = tvb_get_ntohs(tvb, curr_offset);
  2532. proto_tree_add_text(tree,
  2533. tvb, curr_offset, 2,
  2534. "CDMA Target One Way Delay: %u",
  2535. value);
  2536. curr_offset += 2;
  2537. }
  2538. while (curr_cell < num_cells);
  2539. g_snprintf(add_string, string_len, " - %u cell%s",
  2540. num_cells, plurality(num_cells, "", "s"));
  2541. return(curr_offset - offset);
  2542. }
  2543. /*
  2544. * IOS 6.2.2.25
  2545. */
  2546. static guint8
  2547. elem_downlink_re(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2548. {
  2549. guint32 curr_offset;
  2550. curr_offset = offset;
  2551. curr_offset +=
  2552. elem_downlink_re_aux(tvb, tree, offset, len, add_string, string_len);
  2553. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2554. return(curr_offset - offset);
  2555. }
  2556. /*
  2557. * IOS 6.2.2.140
  2558. */
  2559. static guint8
  2560. elem_downlink_re_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2561. {
  2562. guint16 consumed;
  2563. guint8 num_envs;
  2564. guint8 oct_len;
  2565. guint32 curr_offset;
  2566. proto_item *item = NULL;
  2567. proto_tree *subtree = NULL;
  2568. curr_offset = offset;
  2569. num_envs = 0;
  2570. while ((len - (curr_offset - offset)) > 0)
  2571. {
  2572. num_envs++;
  2573. item =
  2574. proto_tree_add_text(tree,
  2575. tvb, curr_offset, -1,
  2576. "Environment [%u]",
  2577. num_envs);
  2578. subtree = proto_item_add_subtree(item, ett_re_list);
  2579. oct_len = tvb_get_guint8(tvb, curr_offset);
  2580. proto_tree_add_text(subtree,
  2581. tvb, curr_offset, 1,
  2582. "Environment Length: %u",
  2583. oct_len);
  2584. curr_offset++;
  2585. add_string[0] = '\0';
  2586. consumed =
  2587. elem_downlink_re_aux(tvb, subtree, curr_offset, len - (curr_offset - offset), add_string, string_len);
  2588. if (add_string[0] != '\0')
  2589. {
  2590. proto_item_append_text(item, "%s", add_string);
  2591. }
  2592. /*
  2593. * +1 is for environment length
  2594. */
  2595. proto_item_set_len(item, consumed + 1);
  2596. curr_offset += consumed;
  2597. }
  2598. g_snprintf(add_string, string_len, " - %u environment%s",
  2599. num_envs, plurality(num_envs, "", "s"));
  2600. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2601. return(curr_offset - offset);
  2602. }
  2603. /*
  2604. * IOS 6.2.2.26
  2605. * UNUSED
  2606. */
  2607. /*
  2608. * IOS 6.2.2.27
  2609. * UNUSED
  2610. */
  2611. /*
  2612. * IOS 6.2.2.28
  2613. * UNUSED
  2614. */
  2615. /*
  2616. * IOS 6.2.2.29
  2617. * UNUSED
  2618. */
  2619. /*
  2620. * IOS 6.2.2.30
  2621. */
  2622. static guint8
  2623. elem_pdsn_ip_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  2624. {
  2625. guint32 curr_offset;
  2626. curr_offset = offset;
  2627. proto_tree_add_item(tree, hf_ansi_a_pdsn_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
  2628. curr_offset += len;
  2629. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2630. return(curr_offset - offset);
  2631. }
  2632. /*
  2633. * IOS 5 4.2.24
  2634. */
  2635. static guint8
  2636. elem_s_pdsn_ip_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  2637. {
  2638. guint32 curr_offset;
  2639. curr_offset = offset;
  2640. proto_tree_add_item(tree, hf_ansi_a_s_pdsn_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
  2641. curr_offset += len;
  2642. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2643. return(curr_offset - offset);
  2644. }
  2645. /*
  2646. * IOS 6.2.2.31
  2647. */
  2648. static guint8
  2649. elem_ho_pow_lev(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2650. {
  2651. guint8 oct;
  2652. guint16 consumed;
  2653. guint8 num_cells;
  2654. proto_item *item = NULL;
  2655. proto_tree *subtree = NULL;
  2656. guint32 curr_offset;
  2657. curr_offset = offset;
  2658. oct = tvb_get_guint8(tvb, curr_offset);
  2659. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2660. "Number of Cells: %u",
  2661. oct);
  2662. curr_offset++;
  2663. SHORT_DATA_CHECK(len - (curr_offset - offset), (guint32) 6);
  2664. oct = tvb_get_guint8(tvb, curr_offset);
  2665. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  2666. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2667. "%s : Reserved",
  2668. a_bigbuf);
  2669. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  2670. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2671. "%s : ID Type: %u",
  2672. a_bigbuf,
  2673. (oct & 0x60) >> 5);
  2674. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  2675. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2676. "%s : Handoff Power Level: %u",
  2677. a_bigbuf,
  2678. oct & 0x1f);
  2679. curr_offset++;
  2680. item =
  2681. proto_tree_add_text(tree,
  2682. tvb, curr_offset, -1,
  2683. "Cell [1]");
  2684. subtree = proto_item_add_subtree(item, ett_cell_list);
  2685. add_string[0] = '\0';
  2686. consumed =
  2687. elem_cell_id_aux(tvb, subtree, curr_offset,
  2688. len - (curr_offset - offset), add_string, string_len, 0x7);
  2689. if (add_string[0] != '\0')
  2690. {
  2691. proto_item_append_text(item, "%s", add_string);
  2692. }
  2693. proto_item_set_len(item, consumed);
  2694. curr_offset += consumed;
  2695. num_cells = 1;
  2696. while ((len - (curr_offset - offset)) >= 3)
  2697. {
  2698. num_cells++;
  2699. oct = tvb_get_guint8(tvb, curr_offset);
  2700. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  2701. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2702. "%s : Reserved",
  2703. a_bigbuf);
  2704. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  2705. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2706. "%s : Handoff Power Level: %u",
  2707. a_bigbuf,
  2708. oct & 0x1f);
  2709. curr_offset++;
  2710. item =
  2711. proto_tree_add_text(tree,
  2712. tvb, curr_offset, -1,
  2713. "Cell [%u]",
  2714. num_cells);
  2715. subtree = proto_item_add_subtree(item, ett_cell_list);
  2716. add_string[0] = '\0';
  2717. consumed =
  2718. elem_cell_id_aux(tvb, subtree, curr_offset,
  2719. len - (curr_offset - offset), add_string, string_len, 0x2);
  2720. if (add_string[0] != '\0')
  2721. {
  2722. proto_item_append_text(item, "%s", add_string);
  2723. }
  2724. proto_item_set_len(item, consumed);
  2725. curr_offset += consumed;
  2726. }
  2727. g_snprintf(add_string, string_len, " - %u cell%s",
  2728. num_cells, plurality(num_cells, "", "s"));
  2729. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2730. return(curr_offset - offset);
  2731. }
  2732. /*
  2733. * IOS 6.2.2.32
  2734. */
  2735. static guint8
  2736. elem_uz_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2737. {
  2738. guint32 value;
  2739. guint32 curr_offset;
  2740. curr_offset = offset;
  2741. value = tvb_get_ntohs(tvb, curr_offset);
  2742. proto_tree_add_text(tree, tvb, curr_offset, 2,
  2743. "UZID: %u",
  2744. value);
  2745. curr_offset += 2;
  2746. g_snprintf(add_string, string_len, " - (%u)", value);
  2747. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2748. return(curr_offset - offset);
  2749. }
  2750. /*
  2751. * IOS 6.2.2.33
  2752. * UNUSED
  2753. */
  2754. /*
  2755. * IOS 5 4.2.77
  2756. */
  2757. static guint8
  2758. elem_info_rec_req(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2759. {
  2760. guint8 rec_type;
  2761. guint8 num_recs;
  2762. guint32 curr_offset;
  2763. const gchar *str;
  2764. gint idx;
  2765. curr_offset = offset;
  2766. num_recs = 0;
  2767. while ((len - (curr_offset - offset)) > 0)
  2768. {
  2769. num_recs++;
  2770. rec_type = tvb_get_guint8(tvb, curr_offset);
  2771. str = try_val_to_str_idx((guint32) rec_type, ansi_rev_ms_info_rec_str, &idx);
  2772. if (str == NULL)
  2773. {
  2774. str = "Reserved";
  2775. }
  2776. proto_tree_add_text(tree,
  2777. tvb, curr_offset, 1,
  2778. "Information Record Type - %u: (%u) %s",
  2779. num_recs,
  2780. rec_type,
  2781. str);
  2782. curr_offset++;
  2783. }
  2784. g_snprintf(add_string, string_len, " - %u request%s",
  2785. num_recs, plurality(num_recs, "", "s"));
  2786. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2787. return(curr_offset - offset);
  2788. }
  2789. /*
  2790. * IOS 6.2.2.34
  2791. */
  2792. static guint8
  2793. elem_is2000_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  2794. {
  2795. guint8 oct;
  2796. guint8 num_chan;
  2797. guint32 value;
  2798. guint32 curr_offset;
  2799. const gchar *str;
  2800. curr_offset = offset;
  2801. oct = tvb_get_guint8(tvb, curr_offset);
  2802. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  2803. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2804. "%s : OTD: Mobile will %sbe using OTD",
  2805. a_bigbuf,
  2806. (oct & 0x80) ? "" : "not ");
  2807. num_chan = (oct & 0x70) >> 4;
  2808. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  2809. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2810. "%s : Channel Count: %u",
  2811. a_bigbuf,
  2812. num_chan);
  2813. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  2814. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2815. "%s : Frame Offset: (%u), %.2f ms",
  2816. a_bigbuf,
  2817. oct & 0x0f,
  2818. (oct & 0x0f) * 1.25);
  2819. curr_offset++;
  2820. NO_MORE_DATA_CHECK(len);
  2821. SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
  2822. do
  2823. {
  2824. oct = tvb_get_guint8(tvb, curr_offset);
  2825. switch (oct)
  2826. {
  2827. case 0x01: str = "Fundamental Channel (FCH) TIA/EIA/IS-2000"; break;
  2828. case 0x02: str = "Dedicated Control Channel (DCCH) TIA/EIA/IS-2000"; break;
  2829. case 0x03: str = "Supplemental Channel (SCH) TIA/EIA/IS-2000"; break;
  2830. default:
  2831. if ((oct >= 0x80) && (oct <= 0x9f)) { str = "Reserved for UMTS"; }
  2832. else { str = "Reserved"; }
  2833. break;
  2834. }
  2835. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2836. "Physical Channel Type: %s",
  2837. str);
  2838. curr_offset++;
  2839. oct = tvb_get_guint8(tvb, curr_offset);
  2840. switch (global_a_variant)
  2841. {
  2842. case A_VARIANT_IOS401:
  2843. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  2844. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2845. "%s : Reserved",
  2846. a_bigbuf);
  2847. break;
  2848. case A_VARIANT_IOS501:
  2849. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  2850. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2851. "%s : Rev_FCH_Gating",
  2852. a_bigbuf);
  2853. break;
  2854. }
  2855. switch ((oct & 0x60) >> 5)
  2856. {
  2857. case 0: str = "Gating rate 1"; break;
  2858. case 1: str = "Gating rate 1/2"; break;
  2859. case 2: str = "Gating rate 1/4"; break;
  2860. default:
  2861. str = "Reserved";
  2862. break;
  2863. }
  2864. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  2865. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2866. "%s : Pilot Gating Rate: %s",
  2867. a_bigbuf,
  2868. str);
  2869. other_decode_bitfield_value(a_bigbuf, oct, 0x18, 8);
  2870. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2871. "%s : QOF Mask",
  2872. a_bigbuf);
  2873. value = tvb_get_guint8(tvb, curr_offset + 1);
  2874. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  2875. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2876. "%s : Walsh Code Channel Index (MSB): %u",
  2877. a_bigbuf,
  2878. ((guint32) (oct & 0x07) << 8) | value);
  2879. curr_offset++;
  2880. other_decode_bitfield_value(a_bigbuf, value, 0xff, 8);
  2881. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2882. "%s : Walsh Code Channel Index (LSB)",
  2883. a_bigbuf);
  2884. curr_offset++;
  2885. oct = tvb_get_guint8(tvb, curr_offset);
  2886. other_decode_bitfield_value(a_bigbuf, oct, 0xff, 8);
  2887. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2888. "%s : Pilot PN Code (LSB)",
  2889. a_bigbuf);
  2890. curr_offset++;
  2891. value = oct;
  2892. oct = tvb_get_guint8(tvb, curr_offset);
  2893. value |= ((guint32) (oct & 0x80)) << 1;
  2894. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  2895. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2896. "%s : Pilot PN Code (MSB): %u",
  2897. a_bigbuf,
  2898. value);
  2899. switch (global_a_variant)
  2900. {
  2901. case A_VARIANT_IOS401:
  2902. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  2903. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2904. "%s : Reserved",
  2905. a_bigbuf);
  2906. break;
  2907. case A_VARIANT_IOS501:
  2908. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  2909. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2910. "%s : Reserved",
  2911. a_bigbuf);
  2912. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  2913. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2914. "%s : Power Combined",
  2915. a_bigbuf);
  2916. break;
  2917. }
  2918. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  2919. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2920. "%s : Frequency Included",
  2921. a_bigbuf);
  2922. value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
  2923. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  2924. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2925. "%s : ARFCN (MSB): %u",
  2926. a_bigbuf,
  2927. value);
  2928. curr_offset++;
  2929. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  2930. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2931. "%s : ARFCN (LSB)",
  2932. a_bigbuf);
  2933. curr_offset++;
  2934. }
  2935. while ((len - (curr_offset - offset)) >= 6);
  2936. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2937. return(curr_offset - offset);
  2938. }
  2939. /*
  2940. * IOS 6.2.2.35
  2941. * NO ASSOCIATED DATA
  2942. */
  2943. /*
  2944. * IOS 6.2.2.36
  2945. */
  2946. static guint8
  2947. elem_is95_ms_meas_chan_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2948. {
  2949. guint8 oct;
  2950. guint32 value;
  2951. gint temp_int;
  2952. guint32 curr_offset;
  2953. const gchar *str;
  2954. curr_offset = offset;
  2955. oct = tvb_get_guint8(tvb, curr_offset);
  2956. temp_int = (oct & 0xf8) >> 3;
  2957. if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
  2958. {
  2959. str = "Reserved";
  2960. }
  2961. else
  2962. {
  2963. str = band_class_str[temp_int];
  2964. }
  2965. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  2966. proto_tree_add_text(tree,
  2967. tvb, curr_offset, 1,
  2968. "%s : Band Class: %s",
  2969. a_bigbuf,
  2970. str);
  2971. value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
  2972. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  2973. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2974. "%s : ARFCN (MSB): %u",
  2975. a_bigbuf,
  2976. value);
  2977. curr_offset++;
  2978. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  2979. proto_tree_add_text(tree, tvb, curr_offset, 1,
  2980. "%s : ARFCN (LSB)",
  2981. a_bigbuf);
  2982. g_snprintf(add_string, string_len, " - (ARFCN: %u)", value);
  2983. curr_offset++;
  2984. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  2985. return(curr_offset - offset);
  2986. }
  2987. /*
  2988. * IOS 6.2.2.37
  2989. */
  2990. static guint8
  2991. elem_clg_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  2992. {
  2993. guint8 oct;
  2994. guint32 curr_offset;
  2995. guint8 *poctets;
  2996. const gchar *str;
  2997. curr_offset = offset;
  2998. oct = tvb_get_guint8(tvb, curr_offset);
  2999. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3000. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3001. "%s : Extension: %s",
  3002. a_bigbuf,
  3003. (oct & 0x80) ? "Not extended" : "Extended");
  3004. switch ((oct & 0x70) >> 4)
  3005. {
  3006. case 0: str = "Unknown"; break;
  3007. case 1: str = "International number"; break;
  3008. case 2: str = "National number"; break;
  3009. case 3: str = "Network-specific number"; break;
  3010. case 4: str = "Dedicated PAD access, short code"; break;
  3011. case 5: str = "Reserved"; break;
  3012. case 6: str = "Reserved"; break;
  3013. default:
  3014. str = "Reserved for extension";
  3015. break;
  3016. }
  3017. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  3018. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3019. "%s : Type of Number: %s",
  3020. a_bigbuf,
  3021. str);
  3022. switch (oct & 0x0f)
  3023. {
  3024. case 0x00: str = "Unknown"; break;
  3025. case 0x01: str = "ISDN/Telephony Numbering (ITU recommendation E.164/E.163)"; break;
  3026. case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
  3027. case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
  3028. case 0x07: str = "Reserved for extension"; break;
  3029. case 0x08: str = "National Numbering"; break;
  3030. case 0x09: str = "Private Numbering"; break;
  3031. default:
  3032. str = "Reserved";
  3033. break;
  3034. }
  3035. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3036. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3037. "%s : Number Plan Identification: %s",
  3038. a_bigbuf,
  3039. str);
  3040. curr_offset++;
  3041. if (!(oct & 0x80))
  3042. {
  3043. /* octet 3a */
  3044. oct = tvb_get_guint8(tvb, curr_offset);
  3045. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3046. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3047. "%s : Extension",
  3048. a_bigbuf);
  3049. switch ((oct & 0x60) >> 5)
  3050. {
  3051. case 0: str = "Presentation allowed"; break;
  3052. case 1: str = "Presentation restricted"; break;
  3053. case 2: str = "Number not available due to interworking"; break;
  3054. default:
  3055. str = "Reserved";
  3056. break;
  3057. }
  3058. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  3059. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3060. "%s : Presentation Indicator: %s",
  3061. a_bigbuf,
  3062. str);
  3063. switch (oct & 0x03)
  3064. {
  3065. case 0: str = "User-provided, not screened"; break;
  3066. case 1: str = "User-provided, verified and passed"; break;
  3067. case 2: str = "User-provided, verified and failed"; break;
  3068. default:
  3069. str = "Network-provided";
  3070. break;
  3071. }
  3072. other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
  3073. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3074. "%s : Reserved",
  3075. a_bigbuf);
  3076. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  3077. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3078. "%s : Screening Indicator: %s",
  3079. a_bigbuf,
  3080. str);
  3081. curr_offset++;
  3082. }
  3083. poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
  3084. proto_tree_add_string_format(tree, hf_ansi_a_clg_party_ascii_num,
  3085. tvb, curr_offset, len - (curr_offset - offset),
  3086. (gchar *) poctets,
  3087. "Digits: %s",
  3088. (gchar *) format_text(poctets, len - (curr_offset - offset)));
  3089. curr_offset += len - (curr_offset - offset);
  3090. g_snprintf(add_string, string_len, " - (%s)", poctets);
  3091. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3092. return(curr_offset - offset);
  3093. }
  3094. /*
  3095. * IOS 6.2.2.38
  3096. */
  3097. static guint8
  3098. elem_l3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  3099. {
  3100. guint32 curr_offset;
  3101. tvbuff_t *l3_tvb;
  3102. curr_offset = offset;
  3103. proto_tree_add_text(tree, tvb, curr_offset, len,
  3104. "Layer 3 Information");
  3105. /*
  3106. * dissect the embedded DTAP message
  3107. */
  3108. l3_tvb = tvb_new_subset(tvb, curr_offset, len, len);
  3109. call_dissector(dtap_handle, l3_tvb, pinfo, g_tree);
  3110. curr_offset += len;
  3111. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3112. return(curr_offset - offset);
  3113. }
  3114. /*
  3115. * IOS 6.2.2.39
  3116. * Protocol Discriminator
  3117. */
  3118. /*
  3119. * IOS 6.2.2.40
  3120. * Reserved Octet
  3121. */
  3122. /*
  3123. * IOS 6.2.2.41
  3124. * Location Updating Type
  3125. * UNUSED in SPEC!
  3126. */
  3127. /*
  3128. * IOS 6.2.2.42
  3129. * Simple data no decode required
  3130. */
  3131. /*
  3132. * IOS 6.2.2.43
  3133. */
  3134. static guint8
  3135. elem_lai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
  3136. {
  3137. guint8 oct;
  3138. guint16 value;
  3139. guint32 curr_offset;
  3140. gchar mcc[4];
  3141. gchar mnc[4];
  3142. curr_offset = offset;
  3143. oct = tvb_get_guint8(tvb, curr_offset);
  3144. mcc[0] = Dgt_tbcd.out[oct & 0x0f];
  3145. mcc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
  3146. oct = tvb_get_guint8(tvb, curr_offset+1);
  3147. mcc[2] = Dgt_tbcd.out[(oct & 0x0f)];
  3148. mcc[3] = '\0';
  3149. mnc[2] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
  3150. oct = tvb_get_guint8(tvb, curr_offset+2);
  3151. mnc[0] = Dgt_tbcd.out[(oct & 0x0f)];
  3152. mnc[1] = Dgt_tbcd.out[(oct & 0xf0) >> 4];
  3153. mnc[3] = '\0';
  3154. proto_tree_add_text(tree,
  3155. tvb, curr_offset, 3,
  3156. "Mobile Country Code (MCC): %s, Mobile Network Code (MNC): %s",
  3157. mcc,
  3158. mnc);
  3159. curr_offset += 3;
  3160. value = tvb_get_ntohs(tvb, curr_offset);
  3161. proto_tree_add_text(tree,
  3162. tvb, curr_offset, 2,
  3163. "Location Area Code (LAC): 0x%04x (%u)",
  3164. value,
  3165. value);
  3166. curr_offset += 2;
  3167. /* no length check possible */
  3168. return(curr_offset - offset);
  3169. }
  3170. /*
  3171. * IOS 6.2.2.44
  3172. */
  3173. static guint8
  3174. elem_rej_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3175. {
  3176. guint8 oct;
  3177. guint32 curr_offset;
  3178. const gchar *str;
  3179. curr_offset = offset;
  3180. oct = tvb_get_guint8(tvb, curr_offset);
  3181. switch (oct)
  3182. {
  3183. case 0x01: str = "Reserved"; break;
  3184. case 0x02: str = "MIN/IMSI unknown in HLR"; break;
  3185. case 0x03: str = "Illegal MS"; break;
  3186. case 0x04: str = "TMSI/IMSI/MIN unknown in VLR"; break;
  3187. case 0x05: str = "Reserved"; break;
  3188. case 0x0b: str = "Roaming not allowed"; break;
  3189. case 0x0c: str = "Location area not allowed"; break;
  3190. case 0x20: str = "Service option not supported"; break;
  3191. case 0x21: str = "Requested service option not subscribed"; break;
  3192. case 0x22: str = "Service option temporarily out of order"; break;
  3193. case 0x26: str = "Call cannot be identified"; break;
  3194. case 0x51: str = "Network failure"; break;
  3195. case 0x56: str = "Congestion"; break;
  3196. case 0x62: str = "Message type non-existent or not implemented"; break;
  3197. case 0x63: str = "Information element non-existent or not implemented"; break;
  3198. case 0x64: str = "Invalid information element contents"; break;
  3199. case 0x65: str = "Message not compatible with the call state"; break;
  3200. case 0x66: str = "Protocol error, unspecified"; break;
  3201. case 0x6e: str = "Invalid message, unspecified"; break;
  3202. case 0x6f: str = "Mandatory information element error"; break;
  3203. default:
  3204. str = "Reserved";
  3205. break;
  3206. }
  3207. proto_tree_add_text(tree,
  3208. tvb, curr_offset, 1,
  3209. "Reject Cause Value: (%u) %s",
  3210. oct,
  3211. str);
  3212. curr_offset++;
  3213. g_snprintf(add_string, string_len, " - (%s)", str);
  3214. /* no length check possible */
  3215. return(curr_offset - offset);
  3216. }
  3217. /*
  3218. * IOS 5 4.2.78
  3219. */
  3220. static guint8
  3221. elem_anchor_pdsn_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  3222. {
  3223. guint32 curr_offset;
  3224. curr_offset = offset;
  3225. proto_tree_add_item(tree, hf_ansi_a_anchor_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
  3226. curr_offset += len;
  3227. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3228. return(curr_offset - offset);
  3229. }
  3230. /*
  3231. * IOS 5 4.2.80
  3232. */
  3233. static guint8
  3234. elem_anchor_pp_addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  3235. {
  3236. guint32 curr_offset;
  3237. curr_offset = offset;
  3238. proto_tree_add_item(tree, hf_ansi_a_anchor_pp_ip_addr, tvb, curr_offset, len, ENC_BIG_ENDIAN);
  3239. curr_offset += len;
  3240. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3241. return(curr_offset - offset);
  3242. }
  3243. /*
  3244. * IOS 6.2.2.45
  3245. */
  3246. static guint8
  3247. elem_auth_chlg_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3248. {
  3249. guint8 oct;
  3250. guint32 curr_offset;
  3251. const gchar *str;
  3252. curr_offset = offset;
  3253. oct = tvb_get_guint8(tvb, curr_offset);
  3254. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  3255. proto_tree_add_text(tree,
  3256. tvb, curr_offset, 1,
  3257. "%s : Reserved",
  3258. a_bigbuf);
  3259. switch (oct & 0x0f)
  3260. {
  3261. case 1: str = "RAND 32 bits"; break;
  3262. case 2: str = "RANDU 24 bits"; break;
  3263. case 4: str = "RANDSSD 56 bits"; break;
  3264. case 8: str = "RANDBS 32 bits"; break;
  3265. default:
  3266. str = "Reserved";
  3267. break;
  3268. }
  3269. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3270. proto_tree_add_text(tree,
  3271. tvb, curr_offset, 1,
  3272. "%s : Random Number Type: (%u) %s",
  3273. a_bigbuf,
  3274. oct & 0x0f,
  3275. str);
  3276. curr_offset++;
  3277. proto_tree_add_text(tree,
  3278. tvb, curr_offset, len - (curr_offset - offset),
  3279. "RAND/RANDU/RANDBS/RANDSSD Value");
  3280. g_snprintf(add_string, string_len, " - (%s)", str);
  3281. curr_offset += len - (curr_offset - offset);
  3282. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3283. return(curr_offset - offset);
  3284. }
  3285. /*
  3286. * IOS 6.2.2.46
  3287. */
  3288. static guint8
  3289. elem_auth_resp_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3290. {
  3291. guint8 oct;
  3292. guint32 curr_offset;
  3293. const gchar *str;
  3294. curr_offset = offset;
  3295. oct = tvb_get_guint8(tvb, curr_offset);
  3296. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  3297. proto_tree_add_text(tree,
  3298. tvb, curr_offset, 1,
  3299. "%s : Reserved",
  3300. a_bigbuf);
  3301. switch (oct & 0x0f)
  3302. {
  3303. case 1: str = "AUTHR"; break;
  3304. case 2: str = "AUTHU"; break;
  3305. case 4: str = "AUTHBS"; break;
  3306. default:
  3307. str = "Reserved";
  3308. break;
  3309. }
  3310. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3311. proto_tree_add_text(tree,
  3312. tvb, curr_offset, 1,
  3313. "%s : Auth Signature Type: (%u) %s",
  3314. a_bigbuf,
  3315. oct & 0x0f,
  3316. str);
  3317. curr_offset++;
  3318. proto_tree_add_text(tree,
  3319. tvb, curr_offset, len - (curr_offset - offset),
  3320. "Auth Signature");
  3321. g_snprintf(add_string, string_len, " - (%s)", str);
  3322. curr_offset += len - (curr_offset - offset);
  3323. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3324. return(curr_offset - offset);
  3325. }
  3326. /*
  3327. * IOS 6.2.2.47
  3328. */
  3329. static guint8
  3330. elem_auth_param_count(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3331. {
  3332. guint8 oct;
  3333. guint32 curr_offset;
  3334. curr_offset = offset;
  3335. oct = tvb_get_guint8(tvb, curr_offset);
  3336. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  3337. proto_tree_add_text(tree,
  3338. tvb, curr_offset, 1,
  3339. "%s : Reserved",
  3340. a_bigbuf);
  3341. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  3342. proto_tree_add_text(tree,
  3343. tvb, curr_offset, 1,
  3344. "%s : Count: %u",
  3345. a_bigbuf,
  3346. oct & 0x3f);
  3347. curr_offset++;
  3348. g_snprintf(add_string, string_len, " - (%u)", oct & 0x3f);
  3349. /* no length check possible */
  3350. return(curr_offset - offset);
  3351. }
  3352. /*
  3353. * IOS 6.2.2.48
  3354. */
  3355. static guint8
  3356. elem_mwi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3357. {
  3358. guint8 oct;
  3359. guint32 curr_offset;
  3360. curr_offset = offset;
  3361. oct = tvb_get_guint8(tvb, curr_offset);
  3362. proto_tree_add_text(tree,
  3363. tvb, curr_offset, 1,
  3364. "Number of Messages: %u",
  3365. oct);
  3366. curr_offset++;
  3367. g_snprintf(add_string, string_len, " - (%u)", oct);
  3368. /* no length check possible */
  3369. return(curr_offset - offset);
  3370. }
  3371. /*
  3372. * IOS 6.2.2.49
  3373. * Progress
  3374. * UNUSED in SPEC and no IEI!
  3375. */
  3376. /*
  3377. * IOS 6.2.2.50
  3378. */
  3379. static guint8
  3380. elem_signal(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3381. {
  3382. guint8 oct;
  3383. guint32 curr_offset;
  3384. const gchar *str;
  3385. curr_offset = offset;
  3386. oct = tvb_get_guint8(tvb, curr_offset);
  3387. switch (oct)
  3388. {
  3389. case 0x00: str = "Dial tone on"; break;
  3390. case 0x01: str = "Ring back tone on"; break;
  3391. case 0x02: str = "Intercept tone on"; break;
  3392. case 0x03: str = "Network congestion (reorder) tone on"; break;
  3393. case 0x04: str = "Busy tone on"; break;
  3394. case 0x05: str = "Confirm tone on"; break;
  3395. case 0x06: str = "Answer tone on"; break;
  3396. case 0x07: str = "Call waiting tone on"; break;
  3397. case 0x08: str = "Off-hook warning tone on"; break;
  3398. case 0x3f: str = "Tones off"; break;
  3399. case 0x40: str = "Normal Alerting"; break;
  3400. case 0x41: str = "Inter-group Alerting"; break;
  3401. case 0x42: str = "Special/Priority Alerting"; break;
  3402. case 0x43: str = "Reserved (ISDN Alerting pattern 3)"; break;
  3403. case 0x44: str = "Ping Ring (abbreviated alert)"; break;
  3404. case 0x45: str = "Reserved (ISDN Alerting pattern 5)"; break;
  3405. case 0x46: str = "Reserved (ISDN Alerting pattern 6)"; break;
  3406. case 0x47: str = "Reserved (ISDN Alerting pattern 7)"; break;
  3407. case 0x63: str = "Abbreviated intercept"; break;
  3408. case 0x65: str = "Abbreviated reorder"; break;
  3409. case 0x4f: str = "Alerting off"; break;
  3410. default:
  3411. str = "Unknown";
  3412. break;
  3413. }
  3414. proto_tree_add_text(tree,
  3415. tvb, curr_offset, 1,
  3416. "Signal Value: (%u) %s",
  3417. oct,
  3418. str);
  3419. g_snprintf(add_string, string_len, " - (%s)", str);
  3420. curr_offset++;
  3421. oct = tvb_get_guint8(tvb, curr_offset);
  3422. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  3423. proto_tree_add_text(tree,
  3424. tvb, curr_offset, 1,
  3425. "%s : Reserved",
  3426. a_bigbuf);
  3427. switch (oct & 0x03)
  3428. {
  3429. case 0: str = "Medium pitch (standard alert)"; break;
  3430. case 1: str = "High pitch"; break;
  3431. case 2: str = "Low pitch"; break;
  3432. default:
  3433. str = "Reserved";
  3434. break;
  3435. }
  3436. proto_tree_add_text(tree,
  3437. tvb, curr_offset, 1,
  3438. "%s : Alert Pitch: %s",
  3439. a_bigbuf,
  3440. str);
  3441. curr_offset++;
  3442. /* no length check possible */
  3443. return(curr_offset - offset);
  3444. }
  3445. /*
  3446. * IOS 6.2.2.51
  3447. * CM Service Type
  3448. */
  3449. /*
  3450. * IOS 6.2.2.52
  3451. */
  3452. static guint8
  3453. elem_cld_party_bcd_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3454. {
  3455. guint8 oct;
  3456. guint8 *poctets;
  3457. guint32 curr_offset;
  3458. const gchar *str;
  3459. curr_offset = offset;
  3460. oct = tvb_get_guint8(tvb, curr_offset);
  3461. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3462. proto_tree_add_text(tree,
  3463. tvb, curr_offset, 1,
  3464. "%s : Extension",
  3465. a_bigbuf);
  3466. switch ((oct & 0x70) >> 4)
  3467. {
  3468. case 0: str = "Unknown"; break;
  3469. case 1: str = "International number"; break;
  3470. case 2: str = "National number"; break;
  3471. case 3: str = "Network specific number"; break;
  3472. case 4: str = "Dedicated PAD access, short code"; break;
  3473. case 7: str = "Reserved for extension"; break;
  3474. default:
  3475. str = "Reserved";
  3476. break;
  3477. }
  3478. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  3479. proto_tree_add_text(tree,
  3480. tvb, curr_offset, 1,
  3481. "%s : Type of Number: %s",
  3482. a_bigbuf,
  3483. str);
  3484. switch (oct & 0x0f)
  3485. {
  3486. case 0x00: str = "Unknown"; break;
  3487. case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
  3488. case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
  3489. case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
  3490. case 0x07: str = "Reserved for extension"; break;
  3491. case 0x08: str = "National numbering plan"; break;
  3492. case 0x09: str = "Private numbering plan"; break;
  3493. default:
  3494. str = "Reserved";
  3495. break;
  3496. }
  3497. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3498. proto_tree_add_text(tree,
  3499. tvb, curr_offset, 1,
  3500. "%s : Numbering Plan Identification: %s",
  3501. a_bigbuf,
  3502. str);
  3503. curr_offset++;
  3504. poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
  3505. my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
  3506. &Dgt_tbcd);
  3507. proto_tree_add_string_format(tree, hf_ansi_a_cld_party_bcd_num,
  3508. tvb, curr_offset, len - (curr_offset - offset),
  3509. a_bigbuf,
  3510. "BCD Digits: %s",
  3511. a_bigbuf);
  3512. g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
  3513. curr_offset += len - (curr_offset - offset);
  3514. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3515. return(curr_offset - offset);
  3516. }
  3517. /*
  3518. * IOS 6.2.2.53
  3519. * UNUSED in SPEC and no IEI!
  3520. */
  3521. #ifdef MAYBE_USED_FOR_OLDER_CODECS
  3522. static guint8
  3523. elem_clg_party_bcd_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3524. {
  3525. guint8 oct;
  3526. guint8 *poctets;
  3527. guint32 curr_offset;
  3528. const gchar *str;
  3529. curr_offset = offset;
  3530. oct = tvb_get_guint8(tvb, curr_offset);
  3531. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3532. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3533. "%s : Extension: %s",
  3534. a_bigbuf,
  3535. (oct & 0x80) ? "Not extended" : "Extended");
  3536. switch ((oct & 0x70) >> 4)
  3537. {
  3538. case 0: str = "Unknown"; break;
  3539. case 1: str = "International number"; break;
  3540. case 2: str = "National number"; break;
  3541. case 3: str = "Network specific number"; break;
  3542. case 4: str = "Dedicated PAD access, short code"; break;
  3543. case 7: str = "Reserved for extension"; break;
  3544. default:
  3545. str = "Reserved";
  3546. break;
  3547. }
  3548. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  3549. proto_tree_add_text(tree,
  3550. tvb, curr_offset, 1,
  3551. "%s : Type of Number: %s",
  3552. a_bigbuf,
  3553. str);
  3554. switch (oct & 0x0f)
  3555. {
  3556. case 0x00: str = "Unknown"; break;
  3557. case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
  3558. case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
  3559. case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
  3560. case 0x07: str = "Reserved for extension"; break;
  3561. case 0x08: str = "National numbering plan"; break;
  3562. case 0x09: str = "Private numbering plan"; break;
  3563. default:
  3564. str = "Reserved";
  3565. break;
  3566. }
  3567. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3568. proto_tree_add_text(tree,
  3569. tvb, curr_offset, 1,
  3570. "%s : Numbering Plan Identification: %s",
  3571. a_bigbuf,
  3572. str);
  3573. curr_offset++;
  3574. if (!(oct & 0x80))
  3575. {
  3576. /* octet 3a */
  3577. oct = tvb_get_guint8(tvb, curr_offset);
  3578. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3579. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3580. "%s : Extension",
  3581. a_bigbuf);
  3582. switch ((oct & 0x60) >> 5)
  3583. {
  3584. case 0: str = "Presentation allowed"; break;
  3585. case 1: str = "Presentation restricted"; break;
  3586. case 2: str = "Number not available due to interworking"; break;
  3587. default:
  3588. str = "Reserved";
  3589. break;
  3590. }
  3591. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  3592. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3593. "%s : Presentation Indicator: %s",
  3594. a_bigbuf,
  3595. str);
  3596. switch (oct & 0x03)
  3597. {
  3598. case 0: str = "User-provided, not screened"; break;
  3599. case 1: str = "User-provided, verified and passed"; break;
  3600. case 2: str = "User-provided, verified and failed"; break;
  3601. default:
  3602. str = "Network-provided";
  3603. break;
  3604. }
  3605. other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
  3606. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3607. "%s : Reserved",
  3608. a_bigbuf);
  3609. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  3610. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3611. "%s : Screening Indicator: %s",
  3612. a_bigbuf,
  3613. str);
  3614. curr_offset++;
  3615. }
  3616. poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
  3617. my_dgt_tbcd_unpack(a_bigbuf, poctets, len - (curr_offset - offset),
  3618. &Dgt_tbcd);
  3619. proto_tree_add_string_format(tree, hf_ansi_a_clg_party_bcd_num,
  3620. tvb, curr_offset, len - (curr_offset - offset),
  3621. a_bigbuf,
  3622. "BCD Digits: %s",
  3623. a_bigbuf);
  3624. g_snprintf(add_string, string_len, " - (%s)", a_bigbuf);
  3625. curr_offset += len - (curr_offset - offset);
  3626. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3627. return(curr_offset - offset);
  3628. }
  3629. #endif
  3630. /*
  3631. * IOS 6.2.2.54
  3632. */
  3633. static guint8
  3634. elem_qos_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3635. {
  3636. guint8 oct;
  3637. guint32 curr_offset;
  3638. curr_offset = offset;
  3639. oct = tvb_get_guint8(tvb, curr_offset);
  3640. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  3641. proto_tree_add_text(tree,
  3642. tvb, curr_offset, 1,
  3643. "%s : Reserved",
  3644. a_bigbuf);
  3645. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3646. proto_tree_add_text(tree,
  3647. tvb, curr_offset, 1,
  3648. "%s : Packet Priority: %u",
  3649. a_bigbuf,
  3650. oct & 0x0f);
  3651. g_snprintf(add_string, string_len, " - (%u)", oct & 0x0f);
  3652. curr_offset++;
  3653. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3654. return(curr_offset - offset);
  3655. }
  3656. /*
  3657. * IOS 6.2.2.55
  3658. */
  3659. static guint8
  3660. elem_cause_l3(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3661. {
  3662. guint8 oct;
  3663. guint32 curr_offset;
  3664. const gchar *str = NULL;
  3665. curr_offset = offset;
  3666. oct = tvb_get_guint8(tvb, curr_offset);
  3667. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3668. proto_tree_add_text(tree,
  3669. tvb, curr_offset, 1,
  3670. "%s : Extension",
  3671. a_bigbuf);
  3672. switch ((oct & 0x60) >> 5)
  3673. {
  3674. case 0: str = "Standard as described in ITU Recommendation Q.931"; break;
  3675. case 1: str = "Reserved for other international standards"; break;
  3676. case 2: str = "National standard"; break;
  3677. default:
  3678. str = "Reserved for other international standards";
  3679. break;
  3680. }
  3681. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  3682. proto_tree_add_text(tree,
  3683. tvb, curr_offset, 1,
  3684. "%s : Coding Standard: %s",
  3685. a_bigbuf,
  3686. str);
  3687. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  3688. proto_tree_add_text(tree,
  3689. tvb, curr_offset, 1,
  3690. "%s : Reserved",
  3691. a_bigbuf);
  3692. switch (oct & 0x0f)
  3693. {
  3694. case 0: str = "User"; break;
  3695. case 1: str = "Private network serving the local user"; break;
  3696. case 2: str = "Public network serving the local user"; break;
  3697. case 3: str = "Transit network"; break;
  3698. case 4: str = "Public network serving the remote user"; break;
  3699. case 5: str = "Private network serving the remote user"; break;
  3700. case 7: str = "International network"; break;
  3701. case 10: str = "Network beyond interworking point"; break;
  3702. default:
  3703. str = "Reserved";
  3704. break;
  3705. }
  3706. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3707. proto_tree_add_text(tree,
  3708. tvb, curr_offset, 1,
  3709. "%s : Location: %s",
  3710. a_bigbuf,
  3711. str);
  3712. curr_offset++;
  3713. oct = tvb_get_guint8(tvb, curr_offset);
  3714. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3715. proto_tree_add_text(tree,
  3716. tvb, curr_offset, 1,
  3717. "%s : Extension",
  3718. a_bigbuf);
  3719. switch ((oct & 0x70) >> 4)
  3720. {
  3721. case 0: str = "normal event"; break;
  3722. case 1: str = "normal event"; break;
  3723. case 2: str = "resource unavailable"; break;
  3724. case 3: str = "service or option not available"; break;
  3725. case 4: str = "service or option not implemented"; break;
  3726. case 5: str = "invalid message (e.g., parameter out of range)"; break;
  3727. case 6: str = "protocol error (e.g., unknown message)"; break;
  3728. default:
  3729. str = "interworking";
  3730. break;
  3731. }
  3732. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  3733. proto_tree_add_text(tree,
  3734. tvb, curr_offset, 1,
  3735. "%s : Class: (%u) %s",
  3736. a_bigbuf,
  3737. (oct & 0x70) >> 4,
  3738. str);
  3739. switch (oct & 0x7f)
  3740. {
  3741. case 0x01: str = "Unassigned (unallocated) number"; break;
  3742. case 0x03: str = "No route to destination"; break;
  3743. case 0x06: str = "Channel unacceptable"; break;
  3744. case 0x0F: str = "Procedure failed"; break;
  3745. case 0x10: str = "Normal Clearing"; break;
  3746. case 0x11: str = "User busy"; break;
  3747. case 0x12: str = "No user responding"; break;
  3748. case 0x13: str = "User alerting, no answer"; break;
  3749. case 0x15: str = "Call rejected"; break;
  3750. case 0x16: str = "Number changed New destination"; break;
  3751. case 0x1A: str = "Non selected user clearing"; break;
  3752. case 0x1B: str = "Destination out of order"; break;
  3753. case 0x1C: str = "Invalid number format (incomplete number)"; break;
  3754. case 0x1D: str = "Facility rejected"; break;
  3755. case 0x1F: str = "Normal, unspecified"; break;
  3756. case 0x22: str = "No circuit/channel available"; break;
  3757. case 0x26: str = "Network out of order"; break;
  3758. case 0x29: str = "Temporary failure"; break;
  3759. case 0x2A: str = "Switching equipment congestion"; break;
  3760. case 0x2B: str = "Access information discarded information element ids"; break;
  3761. case 0x2C: str = "requested circuit/channel not available"; break;
  3762. case 0x2F: str = "Resources unavailable, unspecified"; break;
  3763. case 0x31: str = "Quality of service unavailable"; break;
  3764. case 0x32: str = "Requested facility not subscribed"; break;
  3765. case 0x33: str = "Request MUX option or rates unavailable"; break;
  3766. case 0x39: str = "Bearer capability not authorized"; break;
  3767. case 0x3A: str = "Bearer capability not presently available"; break;
  3768. case 0x3B: str = "SSD Update Rejected"; break;
  3769. case 0x3F: str = "Service or option not available, unspecified"; break;
  3770. case 0x41: str = "Bearer service not implemented"; break;
  3771. case 0x45: str = "Requested facility not implement"; break;
  3772. case 0x46: str = "Only restricted digital information bearer capability is available"; break;
  3773. case 0x4F: str = "Service or option not implemented, unspecified"; break;
  3774. case 0x51: str = "Reserved"; break;
  3775. case 0x58: str = "Incompatible destination incompatible parameter"; break;
  3776. case 0x5B: str = "Invalid transit network selection"; break;
  3777. case 0x5F: str = "Invalid message, unspecified"; break;
  3778. case 0x60: str = "Mandatory information element error information element identifier(s)"; break;
  3779. case 0x61: str = "Message type nonexistent or not implemented message type"; break;
  3780. case 0x62: str = "Message not compatible with control state message type or message type nonexistent or not implemented"; break;
  3781. case 0x64: str = "Invalid information element contents Information element Identifier(s)"; break;
  3782. case 0x65: str = "Message not compatible with call state message type"; break;
  3783. case 0x6F: str = "Protocol error, unspecified"; break;
  3784. case 0x7F: str = "Interworking, unspecified"; break;
  3785. default:
  3786. str = "Reserved";
  3787. break;
  3788. }
  3789. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3790. proto_tree_add_text(tree,
  3791. tvb, curr_offset, 1,
  3792. "%s : Value: (%u)",
  3793. a_bigbuf,
  3794. oct & 0x0f);
  3795. g_snprintf(add_string, string_len, " - (%u) %s", oct & 0x7f, str);
  3796. curr_offset++;
  3797. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3798. return(curr_offset - offset);
  3799. }
  3800. /*
  3801. * IOS 6.2.2.56
  3802. * A3/A7
  3803. */
  3804. /*
  3805. * IOS 6.2.2.57
  3806. * A3/A7
  3807. */
  3808. /*
  3809. * IOS 6.2.2.58
  3810. */
  3811. static guint8
  3812. elem_xmode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  3813. {
  3814. guint8 oct;
  3815. guint32 curr_offset;
  3816. curr_offset = offset;
  3817. oct = tvb_get_guint8(tvb, curr_offset);
  3818. other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
  3819. proto_tree_add_text(tree,
  3820. tvb, curr_offset, 1,
  3821. "%s : Reserved",
  3822. a_bigbuf);
  3823. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  3824. proto_tree_add_text(tree,
  3825. tvb, curr_offset, 1,
  3826. "%s : TFO Mode: %s",
  3827. a_bigbuf,
  3828. (oct & 0x01) ? "TFO" : "tandem");
  3829. g_snprintf(add_string, string_len, " - (%s)",
  3830. (oct & 0x01) ? "TFO" : "tandem");
  3831. curr_offset++;
  3832. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  3833. return(curr_offset - offset);
  3834. }
  3835. /*
  3836. * IOS 6.2.2.59
  3837. * UNUSED
  3838. */
  3839. /*
  3840. * IOS 6.2.2.60
  3841. * NO ASSOCIATED DATA
  3842. */
  3843. /*
  3844. * IOS 6.2.2.61
  3845. */
  3846. static guint8
  3847. elem_reg_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3848. {
  3849. guint8 oct;
  3850. guint32 curr_offset;
  3851. const gchar *str;
  3852. curr_offset = offset;
  3853. oct = tvb_get_guint8(tvb, curr_offset);
  3854. switch (oct)
  3855. {
  3856. case 0x00: str = "Timer-based"; break;
  3857. case 0x01: str = "Power-up"; break;
  3858. case 0x02: str = "Zone-based"; break;
  3859. case 0x03: str = "Power-down"; break;
  3860. case 0x04: str = "Parameter-change"; break;
  3861. case 0x05: str = "Ordered"; break;
  3862. case 0x06: str = "Distance-based"; break;
  3863. case 0x07: str = "User Zone-based"; break;
  3864. case 0x09: str = "BCMC Registration"; break;
  3865. default:
  3866. str = "Reserved";
  3867. break;
  3868. }
  3869. proto_tree_add_text(tree,
  3870. tvb, curr_offset, 1,
  3871. "Location Registration Type: %s",
  3872. str);
  3873. g_snprintf(add_string, string_len, " - (%s)", str);
  3874. curr_offset++;
  3875. /* no length check possible */
  3876. return(curr_offset - offset);
  3877. }
  3878. /*
  3879. * IOS 6.2.2.62
  3880. */
  3881. static guint8
  3882. elem_tag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3883. {
  3884. guint32 value;
  3885. guint32 curr_offset;
  3886. curr_offset = offset;
  3887. value = tvb_get_ntohl(tvb, curr_offset);
  3888. proto_tree_add_text(tree,
  3889. tvb, curr_offset, 4,
  3890. "Tag Value: %u",
  3891. value);
  3892. g_snprintf(add_string, string_len, " - (%u)", value);
  3893. curr_offset += 4;
  3894. /* no length check possible */
  3895. return(curr_offset - offset);
  3896. }
  3897. /*
  3898. * IOS 6.2.2.63
  3899. */
  3900. static guint8
  3901. elem_hho_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  3902. {
  3903. guint8 oct;
  3904. gint temp_int;
  3905. guint32 curr_offset;
  3906. const gchar *str;
  3907. curr_offset = offset;
  3908. oct = tvb_get_guint8(tvb, curr_offset);
  3909. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  3910. proto_tree_add_text(tree,
  3911. tvb, curr_offset, 1,
  3912. "%s : Reserved",
  3913. a_bigbuf);
  3914. temp_int = oct & 0x1f;
  3915. if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
  3916. {
  3917. str = "Reserved";
  3918. }
  3919. else
  3920. {
  3921. str = band_class_str[temp_int];
  3922. }
  3923. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  3924. proto_tree_add_text(tree,
  3925. tvb, curr_offset, 1,
  3926. "%s : Band Class: %s",
  3927. a_bigbuf,
  3928. str);
  3929. curr_offset++;
  3930. g_snprintf(add_string, string_len, " - (%s)", str);
  3931. oct = tvb_get_guint8(tvb, curr_offset);
  3932. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  3933. proto_tree_add_text(tree,
  3934. tvb, curr_offset, 1,
  3935. "%s : Number of Preamble Frames: %u",
  3936. a_bigbuf,
  3937. (oct & 0xe0) >> 5);
  3938. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  3939. proto_tree_add_text(tree,
  3940. tvb, curr_offset, 1,
  3941. "%s : Reset L2: %s Layer 2 Acknowledgement",
  3942. a_bigbuf,
  3943. (oct & 0x10) ? "Reset" : "Do not reset");
  3944. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  3945. proto_tree_add_text(tree,
  3946. tvb, curr_offset, 1,
  3947. "%s : Reset FPC: %s counters",
  3948. a_bigbuf,
  3949. (oct & 0x10) ? "Reset" : "Do not reset");
  3950. switch ((oct & 0x06) >> 1)
  3951. {
  3952. case 0: str = "Encryption disabled"; break;
  3953. case 1: str = "Encryption enabled"; break;
  3954. default:
  3955. str = "Unknown";
  3956. break;
  3957. }
  3958. other_decode_bitfield_value(a_bigbuf, oct, 0x06, 8);
  3959. proto_tree_add_text(tree,
  3960. tvb, curr_offset, 1,
  3961. "%s : Encryption Mode: %s",
  3962. a_bigbuf,
  3963. str);
  3964. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  3965. proto_tree_add_text(tree,
  3966. tvb, curr_offset, 1,
  3967. "%s : Private LCM: %s Private Long Code Mask",
  3968. a_bigbuf,
  3969. (oct & 0x01) ? "Use" : "Do not use");
  3970. curr_offset++;
  3971. oct = tvb_get_guint8(tvb, curr_offset);
  3972. switch (global_a_variant)
  3973. {
  3974. case A_VARIANT_IOS401:
  3975. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  3976. proto_tree_add_text(tree,
  3977. tvb, curr_offset, 1,
  3978. "%s : Reserved",
  3979. a_bigbuf);
  3980. break;
  3981. case A_VARIANT_IOS501:
  3982. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  3983. proto_tree_add_text(tree,
  3984. tvb, curr_offset, 1,
  3985. "%s : Rev_Pwr_Cntl_Delay_Incl",
  3986. a_bigbuf);
  3987. other_decode_bitfield_value(a_bigbuf, oct, 0x60, 8);
  3988. proto_tree_add_text(tree, tvb, curr_offset, 1,
  3989. "%s : Rev_Pwr_Cntl_Delay",
  3990. a_bigbuf);
  3991. break;
  3992. }
  3993. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  3994. proto_tree_add_text(tree,
  3995. tvb, curr_offset, 1,
  3996. "%s : Nom_Pwr_Ext",
  3997. a_bigbuf);
  3998. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  3999. proto_tree_add_text(tree,
  4000. tvb, curr_offset, 1,
  4001. "%s : Nom_Pwr: %u",
  4002. a_bigbuf,
  4003. oct & 0x0f);
  4004. curr_offset++;
  4005. oct = tvb_get_guint8(tvb, curr_offset);
  4006. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  4007. proto_tree_add_text(tree,
  4008. tvb, curr_offset, 1,
  4009. "%s : Reserved",
  4010. a_bigbuf);
  4011. other_decode_bitfield_value(a_bigbuf, oct, 0x3e, 8);
  4012. proto_tree_add_text(tree,
  4013. tvb, curr_offset, 1,
  4014. "%s : FPC Subchannel Information: %u",
  4015. a_bigbuf,
  4016. (oct & 0x3e) >> 1);
  4017. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4018. proto_tree_add_text(tree,
  4019. tvb, curr_offset, 1,
  4020. "%s : FPC Subchannel Information Included",
  4021. a_bigbuf);
  4022. curr_offset++;
  4023. oct = tvb_get_guint8(tvb, curr_offset);
  4024. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  4025. proto_tree_add_text(tree,
  4026. tvb, curr_offset, 1,
  4027. "%s : Reserved",
  4028. a_bigbuf);
  4029. other_decode_bitfield_value(a_bigbuf, oct, 0x0e, 8);
  4030. proto_tree_add_text(tree,
  4031. tvb, curr_offset, 1,
  4032. "%s : Power Control Step: %u",
  4033. a_bigbuf,
  4034. (oct & 0x0e) >> 1);
  4035. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4036. proto_tree_add_text(tree,
  4037. tvb, curr_offset, 1,
  4038. "%s : Power Control Step Included",
  4039. a_bigbuf);
  4040. curr_offset++;
  4041. /* no length check possible */
  4042. return(curr_offset - offset);
  4043. }
  4044. /*
  4045. * IOS 6.2.2.64
  4046. * UNUSED
  4047. */
  4048. /*
  4049. * IOS 6.2.2.65
  4050. */
  4051. static guint8
  4052. elem_sw_ver(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  4053. {
  4054. guint8 major, minor, point;
  4055. guint32 curr_offset;
  4056. curr_offset = offset;
  4057. major = tvb_get_guint8(tvb, curr_offset);
  4058. proto_tree_add_text(tree,
  4059. tvb, curr_offset, 1,
  4060. "IOS Major Revision Level: %u",
  4061. major);
  4062. curr_offset++;
  4063. minor = tvb_get_guint8(tvb, curr_offset);
  4064. proto_tree_add_text(tree,
  4065. tvb, curr_offset, 1,
  4066. "IOS Minor Revision Level: %u",
  4067. minor);
  4068. curr_offset++;
  4069. point = tvb_get_guint8(tvb, curr_offset);
  4070. proto_tree_add_text(tree,
  4071. tvb, curr_offset, 1,
  4072. "IOS Point Revision Level: %u",
  4073. point);
  4074. curr_offset++;
  4075. g_snprintf(add_string, string_len, " - (IOS %u.%u.%u)", major, minor, point);
  4076. if (len > 3)
  4077. {
  4078. proto_tree_add_text(tree, tvb, curr_offset, len - 3,
  4079. "Manufacturer/Carrier Software Information");
  4080. curr_offset += len - 3;
  4081. }
  4082. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4083. return(curr_offset - offset);
  4084. }
  4085. /*
  4086. * IOS 6.2.2.66
  4087. */
  4088. static guint8
  4089. elem_so(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string, int string_len)
  4090. {
  4091. guint16 value;
  4092. guint32 curr_offset;
  4093. curr_offset = offset;
  4094. value = tvb_get_ntohs(tvb, curr_offset);
  4095. other_decode_bitfield_value(a_bigbuf, value, 0x8000, 16);
  4096. proto_tree_add_text(tree,
  4097. tvb, curr_offset, 2,
  4098. "%s : Proprietary Indicator",
  4099. a_bigbuf);
  4100. other_decode_bitfield_value(a_bigbuf, value, 0x7000, 16);
  4101. proto_tree_add_text(tree,
  4102. tvb, curr_offset, 2,
  4103. "%s : Service Option Revision",
  4104. a_bigbuf);
  4105. other_decode_bitfield_value(a_bigbuf, value, 0x0fff, 16);
  4106. proto_tree_add_text(tree,
  4107. tvb, curr_offset, 2,
  4108. "%s : Base Service Option Number",
  4109. a_bigbuf);
  4110. g_snprintf(add_string, string_len, " - (%u) (0x%04x)", value, value);
  4111. proto_tree_add_uint_format(tree, hf_ansi_a_so, tvb,
  4112. curr_offset, 2, value,
  4113. "%s %s",
  4114. &add_string[3],
  4115. ansi_a_so_int_to_str(value));
  4116. curr_offset += 2;
  4117. /* no length check possible */
  4118. return(curr_offset - offset);
  4119. }
  4120. /*
  4121. * IOS 5 4.2.73
  4122. */
  4123. static guint8
  4124. elem_soci(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  4125. {
  4126. guint8 oct;
  4127. guint32 curr_offset;
  4128. curr_offset = offset;
  4129. oct = tvb_get_guint8(tvb, curr_offset);
  4130. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  4131. proto_tree_add_text(tree,
  4132. tvb, curr_offset, 1,
  4133. "%s : Reserved",
  4134. a_bigbuf);
  4135. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4136. proto_tree_add_text(tree,
  4137. tvb, curr_offset, 1,
  4138. "%s : SOCI: %u",
  4139. a_bigbuf,
  4140. oct & 0x07);
  4141. g_snprintf(add_string, string_len, " - (%u)", oct);
  4142. curr_offset++;
  4143. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4144. return(curr_offset - offset);
  4145. }
  4146. /*
  4147. * IOS 5 4.2.74
  4148. */
  4149. static guint8
  4150. elem_so_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  4151. {
  4152. guint8 oct;
  4153. guint8 num_so;
  4154. guint8 inst;
  4155. guint32 curr_offset;
  4156. proto_item *item;
  4157. proto_tree *subtree;
  4158. curr_offset = offset;
  4159. num_so = tvb_get_guint8(tvb, curr_offset);
  4160. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4161. "Number of Service Option instances: %u",
  4162. num_so);
  4163. /*
  4164. * this is in case we leave the function before the
  4165. * loop through the instances
  4166. */
  4167. g_snprintf(add_string, string_len, " - %u service options", num_so);
  4168. curr_offset++;
  4169. NO_MORE_DATA_CHECK(len);
  4170. SHORT_DATA_CHECK(len - (curr_offset - offset), 3);
  4171. inst = 1;
  4172. do
  4173. {
  4174. item =
  4175. proto_tree_add_text(tree,
  4176. tvb, curr_offset, 1,
  4177. "Service Option Instance [%u]",
  4178. inst);
  4179. subtree = proto_item_add_subtree(item, ett_so_list);
  4180. oct = tvb_get_guint8(tvb, curr_offset);
  4181. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  4182. proto_tree_add_text(subtree,
  4183. tvb, curr_offset, 1,
  4184. "%s : Reserved",
  4185. a_bigbuf);
  4186. other_decode_bitfield_value(a_bigbuf, oct, 0x38, 8);
  4187. proto_tree_add_text(subtree,
  4188. tvb, curr_offset, 1,
  4189. "%s : SR_ID: %u",
  4190. a_bigbuf,
  4191. (oct & 0x38) >> 3);
  4192. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4193. proto_tree_add_text(subtree,
  4194. tvb, curr_offset, 1,
  4195. "%s : SOCI: %u",
  4196. a_bigbuf,
  4197. oct & 0x07);
  4198. curr_offset++;
  4199. curr_offset += elem_so(tvb, pinfo, subtree, curr_offset, len, add_string, string_len);
  4200. add_string[0] = '\0';
  4201. inst++;
  4202. }
  4203. while ((len - (curr_offset - offset)) >= 3);
  4204. /*
  4205. * this is because 'add_string' was used by 'elem_so()'
  4206. */
  4207. g_snprintf(add_string, string_len, " - %u service options", num_so);
  4208. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4209. return(curr_offset - offset);
  4210. }
  4211. /*
  4212. * IOS 5 4.2.70
  4213. */
  4214. static guint8
  4215. elem_acc_net_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  4216. {
  4217. guint32 value;
  4218. guint32 sid, nid, pzid;
  4219. guint32 curr_offset;
  4220. curr_offset = offset;
  4221. value = tvb_get_ntohs(tvb, curr_offset);
  4222. sid = value & 0x7fff;
  4223. other_decode_bitfield_value(a_bigbuf, value >> 8, 0x80, 8);
  4224. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4225. "%s : Reserved",
  4226. a_bigbuf);
  4227. other_decode_bitfield_value(a_bigbuf, value >> 8, 0x7f, 8);
  4228. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4229. "%s : SID (MSB), %u",
  4230. a_bigbuf,
  4231. sid);
  4232. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  4233. proto_tree_add_text(tree, tvb, curr_offset + 1, 1,
  4234. "%s : SID (LSB)",
  4235. a_bigbuf);
  4236. curr_offset += 2;
  4237. nid = tvb_get_ntohs(tvb, curr_offset);
  4238. proto_tree_add_text(tree,
  4239. tvb, curr_offset, 2,
  4240. "NID: %u",
  4241. nid);
  4242. curr_offset += 2;
  4243. pzid = tvb_get_ntohs(tvb, curr_offset);
  4244. proto_tree_add_text(tree,
  4245. tvb, curr_offset, 2,
  4246. "PZID: %u",
  4247. pzid);
  4248. curr_offset += 2;
  4249. g_snprintf(add_string, string_len, " - (SID/NID/PZID: %u/%u/%u)", sid, nid, pzid);
  4250. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4251. return(curr_offset - offset);
  4252. }
  4253. #define ADDS_APP_UNKNOWN 0x00
  4254. #define ADDS_APP_ADS 0x01
  4255. #define ADDS_APP_FAX 0x02
  4256. #define ADDS_APP_SMS 0x03
  4257. #define ADDS_APP_OTA 0x04
  4258. #define ADDS_APP_PDS 0x05 /* aka PLD */
  4259. #define ADDS_APP_SDB 0x06
  4260. #define ADDS_APP_HRPD 0x07
  4261. #define ADDS_APP_EXT_INTL 0x3E
  4262. #define ADDS_APP_EXT 0x3F
  4263. static const value_string ansi_a_adds_strings[] = {
  4264. { ADDS_APP_UNKNOWN, "UNKNOWN" },
  4265. { ADDS_APP_ADS, "ADS" },
  4266. { ADDS_APP_FAX, "FAX" },
  4267. { ADDS_APP_SMS, "SMS" },
  4268. { ADDS_APP_OTA, "OTA" },
  4269. { ADDS_APP_PDS, "PDS" },
  4270. { ADDS_APP_SDB, "SDB" },
  4271. { ADDS_APP_HRPD, "HRPD" },
  4272. { ADDS_APP_EXT_INTL, "EXT_INTL" },
  4273. { ADDS_APP_EXT, "EXT" },
  4274. { 0, NULL}
  4275. };
  4276. /*
  4277. * IOS 6.2.2.67
  4278. */
  4279. static guint8
  4280. elem_adds_user_part(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  4281. {
  4282. guint8 oct;
  4283. guint32 value;
  4284. guint8 adds_app;
  4285. guint32 curr_offset;
  4286. const gchar *str;
  4287. tvbuff_t *adds_tvb;
  4288. gint idx;
  4289. proto_tree *subtree;
  4290. proto_item *item;
  4291. curr_offset = offset;
  4292. oct = tvb_get_guint8(tvb, curr_offset);
  4293. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  4294. proto_tree_add_text(tree,
  4295. tvb, curr_offset, 1,
  4296. "%s : Reserved",
  4297. a_bigbuf);
  4298. adds_app = oct & 0x3f;
  4299. str = try_val_to_str_idx((guint32) adds_app, ansi_a_adds_strings, &idx);
  4300. if (str == NULL)
  4301. {
  4302. str = "Reserved";
  4303. }
  4304. g_snprintf(add_string, string_len, " - (%s)", str);
  4305. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  4306. proto_tree_add_text(tree,
  4307. tvb, curr_offset, 1,
  4308. "%s : Data Burst Type: %s",
  4309. a_bigbuf,
  4310. str);
  4311. curr_offset++;
  4312. item =
  4313. proto_tree_add_text(tree, tvb, curr_offset, len - 1,
  4314. "Application Data Message");
  4315. subtree = proto_item_add_subtree(item, ett_adds_user_part);
  4316. switch (adds_app)
  4317. {
  4318. case ADDS_APP_SMS:
  4319. adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
  4320. dissector_try_uint(is637_dissector_table,
  4321. 0, adds_tvb, pinfo, g_tree);
  4322. curr_offset += (len - 1);
  4323. break;
  4324. case ADDS_APP_OTA:
  4325. adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
  4326. dissector_try_uint(is683_dissector_table,
  4327. (pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, pinfo, g_tree);
  4328. curr_offset += (len - 1);
  4329. break;
  4330. case ADDS_APP_PDS:
  4331. adds_tvb = tvb_new_subset(tvb, curr_offset, len - 1, len - 1);
  4332. dissector_try_uint(is801_dissector_table,
  4333. (pinfo->p2p_dir == P2P_DIR_RECV), adds_tvb, pinfo, g_tree);
  4334. curr_offset += (len - 1);
  4335. break;
  4336. case ADDS_APP_SDB:
  4337. /*
  4338. * no SDB dissector, push to GRE/A11 dissector ?
  4339. */
  4340. curr_offset += (len - 1);
  4341. break;
  4342. case ADDS_APP_EXT_INTL:
  4343. /*
  4344. * no generic External International dissector
  4345. */
  4346. value = tvb_get_ntohs(tvb, curr_offset);
  4347. proto_tree_add_text(subtree,
  4348. tvb, curr_offset, 2,
  4349. "Extended Burst Type - International: 0x%04x", value);
  4350. curr_offset += 2;
  4351. proto_tree_add_text(tree, tvb, curr_offset, len - (curr_offset - offset),
  4352. "Data");
  4353. curr_offset += len - (curr_offset - offset);
  4354. break;
  4355. case ADDS_APP_EXT:
  4356. value = tvb_get_ntohs(tvb, curr_offset);
  4357. proto_tree_add_text(subtree,
  4358. tvb, curr_offset, 2,
  4359. "Extended Burst Type: 0x%04x", value);
  4360. curr_offset += 2;
  4361. proto_tree_add_text(subtree, tvb, curr_offset, len - (curr_offset - offset),
  4362. "Data");
  4363. curr_offset += len - (curr_offset - offset);
  4364. break;
  4365. default:
  4366. /*
  4367. * no sub-dissectors
  4368. */
  4369. curr_offset += (len - 1);
  4370. break;
  4371. }
  4372. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4373. return(curr_offset - offset);
  4374. }
  4375. /*
  4376. * IOS 5 4.2.75
  4377. */
  4378. static guint8
  4379. elem_amps_hho_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  4380. {
  4381. guint8 oct;
  4382. guint32 curr_offset;
  4383. curr_offset = offset;
  4384. oct = tvb_get_guint8(tvb, curr_offset);
  4385. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  4386. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4387. "%s : Reserved",
  4388. a_bigbuf);
  4389. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  4390. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4391. "%s : Encryption Mode: (%u) %s",
  4392. a_bigbuf,
  4393. oct & 0x03,
  4394. (oct & 0x03) ? "enabled" : "disabled");
  4395. curr_offset++;
  4396. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4397. return(curr_offset - offset);
  4398. }
  4399. /*
  4400. * IOS 6.2.2.68
  4401. */
  4402. static guint8
  4403. elem_is2000_scr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  4404. {
  4405. guint8 oct, num_con_rec, ii;
  4406. guint8 bit_mask, bit_offset;
  4407. guint32 curr_offset, saved_offset;
  4408. guint32 value;
  4409. guint is2000_portion_len;
  4410. proto_tree *scr_subtree, *subtree;
  4411. proto_item *item = NULL;
  4412. const gchar *str = NULL;
  4413. curr_offset = offset;
  4414. oct = tvb_get_guint8(tvb, curr_offset);
  4415. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  4416. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4417. "%s : Reserved",
  4418. a_bigbuf);
  4419. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4420. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4421. "%s : Bit-Exact Length Fill Bits: %u",
  4422. a_bigbuf,
  4423. oct & 0x07);
  4424. curr_offset++;
  4425. is2000_portion_len = len - (curr_offset - offset);
  4426. /*
  4427. * the following decode was modified from the packet-ansi_map.c version
  4428. */
  4429. SHORT_DATA_CHECK(is2000_portion_len, 7);
  4430. saved_offset = curr_offset;
  4431. item =
  4432. proto_tree_add_text(tree, tvb, curr_offset,
  4433. is2000_portion_len,
  4434. "IS-2000 Service Configuration Record Content");
  4435. scr_subtree =
  4436. proto_item_add_subtree(item, ett_scr);
  4437. proto_tree_add_text(scr_subtree, tvb,
  4438. curr_offset, 2,
  4439. "FOR_MUX_OPTION: Forward Traffic Channel multiplex option");
  4440. curr_offset += 2;
  4441. proto_tree_add_text(scr_subtree, tvb,
  4442. curr_offset, 2,
  4443. "REV_MUX_OPTION: Reverse Traffic Channel multiplex option");
  4444. curr_offset += 2;
  4445. proto_tree_add_text(scr_subtree, tvb,
  4446. curr_offset, 1,
  4447. "FOR_RATES: Transmission rates of the Forward Fundamental Channel");
  4448. curr_offset += 1;
  4449. proto_tree_add_text(scr_subtree, tvb,
  4450. curr_offset, 1,
  4451. "REV_RATES: Transmission rates of the Reverse Fundamental Channel");
  4452. curr_offset += 1;
  4453. num_con_rec = tvb_get_guint8(tvb, curr_offset);
  4454. proto_tree_add_text(scr_subtree, tvb,
  4455. curr_offset, 1,
  4456. "NUM_CON_REC: Number of service option connection records, %u",
  4457. num_con_rec);
  4458. curr_offset += 1;
  4459. for (ii=0; ii < num_con_rec; ii++)
  4460. {
  4461. oct = tvb_get_guint8(tvb, curr_offset);
  4462. item =
  4463. proto_tree_add_text(scr_subtree, tvb,
  4464. curr_offset, oct /* oct already includes the length octet itself */,
  4465. "Service option connection record [%u]", ii+1);
  4466. subtree =
  4467. proto_item_add_subtree(item, ett_srvc_con_rec);
  4468. curr_offset += 1;
  4469. oct = tvb_get_guint8(tvb, curr_offset);
  4470. proto_tree_add_text(subtree, tvb,
  4471. curr_offset, 1,
  4472. "CON_REF: Service option connection reference, %u",
  4473. oct);
  4474. curr_offset += 1;
  4475. value = tvb_get_ntohs(tvb, curr_offset);
  4476. proto_tree_add_text(subtree, tvb,
  4477. curr_offset, 2,
  4478. "SERVICE_OPTION: %s",
  4479. ansi_a_so_int_to_str(value));
  4480. curr_offset += 2;
  4481. oct = tvb_get_guint8(tvb, curr_offset);
  4482. switch ((oct & 0xf0) >> 4)
  4483. {
  4484. case 0x00: str = "The service option connection does not use Forward Traffic Channel traffic."; break;
  4485. case 0x01: str = "The service option connection uses primary traffic on the Forward Traffic Channel."; break;
  4486. case 0x02: str = "The service option connection uses secondary traffic on the Forward Traffic Channel."; break;
  4487. default: str = "Reserved"; break;
  4488. }
  4489. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  4490. proto_tree_add_text(subtree, tvb,
  4491. curr_offset, 1,
  4492. "%s : FOR_TRAFFIC: Forward Traffic Channel traffic type, %s",
  4493. a_bigbuf,
  4494. str);
  4495. switch (oct & 0x0f)
  4496. {
  4497. case 0x00: str = "The service option connection does not use Reverse Traffic Channel traffic."; break;
  4498. case 0x01: str = "The service option connection uses primary traffic on the Reverse Traffic Channel."; break;
  4499. case 0x02: str = "The service option connection uses secondary traffic on the Reverse Traffic Channel."; break;
  4500. default: str = "Reserved"; break;
  4501. }
  4502. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  4503. proto_tree_add_text(subtree, tvb,
  4504. curr_offset, 1,
  4505. "%s : REV_TRAFFIC: Reverse Traffic Channel traffic type, %s",
  4506. a_bigbuf,
  4507. str);
  4508. curr_offset += 1;
  4509. oct = tvb_get_guint8(tvb, curr_offset);
  4510. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  4511. proto_tree_add_text(subtree, tvb,
  4512. curr_offset, 1,
  4513. "%s : UI_ENCRYPT_MODE: Encryption mode indicator for user information privacy",
  4514. a_bigbuf);
  4515. other_decode_bitfield_value(a_bigbuf, oct, 0x1c, 8);
  4516. proto_tree_add_text(subtree, tvb,
  4517. curr_offset, 1,
  4518. "%s : SR_ID: Service reference identifier",
  4519. a_bigbuf);
  4520. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  4521. proto_tree_add_text(subtree, tvb,
  4522. curr_offset, 1,
  4523. "%s : RLP_INFO_INCL: RLP information included indicator",
  4524. a_bigbuf);
  4525. if (oct & 0x02)
  4526. {
  4527. value = (oct & 0x01) << 3;
  4528. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4529. curr_offset += 1;
  4530. oct = tvb_get_guint8(tvb, curr_offset);
  4531. value |= (oct & 0xe0) >> 5;
  4532. proto_tree_add_text(subtree, tvb,
  4533. curr_offset - 1, 1,
  4534. "%s : RLP_BLOB_LEN (MSB), %u",
  4535. a_bigbuf,
  4536. value);
  4537. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  4538. proto_tree_add_text(subtree, tvb,
  4539. curr_offset, 1,
  4540. "%s : RLP_BLOB_LEN (LSB)",
  4541. a_bigbuf);
  4542. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  4543. proto_tree_add_text(subtree, tvb,
  4544. curr_offset, 1,
  4545. "%s : RLP_BLOB (MSB)",
  4546. a_bigbuf);
  4547. curr_offset += 1;
  4548. if (value > 1)
  4549. {
  4550. proto_tree_add_text(subtree, tvb,
  4551. curr_offset, value - 1,
  4552. "RLP_BLOB");
  4553. curr_offset += value - 1;
  4554. }
  4555. oct = tvb_get_guint8(tvb, curr_offset);
  4556. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  4557. proto_tree_add_text(subtree, tvb,
  4558. curr_offset, 1,
  4559. "%s : RLP_BLOB (LSB)",
  4560. a_bigbuf);
  4561. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  4562. proto_tree_add_text(subtree, tvb,
  4563. curr_offset, 1,
  4564. "%s : Reserved",
  4565. a_bigbuf);
  4566. }
  4567. else
  4568. {
  4569. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4570. proto_tree_add_text(subtree, tvb,
  4571. curr_offset, 1,
  4572. "%s : Reserved",
  4573. a_bigbuf);
  4574. }
  4575. curr_offset += 1;
  4576. }
  4577. oct = tvb_get_guint8(tvb, curr_offset);
  4578. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  4579. proto_tree_add_text(scr_subtree, tvb,
  4580. curr_offset, 1,
  4581. "%s : FCH_CC_INCL: Channel configuration for the Fundamental Channel included indicator",
  4582. a_bigbuf);
  4583. if (oct & 0x80)
  4584. {
  4585. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  4586. proto_tree_add_text(scr_subtree, tvb,
  4587. curr_offset, 1,
  4588. "%s : FCH_FRAME_SIZE: Fundamental Channel frame size supported indicator",
  4589. a_bigbuf);
  4590. other_decode_bitfield_value(a_bigbuf, oct, 0x3e, 8);
  4591. proto_tree_add_text(scr_subtree, tvb,
  4592. curr_offset, 1,
  4593. "%s : FOR_FCH_RC: Forward Fundamental Channel Radio Configuration, %u",
  4594. a_bigbuf,
  4595. (oct & 0x3e) >> 1);
  4596. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4597. value = (oct & 0x01) << 4;
  4598. curr_offset += 1;
  4599. oct = tvb_get_guint8(tvb, curr_offset);
  4600. value |= (oct & 0xf0) >> 4;
  4601. proto_tree_add_text(scr_subtree, tvb,
  4602. curr_offset - 1, 1,
  4603. "%s : REV_FCH_RC: Reverse Fundamental Channel Radio Configuration (MSB), %u",
  4604. a_bigbuf,
  4605. value);
  4606. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  4607. proto_tree_add_text(scr_subtree, tvb,
  4608. curr_offset, 1,
  4609. "%s : REV_FCH_RC: (LSB)",
  4610. a_bigbuf);
  4611. bit_mask = 0x08;
  4612. bit_offset = 3;
  4613. }
  4614. else
  4615. {
  4616. bit_mask = 0x40;
  4617. bit_offset = 6;
  4618. }
  4619. other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
  4620. proto_tree_add_text(scr_subtree, tvb,
  4621. curr_offset, 1,
  4622. "%s : DCCH_CC_INCL: Channel configuration for the Dedicated Control Channel included indicator",
  4623. a_bigbuf);
  4624. if (oct & bit_mask)
  4625. {
  4626. /* can't be bothered to do the rest of the decode */
  4627. proto_tree_add_text(scr_subtree, tvb,
  4628. curr_offset, (is2000_portion_len - (curr_offset - saved_offset)),
  4629. "DCCH + ? + Reserved");
  4630. curr_offset += (is2000_portion_len - (curr_offset - saved_offset));
  4631. }
  4632. else
  4633. {
  4634. bit_mask >>= 1;
  4635. bit_offset--;
  4636. other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
  4637. proto_tree_add_text(scr_subtree, tvb,
  4638. curr_offset, 1,
  4639. "%s : FOR_SCH_CC_INCL: Channel configuration for the Dedicated Control Channel included indicator",
  4640. a_bigbuf);
  4641. if (oct & bit_mask)
  4642. {
  4643. /* can't be bothered to do the rest of the decode */
  4644. proto_tree_add_text(scr_subtree, tvb,
  4645. curr_offset, (is2000_portion_len - (curr_offset - saved_offset)),
  4646. "FOR_SCH + ? + Reserved");
  4647. curr_offset += (is2000_portion_len - (curr_offset - saved_offset));
  4648. }
  4649. else
  4650. {
  4651. bit_mask >>= 1;
  4652. bit_offset--;
  4653. other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
  4654. proto_tree_add_text(scr_subtree, tvb,
  4655. curr_offset, 1,
  4656. "%s : REV_SCH_CC_INCL: Channel configuration for the Dedicated Control Channel included indicator",
  4657. a_bigbuf);
  4658. if (oct & bit_mask)
  4659. {
  4660. /* can't be bothered to do the rest of the decode */
  4661. proto_tree_add_text(scr_subtree, tvb,
  4662. curr_offset, (is2000_portion_len - (curr_offset - saved_offset)),
  4663. "REV_SCH + ? + Reserved");
  4664. curr_offset += (is2000_portion_len - (curr_offset - saved_offset));
  4665. }
  4666. else
  4667. {
  4668. bit_mask = (0xff << (8 - bit_offset));
  4669. bit_mask >>= (8 - bit_offset);
  4670. other_decode_bitfield_value(a_bigbuf, oct, bit_mask, 8);
  4671. proto_tree_add_text(scr_subtree, tvb,
  4672. curr_offset, 1,
  4673. "%s : Reserved",
  4674. a_bigbuf);
  4675. curr_offset += 1;
  4676. }
  4677. }
  4678. }
  4679. EXTRANEOUS_DATA_CHECK_EXPERT(len, curr_offset - offset);
  4680. return(curr_offset - offset);
  4681. }
  4682. /*
  4683. * IOS 6.2.2.69
  4684. */
  4685. static guint8
  4686. elem_is2000_nn_scr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  4687. {
  4688. guint8 oct;
  4689. guint32 curr_offset;
  4690. #ifndef MLUM
  4691. guint is2000_portion_len;
  4692. #endif
  4693. curr_offset = offset;
  4694. oct = tvb_get_guint8(tvb, curr_offset);
  4695. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  4696. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4697. "%s : Reserved",
  4698. a_bigbuf);
  4699. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4700. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4701. "%s : Bit-Exact Length Fill Bits: %u",
  4702. a_bigbuf,
  4703. oct & 0x07);
  4704. curr_offset++;
  4705. #ifndef MLUM
  4706. is2000_portion_len = len - (curr_offset - offset);
  4707. NO_MORE_DATA_CHECK(len);
  4708. if (is2000_portion_len > 0)
  4709. {
  4710. SHORT_DATA_CHECK(len - (curr_offset - offset), is2000_portion_len);
  4711. proto_tree_add_text(tree, tvb, curr_offset, is2000_portion_len,
  4712. "IS-2000 Non-Negotiable Service Configuration Record Content");
  4713. curr_offset += is2000_portion_len;
  4714. }
  4715. #else
  4716. #endif
  4717. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4718. return(curr_offset - offset);
  4719. }
  4720. /*
  4721. * IOS 6.2.2.70
  4722. */
  4723. static guint8
  4724. elem_is2000_mob_cap(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  4725. {
  4726. guint8 oct;
  4727. guint8 oct_len;
  4728. guint32 curr_offset;
  4729. proto_tree *subtree;
  4730. proto_item *item = NULL;
  4731. const gchar *str;
  4732. curr_offset = offset;
  4733. oct = tvb_get_guint8(tvb, curr_offset);
  4734. switch (global_a_variant)
  4735. {
  4736. case A_VARIANT_IOS401:
  4737. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  4738. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4739. "%s : Reserved",
  4740. a_bigbuf);
  4741. break;
  4742. case A_VARIANT_IOS501:
  4743. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  4744. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4745. "%s : REV_PDCH Supported: IS-2000 R-PDCH %ssupported",
  4746. a_bigbuf,
  4747. (oct & 0x80) ? "" : "not ");
  4748. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  4749. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4750. "%s : FOR_PDCH Supported: IS-2000 F-PDCH %ssupported",
  4751. a_bigbuf,
  4752. (oct & 0x40) ? "" : "not ");
  4753. other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
  4754. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4755. "%s : ERAM Supported: Enhanced Rate Adaptation Mode %ssupported",
  4756. a_bigbuf,
  4757. (oct & 0x20) ? "" : "not ");
  4758. break;
  4759. }
  4760. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  4761. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4762. "%s : DCCH Supported: IS-2000 DCCH %ssupported",
  4763. a_bigbuf,
  4764. (oct & 0x10) ? "" : "not ");
  4765. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  4766. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4767. "%s : FCH Supported: IS-2000 FCH %ssupported",
  4768. a_bigbuf,
  4769. (oct & 0x08) ? "" : "not ");
  4770. other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
  4771. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4772. "%s : OTD Supported: Orthogonal Transmit Diversity %ssupported",
  4773. a_bigbuf,
  4774. (oct & 0x04) ? "" : "not ");
  4775. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  4776. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4777. "%s : Enhanced RC CFG Supported: Radio configuration in radio class 2 %ssupported",
  4778. a_bigbuf,
  4779. (oct & 0x02) ? "" : "not ");
  4780. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4781. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4782. "%s : QPCH Supported: Quick Paging Channel %ssupported",
  4783. a_bigbuf,
  4784. (oct & 0x01) ? "" : "not ");
  4785. curr_offset++;
  4786. NO_MORE_DATA_CHECK(len);
  4787. oct_len = tvb_get_guint8(tvb, curr_offset);
  4788. proto_tree_add_text(tree,
  4789. tvb, curr_offset, 1,
  4790. "FCH Information: Bit-Exact Length Octet Count: %u",
  4791. oct_len);
  4792. curr_offset++;
  4793. NO_MORE_DATA_CHECK(len);
  4794. oct = tvb_get_guint8(tvb, curr_offset);
  4795. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  4796. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4797. "%s : Reserved",
  4798. a_bigbuf);
  4799. switch ((oct & 0x70) >> 4)
  4800. {
  4801. case 0: str = "No mobile assisted geo-location capabilities"; break;
  4802. case 1: str = "IS801 capable (Advanced Forward Link Triangulation only (AFLT))"; break;
  4803. case 2: str = "IS801 capable (Advanced Forward Link Triangulation and Global Positioning Systems"; break;
  4804. case 3: str = "Global Positioning Systems Only"; break;
  4805. default:
  4806. str = "Reserved";
  4807. break;
  4808. }
  4809. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  4810. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4811. "%s : Geo Location Type: %s",
  4812. a_bigbuf,
  4813. str);
  4814. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  4815. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4816. "%s : Geo Location Included",
  4817. a_bigbuf);
  4818. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4819. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4820. "%s : FCH Information: Bit-Exact Length Fill Bits: %u",
  4821. a_bigbuf,
  4822. oct & 0x07);
  4823. curr_offset++;
  4824. NO_MORE_DATA_CHECK(len);
  4825. if (oct_len > 0)
  4826. {
  4827. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  4828. proto_tree_add_text(tree, tvb, curr_offset, oct_len,
  4829. "FCH Information Content");
  4830. curr_offset += oct_len;
  4831. NO_MORE_DATA_CHECK(len);
  4832. }
  4833. /*
  4834. * DCCH
  4835. */
  4836. oct_len = tvb_get_guint8(tvb, curr_offset);
  4837. proto_tree_add_text(tree,
  4838. tvb, curr_offset, 1,
  4839. "DCCH Information: Bit-Exact Length Octet Count: %u",
  4840. oct_len);
  4841. curr_offset++;
  4842. NO_MORE_DATA_CHECK(len);
  4843. oct = tvb_get_guint8(tvb, curr_offset);
  4844. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  4845. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4846. "%s : Reserved",
  4847. a_bigbuf);
  4848. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4849. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4850. "%s : DCCH Information: Bit-Exact Length Fill Bits: %u",
  4851. a_bigbuf,
  4852. oct & 0x07);
  4853. curr_offset++;
  4854. NO_MORE_DATA_CHECK(len);
  4855. if (oct_len > 0)
  4856. {
  4857. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  4858. proto_tree_add_text(tree, tvb, curr_offset, oct_len,
  4859. "DCCH Information Content");
  4860. curr_offset += oct_len;
  4861. NO_MORE_DATA_CHECK(len);
  4862. }
  4863. /*
  4864. * FOR_PDCH
  4865. */
  4866. oct_len = tvb_get_guint8(tvb, curr_offset);
  4867. proto_tree_add_text(tree,
  4868. tvb, curr_offset, 1,
  4869. "FOR_PDCH Information: Bit-Exact Length Octet Count: %u",
  4870. oct_len);
  4871. curr_offset++;
  4872. NO_MORE_DATA_CHECK(len);
  4873. oct = tvb_get_guint8(tvb, curr_offset);
  4874. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  4875. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4876. "%s : Reserved",
  4877. a_bigbuf);
  4878. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4879. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4880. "%s : FOR_PDCH Information: Bit-Exact Length Fill Bits: %u",
  4881. a_bigbuf,
  4882. oct & 0x07);
  4883. curr_offset++;
  4884. NO_MORE_DATA_CHECK(len);
  4885. if (oct_len > 0)
  4886. {
  4887. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  4888. proto_tree_add_text(tree, tvb, curr_offset, oct_len,
  4889. "FOR_PDCH Information Content");
  4890. curr_offset += oct_len;
  4891. NO_MORE_DATA_CHECK(len);
  4892. }
  4893. /*
  4894. * REV_PDCH
  4895. */
  4896. oct_len = tvb_get_guint8(tvb, curr_offset);
  4897. proto_tree_add_text(tree,
  4898. tvb, curr_offset, 1,
  4899. "REV_PDCH Information: Bit-Exact Length Octet Count: %u",
  4900. oct_len);
  4901. curr_offset++;
  4902. NO_MORE_DATA_CHECK(len);
  4903. oct = tvb_get_guint8(tvb, curr_offset);
  4904. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  4905. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4906. "%s : Reserved",
  4907. a_bigbuf);
  4908. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  4909. proto_tree_add_text(tree, tvb, curr_offset, 1,
  4910. "%s : REV_PDCH Information: Bit-Exact Length Fill Bits: %u",
  4911. a_bigbuf,
  4912. oct & 0x07);
  4913. curr_offset++;
  4914. NO_MORE_DATA_CHECK(len);
  4915. if (oct_len > 0)
  4916. {
  4917. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  4918. proto_tree_add_text(tree, tvb, curr_offset, oct_len,
  4919. "REV_PDCH Information Content");
  4920. curr_offset += oct_len;
  4921. NO_MORE_DATA_CHECK(len);
  4922. }
  4923. oct = tvb_get_guint8(tvb, curr_offset);
  4924. item =
  4925. proto_tree_add_text(tree, tvb,
  4926. curr_offset, 1,
  4927. "VP Algorithms Supported%s",
  4928. oct ? "" : ": No voice privacy supported");
  4929. if (oct)
  4930. {
  4931. subtree =
  4932. proto_item_add_subtree(item, ett_vp_algs);
  4933. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  4934. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4935. "%s : %s",
  4936. a_bigbuf,
  4937. (oct & 0x80) ? "No extension" : "Extended");
  4938. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  4939. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4940. "%s : A7: Reserved",
  4941. a_bigbuf);
  4942. other_decode_bitfield_value(a_bigbuf, oct, 0x20, 8);
  4943. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4944. "%s : A6: Reserved",
  4945. a_bigbuf);
  4946. other_decode_bitfield_value(a_bigbuf, oct, 0x10, 8);
  4947. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4948. "%s : A5: Reserved",
  4949. a_bigbuf);
  4950. other_decode_bitfield_value(a_bigbuf, oct, 0x08, 8);
  4951. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4952. "%s : A4: Reserved",
  4953. a_bigbuf);
  4954. other_decode_bitfield_value(a_bigbuf, oct, 0x04, 8);
  4955. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4956. "%s : A3: Reserved",
  4957. a_bigbuf);
  4958. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  4959. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4960. "%s : A2: Advanced Encryption Standard (AES)",
  4961. a_bigbuf);
  4962. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  4963. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  4964. "%s : A1: Private long code",
  4965. a_bigbuf);
  4966. }
  4967. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4968. return(curr_offset - offset);
  4969. }
  4970. /*
  4971. * IOS 6.2.2.71
  4972. */
  4973. static guint8
  4974. elem_ptype(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  4975. {
  4976. guint32 value;
  4977. guint32 curr_offset;
  4978. const gchar *str;
  4979. curr_offset = offset;
  4980. value = tvb_get_ntohs(tvb, curr_offset);
  4981. switch (value)
  4982. {
  4983. case 0x880b: str = "PPP"; break;
  4984. case 0x8881: str = "Unstructured Byte Stream"; break;
  4985. default:
  4986. str = "Unknown";
  4987. break;
  4988. }
  4989. proto_tree_add_text(tree,
  4990. tvb, curr_offset, 2,
  4991. "(%u) %s",
  4992. value,
  4993. str);
  4994. g_snprintf(add_string, string_len, " - (%s)", str);
  4995. curr_offset += 2;
  4996. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  4997. return(curr_offset - offset);
  4998. }
  4999. /*
  5000. * IOS 6.2.2.72
  5001. */
  5002. static guint8
  5003. elem_fwd_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  5004. {
  5005. guint8 oct;
  5006. guint8 oct_len;
  5007. guint8 rec_type;
  5008. guint8 num_recs;
  5009. guint32 value;
  5010. guint32 curr_offset;
  5011. const gchar *str;
  5012. gint ett_elem_idx, idx, i;
  5013. proto_tree *subtree;
  5014. proto_item *item;
  5015. curr_offset = offset;
  5016. num_recs = 0;
  5017. while ((len - (curr_offset - offset)) >= 2)
  5018. {
  5019. num_recs++;
  5020. rec_type = tvb_get_guint8(tvb, curr_offset);
  5021. str = try_val_to_str_idx((guint32) rec_type, ansi_fwd_ms_info_rec_str, &idx);
  5022. if (str == NULL)
  5023. {
  5024. str = "Reserved";
  5025. ett_elem_idx = ett_ansi_ms_info_rec_reserved;
  5026. }
  5027. else
  5028. {
  5029. ett_elem_idx = ett_ansi_fwd_ms_info_rec[idx];
  5030. }
  5031. item =
  5032. proto_tree_add_text(tree,
  5033. tvb, curr_offset, 1,
  5034. "Information Record Type [%u]: (%u) %s",
  5035. num_recs,
  5036. rec_type,
  5037. str);
  5038. subtree = proto_item_add_subtree(item, ett_elem_idx);
  5039. curr_offset++;
  5040. oct_len = tvb_get_guint8(tvb, curr_offset);
  5041. proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
  5042. curr_offset, 1, oct_len);
  5043. curr_offset++;
  5044. if (oct_len > 0)
  5045. {
  5046. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  5047. switch (rec_type)
  5048. {
  5049. case ANSI_FWD_MS_INFO_REC_CLD_PN:
  5050. oct = tvb_get_guint8(tvb, curr_offset);
  5051. switch ((oct & 0xe0) >> 5)
  5052. {
  5053. case 0: str = "Unknown"; break;
  5054. case 1: str = "International number"; break;
  5055. case 2: str = "National number"; break;
  5056. case 3: str = "Network-specific number"; break;
  5057. case 4: str = "Subscriber number"; break;
  5058. case 5: str = "Reserved"; break;
  5059. case 6: str = "Abbreviated number"; break;
  5060. default:
  5061. str = "Reserved for extension";
  5062. break;
  5063. }
  5064. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  5065. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5066. "%s : Number Type: %s",
  5067. a_bigbuf,
  5068. str);
  5069. switch ((oct & 0x1e) >> 1)
  5070. {
  5071. case 0x00: str = "Unknown"; break;
  5072. case 0x01: str = "ISDN/Telephony Numbering"; break;
  5073. case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
  5074. case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
  5075. case 0x09: str = "Private Numbering"; break;
  5076. case 0x0f: str = "Reserved for extension"; break;
  5077. default:
  5078. str = "Reserved";
  5079. break;
  5080. }
  5081. other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
  5082. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5083. "%s : Number Plan: %s",
  5084. a_bigbuf,
  5085. str);
  5086. if (oct_len > 1)
  5087. {
  5088. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  5089. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5090. "%s : MSB of first digit",
  5091. a_bigbuf);
  5092. curr_offset++;
  5093. for (i=0; i < (oct_len - 1); i++)
  5094. {
  5095. a_bigbuf[i] = (oct & 0x01) << 7;
  5096. oct = tvb_get_guint8(tvb, curr_offset + i);
  5097. a_bigbuf[i] |= (oct & 0xfe) >> 1;
  5098. }
  5099. a_bigbuf[i] = '\0';
  5100. proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 1,
  5101. "Digits: %s",
  5102. a_bigbuf);
  5103. curr_offset += (oct_len - 2);
  5104. }
  5105. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  5106. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5107. "%s : Reserved",
  5108. a_bigbuf);
  5109. curr_offset++;
  5110. break;
  5111. case ANSI_FWD_MS_INFO_REC_CLG_PN:
  5112. value = tvb_get_ntohs(tvb, curr_offset);
  5113. oct = (value & 0xff00) >> 8;
  5114. switch ((oct & 0xe0) >> 5)
  5115. {
  5116. case 0: str = "Unknown"; break;
  5117. case 1: str = "International number"; break;
  5118. case 2: str = "National number"; break;
  5119. case 3: str = "Network-specific number"; break;
  5120. case 4: str = "Subscriber number"; break;
  5121. case 5: str = "Reserved"; break;
  5122. case 6: str = "Abbreviated number"; break;
  5123. default:
  5124. str = "Reserved for extension";
  5125. break;
  5126. }
  5127. other_decode_bitfield_value(a_bigbuf, value, 0xe000, 16);
  5128. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5129. "%s : Number Type: %s",
  5130. a_bigbuf,
  5131. str);
  5132. switch ((oct & 0x1e) >> 1)
  5133. {
  5134. case 0x00: str = "Unknown"; break;
  5135. case 0x01: str = "ISDN/Telephony Numbering"; break;
  5136. case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
  5137. case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
  5138. case 0x09: str = "Private Numbering"; break;
  5139. case 0x0f: str = "Reserved for extension"; break;
  5140. default:
  5141. str = "Reserved";
  5142. break;
  5143. }
  5144. other_decode_bitfield_value(a_bigbuf, value, 0x1e00, 16);
  5145. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5146. "%s : Number Plan: %s",
  5147. a_bigbuf,
  5148. str);
  5149. switch ((value & 0x0180) >> 7)
  5150. {
  5151. case 0: str = "Presentation allowed"; break;
  5152. case 1: str = "Presentation restricted"; break;
  5153. case 2: str = "Number not available"; break;
  5154. default:
  5155. str = "Reserved";
  5156. break;
  5157. }
  5158. other_decode_bitfield_value(a_bigbuf, value, 0x0180, 16);
  5159. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5160. "%s : Presentation Indicator (PI): %s",
  5161. a_bigbuf,
  5162. str);
  5163. switch ((value & 0x0060) >> 5)
  5164. {
  5165. case 0: str = "User-provided, not screened"; break;
  5166. case 1: str = "User-provided, verified and passed"; break;
  5167. case 2: str = "User-provided, verified and failed"; break;
  5168. default:
  5169. str = "Network-provided";
  5170. break;
  5171. }
  5172. other_decode_bitfield_value(a_bigbuf, value, 0x0060, 16);
  5173. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5174. "%s : Screening Indicator (SI): %s",
  5175. a_bigbuf,
  5176. str);
  5177. if (oct_len > 2)
  5178. {
  5179. oct = (value & 0x00ff);
  5180. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  5181. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5182. "%s : MSB of first digit",
  5183. a_bigbuf);
  5184. curr_offset += 2;
  5185. for (i=0; i < (oct_len - 2); i++)
  5186. {
  5187. a_bigbuf[i] = (oct & 0x1f) << 3;
  5188. oct = tvb_get_guint8(tvb, curr_offset + i);
  5189. a_bigbuf[i] |= (oct & 0xe0) >> 5;
  5190. }
  5191. a_bigbuf[i] = '\0';
  5192. proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 2,
  5193. "Digits: %s",
  5194. a_bigbuf);
  5195. curr_offset += (oct_len - 3);
  5196. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  5197. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5198. "%s : Reserved",
  5199. a_bigbuf);
  5200. curr_offset++;
  5201. }
  5202. else
  5203. {
  5204. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  5205. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5206. "%s : Reserved",
  5207. a_bigbuf);
  5208. curr_offset += 2;
  5209. }
  5210. break;
  5211. case ANSI_FWD_MS_INFO_REC_MW:
  5212. oct = tvb_get_guint8(tvb, curr_offset);
  5213. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5214. "Number of messages waiting: %u",
  5215. oct);
  5216. curr_offset++;
  5217. break;
  5218. default:
  5219. proto_tree_add_text(subtree,
  5220. tvb, curr_offset, oct_len,
  5221. "Record Content");
  5222. curr_offset += oct_len;
  5223. break;
  5224. }
  5225. }
  5226. }
  5227. g_snprintf(add_string, string_len, " - %u record%s",
  5228. num_recs, plurality(num_recs, "", "s"));
  5229. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  5230. return(curr_offset - offset);
  5231. }
  5232. /*
  5233. * IOS 6.2.2.72
  5234. */
  5235. static guint8
  5236. elem_rev_ms_info_recs(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  5237. {
  5238. guint8 oct;
  5239. guint8 oct_len;
  5240. guint8 rec_type;
  5241. guint8 num_recs;
  5242. guint32 value;
  5243. guint32 curr_offset, saved_offset;
  5244. const gchar *str;
  5245. gint ett_elem_idx, idx, i;
  5246. proto_tree *subtree, *subtree2;
  5247. proto_item *item;
  5248. guint8 *poctets;
  5249. curr_offset = offset;
  5250. num_recs = 0;
  5251. while ((len - (curr_offset - offset)) >= 2)
  5252. {
  5253. num_recs++;
  5254. rec_type = tvb_get_guint8(tvb, curr_offset);
  5255. str = try_val_to_str_idx((guint32) rec_type, ansi_rev_ms_info_rec_str, &idx);
  5256. if (str == NULL)
  5257. {
  5258. str = "Reserved";
  5259. ett_elem_idx = ett_ansi_ms_info_rec_reserved;
  5260. }
  5261. else
  5262. {
  5263. ett_elem_idx = ett_ansi_rev_ms_info_rec[idx];
  5264. }
  5265. item =
  5266. proto_tree_add_text(tree,
  5267. tvb, curr_offset, 1,
  5268. "Information Record Type [%u]: (%u) %s",
  5269. num_recs,
  5270. rec_type,
  5271. str);
  5272. subtree = proto_item_add_subtree(item, ett_elem_idx);
  5273. curr_offset++;
  5274. oct_len = tvb_get_guint8(tvb, curr_offset);
  5275. proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
  5276. curr_offset, 1, oct_len);
  5277. curr_offset++;
  5278. if (oct_len > 0)
  5279. {
  5280. SHORT_DATA_CHECK(len - (curr_offset - offset), oct_len);
  5281. switch (rec_type)
  5282. {
  5283. case ANSI_REV_MS_INFO_REC_KEYPAD_FAC:
  5284. poctets = tvb_get_ephemeral_string(tvb, curr_offset, oct_len);
  5285. proto_tree_add_string_format(subtree, hf_ansi_a_cld_party_ascii_num,
  5286. tvb, curr_offset, oct_len,
  5287. (gchar *) poctets,
  5288. "Digits: %s",
  5289. (gchar *) format_text(poctets, oct_len));
  5290. curr_offset += oct_len;
  5291. break;
  5292. case ANSI_REV_MS_INFO_REC_CLD_PN:
  5293. oct = tvb_get_guint8(tvb, curr_offset);
  5294. switch ((oct & 0xe0) >> 5)
  5295. {
  5296. case 0: str = "Unknown"; break;
  5297. case 1: str = "International number"; break;
  5298. case 2: str = "National number"; break;
  5299. case 3: str = "Network-specific number"; break;
  5300. case 4: str = "Subscriber number"; break;
  5301. case 5: str = "Reserved"; break;
  5302. case 6: str = "Abbreviated number"; break;
  5303. default:
  5304. str = "Reserved for extension";
  5305. break;
  5306. }
  5307. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  5308. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5309. "%s : Number Type: %s",
  5310. a_bigbuf,
  5311. str);
  5312. switch ((oct & 0x1e) >> 1)
  5313. {
  5314. case 0x00: str = "Unknown"; break;
  5315. case 0x01: str = "ISDN/Telephony Numbering"; break;
  5316. case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
  5317. case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
  5318. case 0x09: str = "Private Numbering"; break;
  5319. case 0x0f: str = "Reserved for extension"; break;
  5320. default:
  5321. str = "Reserved";
  5322. break;
  5323. }
  5324. other_decode_bitfield_value(a_bigbuf, oct, 0x1e, 8);
  5325. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5326. "%s : Number Plan: %s",
  5327. a_bigbuf,
  5328. str);
  5329. if (oct_len > 1)
  5330. {
  5331. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  5332. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5333. "%s : MSB of first digit",
  5334. a_bigbuf);
  5335. curr_offset++;
  5336. for (i=0; i < (oct_len - 1); i++)
  5337. {
  5338. a_bigbuf[i] = (oct & 0x01) << 7;
  5339. oct = tvb_get_guint8(tvb, curr_offset + i);
  5340. a_bigbuf[i] |= (oct & 0xfe) >> 1;
  5341. }
  5342. a_bigbuf[i] = '\0';
  5343. proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 1,
  5344. "Digits: %s",
  5345. a_bigbuf);
  5346. curr_offset += (oct_len - 2);
  5347. }
  5348. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  5349. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5350. "%s : Reserved",
  5351. a_bigbuf);
  5352. curr_offset++;
  5353. break;
  5354. case ANSI_REV_MS_INFO_REC_CLG_PN:
  5355. value = tvb_get_ntohs(tvb, curr_offset);
  5356. oct = (value & 0xff00) >> 8;
  5357. switch ((oct & 0xe0) >> 5)
  5358. {
  5359. case 0: str = "Unknown"; break;
  5360. case 1: str = "International number"; break;
  5361. case 2: str = "National number"; break;
  5362. case 3: str = "Network-specific number"; break;
  5363. case 4: str = "Subscriber number"; break;
  5364. case 5: str = "Reserved"; break;
  5365. case 6: str = "Abbreviated number"; break;
  5366. default:
  5367. str = "Reserved for extension";
  5368. break;
  5369. }
  5370. other_decode_bitfield_value(a_bigbuf, value, 0xe000, 16);
  5371. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5372. "%s : Number Type: %s",
  5373. a_bigbuf,
  5374. str);
  5375. switch ((oct & 0x1e) >> 1)
  5376. {
  5377. case 0x00: str = "Unknown"; break;
  5378. case 0x01: str = "ISDN/Telephony Numbering"; break;
  5379. case 0x03: str = "Data Numbering (ITU-T Rec. X.121)"; break;
  5380. case 0x04: str = "Telex Numbering (ITU-T Rec. F.69)"; break;
  5381. case 0x09: str = "Private Numbering"; break;
  5382. case 0x0f: str = "Reserved for extension"; break;
  5383. default:
  5384. str = "Reserved";
  5385. break;
  5386. }
  5387. other_decode_bitfield_value(a_bigbuf, value, 0x1e00, 16);
  5388. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5389. "%s : Number Plan: %s",
  5390. a_bigbuf,
  5391. str);
  5392. switch ((value & 0x0180) >> 7)
  5393. {
  5394. case 0: str = "Presentation allowed"; break;
  5395. case 1: str = "Presentation restricted"; break;
  5396. case 2: str = "Number not available"; break;
  5397. default:
  5398. str = "Reserved";
  5399. break;
  5400. }
  5401. other_decode_bitfield_value(a_bigbuf, value, 0x0180, 16);
  5402. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5403. "%s : Presentation Indicator (PI): %s",
  5404. a_bigbuf,
  5405. str);
  5406. switch ((value & 0x0060) >> 5)
  5407. {
  5408. case 0: str = "User-provided, not screened"; break;
  5409. case 1: str = "User-provided, verified and passed"; break;
  5410. case 2: str = "User-provided, verified and failed"; break;
  5411. default:
  5412. str = "Network-provided";
  5413. break;
  5414. }
  5415. other_decode_bitfield_value(a_bigbuf, value, 0x0060, 16);
  5416. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5417. "%s : Screening Indicator (SI): %s",
  5418. a_bigbuf,
  5419. str);
  5420. if (oct_len > 2)
  5421. {
  5422. oct = (value & 0x00ff);
  5423. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  5424. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5425. "%s : MSB of first digit",
  5426. a_bigbuf);
  5427. curr_offset += 2;
  5428. for (i=0; i < (oct_len - 2); i++)
  5429. {
  5430. a_bigbuf[i] = (oct & 0x1f) << 3;
  5431. oct = tvb_get_guint8(tvb, curr_offset + i);
  5432. a_bigbuf[i] |= (oct & 0xe0) >> 5;
  5433. }
  5434. a_bigbuf[i] = '\0';
  5435. proto_tree_add_text(subtree, tvb, curr_offset, oct_len - 2,
  5436. "Digits: %s",
  5437. a_bigbuf);
  5438. curr_offset += (oct_len - 3);
  5439. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  5440. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  5441. "%s : Reserved",
  5442. a_bigbuf);
  5443. curr_offset++;
  5444. }
  5445. else
  5446. {
  5447. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  5448. proto_tree_add_text(subtree, tvb, curr_offset, 2,
  5449. "%s : Reserved",
  5450. a_bigbuf);
  5451. curr_offset += 2;
  5452. }
  5453. break;
  5454. case ANSI_REV_MS_INFO_REC_SO_INFO:
  5455. i = 0;
  5456. saved_offset = curr_offset;
  5457. while ((oct_len - (curr_offset - saved_offset)) > 2)
  5458. {
  5459. item =
  5460. proto_tree_add_text(subtree,
  5461. tvb, curr_offset, 3,
  5462. "Service Option [%u]",
  5463. i + 1);
  5464. subtree2 = proto_item_add_subtree(item, ett_so_list);
  5465. oct = tvb_get_guint8(tvb, curr_offset);
  5466. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  5467. proto_tree_add_text(subtree2, tvb, curr_offset, 1,
  5468. "%s : Reserved",
  5469. a_bigbuf);
  5470. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  5471. proto_tree_add_text(subtree2, tvb, curr_offset, 1,
  5472. "%s : Forward Support: %s",
  5473. a_bigbuf,
  5474. (oct & 0x02) ? "TRUE" : "FALSE");
  5475. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  5476. proto_tree_add_text(subtree2, tvb, curr_offset, 1,
  5477. "%s : Reverse Support: %s",
  5478. a_bigbuf,
  5479. (oct & 0x01) ? "TRUE" : "FALSE");
  5480. curr_offset++;
  5481. value = tvb_get_ntohs(tvb, curr_offset);
  5482. str = ansi_a_so_int_to_str(value);
  5483. proto_tree_add_text(subtree2, tvb, curr_offset, 2,
  5484. "Service Option: %s (%u)",
  5485. str,
  5486. value);
  5487. proto_item_append_text(item, " - (%u) %s", value, str);
  5488. i++;
  5489. curr_offset += 2;
  5490. }
  5491. break;
  5492. default:
  5493. proto_tree_add_text(subtree,
  5494. tvb, curr_offset, oct_len,
  5495. "Record Content");
  5496. curr_offset += oct_len;
  5497. break;
  5498. }
  5499. }
  5500. }
  5501. g_snprintf(add_string, string_len, " - %u record%s",
  5502. num_recs, plurality(num_recs, "", "s"));
  5503. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  5504. return(curr_offset - offset);
  5505. }
  5506. /*
  5507. * IOS 6.2.2.73
  5508. */
  5509. static guint8
  5510. elem_ext_ho_dir_params(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  5511. {
  5512. guint8 oct;
  5513. guint32 value;
  5514. guint32 curr_offset;
  5515. const gchar *str;
  5516. curr_offset = offset;
  5517. oct = tvb_get_guint8(tvb, curr_offset);
  5518. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  5519. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5520. "%s : Search Window A Size (Srch_Win_A): %u",
  5521. a_bigbuf,
  5522. (oct & 0xf0) >> 4);
  5523. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  5524. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5525. "%s : Search Window N Size (Srch_Win_N): %u",
  5526. a_bigbuf,
  5527. oct & 0x0f);
  5528. curr_offset++;
  5529. NO_MORE_DATA_CHECK(len);
  5530. oct = tvb_get_guint8(tvb, curr_offset);
  5531. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  5532. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5533. "%s : Search Window R Size (Srch_Win_R): %u",
  5534. a_bigbuf,
  5535. (oct & 0xf0) >> 4);
  5536. value = tvb_get_guint8(tvb, curr_offset + 1);
  5537. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  5538. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5539. "%s : Add Pilot Threshold (T_Add) (MSB): %u",
  5540. a_bigbuf,
  5541. (oct & 0x0f) << 2 | (value & 0xc0) >> 6);
  5542. curr_offset++;
  5543. oct = value;
  5544. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  5545. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5546. "%s : Add Pilot Threshold (T_Add) (LSB)",
  5547. a_bigbuf);
  5548. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  5549. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5550. "%s : Drop Pilot Threshold (T_Drop): %u",
  5551. a_bigbuf,
  5552. oct & 0x3f);
  5553. curr_offset++;
  5554. NO_MORE_DATA_CHECK(len);
  5555. oct = tvb_get_guint8(tvb, curr_offset);
  5556. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  5557. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5558. "%s : Compare Threshold (T_Comp): %u",
  5559. a_bigbuf,
  5560. (oct & 0xf0) >> 4);
  5561. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  5562. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5563. "%s : Drop Timer Value (T_TDrop): %u",
  5564. a_bigbuf,
  5565. oct & 0x0f);
  5566. curr_offset++;
  5567. NO_MORE_DATA_CHECK(len);
  5568. oct = tvb_get_guint8(tvb, curr_offset);
  5569. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  5570. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5571. "%s : Neighbor Max Age (Nghbor_Max_AGE): %u",
  5572. a_bigbuf,
  5573. (oct & 0xf0) >> 4);
  5574. switch (global_a_variant)
  5575. {
  5576. case A_VARIANT_IOS401:
  5577. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  5578. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5579. "%s : Reserved",
  5580. a_bigbuf);
  5581. break;
  5582. case A_VARIANT_IOS501:
  5583. other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
  5584. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5585. "%s : Reserved",
  5586. a_bigbuf);
  5587. switch (oct & 0x03)
  5588. {
  5589. case 0: str = "Only Search Window A Size is valid"; break;
  5590. case 1: str = "Subset is valid"; break;
  5591. case 2: str = "All fields valid"; break;
  5592. default:
  5593. str = "Reserved";
  5594. break;
  5595. }
  5596. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  5597. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5598. "%s : Target BS Values Included: %s",
  5599. a_bigbuf,
  5600. str);
  5601. break;
  5602. }
  5603. curr_offset++;
  5604. NO_MORE_DATA_CHECK(len);
  5605. oct = tvb_get_guint8(tvb, curr_offset);
  5606. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  5607. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5608. "%s : Reserved",
  5609. a_bigbuf);
  5610. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  5611. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5612. "%s : SOFT_SLOPE: %u",
  5613. a_bigbuf,
  5614. oct & 0x3f);
  5615. curr_offset++;
  5616. NO_MORE_DATA_CHECK(len);
  5617. oct = tvb_get_guint8(tvb, curr_offset);
  5618. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  5619. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5620. "%s : Reserved",
  5621. a_bigbuf);
  5622. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  5623. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5624. "%s : ADD_INTERCEPT: %u",
  5625. a_bigbuf,
  5626. oct & 0x3f);
  5627. curr_offset++;
  5628. NO_MORE_DATA_CHECK(len);
  5629. oct = tvb_get_guint8(tvb, curr_offset);
  5630. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  5631. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5632. "%s : Reserved",
  5633. a_bigbuf);
  5634. other_decode_bitfield_value(a_bigbuf, oct, 0x3f, 8);
  5635. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5636. "%s : DROP_INTERCEPT: %u",
  5637. a_bigbuf,
  5638. oct & 0x3f);
  5639. curr_offset++;
  5640. NO_MORE_DATA_CHECK(len);
  5641. oct = tvb_get_guint8(tvb, curr_offset);
  5642. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5643. "Target BS P_REV: %u",
  5644. oct);
  5645. curr_offset++;
  5646. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  5647. return(curr_offset - offset);
  5648. }
  5649. /*
  5650. * IOS 6.2.2.74
  5651. * UNUSED in SPEC and no IEI!
  5652. */
  5653. /*
  5654. * IOS 6.2.2.75
  5655. * UNUSED in SPEC and no IEI!
  5656. */
  5657. /*
  5658. * IOS 6.2.2.76
  5659. * UNUSED
  5660. */
  5661. /*
  5662. * IOS 6.2.2.77
  5663. * UNUSED in SPEC and no IEI!
  5664. */
  5665. /*
  5666. * IOS 6.2.2.78
  5667. * UNUSED in SPEC and no IEI!
  5668. */
  5669. /*
  5670. * IOS 6.2.2.79
  5671. */
  5672. static guint8
  5673. elem_cdma_sowd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  5674. {
  5675. guint8 oct;
  5676. guint32 value;
  5677. guint32 curr_offset;
  5678. const gchar *str = NULL;
  5679. curr_offset = offset;
  5680. curr_offset += elem_cell_id(tvb, pinfo, tree, offset, len, add_string, string_len);
  5681. add_string[0] = '\0';
  5682. value = tvb_get_ntohs(tvb, curr_offset);
  5683. proto_tree_add_text(tree,
  5684. tvb, curr_offset, 2,
  5685. "CDMA Serving One Way Delay: %u",
  5686. value);
  5687. curr_offset += 2;
  5688. oct = tvb_get_guint8(tvb, curr_offset);
  5689. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  5690. proto_tree_add_text(tree,
  5691. tvb, curr_offset, 1,
  5692. "%s : Reserved",
  5693. a_bigbuf);
  5694. switch (oct & 0x03)
  5695. {
  5696. case 0: str = "100 nsec"; break;
  5697. case 1: str = "50 nsec"; break;
  5698. case 2: str = "1/16 CDMA PN Chip"; break;
  5699. case 3: str = "Reserved"; break;
  5700. }
  5701. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  5702. proto_tree_add_text(tree,
  5703. tvb, curr_offset, 1,
  5704. "%s : Resolution: %s",
  5705. a_bigbuf,
  5706. str);
  5707. curr_offset++;
  5708. if ((len - (curr_offset - offset)) > 1)
  5709. {
  5710. proto_tree_add_text(tree,
  5711. tvb, curr_offset, 2,
  5712. "Timestamp");
  5713. curr_offset += 2;
  5714. }
  5715. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  5716. return(curr_offset - offset);
  5717. }
  5718. /*
  5719. * IOS 6.2.2.80
  5720. * UNUSED
  5721. */
  5722. /*
  5723. * IOS 6.2.2.81
  5724. * UNUSED
  5725. */
  5726. /*
  5727. * IOS 6.2.2.82
  5728. */
  5729. static guint8
  5730. elem_re_res(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len _U_, gchar *add_string _U_, int string_len _U_)
  5731. {
  5732. guint8 oct;
  5733. guint32 curr_offset;
  5734. const gchar *str;
  5735. curr_offset = offset;
  5736. oct = tvb_get_guint8(tvb, curr_offset);
  5737. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  5738. proto_tree_add_text(tree,
  5739. tvb, curr_offset, 1,
  5740. "%s : Reserved",
  5741. a_bigbuf);
  5742. other_decode_bitfield_value(a_bigbuf, oct, 0x40, 8);
  5743. proto_tree_add_text(tree,
  5744. tvb, curr_offset, 1,
  5745. "%s : Include Priority: MSC %s include priority in Assignment Request",
  5746. a_bigbuf,
  5747. (oct & 0x40) ? "should" : "does not need to");
  5748. switch ((oct & 0x30) >> 4)
  5749. {
  5750. case 0: str = "Not reported"; break;
  5751. case 1: str = "radio environment is acceptable"; break;
  5752. case 2: str = "radio environment is marginally acceptable"; break;
  5753. default:
  5754. str = "radio environment is poor";
  5755. break;
  5756. }
  5757. other_decode_bitfield_value(a_bigbuf, oct, 0x30, 8);
  5758. proto_tree_add_text(tree,
  5759. tvb, curr_offset, 1,
  5760. "%s : Forward: %s",
  5761. a_bigbuf,
  5762. str);
  5763. switch ((oct & 0x0c) >> 2)
  5764. {
  5765. case 0: str = "Not reported"; break;
  5766. case 1: str = "radio environment is acceptable"; break;
  5767. case 2: str = "radio environment is marginally acceptable"; break;
  5768. default:
  5769. str = "radio environment is poor";
  5770. break;
  5771. }
  5772. other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
  5773. proto_tree_add_text(tree,
  5774. tvb, curr_offset, 1,
  5775. "%s : Reverse: %s",
  5776. a_bigbuf,
  5777. str);
  5778. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  5779. proto_tree_add_text(tree,
  5780. tvb, curr_offset, 1,
  5781. "%s : Alloc: resources are %sallocated",
  5782. a_bigbuf,
  5783. (oct & 0x02) ? "" : "not ");
  5784. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  5785. proto_tree_add_text(tree,
  5786. tvb, curr_offset, 1,
  5787. "%s : Avail: resources are %savailable",
  5788. a_bigbuf,
  5789. (oct & 0x01) ? "" : "not ");
  5790. curr_offset++;
  5791. /* no length check possible */
  5792. return(curr_offset - offset);
  5793. }
  5794. /*
  5795. * IOS 6.2.2.83
  5796. * UNUSED in SPEC and no IEI!
  5797. */
  5798. /*
  5799. * IOS 6.2.2.84
  5800. * UNUSED
  5801. */
  5802. /*
  5803. * IOS 6.2.2.85
  5804. * UNUSED
  5805. */
  5806. /*
  5807. * IOS 6.2.2.86
  5808. * UNUSED
  5809. */
  5810. /*
  5811. * IOS 6.2.2.87
  5812. * UNUSED
  5813. */
  5814. /*
  5815. * IOS 6.2.2.88
  5816. * UNUSED
  5817. */
  5818. /*
  5819. * IOS 6.2.2.89
  5820. * A3/A7
  5821. */
  5822. /*
  5823. * IOS 6.2.2.90
  5824. * UNUSED in SPEC and no IEI!
  5825. */
  5826. /*
  5827. * IOS 6.2.2.91
  5828. * A3/A7
  5829. */
  5830. /*
  5831. * IOS 6.2.2.92
  5832. * UNUSED
  5833. */
  5834. /*
  5835. * IOS 6.2.2.93
  5836. * UNUSED
  5837. */
  5838. /*
  5839. * IOS 6.2.2.94
  5840. * UNUSED
  5841. */
  5842. /*
  5843. * IOS 6.2.2.95
  5844. * UNUSED
  5845. */
  5846. /*
  5847. * IOS 6.2.2.96
  5848. * A3/A7
  5849. */
  5850. /*
  5851. * IOS 6.2.2.97
  5852. * A3/A7
  5853. */
  5854. /*
  5855. * IOS 6.2.2.98
  5856. * A3/A7
  5857. */
  5858. /*
  5859. * IOS 6.2.2.99
  5860. * A3/A7
  5861. */
  5862. /*
  5863. * IOS 6.2.2.100
  5864. * UNUSED
  5865. */
  5866. /*
  5867. * IOS 6.2.2.101
  5868. * UNUSED
  5869. */
  5870. /*
  5871. * IOS 6.2.2.102
  5872. * UNUSED
  5873. */
  5874. /*
  5875. * IOS 6.2.2.103
  5876. * UNUSED
  5877. */
  5878. /*
  5879. * IOS 6.2.2.104
  5880. * UNUSED
  5881. */
  5882. /*
  5883. * IOS 6.2.2.105
  5884. */
  5885. static guint8
  5886. elem_cld_party_ascii_num(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  5887. {
  5888. guint8 oct;
  5889. guint32 curr_offset;
  5890. guint8 *poctets;
  5891. const gchar *str;
  5892. curr_offset = offset;
  5893. oct = tvb_get_guint8(tvb, curr_offset);
  5894. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  5895. proto_tree_add_text(tree, tvb, curr_offset, 1,
  5896. "%s : Extension",
  5897. a_bigbuf);
  5898. switch ((oct & 0x70) >> 4)
  5899. {
  5900. case 0: str = "Unknown"; break;
  5901. case 1: str = "International number"; break;
  5902. case 2: str = "National number"; break;
  5903. case 3: str = "Network specific number"; break;
  5904. case 4: str = "Dedicated PAD access, short code"; break;
  5905. case 7: str = "Reserved for extension"; break;
  5906. default:
  5907. str = "Reserved";
  5908. break;
  5909. }
  5910. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  5911. proto_tree_add_text(tree,
  5912. tvb, curr_offset, 1,
  5913. "%s : Type of Number: %s",
  5914. a_bigbuf,
  5915. str);
  5916. switch (oct & 0x0f)
  5917. {
  5918. case 0x00: str = "Unknown"; break;
  5919. case 0x01: str = "ISDN/telephony number plan (ITU recommendation E.164/E.163)"; break;
  5920. case 0x03: str = "Data number plan (ITU recommendation X.121)"; break;
  5921. case 0x04: str = "Telex numbering plan (ITU recommendation F.69)"; break;
  5922. case 0x07: str = "Reserved for extension"; break;
  5923. case 0x08: str = "National numbering plan"; break;
  5924. case 0x09: str = "Private numbering plan"; break;
  5925. default:
  5926. str = "Reserved";
  5927. break;
  5928. }
  5929. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  5930. proto_tree_add_text(tree,
  5931. tvb, curr_offset, 1,
  5932. "%s : Numbering Plan Identification: %s",
  5933. a_bigbuf,
  5934. str);
  5935. curr_offset++;
  5936. poctets = tvb_get_ephemeral_string(tvb, curr_offset, len - (curr_offset - offset));
  5937. proto_tree_add_string_format(tree, hf_ansi_a_cld_party_ascii_num,
  5938. tvb, curr_offset, len - (curr_offset - offset),
  5939. (gchar *) poctets,
  5940. "Digits: %s",
  5941. (gchar *) format_text(poctets, len - (curr_offset - offset)));
  5942. curr_offset += len - (curr_offset - offset);
  5943. g_snprintf(add_string, string_len, " - (%s)", poctets);
  5944. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  5945. return(curr_offset - offset);
  5946. }
  5947. /*
  5948. * IOS 6.2.2.106
  5949. */
  5950. static guint8
  5951. elem_band_class(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  5952. {
  5953. guint8 oct;
  5954. guint32 curr_offset;
  5955. gint temp_int;
  5956. const gchar *str;
  5957. curr_offset = offset;
  5958. oct = tvb_get_guint8(tvb, curr_offset);
  5959. other_decode_bitfield_value(a_bigbuf, oct, 0xe0, 8);
  5960. proto_tree_add_text(tree,
  5961. tvb, curr_offset, 1,
  5962. "%s : Reserved",
  5963. a_bigbuf);
  5964. temp_int = oct & 0x1f;
  5965. if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
  5966. {
  5967. str = "Reserved";
  5968. }
  5969. else
  5970. {
  5971. str = band_class_str[temp_int];
  5972. }
  5973. other_decode_bitfield_value(a_bigbuf, oct, 0x1f, 8);
  5974. proto_tree_add_text(tree,
  5975. tvb, curr_offset, 1,
  5976. "%s : Band Class: %s",
  5977. a_bigbuf,
  5978. str);
  5979. curr_offset++;
  5980. g_snprintf(add_string, string_len, " - (%s)", str);
  5981. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  5982. return(curr_offset - offset);
  5983. }
  5984. /*
  5985. * IOS 6.2.2.107
  5986. * UNUSED
  5987. */
  5988. /*
  5989. * IOS 6.2.2.108
  5990. * A3/A7
  5991. */
  5992. /*
  5993. * IOS 6.2.2.109
  5994. * A3/A7
  5995. */
  5996. /*
  5997. * IOS 6.2.2.110
  5998. */
  5999. static guint8
  6000. elem_is2000_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6001. {
  6002. guint32 curr_offset;
  6003. curr_offset = offset;
  6004. proto_tree_add_text(tree, tvb, curr_offset, len, "IS-95/IS-2000 Cause Information");
  6005. curr_offset += len;
  6006. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6007. return(curr_offset - offset);
  6008. }
  6009. /*
  6010. * IOS 6.2.2.111
  6011. * UNUSED
  6012. */
  6013. /*
  6014. * IOS 6.2.2.112
  6015. * UNUSED
  6016. */
  6017. /*
  6018. * IOS 6.2.2.113
  6019. * UNUSED
  6020. */
  6021. /*
  6022. * IOS 6.2.2.114
  6023. */
  6024. static guint8
  6025. elem_auth_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6026. {
  6027. guint8 oct;
  6028. guint32 curr_offset;
  6029. const gchar *str;
  6030. curr_offset = offset;
  6031. if (len == 1)
  6032. {
  6033. oct = tvb_get_guint8(tvb, curr_offset);
  6034. switch (oct)
  6035. {
  6036. case 0x01: str = "Event: Authentication parameters were NOT received from mobile"; break;
  6037. case 0x02: str = "Event: RANDC mis-match"; break;
  6038. case 0x03: str = "Event: Recently requested"; break;
  6039. case 0x04: str = "Event: Direct channel assignment"; break;
  6040. default:
  6041. str = "Event";
  6042. break;
  6043. }
  6044. proto_tree_add_text(tree, tvb, curr_offset, len,
  6045. "%s", str);
  6046. }
  6047. else
  6048. {
  6049. proto_tree_add_text(tree, tvb, curr_offset, len, "Event");
  6050. }
  6051. curr_offset += len;
  6052. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6053. return(curr_offset - offset);
  6054. }
  6055. /*
  6056. * IOS 6.2.2.115
  6057. * UNUSED
  6058. */
  6059. /*
  6060. * IOS 6.2.2.116
  6061. * UNUSED
  6062. */
  6063. /*
  6064. * IOS 6.2.2.117
  6065. * UNUSED
  6066. */
  6067. /*
  6068. * IOS 6.2.2.118
  6069. * UNUSED
  6070. */
  6071. /*
  6072. * IOS 6.2.2.119
  6073. * A3/A7
  6074. */
  6075. /*
  6076. * IOS 6.2.2.120
  6077. * A3/A7
  6078. */
  6079. /*
  6080. * IOS 6.2.2.121
  6081. * A3/A7
  6082. */
  6083. /*
  6084. * IOS 6.2.2.122
  6085. * UNUSED
  6086. */
  6087. /*
  6088. * IOS 6.2.2.123
  6089. * UNUSED
  6090. */
  6091. /*
  6092. * IOS 6.2.2.124
  6093. * UNUSED
  6094. */
  6095. /*
  6096. * IOS 6.2.2.125
  6097. * A3/A7
  6098. */
  6099. /*
  6100. * IOS 6.2.2.126
  6101. * UNUSED
  6102. */
  6103. /*
  6104. * IOS 6.2.2.127
  6105. * UNUSED
  6106. */
  6107. /*
  6108. * IOS 6.2.2.128
  6109. * A3/A7
  6110. */
  6111. /*
  6112. * IOS 6.2.2.129
  6113. * UNUSED
  6114. */
  6115. /*
  6116. * IOS 6.2.2.130
  6117. * UNUSED
  6118. */
  6119. /*
  6120. * IOS 6.2.2.131
  6121. * UNUSED
  6122. */
  6123. /*
  6124. * IOS 6.2.2.132
  6125. * A3/A7
  6126. */
  6127. /*
  6128. * IOS 6.2.2.133
  6129. * UNUSED
  6130. */
  6131. /*
  6132. * IOS 6.2.2.134
  6133. * A3/A7
  6134. */
  6135. /*
  6136. * IOS 6.2.2.135
  6137. * UNUSED
  6138. */
  6139. /*
  6140. * IOS 6.2.2.136
  6141. * UNUSED
  6142. */
  6143. /*
  6144. * IOS 6.2.2.137
  6145. * Generic decode is good enough
  6146. */
  6147. /*
  6148. * IOS 6.2.2.138
  6149. */
  6150. static guint8
  6151. elem_psmm_count(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6152. {
  6153. guint8 oct;
  6154. guint32 curr_offset;
  6155. curr_offset = offset;
  6156. oct = tvb_get_guint8(tvb, curr_offset);
  6157. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  6158. proto_tree_add_text(tree,
  6159. tvb, curr_offset, 1,
  6160. "%s : Reserved",
  6161. a_bigbuf);
  6162. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  6163. proto_tree_add_text(tree,
  6164. tvb, curr_offset, 1,
  6165. "%s : PSMM Count: %u",
  6166. a_bigbuf,
  6167. oct & 0x0f);
  6168. curr_offset++;
  6169. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6170. return(curr_offset - offset);
  6171. }
  6172. /*
  6173. * IOS 6.2.2.139
  6174. */
  6175. static guint8
  6176. elem_geo_loc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6177. {
  6178. guint32 curr_offset;
  6179. curr_offset = offset;
  6180. proto_tree_add_text(tree, tvb, curr_offset, len, "Calling Geodetic Location");
  6181. curr_offset += len;
  6182. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6183. return(curr_offset - offset);
  6184. }
  6185. /*
  6186. * IOS 6.2.2.140
  6187. * UNUSED
  6188. */
  6189. /*
  6190. * IOS 6.2.2.141
  6191. * A3/A7
  6192. */
  6193. /*
  6194. * IOS 6.2.2.142
  6195. * A3/A7
  6196. */
  6197. /*
  6198. * IOS 6.2.2.143
  6199. * A3/A7
  6200. */
  6201. /*
  6202. * IOS 6.2.2.144
  6203. * A3/A7
  6204. */
  6205. /*
  6206. * IOS 6.2.2.145
  6207. * A3/A7
  6208. */
  6209. /*
  6210. * IOS 6.2.2.146
  6211. * A3/A7
  6212. */
  6213. /*
  6214. * IOS 6.2.2.147
  6215. * A3/A7
  6216. */
  6217. /*
  6218. * IOS 6.2.2.148
  6219. */
  6220. static guint8
  6221. elem_cct_group(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  6222. {
  6223. guint8 oct;
  6224. guint32 value;
  6225. guint32 curr_offset;
  6226. curr_offset = offset;
  6227. oct = tvb_get_guint8(tvb, curr_offset);
  6228. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  6229. proto_tree_add_text(tree,
  6230. tvb, curr_offset, 1,
  6231. "%s : Reserved",
  6232. a_bigbuf);
  6233. other_decode_bitfield_value(a_bigbuf, oct, 0x02, 8);
  6234. proto_tree_add_text(tree,
  6235. tvb, curr_offset, 1,
  6236. "%s : All Circuits",
  6237. a_bigbuf);
  6238. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  6239. proto_tree_add_text(tree,
  6240. tvb, curr_offset, 1,
  6241. "%s : Inclusive",
  6242. a_bigbuf);
  6243. curr_offset++;
  6244. NO_MORE_DATA_CHECK(len);
  6245. oct = tvb_get_guint8(tvb, curr_offset);
  6246. proto_tree_add_text(tree,
  6247. tvb, curr_offset, 1,
  6248. "Count: %u circuit%s",
  6249. oct, plurality(oct, "", "s"));
  6250. g_snprintf(add_string, string_len, " - %u circuit%s",
  6251. oct, plurality(oct, "", "s"));
  6252. curr_offset++;
  6253. value = tvb_get_ntohs(tvb, curr_offset);
  6254. other_decode_bitfield_value(a_bigbuf, value, 0xffe0, 16);
  6255. proto_tree_add_text(tree,
  6256. tvb, curr_offset, 2,
  6257. "%s : PCM Multiplexer: %u",
  6258. a_bigbuf,
  6259. (value & 0xffe0) >> 5);
  6260. other_decode_bitfield_value(a_bigbuf, value, 0x001f, 16);
  6261. proto_tree_add_text(tree,
  6262. tvb, curr_offset, 2,
  6263. "%s : Timeslot: %u",
  6264. a_bigbuf,
  6265. value & 0x001f);
  6266. curr_offset += 2;
  6267. NO_MORE_DATA_CHECK(len);
  6268. proto_tree_add_text(tree,
  6269. tvb, curr_offset, len - (curr_offset - offset),
  6270. "Circuit Bitmap");
  6271. curr_offset += len - (curr_offset - offset);
  6272. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6273. return(curr_offset - offset);
  6274. }
  6275. /*
  6276. * IOS 6.2.2.149
  6277. */
  6278. static guint8
  6279. elem_paca_ts(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6280. {
  6281. guint32 curr_offset;
  6282. curr_offset = offset;
  6283. proto_tree_add_text(tree, tvb, curr_offset, len, "PACA Queuing Time");
  6284. curr_offset += len;
  6285. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6286. return(curr_offset - offset);
  6287. }
  6288. /*
  6289. * IOS 6.2.2.150
  6290. */
  6291. static guint8
  6292. elem_paca_order(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  6293. {
  6294. guint8 oct;
  6295. guint32 curr_offset;
  6296. const gchar *str;
  6297. curr_offset = offset;
  6298. oct = tvb_get_guint8(tvb, curr_offset);
  6299. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  6300. proto_tree_add_text(tree,
  6301. tvb, curr_offset, 1,
  6302. "%s : Reserved",
  6303. a_bigbuf);
  6304. switch (oct & 0x07)
  6305. {
  6306. case 0: str = "Reserved"; break;
  6307. case 1: str = "Update Queue Position and notify MS"; break;
  6308. case 2: str = "Remove MS from the queue and release MS"; break;
  6309. case 3: str = "Remove MS from the queue"; break;
  6310. case 4: str = "MS Requested PACA Cancel"; break;
  6311. case 5: str = "BS Requested PACA Cancel"; break;
  6312. default:
  6313. str = "Reserved";
  6314. break;
  6315. }
  6316. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  6317. proto_tree_add_text(tree,
  6318. tvb, curr_offset, 1,
  6319. "%s : PACA Action Required: %s",
  6320. a_bigbuf,
  6321. str);
  6322. curr_offset++;
  6323. g_snprintf(add_string, string_len, " - (%s)", str);
  6324. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6325. return(curr_offset - offset);
  6326. }
  6327. /*
  6328. * IOS 6.2.2.151
  6329. */
  6330. static guint8
  6331. elem_paca_reoi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  6332. {
  6333. guint8 oct;
  6334. guint32 curr_offset;
  6335. curr_offset = offset;
  6336. oct = tvb_get_guint8(tvb, curr_offset);
  6337. other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
  6338. proto_tree_add_text(tree,
  6339. tvb, curr_offset, 1,
  6340. "%s : Reserved",
  6341. a_bigbuf);
  6342. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  6343. proto_tree_add_text(tree,
  6344. tvb, curr_offset, 1,
  6345. "%s : PACA Reorigination Indicator (PRI)",
  6346. a_bigbuf);
  6347. curr_offset++;
  6348. g_snprintf(add_string, string_len, " - (%sReorigination)", (oct & 0x01) ? "" : "Not ");
  6349. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6350. return(curr_offset - offset);
  6351. }
  6352. /*
  6353. * IOS 5 4.2.89
  6354. */
  6355. static guint8
  6356. elem_a2p_bearer_session(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6357. {
  6358. guint8 oct;
  6359. guint32 curr_offset;
  6360. curr_offset = offset;
  6361. oct = tvb_get_guint8(tvb, curr_offset);
  6362. other_decode_bitfield_value(a_bigbuf, oct, 0xc0, 8);
  6363. proto_tree_add_text(tree,
  6364. tvb, curr_offset, 1,
  6365. "%s : Reserved",
  6366. a_bigbuf);
  6367. other_decode_bitfield_value(a_bigbuf, oct, 0x38, 8);
  6368. proto_tree_add_text(tree,
  6369. tvb, curr_offset, 1,
  6370. "%s : Max Frames: %u",
  6371. a_bigbuf,
  6372. (oct & 0x38) >> 3);
  6373. other_decode_bitfield_value(a_bigbuf, oct, 0x06, 8);
  6374. proto_tree_add_text(tree,
  6375. tvb, curr_offset, 1,
  6376. "%s : Session IP Address Type: Internet Protocol IPv%s",
  6377. a_bigbuf,
  6378. ((oct & 0x06) >> 1) ? "6" : "4");
  6379. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  6380. proto_tree_add_text(tree,
  6381. tvb, curr_offset, 1,
  6382. "%s : Session Address Flag",
  6383. a_bigbuf);
  6384. curr_offset++;
  6385. if (oct & 0x01)
  6386. {
  6387. /* session address included */
  6388. if ((oct & 0x06) >> 1)
  6389. {
  6390. SHORT_DATA_CHECK(len - (curr_offset - offset), 18);
  6391. proto_tree_add_item(tree, hf_ansi_a_a2p_bearer_ipv6_addr,
  6392. tvb, curr_offset, 16, ENC_NA);
  6393. rtp_src_addr.type = AT_IPv6;
  6394. rtp_src_addr.len = 16;
  6395. rtp_src_addr.data = (guint8 *) &rtp_ipv6_addr;
  6396. tvb_get_ipv6(tvb, curr_offset, &rtp_ipv6_addr);
  6397. curr_offset += 16;
  6398. }
  6399. else
  6400. {
  6401. SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
  6402. proto_tree_add_item(tree, hf_ansi_a_a2p_bearer_ipv4_addr,
  6403. tvb, curr_offset, 4, ENC_BIG_ENDIAN);
  6404. rtp_src_addr.type = AT_IPv4;
  6405. rtp_src_addr.len = 4;
  6406. rtp_src_addr.data = (guint8 *) &rtp_ipv4_addr;
  6407. rtp_ipv4_addr = tvb_get_ipv4(tvb, curr_offset);
  6408. curr_offset += 4;
  6409. }
  6410. proto_tree_add_item(tree, hf_ansi_a_a2p_bearer_udp_port,
  6411. tvb, curr_offset, 2, ENC_BIG_ENDIAN);
  6412. rtp_port = tvb_get_ntohs(tvb, curr_offset);
  6413. curr_offset += 2;
  6414. }
  6415. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6416. return(curr_offset - offset);
  6417. }
  6418. /*
  6419. * IOS 5 4.2.90
  6420. */
  6421. static guint8
  6422. elem_a2p_bearer_format(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6423. {
  6424. guint8 oct;
  6425. proto_item *item;
  6426. proto_tree *subtree;
  6427. guint8 num_bearers;
  6428. guint32 curr_offset, orig_offset;
  6429. guint8 ip_addr_type;
  6430. gboolean ext;
  6431. guint8 ext_len;
  6432. const gchar *str;
  6433. const gchar *mime_type;
  6434. int sample_rate;
  6435. gboolean format_assigned;
  6436. gboolean in_band_format_assigned;
  6437. gboolean first_assigned_found;
  6438. gboolean rtp_dyn_payload_used;
  6439. guint8 rtp_payload_type;
  6440. GHashTable *rtp_dyn_payload;
  6441. gint *key;
  6442. encoding_name_and_rate_t *encoding_name_and_rate;
  6443. rtp_dyn_payload = g_hash_table_new(g_int_hash, g_int_equal);
  6444. rtp_dyn_payload_used = FALSE;
  6445. first_assigned_found = FALSE;
  6446. curr_offset = offset;
  6447. oct = tvb_get_guint8(tvb, curr_offset);
  6448. other_decode_bitfield_value(a_bigbuf, oct, 0xfc, 8);
  6449. proto_tree_add_text(tree,
  6450. tvb, curr_offset, 1,
  6451. "%s : Number of Bearer Formats: %u",
  6452. a_bigbuf,
  6453. (oct & 0xfc) >> 2);
  6454. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  6455. proto_tree_add_text(tree,
  6456. tvb, curr_offset, 1,
  6457. "%s : Session IP Address Type: Internet Protocol IPv%s",
  6458. a_bigbuf,
  6459. (oct & 0x03) ? "6" : "4");
  6460. ip_addr_type = (oct & 0x03);
  6461. curr_offset++;
  6462. num_bearers = 0;
  6463. while ((len - (curr_offset - offset)) > 0)
  6464. {
  6465. orig_offset = curr_offset;
  6466. item =
  6467. proto_tree_add_text(tree,
  6468. tvb, curr_offset, -1,
  6469. "Bearer Format [%u]",
  6470. num_bearers + 1);
  6471. subtree = proto_item_add_subtree(item, ett_bearer_list);
  6472. oct = tvb_get_guint8(tvb, curr_offset);
  6473. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6474. "Bearer Format Length: %u",
  6475. oct);
  6476. curr_offset++;
  6477. NO_MORE_DATA_CHECK(len);
  6478. oct = tvb_get_guint8(tvb, curr_offset);
  6479. other_decode_bitfield_value(a_bigbuf, oct, 0x80, 8);
  6480. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6481. "%s : Extension",
  6482. a_bigbuf);
  6483. ext = (oct & 0x80) ? TRUE : FALSE;
  6484. format_assigned = FALSE;
  6485. in_band_format_assigned = FALSE;
  6486. switch ((oct & 0x70) >> 4)
  6487. {
  6488. case 0: str = "Unknown"; break;
  6489. case 1:
  6490. str = "In-band signaling";
  6491. in_band_format_assigned = TRUE;
  6492. break;
  6493. case 2:
  6494. str = "Assigned";
  6495. format_assigned = TRUE;
  6496. break;
  6497. case 3: str = "Unassigned"; break;
  6498. case 4: str = "Transcoded"; break;
  6499. default:
  6500. str = "Reserved";
  6501. break;
  6502. }
  6503. other_decode_bitfield_value(a_bigbuf, oct, 0x70, 8);
  6504. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6505. "%s : Bearer Format Tag Type: %s",
  6506. a_bigbuf,
  6507. str);
  6508. /*
  6509. * assuming default sampling rate of 8000Hz
  6510. */
  6511. sample_rate = 8000;
  6512. switch (oct & 0x0f)
  6513. {
  6514. case 0: mime_type = str = "PCMU"; break;
  6515. case 1: mime_type = str = "PCMA"; break;
  6516. case 2:
  6517. str = "13K Vocoder";
  6518. mime_type = "QCELP";
  6519. break;
  6520. case 3: mime_type = str = "EVRC"; break;
  6521. case 4: mime_type = str = "EVRC0"; break;
  6522. case 5: mime_type = str = "SMV"; break;
  6523. case 6: mime_type = str = "SMV0"; break;
  6524. case 7: mime_type = str = "telephone-event"; break;
  6525. case 8: mime_type = str = "EVRCB"; break;
  6526. case 9: mime_type = str = "EVRCB0"; break;
  6527. case 10: mime_type = str = "EVRCWB"; sample_rate = 16000; break;
  6528. case 11: mime_type = str = "EVRCWB0"; sample_rate = 16000; break;
  6529. case 12: mime_type = str = "EVRCNW"; sample_rate = 16000; break;
  6530. case 13: mime_type = str = "EVRCNW0"; sample_rate = 16000; break;
  6531. default:
  6532. mime_type = str = "Reserved";
  6533. break;
  6534. }
  6535. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  6536. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6537. "%s : Bearer Format ID: %s",
  6538. a_bigbuf,
  6539. str);
  6540. proto_item_append_text(item, " - (%s)", str);
  6541. curr_offset++;
  6542. NO_MORE_DATA_CHECK(len);
  6543. oct = tvb_get_guint8(tvb, curr_offset);
  6544. rtp_payload_type = (oct & 0xfe) >> 1;
  6545. other_decode_bitfield_value(a_bigbuf, oct, 0xfe, 8);
  6546. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6547. "%s : RTP Payload Type: %u",
  6548. a_bigbuf,
  6549. rtp_payload_type);
  6550. other_decode_bitfield_value(a_bigbuf, oct, 0x01, 8);
  6551. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6552. "%s : Bearer Address Flag",
  6553. a_bigbuf);
  6554. curr_offset++;
  6555. if (oct & 0x01)
  6556. {
  6557. /* bearer address included */
  6558. if (ip_addr_type != 0)
  6559. {
  6560. SHORT_DATA_CHECK(len - (curr_offset - offset), 18);
  6561. proto_tree_add_item(subtree, hf_ansi_a_a2p_bearer_ipv6_addr,
  6562. tvb, curr_offset, 16, ENC_NA);
  6563. if (format_assigned)
  6564. {
  6565. rtp_src_addr.type = AT_IPv6;
  6566. rtp_src_addr.len = 16;
  6567. rtp_src_addr.data = (guint8 *) &rtp_ipv6_addr;
  6568. tvb_get_ipv6(tvb, curr_offset, &rtp_ipv6_addr);
  6569. }
  6570. curr_offset += 16;
  6571. }
  6572. else
  6573. {
  6574. SHORT_DATA_CHECK(len - (curr_offset - offset), 6);
  6575. proto_tree_add_item(subtree, hf_ansi_a_a2p_bearer_ipv4_addr,
  6576. tvb, curr_offset, 4, ENC_BIG_ENDIAN);
  6577. if (format_assigned)
  6578. {
  6579. rtp_src_addr.type = AT_IPv4;
  6580. rtp_src_addr.len = 4;
  6581. rtp_src_addr.data = (guint8 *) &rtp_ipv4_addr;
  6582. rtp_ipv4_addr = tvb_get_ipv4(tvb, curr_offset);
  6583. }
  6584. curr_offset += 4;
  6585. }
  6586. proto_tree_add_item(subtree, hf_ansi_a_a2p_bearer_udp_port,
  6587. tvb, curr_offset, 2, ENC_BIG_ENDIAN);
  6588. if (format_assigned)
  6589. {
  6590. rtp_port = tvb_get_ntohs(tvb, curr_offset);
  6591. }
  6592. curr_offset += 2;
  6593. }
  6594. if (ext)
  6595. {
  6596. SHORT_DATA_CHECK(len - (curr_offset - offset), 1);
  6597. oct = tvb_get_guint8(tvb, curr_offset);
  6598. ext_len = (oct & 0xf0) >> 4;
  6599. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  6600. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6601. "%s : Extension Length: %u",
  6602. a_bigbuf,
  6603. ext_len);
  6604. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  6605. proto_tree_add_text(subtree, tvb, curr_offset, 1,
  6606. "%s : Extension ID: %u",
  6607. a_bigbuf,
  6608. (oct & 0x0f));
  6609. curr_offset++;
  6610. if (ext_len > 0)
  6611. {
  6612. SHORT_DATA_CHECK(len - (curr_offset - offset), ext_len);
  6613. proto_tree_add_text(subtree, tvb, curr_offset, ext_len,
  6614. "Extension Parameter value");
  6615. curr_offset += ext_len;
  6616. }
  6617. }
  6618. proto_item_set_len(item, curr_offset - orig_offset);
  6619. if (rtp_handle &&
  6620. format_assigned &&
  6621. (first_assigned_found == FALSE))
  6622. {
  6623. key = wmem_new(wmem_file_scope(), gint);
  6624. *key = rtp_payload_type;
  6625. encoding_name_and_rate = wmem_new(wmem_file_scope(), encoding_name_and_rate_t);
  6626. encoding_name_and_rate->encoding_name = wmem_strdup(wmem_file_scope(), mime_type);
  6627. encoding_name_and_rate->sample_rate = sample_rate;
  6628. g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
  6629. rtp_dyn_payload_used = TRUE;
  6630. first_assigned_found = TRUE;
  6631. rtp_add_address(pinfo, &rtp_src_addr, rtp_port, 0, "IOS5",
  6632. pinfo->fd->num, FALSE, rtp_dyn_payload);
  6633. }
  6634. if (in_band_format_assigned)
  6635. {
  6636. key = (gint *) wmem_alloc(wmem_file_scope(), sizeof(gint));
  6637. *key = rtp_payload_type;
  6638. encoding_name_and_rate = wmem_new(wmem_file_scope(), encoding_name_and_rate_t);
  6639. encoding_name_and_rate->encoding_name = wmem_strdup(wmem_file_scope(), "telephone-event");
  6640. encoding_name_and_rate->sample_rate = sample_rate;
  6641. g_hash_table_insert(rtp_dyn_payload, key, encoding_name_and_rate);
  6642. rtp_dyn_payload_used = TRUE;
  6643. }
  6644. num_bearers++;
  6645. }
  6646. if (rtp_dyn_payload_used == FALSE)
  6647. {
  6648. rtp_free_hash_dyn_payload(rtp_dyn_payload);
  6649. }
  6650. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6651. return(curr_offset - offset);
  6652. }
  6653. /*
  6654. * IOS 5 4.2.88
  6655. */
  6656. static guint8
  6657. elem_ms_des_freq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len)
  6658. {
  6659. guint8 oct;
  6660. guint32 value;
  6661. gint temp_int;
  6662. guint32 curr_offset;
  6663. const gchar *str;
  6664. curr_offset = offset;
  6665. oct = tvb_get_guint8(tvb, curr_offset);
  6666. temp_int = (oct & 0xf8) >> 3;
  6667. if ((temp_int < 0) || (temp_int >= (gint) NUM_BAND_CLASS_STR))
  6668. {
  6669. str = "Reserved";
  6670. }
  6671. else
  6672. {
  6673. str = band_class_str[temp_int];
  6674. }
  6675. other_decode_bitfield_value(a_bigbuf, oct, 0xf8, 8);
  6676. proto_tree_add_text(tree,
  6677. tvb, curr_offset, 1,
  6678. "%s : Band Class: %s",
  6679. a_bigbuf,
  6680. str);
  6681. value = tvb_get_guint8(tvb, curr_offset + 1) | ((oct & 0x07) << 8);
  6682. other_decode_bitfield_value(a_bigbuf, oct, 0x07, 8);
  6683. proto_tree_add_text(tree, tvb, curr_offset, 1,
  6684. "%s : CDMA Channel (MSB): %u",
  6685. a_bigbuf,
  6686. value);
  6687. curr_offset++;
  6688. other_decode_bitfield_value(a_bigbuf, value & 0x00ff, 0xff, 8);
  6689. proto_tree_add_text(tree, tvb, curr_offset, 1,
  6690. "%s : CDMA Channel (LSB)",
  6691. a_bigbuf);
  6692. g_snprintf(add_string, string_len, " - (CDMA Channel: %u)", value);
  6693. curr_offset++;
  6694. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6695. return(curr_offset - offset);
  6696. }
  6697. /*
  6698. * IOS 5 4.2.87
  6699. */
  6700. static guint8
  6701. elem_plcm_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
  6702. {
  6703. guint8 oct;
  6704. guint32 curr_offset;
  6705. const gchar *str;
  6706. curr_offset = offset;
  6707. oct = tvb_get_guint8(tvb, curr_offset);
  6708. /*
  6709. * from C.S0005-D v1.0 L3 Table 3.7.2.3.2.21-5
  6710. */
  6711. switch ((oct & 0xf0) >> 4)
  6712. {
  6713. case 0x00: str = "PLCM derived from ESN or MEID"; break;
  6714. case 0x01: str = "PLCM specified by the base station"; break;
  6715. case 0x02: str = "PLCM derived from IMSI_O_S when IMSI_O is derived from IMSI_M"; break;
  6716. case 0x03: str = "PLCM derived from IMSI_O_S when IMSI_O is derived from IMSI_T"; break;
  6717. default:
  6718. str = "Reserved";
  6719. break;
  6720. }
  6721. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  6722. proto_tree_add_text(tree,
  6723. tvb, curr_offset, 1,
  6724. "%s : PLCM_TYPE: %s",
  6725. a_bigbuf,
  6726. str);
  6727. other_decode_bitfield_value(a_bigbuf, oct, 0x0c, 8);
  6728. proto_tree_add_text(tree,
  6729. tvb, curr_offset, 1,
  6730. "%s : Reserved",
  6731. a_bigbuf);
  6732. other_decode_bitfield_value(a_bigbuf, oct, 0x03, 8);
  6733. proto_tree_add_text(tree, tvb, curr_offset, 1,
  6734. "%s : PLCM_42 (MSB)",
  6735. a_bigbuf);
  6736. curr_offset++;
  6737. proto_tree_add_text(tree, tvb, curr_offset, 5, "PLCM_42");
  6738. curr_offset += 5;
  6739. EXTRANEOUS_DATA_CHECK(len, curr_offset - offset);
  6740. return(curr_offset - offset);
  6741. }
  6742. /*
  6743. * IOS 6.2.2.152
  6744. * A3/A7
  6745. */
  6746. /*
  6747. * IOS 6.2.2.153
  6748. * A3/A7
  6749. */
  6750. /*
  6751. * ORDER MUST BE MAINTAINED
  6752. *
  6753. * The value of this enum is used as an index into
  6754. * elem_1_fcn[]
  6755. *
  6756. */
  6757. typedef enum
  6758. {
  6759. ANSI_A_E_ACC_NET_ID, /* Access Network Identifiers */
  6760. ANSI_A_E_ADDS_USER_PART, /* ADDS User Part */
  6761. ANSI_A_E_AMPS_HHO_PARAM, /* AMPS Hard Handoff Parameters */
  6762. ANSI_A_E_ANCH_PDSN_ADDR, /* Anchor PDSN Address */
  6763. ANSI_A_E_ANCH_PP_ADDR, /* Anchor P-P Address */
  6764. ANSI_A_E_AUTH_CHLG_PARAM, /* Authentication Challenge Parameter */
  6765. ANSI_A_E_AUTH_CNF_PARAM, /* Authentication Confirmation Parameter (RANDC) */
  6766. ANSI_A_E_AUTH_DATA, /* Authentication Data */
  6767. ANSI_A_E_AUTH_EVENT, /* Authentication Event */
  6768. ANSI_A_E_AUTH_PARAM_COUNT, /* Authentication Parameter COUNT */
  6769. ANSI_A_E_AUTH_RESP_PARAM, /* Authentication Response Parameter */
  6770. ANSI_A_E_BAND_CLASS, /* Band Class */
  6771. ANSI_A_E_CLD_PARTY_ASCII_NUM, /* Called Party ASCII Number */
  6772. ANSI_A_E_CLD_PARTY_BCD_NUM, /* Called Party BCD Number */
  6773. ANSI_A_E_CLG_PARTY_ASCII_NUM, /* Calling Party ASCII Number */
  6774. ANSI_A_E_CAUSE, /* Cause */
  6775. ANSI_A_E_CAUSE_L3, /* Cause Layer 3 */
  6776. ANSI_A_E_CDMA_SOWD, /* CDMA Serving One Way Delay */
  6777. ANSI_A_E_CELL_ID, /* Cell Identifier */
  6778. ANSI_A_E_CELL_ID_LIST, /* Cell Identifier List */
  6779. ANSI_A_E_CHAN_NUM, /* Channel Number */
  6780. ANSI_A_E_CHAN_TYPE, /* Channel Type */
  6781. ANSI_A_E_CCT_GROUP, /* Circuit Group */
  6782. ANSI_A_E_CIC, /* Circuit Identity Code */
  6783. ANSI_A_E_CIC_EXT, /* Circuit Identity Code Extension */
  6784. ANSI_A_E_CM_INFO_TYPE_2, /* Classmark Information Type 2 */
  6785. ANSI_A_E_DOWNLINK_RE, /* Downlink Radio Environment */
  6786. ANSI_A_E_DOWNLINK_RE_LIST, /* Downlink Radio Environment List */
  6787. ANSI_A_E_ENC_INFO, /* Encryption Information */
  6788. ANSI_A_E_EXT_HO_DIR_PARAMS, /* Extended Handoff Direction Parameters */
  6789. ANSI_A_E_GEO_LOC, /* Geographic Location */
  6790. ANSI_A_E_SSCI, /* Special Service Call Indicator */
  6791. ANSI_A_E_HO_POW_LEV, /* Handoff Power Level */
  6792. ANSI_A_E_HHO_PARAMS, /* Hard Handoff Parameters */
  6793. ANSI_A_E_IE_REQD, /* Information Element Requested */
  6794. ANSI_A_E_IS2000_CHAN_ID, /* IS-2000 Channel Identity */
  6795. ANSI_A_E_IS2000_CHAN_ID_3X, /* IS-2000 Channel Identity 3X */
  6796. ANSI_A_E_IS2000_MOB_CAP, /* IS-2000 Mobile Capabilities */
  6797. ANSI_A_E_IS2000_NN_SCR, /* IS-2000 Non-Negotiable Service Configuration Record */
  6798. ANSI_A_E_IS2000_SCR, /* IS-2000 Service Configuration Record */
  6799. ANSI_A_E_IS2000_CAUSE, /* IS-95/IS-2000 Cause Value */
  6800. ANSI_A_E_IS2000_RED_RECORD, /* IS-2000 Redirection Record */
  6801. ANSI_A_E_IS95_CHAN_ID, /* IS-95 Channel Identity */
  6802. ANSI_A_E_IS95_MS_MEAS_CHAN_ID, /* IS-95 MS Measured Channel Identity */
  6803. ANSI_A_E_L3_INFO, /* Layer 3 Information */
  6804. ANSI_A_E_LAI, /* Location Area Information */
  6805. ANSI_A_E_MWI, /* Message Waiting Indication */
  6806. ANSI_A_E_MID, /* Mobile Identity */
  6807. ANSI_A_E_FWD_MS_INFO_RECS, /* (Forward) MS Information Records */
  6808. ANSI_A_E_ORIG_CI, /* Origination Continuation Indicator */
  6809. ANSI_A_E_PACA_ORDER, /* PACA Order */
  6810. ANSI_A_E_PACA_REOI, /* PACA Reorigination Indicator */
  6811. ANSI_A_E_PACA_TS, /* PACA Timestamp */
  6812. ANSI_A_E_PSP, /* Packet Session Parameters */
  6813. ANSI_A_E_PDSN_IP_ADDR, /* PDSN IP Address */
  6814. ANSI_A_E_PDI, /* Power Down Indicator */
  6815. ANSI_A_E_PRIO, /* Priority */
  6816. ANSI_A_E_P_REV, /* Protocol Revision */
  6817. ANSI_A_E_PTYPE, /* Protocol Type */
  6818. ANSI_A_E_PSMM_COUNT, /* PSMM Count */
  6819. ANSI_A_E_QOS_PARAMS, /* Quality of Service Parameters */
  6820. ANSI_A_E_RE_RES, /* Radio Environment and Resources */
  6821. ANSI_A_E_REG_TYPE, /* Registration Type */
  6822. ANSI_A_E_REJ_CAUSE, /* Reject Cause */
  6823. ANSI_A_E_RESP_REQ, /* Response Request */
  6824. ANSI_A_E_RETURN_CAUSE, /* Return Cause */
  6825. ANSI_A_E_RF_CHAN_ID, /* RF Channel Identity */
  6826. ANSI_A_E_SO, /* Service Option */
  6827. ANSI_A_E_SOCI, /* Service Option Connection Identifier (SOCI) */
  6828. ANSI_A_E_SO_LIST, /* Service Option List */
  6829. ANSI_A_E_S_RED_INFO, /* Service Redirection Info */
  6830. ANSI_A_E_SR_ID, /* Service Reference Identifier (SR_ID) */
  6831. ANSI_A_E_SID, /* SID */
  6832. ANSI_A_E_SIGNAL, /* Signal */
  6833. ANSI_A_E_SCI, /* Slot Cycle Index */
  6834. ANSI_A_E_SW_VER, /* Software Version */
  6835. ANSI_A_E_SRNC_TRNC_TC, /* Source RNC to Target RNC Transparent Container */
  6836. ANSI_A_E_S_PDSN_ADDR, /* Source PDSN Address */
  6837. ANSI_A_E_TAG, /* Tag */
  6838. ANSI_A_E_TRNC_SRNC_TC, /* Target RNC to Source RNC Transparent Container */
  6839. ANSI_A_E_XMODE, /* Transcoder Mode */
  6840. ANSI_A_E_UZ_ID, /* User Zone ID */
  6841. ANSI_A_E_VP_REQ, /* Voice Privacy Request */
  6842. ANSI_A_E_A2P_BEARER_SESSION, /* A2p Bearer Session-Level Parameters */
  6843. ANSI_A_E_A2P_BEARER_FORMAT, /* A2p Bearer Format-Specific Parameters */
  6844. ANSI_A_E_MS_DES_FREQ, /* MS Designated Frequency */
  6845. ANSI_A_E_MOB_SUB_INFO, /* Mobile Subscription Information */
  6846. ANSI_A_E_PLCM_ID, /* Public Long Code Mask Identifier */
  6847. ANSI_A_E_REV_MS_INFO_RECS, /* (Reverse) MS Information Records */
  6848. ANSI_A_E_NONE /* NONE */
  6849. }
  6850. elem_idx_t;
  6851. static elem_idx_t ansi_a_elem_1_max = (elem_idx_t)0;
  6852. #define MAX_IOS401_NUM_ELEM_1 (sizeof(ansi_a_ios401_elem_1_strings)/sizeof(ext_value_string_t))
  6853. #define MAX_IOS501_NUM_ELEM_1 (sizeof(ansi_a_ios501_elem_1_strings)/sizeof(ext_value_string_t))
  6854. static gint ett_ansi_elem_1[MAX(MAX_IOS401_NUM_ELEM_1, MAX_IOS501_NUM_ELEM_1)];
  6855. static guint8 (*elem_1_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len) =
  6856. {
  6857. elem_acc_net_id, /* Access Network Identifiers */
  6858. elem_adds_user_part, /* ADDS User Part */
  6859. elem_amps_hho_param, /* AMPS Hard Handoff Parameters */
  6860. elem_anchor_pdsn_addr, /* Anchor PDSN Address */
  6861. elem_anchor_pp_addr, /* Anchor P-P Address */
  6862. elem_auth_chlg_param, /* Authentication Challenge Parameter */
  6863. NULL /* no decode required */, /* Authentication Confirmation Parameter (RANDC) */
  6864. NULL /* no decode required */, /* Authentication Data */
  6865. elem_auth_event, /* Authentication Event */
  6866. elem_auth_param_count, /* Authentication Parameter COUNT */
  6867. elem_auth_resp_param, /* Authentication Response Parameter */
  6868. elem_band_class, /* Band Class */
  6869. elem_cld_party_ascii_num, /* Called Party ASCII Number */
  6870. elem_cld_party_bcd_num, /* Called Party BCD Number */
  6871. elem_clg_party_ascii_num, /* Calling Party ASCII Number */
  6872. elem_cause, /* Cause */
  6873. elem_cause_l3, /* Cause Layer 3 */
  6874. elem_cdma_sowd, /* CDMA Serving One Way Delay */
  6875. elem_cell_id, /* Cell Identifier */
  6876. elem_cell_id_list, /* Cell Identifier List */
  6877. elem_chan_num, /* Channel Number */
  6878. elem_chan_type, /* Channel Type */
  6879. elem_cct_group, /* Circuit Group */
  6880. elem_cic, /* Circuit Identity Code */
  6881. elem_cic_ext, /* Circuit Identity Code Extension */
  6882. elem_cm_info_type_2, /* Classmark Information Type 2 */
  6883. elem_downlink_re, /* Downlink Radio Environment */
  6884. elem_downlink_re_list, /* Downlink Radio Environment List */
  6885. elem_enc_info, /* Encryption Information */
  6886. elem_ext_ho_dir_params, /* Extended Handoff Direction Parameters */
  6887. elem_geo_loc, /* Geographic Location */
  6888. elem_ssci, /* Special Service Call Indicator */
  6889. elem_ho_pow_lev, /* Handoff Power Level */
  6890. elem_hho_params, /* Hard Handoff Parameters */
  6891. elem_info_rec_req, /* Information Element Requested */
  6892. elem_is2000_chan_id, /* IS-2000 Channel Identity */
  6893. NULL, /* IS-2000 Channel Identity 3X */
  6894. elem_is2000_mob_cap, /* IS-2000 Mobile Capabilities */
  6895. elem_is2000_nn_scr, /* IS-2000 Non-Negotiable Service Configuration Record */
  6896. elem_is2000_scr, /* IS-2000 Service Configuration Record */
  6897. elem_is2000_cause, /* IS-95/IS-2000 Cause Value */
  6898. NULL, /* IS-2000 Redirection Record */
  6899. elem_is95_chan_id, /* IS-95 Channel Identity */
  6900. elem_is95_ms_meas_chan_id, /* IS-95 MS Measured Channel Identity */
  6901. elem_l3_info, /* Layer 3 Information */
  6902. elem_lai, /* Location Area Information */
  6903. elem_mwi, /* Message Waiting Indication */
  6904. elem_mid, /* Mobile Identity */
  6905. elem_fwd_ms_info_recs, /* (Forward) MS Information Records */
  6906. NULL /* no associated data */, /* Origination Continuation Indicator */
  6907. elem_paca_order, /* PACA Order */
  6908. elem_paca_reoi, /* PACA Reorigination Indicator */
  6909. elem_paca_ts, /* PACA Timestamp */
  6910. NULL, /* Packet Session Parameters */
  6911. elem_pdsn_ip_addr, /* PDSN IP Address */
  6912. NULL /* no associated data */, /* Power Down Indicator */
  6913. elem_prio, /* Priority */
  6914. elem_p_rev, /* Protocol Revision */
  6915. elem_ptype, /* Protocol Type */
  6916. elem_psmm_count, /* PSMM Count */
  6917. elem_qos_params, /* Quality of Service Parameters */
  6918. elem_re_res, /* Radio Environment and Resources */
  6919. elem_reg_type, /* Registration Type */
  6920. elem_rej_cause, /* Reject Cause */
  6921. NULL /* no associated data */, /* Response Request */
  6922. elem_return_cause, /* Return Cause */
  6923. elem_rf_chan_id, /* RF Channel Identity */
  6924. elem_so, /* Service Option */
  6925. elem_soci, /* Service Option Connection Identifier (SOCI) */
  6926. elem_so_list, /* Service Option List */
  6927. NULL, /* Service Redirection Info */
  6928. elem_sr_id, /* Service Reference Identifier (SR_ID) */
  6929. elem_sid, /* SID */
  6930. elem_signal, /* Signal */
  6931. elem_sci, /* Slot Cycle Index */
  6932. elem_sw_ver, /* Software Version */
  6933. NULL /* transparent */, /* Source RNC to Target RNC Transparent Container */
  6934. elem_s_pdsn_ip_addr, /* Source PDSN Address */
  6935. elem_tag, /* Tag */
  6936. NULL /* transparent */, /* Target RNC to Source RNC Transparent Container */
  6937. elem_xmode, /* Transcoder Mode */
  6938. elem_uz_id, /* User Zone ID */
  6939. NULL /* no associated data */, /* Voice Privacy Request */
  6940. elem_a2p_bearer_session, /* A2p Bearer Session-Level Parameters */
  6941. elem_a2p_bearer_format, /* A2p Bearer Format-Specific Parameters */
  6942. elem_ms_des_freq, /* MS Designated Frequency */
  6943. NULL, /* Mobile Subscription Information */
  6944. elem_plcm_id, /* Public Long Code Mask Identification */
  6945. elem_rev_ms_info_recs, /* (Reverse) MS Information Records */
  6946. NULL, /* NONE */
  6947. };
  6948. /* MESSAGE FUNCTIONS */
  6949. /*
  6950. * Type Length Value (TLV) element dissector
  6951. */
  6952. static guint16
  6953. elem_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len _U_, const gchar *name_add)
  6954. {
  6955. guint8 oct, parm_len;
  6956. guint16 consumed;
  6957. guint32 curr_offset;
  6958. proto_tree *subtree;
  6959. proto_item *item;
  6960. gint dec_idx;
  6961. curr_offset = offset;
  6962. consumed = 0;
  6963. if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
  6964. {
  6965. /* Unknown index, skip the element */
  6966. return tvb_length_remaining(tvb, offset) ;
  6967. }
  6968. oct = tvb_get_guint8(tvb, curr_offset);
  6969. if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
  6970. {
  6971. dec_idx = ansi_a_elem_1_strings[idx].dec_index;
  6972. parm_len = tvb_get_guint8(tvb, curr_offset + 1);
  6973. item =
  6974. proto_tree_add_text(tree,
  6975. tvb, curr_offset, parm_len + 2,
  6976. "%s%s",
  6977. ansi_a_elem_1_strings[idx].strptr,
  6978. (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
  6979. subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
  6980. proto_tree_add_uint_format(subtree, hf_ansi_a_elem_id, tvb,
  6981. curr_offset, 1, oct,
  6982. "Element ID");
  6983. proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
  6984. curr_offset + 1, 1, parm_len);
  6985. if (parm_len > 0)
  6986. {
  6987. if (elem_1_fcn[dec_idx] == NULL)
  6988. {
  6989. proto_tree_add_text(subtree,
  6990. tvb, curr_offset + 2, parm_len,
  6991. "Element Value");
  6992. consumed = parm_len;
  6993. }
  6994. else
  6995. {
  6996. gchar *a_add_string;
  6997. a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
  6998. a_add_string[0] = '\0';
  6999. consumed =
  7000. (*elem_1_fcn[dec_idx])(tvb, pinfo, subtree, curr_offset + 2,
  7001. parm_len, a_add_string, 1024);
  7002. if (a_add_string[0] != '\0')
  7003. {
  7004. proto_item_append_text(item, "%s", a_add_string);
  7005. }
  7006. }
  7007. }
  7008. consumed += 2;
  7009. }
  7010. return(consumed);
  7011. }
  7012. /*
  7013. * Type Value (TV) element dissector
  7014. *
  7015. * Length cannot be used in these functions, big problem if a element dissector
  7016. * is not defined for these.
  7017. */
  7018. static guint16
  7019. elem_tv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset, const gchar *name_add)
  7020. {
  7021. guint8 oct;
  7022. guint16 consumed;
  7023. guint32 curr_offset;
  7024. proto_tree *subtree;
  7025. proto_item *item;
  7026. gint dec_idx;
  7027. curr_offset = offset;
  7028. consumed = 0;
  7029. if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
  7030. {
  7031. /* Unknown index, skip the element */
  7032. return tvb_length_remaining(tvb, offset) ;
  7033. }
  7034. oct = tvb_get_guint8(tvb, curr_offset);
  7035. if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
  7036. {
  7037. dec_idx = ansi_a_elem_1_strings[idx].dec_index;
  7038. item =
  7039. proto_tree_add_text(tree,
  7040. tvb, curr_offset, -1,
  7041. "%s%s",
  7042. ansi_a_elem_1_strings[idx].strptr,
  7043. (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
  7044. subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
  7045. proto_tree_add_uint_format(subtree, hf_ansi_a_elem_id, tvb,
  7046. curr_offset, 1, oct,
  7047. "Element ID");
  7048. if (elem_1_fcn[dec_idx] == NULL)
  7049. {
  7050. /* BAD THING, CANNOT DETERMINE LENGTH */
  7051. proto_tree_add_text(subtree,
  7052. tvb, curr_offset + 1, 1,
  7053. "No element dissector, rest of dissection may be incorrect");
  7054. consumed = 1;
  7055. }
  7056. else
  7057. {
  7058. gchar *a_add_string;
  7059. a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
  7060. a_add_string[0] = '\0';
  7061. consumed = (*elem_1_fcn[dec_idx])(tvb, pinfo, subtree, curr_offset + 1, -1, a_add_string, 1024);
  7062. if (a_add_string[0] != '\0')
  7063. {
  7064. proto_item_append_text(item, "%s", a_add_string);
  7065. }
  7066. }
  7067. consumed++;
  7068. proto_item_set_len(item, consumed);
  7069. }
  7070. return(consumed);
  7071. }
  7072. /*
  7073. * Type (T) element dissector
  7074. *
  7075. * Length cannot be used in these functions, big problem if a element dissector
  7076. * is not defined for these.
  7077. */
  7078. static guint16
  7079. elem_t(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, elem_idx_t idx, guint32 offset, const gchar *name_add)
  7080. {
  7081. guint8 oct;
  7082. guint32 curr_offset;
  7083. guint16 consumed;
  7084. curr_offset = offset;
  7085. consumed = 0;
  7086. if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
  7087. {
  7088. /* Unknown index, skip the element */
  7089. return tvb_length_remaining(tvb, offset) ;
  7090. }
  7091. oct = tvb_get_guint8(tvb, curr_offset);
  7092. if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
  7093. {
  7094. proto_tree_add_uint_format(tree, hf_ansi_a_elem_id, tvb, curr_offset, 1, oct,
  7095. "%s%s",
  7096. ansi_a_elem_1_strings[idx].strptr,
  7097. (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
  7098. consumed = 1;
  7099. }
  7100. return(consumed);
  7101. }
  7102. /*
  7103. * Length Value (LV) element dissector
  7104. */
  7105. static guint16
  7106. elem_lv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset, guint len _U_, const gchar *name_add)
  7107. {
  7108. guint8 parm_len;
  7109. guint16 consumed;
  7110. guint32 curr_offset;
  7111. proto_tree *subtree;
  7112. proto_item *item;
  7113. gint dec_idx;
  7114. curr_offset = offset;
  7115. consumed = 0;
  7116. if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
  7117. {
  7118. /* Unknown index, skip the element */
  7119. return tvb_length_remaining(tvb, offset) ;
  7120. }
  7121. dec_idx = ansi_a_elem_1_strings[idx].dec_index;
  7122. parm_len = tvb_get_guint8(tvb, curr_offset);
  7123. item =
  7124. proto_tree_add_text(tree,
  7125. tvb, curr_offset, parm_len + 1,
  7126. "%s%s",
  7127. ansi_a_elem_1_strings[idx].strptr,
  7128. (name_add == NULL) || (name_add[0] == '\0') ? "" : name_add);
  7129. subtree = proto_item_add_subtree(item, ett_ansi_elem_1[idx]);
  7130. proto_tree_add_uint(subtree, hf_ansi_a_length, tvb,
  7131. curr_offset, 1, parm_len);
  7132. if (parm_len > 0)
  7133. {
  7134. if (elem_1_fcn[dec_idx] == NULL)
  7135. {
  7136. proto_tree_add_text(subtree,
  7137. tvb, curr_offset + 1, parm_len,
  7138. "Element Value");
  7139. consumed = parm_len;
  7140. }
  7141. else
  7142. {
  7143. gchar *a_add_string;
  7144. a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
  7145. a_add_string[0] = '\0';
  7146. consumed =
  7147. (*elem_1_fcn[dec_idx])(tvb, pinfo, subtree, curr_offset + 1,
  7148. parm_len, a_add_string, 1024);
  7149. if (a_add_string[0] != '\0')
  7150. {
  7151. proto_item_append_text(item, "%s", a_add_string);
  7152. }
  7153. }
  7154. }
  7155. return(consumed + 1);
  7156. }
  7157. /*
  7158. * Value (V) element dissector
  7159. *
  7160. * Length cannot be used in these functions, big problem if a element dissector
  7161. * is not defined for these.
  7162. */
  7163. static guint16
  7164. elem_v(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, elem_idx_t idx, guint32 offset)
  7165. {
  7166. guint16 consumed;
  7167. guint32 curr_offset;
  7168. gint dec_idx;
  7169. curr_offset = offset;
  7170. if ((int)idx < 0 || idx >= ansi_a_elem_1_max-1)
  7171. {
  7172. /* Unknown index, skip the element */
  7173. return tvb_length_remaining(tvb, offset) ;
  7174. }
  7175. dec_idx = ansi_a_elem_1_strings[idx].dec_index;
  7176. if (elem_1_fcn[dec_idx] == NULL)
  7177. {
  7178. /* BAD THING, CANNOT DETERMINE LENGTH */
  7179. proto_tree_add_text(tree,
  7180. tvb, curr_offset, 1,
  7181. "No element dissector, rest of dissection may be incorrect");
  7182. consumed = 1;
  7183. }
  7184. else
  7185. {
  7186. gchar *a_add_string;
  7187. a_add_string = (gchar *) wmem_alloc(wmem_packet_scope(), 1024);
  7188. a_add_string[0] = '\0';
  7189. consumed = (*elem_1_fcn[dec_idx])(tvb, pinfo, tree, curr_offset, -1, a_add_string, 1024);
  7190. }
  7191. return(consumed);
  7192. }
  7193. #define ELEM_MAND_TLV(elem_idx, elem_name_addition) \
  7194. {\
  7195. if ((consumed = elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
  7196. { \
  7197. curr_offset += consumed; \
  7198. curr_len -= consumed; \
  7199. } \
  7200. else \
  7201. { \
  7202. proto_tree_add_text(tree, \
  7203. tvb, curr_offset, 0, \
  7204. "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
  7205. ansi_a_elem_1_strings[elem_idx].value, \
  7206. ansi_a_elem_1_strings[elem_idx].strptr, \
  7207. (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
  7208. ); \
  7209. } \
  7210. if (curr_len <= 0) return; \
  7211. }
  7212. #define ELEM_OPT_TLV(elem_idx, elem_name_addition) \
  7213. {\
  7214. if ((consumed = elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition)) > 0) \
  7215. { \
  7216. curr_offset += consumed; \
  7217. curr_len -= consumed; \
  7218. } \
  7219. if (curr_len <= 0) return; \
  7220. }
  7221. #define ELEM_MAND_TV(elem_idx, elem_name_addition) \
  7222. {\
  7223. if ((consumed = elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
  7224. { \
  7225. curr_offset += consumed; \
  7226. curr_len -= consumed; \
  7227. } \
  7228. else \
  7229. { \
  7230. proto_tree_add_text(tree, \
  7231. tvb, curr_offset, 0, \
  7232. "Missing Mandatory element (0x%02x) %s%s, rest of dissection is suspect", \
  7233. ansi_a_elem_1_strings[elem_idx].value, \
  7234. ansi_a_elem_1_strings[elem_idx].strptr, \
  7235. (elem_name_addition == NULL) || (elem_name_addition[0] == '\0') ? "" : elem_name_addition \
  7236. ); \
  7237. } \
  7238. if (curr_len <= 0) return; \
  7239. }
  7240. #define ELEM_OPT_TV(elem_idx, elem_name_addition) \
  7241. {\
  7242. if ((consumed = elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
  7243. { \
  7244. curr_offset += consumed; \
  7245. curr_len -= consumed; \
  7246. } \
  7247. if (curr_len <= 0) return; \
  7248. }
  7249. #define ELEM_OPT_T(elem_idx, elem_name_addition) \
  7250. {\
  7251. if ((consumed = elem_t(tvb, pinfo, tree, elem_idx, curr_offset, elem_name_addition)) > 0) \
  7252. { \
  7253. curr_offset += consumed; \
  7254. curr_len -= consumed; \
  7255. } \
  7256. if (curr_len <= 0) return; \
  7257. }
  7258. #define ELEM_MAND_LV(elem_idx, elem_name_addition) \
  7259. {\
  7260. if ((consumed = (GPOINTER_TO_UINT(pinfo->private_data) ? \
  7261. elem_tlv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition) : \
  7262. elem_lv(tvb, pinfo, tree, elem_idx, curr_offset, curr_len, elem_name_addition))) > 0) \
  7263. { \
  7264. curr_offset += consumed; \
  7265. curr_len -= consumed; \
  7266. } \
  7267. else \
  7268. { \
  7269. /* Mandatory, but nothing we can do */ \
  7270. } \
  7271. if (curr_len <= 0) return; \
  7272. }
  7273. #define ELEM_MAND_V(elem_idx) \
  7274. {\
  7275. if ((consumed = (GPOINTER_TO_UINT(pinfo->private_data) ? \
  7276. elem_tv(tvb, pinfo, tree, elem_idx, curr_offset, "") : \
  7277. elem_v(tvb, pinfo, tree, elem_idx, curr_offset))) > 0) \
  7278. { \
  7279. curr_offset += consumed; \
  7280. curr_len -= consumed; \
  7281. } \
  7282. else \
  7283. { \
  7284. /* Mandatory, but nothing we can do */ \
  7285. } \
  7286. if (curr_len <= 0) return; \
  7287. }
  7288. /*
  7289. * IOS 6.1.2.1
  7290. */
  7291. static void
  7292. bsmap_cl3_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7293. {
  7294. guint16 consumed;
  7295. guint32 curr_offset;
  7296. guint curr_len;
  7297. curr_offset = offset;
  7298. curr_len = len;
  7299. ELEM_MAND_TLV(ANSI_A_E_CELL_ID, "");
  7300. ELEM_MAND_TLV(ANSI_A_E_L3_INFO, "");
  7301. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7302. }
  7303. /*
  7304. * IOS 6.1.2.2
  7305. */
  7306. static void
  7307. dtap_cm_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7308. {
  7309. guint32 curr_offset;
  7310. guint32 consumed;
  7311. guint curr_len;
  7312. guint8 oct;
  7313. proto_tree *subtree;
  7314. proto_item *item;
  7315. const gchar *str;
  7316. curr_offset = offset;
  7317. curr_len = len;
  7318. /*
  7319. * special dissection for CM Service Type
  7320. */
  7321. oct = tvb_get_guint8(tvb, curr_offset);
  7322. switch (oct & 0x0f)
  7323. {
  7324. case 0x01: str = "Mobile Originating Call"; break;
  7325. default:
  7326. str = "Unknown";
  7327. break;
  7328. }
  7329. item =
  7330. proto_tree_add_text(tree,
  7331. tvb, curr_offset, 1,
  7332. "CM Service Type: %s",
  7333. str);
  7334. subtree = proto_item_add_subtree(item, ett_cm_srvc_type);
  7335. other_decode_bitfield_value(a_bigbuf, oct, 0xf0, 8);
  7336. proto_tree_add_text(subtree,
  7337. tvb, curr_offset, 1,
  7338. "%s : Element ID",
  7339. a_bigbuf);
  7340. other_decode_bitfield_value(a_bigbuf, oct, 0x0f, 8);
  7341. proto_tree_add_text(subtree,
  7342. tvb, curr_offset, 1,
  7343. "%s : Service Type: (%u) %s",
  7344. a_bigbuf,
  7345. oct & 0x0f,
  7346. str);
  7347. curr_offset++;
  7348. curr_len--;
  7349. ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "");
  7350. ELEM_MAND_LV(ANSI_A_E_MID, "");
  7351. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
  7352. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7353. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  7354. ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
  7355. ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
  7356. ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
  7357. ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  7358. ELEM_OPT_TV(ANSI_A_E_SO, "");
  7359. ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
  7360. ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
  7361. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
  7362. ELEM_OPT_TV(ANSI_A_E_CIC, "");
  7363. ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
  7364. ELEM_OPT_TLV(ANSI_A_E_AUTH_DATA, "");
  7365. ELEM_OPT_TLV(ANSI_A_E_PACA_REOI, "");
  7366. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  7367. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  7368. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  7369. switch (global_a_variant)
  7370. {
  7371. case A_VARIANT_IOS501:
  7372. ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
  7373. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7374. ELEM_OPT_T(ANSI_A_E_ORIG_CI, "");
  7375. ELEM_OPT_TV(ANSI_A_E_RETURN_CAUSE, "");
  7376. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7377. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  7378. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  7379. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  7380. break;
  7381. }
  7382. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7383. }
  7384. /*
  7385. * IOS 5 3.1.3
  7386. */
  7387. static void
  7388. dtap_cm_srvc_req_cont(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7389. {
  7390. guint32 curr_offset;
  7391. guint32 consumed;
  7392. guint curr_len;
  7393. curr_offset = offset;
  7394. curr_len = len;
  7395. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
  7396. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
  7397. ELEM_OPT_TLV(ANSI_A_E_REV_MS_INFO_RECS, "");
  7398. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7399. }
  7400. /*
  7401. * IOS 6.1.2.3
  7402. */
  7403. static void
  7404. bsmap_page_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7405. {
  7406. guint32 curr_offset;
  7407. guint32 consumed;
  7408. guint curr_len;
  7409. curr_offset = offset;
  7410. curr_len = len;
  7411. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7412. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7413. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  7414. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  7415. ELEM_OPT_TV(ANSI_A_E_SO, "");
  7416. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  7417. switch (global_a_variant)
  7418. {
  7419. case A_VARIANT_IOS501:
  7420. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  7421. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  7422. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  7423. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7424. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  7425. break;
  7426. }
  7427. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7428. }
  7429. /*
  7430. * IOS 6.1.2.4
  7431. */
  7432. static void
  7433. dtap_page_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7434. {
  7435. guint32 curr_offset;
  7436. guint32 consumed;
  7437. guint curr_len;
  7438. curr_offset = offset;
  7439. curr_len = len;
  7440. ELEM_MAND_LV(ANSI_A_E_CM_INFO_TYPE_2, "");
  7441. ELEM_MAND_LV(ANSI_A_E_MID, "");
  7442. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7443. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7444. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  7445. ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
  7446. ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
  7447. ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
  7448. ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  7449. ELEM_OPT_TV(ANSI_A_E_SO, "");
  7450. ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
  7451. ELEM_OPT_TV(ANSI_A_E_CIC, "");
  7452. ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
  7453. ELEM_OPT_TV(ANSI_A_E_RE_RES, "");
  7454. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  7455. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  7456. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  7457. switch (global_a_variant)
  7458. {
  7459. case A_VARIANT_IOS501:
  7460. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7461. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7462. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  7463. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  7464. break;
  7465. }
  7466. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7467. }
  7468. /*
  7469. * IOS 6.1.2.12
  7470. */
  7471. static void
  7472. dtap_progress(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7473. {
  7474. guint32 curr_offset;
  7475. guint32 consumed;
  7476. guint curr_len;
  7477. curr_offset = offset;
  7478. curr_len = len;
  7479. ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
  7480. ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
  7481. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7482. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7483. }
  7484. /*
  7485. * IOS 5 3.8.1
  7486. */
  7487. static void
  7488. dtap_srvc_redirection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7489. {
  7490. guint32 curr_offset;
  7491. guint32 consumed;
  7492. guint curr_len;
  7493. curr_offset = offset;
  7494. curr_len = len;
  7495. ELEM_MAND_TLV(ANSI_A_E_IS2000_RED_RECORD, "");
  7496. ELEM_MAND_TLV(ANSI_A_E_S_RED_INFO, "");
  7497. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7498. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7499. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  7500. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7501. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7502. }
  7503. /*
  7504. * IOS 5 3.1.11
  7505. */
  7506. static void
  7507. dtap_srvc_release(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7508. {
  7509. guint32 curr_offset;
  7510. guint32 consumed;
  7511. guint curr_len;
  7512. curr_offset = offset;
  7513. curr_len = len;
  7514. ELEM_MAND_TLV(ANSI_A_E_SOCI, "");
  7515. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  7516. ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
  7517. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7518. }
  7519. /*
  7520. * IOS 5 3.1.12
  7521. */
  7522. static void
  7523. dtap_srvc_release_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7524. {
  7525. guint32 curr_offset;
  7526. guint32 consumed;
  7527. guint curr_len;
  7528. curr_offset = offset;
  7529. curr_len = len;
  7530. ELEM_MAND_TLV(ANSI_A_E_SOCI, "");
  7531. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7532. }
  7533. /*
  7534. * IOS 6.1.2.15
  7535. */
  7536. static void
  7537. bsmap_ass_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7538. {
  7539. guint16 consumed;
  7540. guint32 curr_offset;
  7541. guint curr_len;
  7542. curr_offset = offset;
  7543. curr_len = len;
  7544. ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
  7545. ELEM_OPT_TV(ANSI_A_E_CIC, "");
  7546. ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
  7547. ELEM_OPT_TV(ANSI_A_E_SO, "");
  7548. ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
  7549. ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
  7550. ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
  7551. ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
  7552. ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
  7553. ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
  7554. switch (global_a_variant)
  7555. {
  7556. case A_VARIANT_IOS501:
  7557. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7558. ELEM_OPT_TLV(ANSI_A_E_SR_ID, "");
  7559. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  7560. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  7561. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7562. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  7563. break;
  7564. }
  7565. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7566. }
  7567. /*
  7568. * IOS 6.1.2.16
  7569. */
  7570. static void
  7571. bsmap_ass_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7572. {
  7573. guint16 consumed;
  7574. guint32 curr_offset;
  7575. guint curr_len;
  7576. curr_offset = offset;
  7577. curr_len = len;
  7578. ELEM_MAND_TV(ANSI_A_E_CHAN_NUM, "");
  7579. ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
  7580. ELEM_OPT_TV(ANSI_A_E_SO, "");
  7581. switch (global_a_variant)
  7582. {
  7583. case A_VARIANT_IOS501:
  7584. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7585. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  7586. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  7587. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7588. break;
  7589. }
  7590. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7591. }
  7592. /*
  7593. * IOS 6.1.2.17
  7594. */
  7595. static void
  7596. bsmap_ass_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7597. {
  7598. guint16 consumed;
  7599. guint32 curr_offset;
  7600. guint curr_len;
  7601. curr_offset = offset;
  7602. curr_len = len;
  7603. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  7604. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7605. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7606. }
  7607. /*
  7608. * IOS 6.1.2.20
  7609. */
  7610. static void
  7611. bsmap_clr_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7612. {
  7613. guint16 consumed;
  7614. guint32 curr_offset;
  7615. guint curr_len;
  7616. curr_offset = offset;
  7617. curr_len = len;
  7618. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  7619. ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
  7620. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7621. }
  7622. /*
  7623. * IOS 6.1.2.21
  7624. */
  7625. static void
  7626. bsmap_clr_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7627. {
  7628. guint16 consumed;
  7629. guint32 curr_offset;
  7630. guint curr_len;
  7631. curr_offset = offset;
  7632. curr_len = len;
  7633. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  7634. ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
  7635. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7636. }
  7637. /*
  7638. * IOS 6.1.2.22
  7639. */
  7640. static void
  7641. bsmap_clr_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7642. {
  7643. guint16 consumed;
  7644. guint32 curr_offset;
  7645. guint curr_len;
  7646. curr_offset = offset;
  7647. curr_len = len;
  7648. ELEM_OPT_T(ANSI_A_E_PDI, "");
  7649. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  7650. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7651. }
  7652. /*
  7653. * IOS 6.1.2.24
  7654. */
  7655. static void
  7656. dtap_alert_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7657. {
  7658. guint32 curr_offset;
  7659. guint32 consumed;
  7660. guint curr_len;
  7661. curr_offset = offset;
  7662. curr_len = len;
  7663. ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
  7664. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7665. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7666. }
  7667. /*
  7668. * IOS 6.1.2.28
  7669. */
  7670. static void
  7671. bsmap_bs_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7672. {
  7673. guint32 curr_offset;
  7674. guint32 consumed;
  7675. guint curr_len;
  7676. curr_offset = offset;
  7677. curr_len = len;
  7678. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7679. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7680. ELEM_OPT_TV(ANSI_A_E_SO, "");
  7681. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7682. ELEM_OPT_TLV(ANSI_A_E_ADDS_USER_PART, "");
  7683. ELEM_OPT_TLV(ANSI_A_E_SR_ID, "");
  7684. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7685. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7686. }
  7687. /*
  7688. * IOS 6.1.2.29
  7689. */
  7690. static void
  7691. bsmap_bs_srvc_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7692. {
  7693. guint32 curr_offset;
  7694. guint32 consumed;
  7695. guint curr_len;
  7696. curr_offset = offset;
  7697. curr_len = len;
  7698. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7699. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7700. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7701. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  7702. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7703. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7704. }
  7705. /*
  7706. * IOS 5 3.1.19
  7707. */
  7708. static void
  7709. bsmap_add_srvc_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7710. {
  7711. guint32 curr_offset;
  7712. guint32 consumed;
  7713. guint curr_len;
  7714. curr_offset = offset;
  7715. curr_len = len;
  7716. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7717. ELEM_MAND_TV(ANSI_A_E_SO, "");
  7718. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  7719. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7720. }
  7721. /*
  7722. * IOS 5 3.1.20
  7723. */
  7724. static void
  7725. dtap_add_srvc_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7726. {
  7727. guint32 curr_offset;
  7728. guint32 consumed;
  7729. guint curr_len;
  7730. curr_offset = offset;
  7731. curr_len = len;
  7732. ELEM_MAND_TLV(ANSI_A_E_SOCI, "");
  7733. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
  7734. ELEM_MAND_TV(ANSI_A_E_SO, "");
  7735. ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
  7736. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_ASCII_NUM, "");
  7737. ELEM_OPT_TV(ANSI_A_E_CIC, "");
  7738. ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
  7739. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  7740. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  7741. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7742. }
  7743. /*
  7744. * IOS 5 3.1.10
  7745. */
  7746. static void
  7747. dtap_connect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7748. {
  7749. guint32 curr_offset;
  7750. guint32 consumed;
  7751. guint curr_len;
  7752. curr_offset = offset;
  7753. curr_len = len;
  7754. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7755. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7756. }
  7757. /*
  7758. * IOS 6.1.3.7
  7759. */
  7760. static void
  7761. dtap_flash_with_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7762. {
  7763. guint32 curr_offset;
  7764. guint32 consumed;
  7765. guint curr_len;
  7766. curr_offset = offset;
  7767. curr_len = len;
  7768. ELEM_OPT_TLV(ANSI_A_E_CLD_PARTY_BCD_NUM, "");
  7769. ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
  7770. ELEM_OPT_TV(ANSI_A_E_MWI, "");
  7771. ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
  7772. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7773. if (pinfo->p2p_dir == P2P_DIR_RECV)
  7774. {
  7775. ELEM_OPT_TLV(ANSI_A_E_REV_MS_INFO_RECS, "");
  7776. }
  7777. else
  7778. {
  7779. ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
  7780. }
  7781. ELEM_OPT_TLV(ANSI_A_E_SSCI, "");
  7782. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7783. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7784. }
  7785. /*
  7786. * IOS 6.1.3.8
  7787. */
  7788. static void
  7789. dtap_flash_with_info_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7790. {
  7791. guint32 curr_offset;
  7792. guint32 consumed;
  7793. guint curr_len;
  7794. curr_offset = offset;
  7795. curr_len = len;
  7796. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7797. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  7798. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7799. }
  7800. /*
  7801. * IOS 6.1.3.9
  7802. */
  7803. static void
  7804. bsmap_feat_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7805. {
  7806. guint32 curr_offset;
  7807. guint32 consumed;
  7808. guint curr_len;
  7809. curr_offset = offset;
  7810. curr_len = len;
  7811. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7812. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7813. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  7814. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  7815. ELEM_OPT_TV(ANSI_A_E_SIGNAL, "");
  7816. ELEM_OPT_TV(ANSI_A_E_MWI, "");
  7817. ELEM_OPT_TLV(ANSI_A_E_CLG_PARTY_ASCII_NUM, "");
  7818. ELEM_OPT_TLV(ANSI_A_E_FWD_MS_INFO_RECS, "");
  7819. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  7820. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  7821. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  7822. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  7823. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7824. }
  7825. /*
  7826. * IOS 6.1.3.10
  7827. */
  7828. static void
  7829. bsmap_feat_noti_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7830. {
  7831. guint32 curr_offset;
  7832. guint32 consumed;
  7833. guint curr_len;
  7834. curr_offset = offset;
  7835. curr_len = len;
  7836. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7837. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7838. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7839. }
  7840. /*
  7841. * IOS 6.1.3.11
  7842. */
  7843. static void
  7844. bsmap_paca_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7845. {
  7846. guint32 curr_offset;
  7847. guint32 consumed;
  7848. guint curr_len;
  7849. curr_offset = offset;
  7850. curr_len = len;
  7851. ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
  7852. ELEM_OPT_TLV(ANSI_A_E_PACA_TS, "");
  7853. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7854. }
  7855. /*
  7856. * IOS 6.1.3.12
  7857. */
  7858. static void
  7859. bsmap_paca_command_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7860. {
  7861. guint32 curr_offset;
  7862. guint32 consumed;
  7863. guint curr_len;
  7864. curr_offset = offset;
  7865. curr_len = len;
  7866. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  7867. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7868. }
  7869. /*
  7870. * IOS 6.1.3.13
  7871. */
  7872. static void
  7873. bsmap_paca_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7874. {
  7875. guint32 curr_offset;
  7876. guint32 consumed;
  7877. guint curr_len;
  7878. curr_offset = offset;
  7879. curr_len = len;
  7880. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7881. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7882. ELEM_OPT_TLV(ANSI_A_E_PACA_ORDER, "");
  7883. ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
  7884. ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
  7885. ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
  7886. ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
  7887. ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  7888. ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
  7889. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7890. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  7891. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7892. }
  7893. /*
  7894. * IOS 6.1.3.14
  7895. */
  7896. static void
  7897. bsmap_paca_update_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7898. {
  7899. guint32 curr_offset;
  7900. guint32 consumed;
  7901. guint curr_len;
  7902. curr_offset = offset;
  7903. curr_len = len;
  7904. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7905. ELEM_OPT_TLV(ANSI_A_E_PRIO, "");
  7906. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  7907. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7908. }
  7909. /*
  7910. * IOS 5 3.2.9
  7911. */
  7912. static void
  7913. bsmap_rm_pos_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7914. {
  7915. guint32 curr_offset;
  7916. guint32 consumed;
  7917. guint curr_len;
  7918. curr_offset = offset;
  7919. curr_len = len;
  7920. ELEM_MAND_TLV(ANSI_A_E_PSMM_COUNT, "");
  7921. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7922. }
  7923. /*
  7924. * IOS 5 3.2.10
  7925. */
  7926. static void
  7927. bsmap_rm_pos_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7928. {
  7929. guint32 curr_offset;
  7930. guint32 consumed;
  7931. guint curr_len;
  7932. curr_offset = offset;
  7933. curr_len = len;
  7934. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  7935. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  7936. ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE_LIST, "");
  7937. ELEM_OPT_TLV(ANSI_A_E_GEO_LOC, "");
  7938. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7939. }
  7940. /*
  7941. * IOS 6.1.4.1
  7942. */
  7943. static void
  7944. bsmap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7945. {
  7946. guint32 curr_offset;
  7947. guint32 consumed;
  7948. guint curr_len;
  7949. curr_offset = offset;
  7950. curr_len = len;
  7951. ELEM_MAND_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  7952. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7953. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  7954. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  7955. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  7956. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  7957. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  7958. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  7959. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  7960. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7961. }
  7962. static void
  7963. dtap_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7964. {
  7965. guint32 curr_offset;
  7966. guint32 consumed;
  7967. guint curr_len;
  7968. curr_offset = offset;
  7969. curr_len = len;
  7970. ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  7971. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  7972. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7973. }
  7974. /*
  7975. * IOS 6.1.4.2
  7976. */
  7977. static void
  7978. bsmap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7979. {
  7980. guint32 curr_offset;
  7981. guint32 consumed;
  7982. guint curr_len;
  7983. curr_offset = offset;
  7984. curr_len = len;
  7985. ELEM_MAND_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
  7986. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  7987. ELEM_MAND_TV(ANSI_A_E_TAG, "");
  7988. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7989. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  7990. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  7991. }
  7992. /*
  7993. * IOS 5
  7994. * Section 3.1.21
  7995. */
  7996. static void
  7997. bsmap_bearer_upd_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  7998. {
  7999. guint32 curr_offset;
  8000. guint32 consumed;
  8001. guint curr_len;
  8002. curr_offset = offset;
  8003. curr_len = len;
  8004. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  8005. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  8006. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8007. }
  8008. /*
  8009. * IOS 5
  8010. * Section 3.1.22
  8011. */
  8012. static void
  8013. bsmap_bearer_upd_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8014. {
  8015. guint32 curr_offset;
  8016. guint32 consumed;
  8017. guint curr_len;
  8018. curr_offset = offset;
  8019. curr_len = len;
  8020. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8021. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  8022. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  8023. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8024. }
  8025. /*
  8026. * IOS 5
  8027. * Section 3.1.23
  8028. */
  8029. static void
  8030. bsmap_bearer_upd_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8031. {
  8032. guint32 curr_offset;
  8033. guint32 consumed;
  8034. guint curr_len;
  8035. curr_offset = offset;
  8036. curr_len = len;
  8037. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8038. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  8039. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  8040. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8041. }
  8042. static void
  8043. dtap_auth_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8044. {
  8045. guint32 curr_offset;
  8046. guint32 consumed;
  8047. guint curr_len;
  8048. curr_offset = offset;
  8049. curr_len = len;
  8050. ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "");
  8051. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8052. }
  8053. /*
  8054. * IOS 6.1.4.3
  8055. */
  8056. static void
  8057. bsmap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8058. {
  8059. guint32 curr_offset;
  8060. guint32 consumed;
  8061. guint curr_len;
  8062. curr_offset = offset;
  8063. curr_len = len;
  8064. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  8065. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8066. }
  8067. /*
  8068. * IOS 5 3.3.16
  8069. */
  8070. static void
  8071. dtap_user_zone_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8072. {
  8073. guint32 curr_offset;
  8074. guint32 consumed;
  8075. guint curr_len;
  8076. curr_offset = offset;
  8077. curr_len = len;
  8078. ELEM_MAND_TLV(ANSI_A_E_UZ_ID, "");
  8079. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8080. }
  8081. /*
  8082. * IOS 5 3.3.17
  8083. */
  8084. static void
  8085. dtap_user_zone_update(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8086. {
  8087. guint32 curr_offset;
  8088. guint32 consumed;
  8089. guint curr_len;
  8090. curr_offset = offset;
  8091. curr_len = len;
  8092. ELEM_MAND_TLV(ANSI_A_E_UZ_ID, "");
  8093. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8094. }
  8095. /*
  8096. * IOS 5 3.3.18
  8097. */
  8098. static void
  8099. bsmap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8100. {
  8101. guint32 curr_offset;
  8102. guint32 consumed;
  8103. guint curr_len;
  8104. curr_offset = offset;
  8105. curr_len = len;
  8106. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  8107. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8108. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8109. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8110. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8111. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  8112. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8113. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8114. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8115. }
  8116. /*
  8117. * IOS 5 3.3.18
  8118. */
  8119. static void
  8120. dtap_user_zone_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8121. {
  8122. guint32 curr_offset;
  8123. guint32 consumed;
  8124. guint curr_len;
  8125. curr_offset = offset;
  8126. curr_len = len;
  8127. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  8128. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8129. }
  8130. /*
  8131. * IOS 5 3.3.19
  8132. */
  8133. static void
  8134. bsmap_reg_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8135. {
  8136. guint32 curr_offset;
  8137. guint32 consumed;
  8138. guint curr_len;
  8139. curr_offset = offset;
  8140. curr_len = len;
  8141. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8142. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8143. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8144. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  8145. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8146. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8147. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8148. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8149. }
  8150. /*
  8151. * IOS 5 3.3.20
  8152. */
  8153. static void
  8154. bsmap_ms_reg_noti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8155. {
  8156. guint32 curr_offset;
  8157. guint32 consumed;
  8158. guint curr_len;
  8159. curr_offset = offset;
  8160. curr_len = len;
  8161. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8162. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8163. }
  8164. /*
  8165. * IOS 5 3.3.21
  8166. */
  8167. static void
  8168. bsmap_bs_auth_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8169. {
  8170. guint32 curr_offset;
  8171. guint32 consumed;
  8172. guint curr_len;
  8173. curr_offset = offset;
  8174. curr_len = len;
  8175. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8176. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8177. }
  8178. /*
  8179. * IOS 5 3.3.22
  8180. */
  8181. static void
  8182. bsmap_bs_auth_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8183. {
  8184. guint32 curr_offset;
  8185. guint32 consumed;
  8186. guint curr_len;
  8187. curr_offset = offset;
  8188. curr_len = len;
  8189. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8190. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8191. }
  8192. /*
  8193. * IOS 6.1.4.4
  8194. */
  8195. static void
  8196. dtap_ssd_update_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8197. {
  8198. guint32 curr_offset;
  8199. guint32 consumed;
  8200. guint curr_len;
  8201. curr_offset = offset;
  8202. curr_len = len;
  8203. ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  8204. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8205. }
  8206. /*
  8207. * IOS 6.1.4.5
  8208. */
  8209. static void
  8210. dtap_bs_challenge(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8211. {
  8212. guint32 curr_offset;
  8213. guint32 consumed;
  8214. guint curr_len;
  8215. curr_offset = offset;
  8216. curr_len = len;
  8217. ELEM_MAND_LV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  8218. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8219. }
  8220. /*
  8221. * IOS 6.1.4.6
  8222. */
  8223. static void
  8224. dtap_bs_challenge_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8225. {
  8226. guint32 curr_offset;
  8227. guint32 consumed;
  8228. guint curr_len;
  8229. curr_offset = offset;
  8230. curr_len = len;
  8231. ELEM_MAND_LV(ANSI_A_E_AUTH_RESP_PARAM, "");
  8232. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8233. }
  8234. /*
  8235. * IOS 6.1.4.7
  8236. */
  8237. static void
  8238. dtap_ssd_update_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8239. {
  8240. guint32 curr_offset;
  8241. guint32 consumed;
  8242. guint curr_len;
  8243. curr_offset = offset;
  8244. curr_len = len;
  8245. ELEM_OPT_TLV(ANSI_A_E_CAUSE_L3, "");
  8246. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8247. }
  8248. /*
  8249. * IOS 6.1.4.8
  8250. */
  8251. static void
  8252. dtap_lu_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8253. {
  8254. guint32 curr_offset;
  8255. guint32 consumed;
  8256. guint curr_len;
  8257. curr_offset = offset;
  8258. curr_len = len;
  8259. ELEM_MAND_LV(ANSI_A_E_MID, "");
  8260. ELEM_OPT_TV(ANSI_A_E_LAI, "");
  8261. ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
  8262. ELEM_OPT_TV(ANSI_A_E_REG_TYPE, "");
  8263. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8264. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8265. ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
  8266. ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
  8267. ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
  8268. ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  8269. ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
  8270. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  8271. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8272. ELEM_OPT_TV(ANSI_A_E_RETURN_CAUSE, "");
  8273. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8274. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8275. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8276. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8277. }
  8278. /*
  8279. * IOS 6.1.4.9
  8280. */
  8281. static void
  8282. dtap_lu_accept(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8283. {
  8284. guint32 curr_offset;
  8285. guint32 consumed;
  8286. guint curr_len;
  8287. curr_offset = offset;
  8288. curr_len = len;
  8289. switch (global_a_variant)
  8290. {
  8291. case A_VARIANT_IOS401:
  8292. ELEM_OPT_TV(ANSI_A_E_LAI, "");
  8293. break;
  8294. case A_VARIANT_IOS501:
  8295. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8296. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  8297. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8298. break;
  8299. }
  8300. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8301. }
  8302. /*
  8303. * IOS 6.1.4.10
  8304. */
  8305. static void
  8306. dtap_lu_reject(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8307. {
  8308. guint32 curr_offset;
  8309. guint32 consumed;
  8310. guint curr_len;
  8311. curr_offset = offset;
  8312. curr_len = len;
  8313. ELEM_MAND_V(ANSI_A_E_REJ_CAUSE);
  8314. switch (global_a_variant)
  8315. {
  8316. case A_VARIANT_IOS501:
  8317. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  8318. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8319. break;
  8320. }
  8321. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8322. }
  8323. /*
  8324. * IOS 6.1.4.18
  8325. */
  8326. static void
  8327. bsmap_priv_mode_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8328. {
  8329. guint32 curr_offset;
  8330. guint32 consumed;
  8331. guint curr_len;
  8332. curr_offset = offset;
  8333. curr_len = len;
  8334. ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
  8335. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8336. }
  8337. /*
  8338. * IOS 6.1.4.19
  8339. */
  8340. static void
  8341. bsmap_priv_mode_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8342. {
  8343. guint32 curr_offset;
  8344. guint32 consumed;
  8345. guint curr_len;
  8346. curr_offset = offset;
  8347. curr_len = len;
  8348. ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
  8349. ELEM_OPT_T(ANSI_A_E_VP_REQ, "");
  8350. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8351. }
  8352. /*
  8353. * IOS 5 3.3.14
  8354. */
  8355. static void
  8356. bsmap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8357. {
  8358. guint32 curr_offset;
  8359. guint32 consumed;
  8360. guint curr_len;
  8361. curr_offset = offset;
  8362. curr_len = len;
  8363. ELEM_MAND_TLV(ANSI_A_E_IE_REQD, "");
  8364. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8365. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8366. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8367. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8368. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8369. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  8370. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8371. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8372. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8373. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8374. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8375. }
  8376. /*
  8377. * IOS 5 3.3.14
  8378. */
  8379. static void
  8380. dtap_status_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8381. {
  8382. guint32 curr_offset;
  8383. guint32 consumed;
  8384. guint curr_len;
  8385. curr_offset = offset;
  8386. curr_len = len;
  8387. ELEM_MAND_LV(ANSI_A_E_IE_REQD, "");
  8388. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8389. }
  8390. /*
  8391. * IOS 5 3.3.15
  8392. */
  8393. static void
  8394. bsmap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8395. {
  8396. guint32 curr_offset;
  8397. guint32 consumed;
  8398. guint curr_len;
  8399. curr_offset = offset;
  8400. curr_len = len;
  8401. ELEM_MAND_TLV(ANSI_A_E_REV_MS_INFO_RECS, "");
  8402. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8403. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8404. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8405. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8406. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8407. }
  8408. /*
  8409. * IOS 5 3.3.15
  8410. */
  8411. static void
  8412. dtap_status_resp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8413. {
  8414. guint32 curr_offset;
  8415. guint32 consumed;
  8416. guint curr_len;
  8417. curr_offset = offset;
  8418. curr_len = len;
  8419. ELEM_MAND_LV(ANSI_A_E_REV_MS_INFO_RECS, "");
  8420. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8421. }
  8422. /*
  8423. * IOS 6.1.5.4
  8424. */
  8425. static void
  8426. bsmap_ho_reqd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8427. {
  8428. guint32 curr_offset;
  8429. guint32 consumed;
  8430. guint curr_len;
  8431. curr_offset = offset;
  8432. curr_len = len;
  8433. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8434. ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, " (Target)");
  8435. ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
  8436. ELEM_OPT_T(ANSI_A_E_RESP_REQ, "");
  8437. ELEM_OPT_TLV(ANSI_A_E_ENC_INFO, "");
  8438. ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
  8439. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8440. ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
  8441. ELEM_OPT_TV(ANSI_A_E_SO, "");
  8442. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  8443. ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
  8444. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
  8445. ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
  8446. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8447. ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
  8448. switch (global_a_variant)
  8449. {
  8450. case A_VARIANT_IOS401:
  8451. ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
  8452. break;
  8453. case A_VARIANT_IOS501:
  8454. ELEM_OPT_TLV(ANSI_A_E_S_PDSN_ADDR, "");
  8455. break;
  8456. }
  8457. ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
  8458. ELEM_OPT_TLV(ANSI_A_E_SRNC_TRNC_TC, "");
  8459. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8460. ELEM_OPT_TV(ANSI_A_E_ACC_NET_ID, "");
  8461. ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
  8462. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
  8463. ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
  8464. ELEM_OPT_TLV(ANSI_A_E_ANCH_PDSN_ADDR, "");
  8465. ELEM_OPT_TLV(ANSI_A_E_ANCH_PP_ADDR, "");
  8466. ELEM_OPT_TLV(ANSI_A_E_PSP, "");
  8467. ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
  8468. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8469. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8470. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8471. }
  8472. /*
  8473. * IOS 6.1.5.5
  8474. */
  8475. static void
  8476. bsmap_ho_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8477. {
  8478. guint32 curr_offset;
  8479. guint32 consumed;
  8480. guint curr_len;
  8481. curr_offset = offset;
  8482. curr_len = len;
  8483. ELEM_MAND_TLV(ANSI_A_E_CHAN_TYPE, "");
  8484. ELEM_MAND_TLV(ANSI_A_E_ENC_INFO, "");
  8485. ELEM_MAND_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
  8486. ELEM_MAND_TLV(ANSI_A_E_CELL_ID_LIST, "(Target)");
  8487. ELEM_OPT_TLV(ANSI_A_E_CIC_EXT, "");
  8488. ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
  8489. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8490. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8491. ELEM_OPT_TLV(ANSI_A_E_DOWNLINK_RE, "");
  8492. ELEM_OPT_TV(ANSI_A_E_SO, "");
  8493. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  8494. ELEM_OPT_TLV(ANSI_A_E_IS95_MS_MEAS_CHAN_ID, "");
  8495. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
  8496. ELEM_OPT_TLV(ANSI_A_E_QOS_PARAMS, "");
  8497. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8498. ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
  8499. switch (global_a_variant)
  8500. {
  8501. case A_VARIANT_IOS401:
  8502. ELEM_OPT_TLV(ANSI_A_E_PDSN_IP_ADDR, "");
  8503. break;
  8504. case A_VARIANT_IOS501:
  8505. ELEM_OPT_TLV(ANSI_A_E_S_PDSN_ADDR, "");
  8506. break;
  8507. }
  8508. ELEM_OPT_TLV(ANSI_A_E_PTYPE, "");
  8509. switch (global_a_variant)
  8510. {
  8511. case A_VARIANT_IOS501:
  8512. ELEM_OPT_TLV(ANSI_A_E_SRNC_TRNC_TC, "");
  8513. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8514. ELEM_OPT_TV(ANSI_A_E_ACC_NET_ID, "");
  8515. ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
  8516. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
  8517. ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
  8518. ELEM_OPT_TLV(ANSI_A_E_ANCH_PDSN_ADDR, "");
  8519. ELEM_OPT_TLV(ANSI_A_E_ANCH_PP_ADDR, "");
  8520. ELEM_OPT_TLV(ANSI_A_E_PSP, "");
  8521. ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
  8522. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  8523. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  8524. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8525. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8526. break;
  8527. }
  8528. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8529. }
  8530. /*
  8531. * IOS 6.1.5.6
  8532. */
  8533. static void
  8534. bsmap_ho_req_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8535. {
  8536. guint32 curr_offset;
  8537. guint32 consumed;
  8538. guint curr_len;
  8539. curr_offset = offset;
  8540. curr_len = len;
  8541. ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
  8542. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8543. ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
  8544. ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
  8545. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
  8546. ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
  8547. ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
  8548. switch (global_a_variant)
  8549. {
  8550. case A_VARIANT_IOS501:
  8551. ELEM_OPT_TLV(ANSI_A_E_TRNC_SRNC_TC, "");
  8552. ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
  8553. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8554. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
  8555. ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
  8556. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_SESSION, "");
  8557. ELEM_OPT_TLV(ANSI_A_E_A2P_BEARER_FORMAT, "");
  8558. break;
  8559. }
  8560. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8561. }
  8562. /*
  8563. * IOS 6.1.5.7
  8564. */
  8565. static void
  8566. bsmap_ho_failure(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8567. {
  8568. guint32 curr_offset;
  8569. guint32 consumed;
  8570. guint curr_len;
  8571. curr_offset = offset;
  8572. curr_len = len;
  8573. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8574. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8575. }
  8576. /*
  8577. * IOS 6.1.5.8
  8578. */
  8579. static void
  8580. bsmap_ho_command(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8581. {
  8582. guint32 curr_offset;
  8583. guint32 consumed;
  8584. guint curr_len;
  8585. curr_offset = offset;
  8586. curr_len = len;
  8587. ELEM_OPT_TV(ANSI_A_E_RF_CHAN_ID, "");
  8588. ELEM_OPT_TLV(ANSI_A_E_IS95_CHAN_ID, "");
  8589. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8590. ELEM_OPT_TLV(ANSI_A_E_HO_POW_LEV, "");
  8591. ELEM_OPT_TV(ANSI_A_E_SID, "");
  8592. ELEM_OPT_TLV(ANSI_A_E_EXT_HO_DIR_PARAMS, "");
  8593. ELEM_OPT_TV(ANSI_A_E_HHO_PARAMS, "");
  8594. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID, "");
  8595. ELEM_OPT_TLV(ANSI_A_E_IS2000_SCR, "");
  8596. ELEM_OPT_TLV(ANSI_A_E_IS2000_NN_SCR, "");
  8597. switch (global_a_variant)
  8598. {
  8599. case A_VARIANT_IOS501:
  8600. ELEM_OPT_TLV(ANSI_A_E_TRNC_SRNC_TC, "");
  8601. ELEM_OPT_TLV(ANSI_A_E_SO_LIST, "");
  8602. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8603. ELEM_OPT_TLV(ANSI_A_E_AMPS_HHO_PARAM, "");
  8604. ELEM_OPT_TLV(ANSI_A_E_IS2000_CHAN_ID_3X, "");
  8605. ELEM_OPT_TLV(ANSI_A_E_PLCM_ID, "");
  8606. break;
  8607. }
  8608. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8609. }
  8610. /*
  8611. * IOS 5 3.4.6
  8612. */
  8613. static void
  8614. bsmap_ho_complete(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8615. {
  8616. guint32 curr_offset;
  8617. guint32 consumed;
  8618. guint curr_len;
  8619. curr_offset = offset;
  8620. curr_len = len;
  8621. ELEM_OPT_TV(ANSI_A_E_SO, "");
  8622. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8623. }
  8624. /*
  8625. * IOS 6.1.5.9
  8626. */
  8627. static void
  8628. bsmap_ho_reqd_rej(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8629. {
  8630. guint32 curr_offset;
  8631. guint32 consumed;
  8632. guint curr_len;
  8633. curr_offset = offset;
  8634. curr_len = len;
  8635. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8636. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8637. }
  8638. /*
  8639. * IOS 6.1.5.12
  8640. */
  8641. static void
  8642. bsmap_ho_performed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8643. {
  8644. guint32 curr_offset;
  8645. guint32 consumed;
  8646. guint curr_len;
  8647. curr_offset = offset;
  8648. curr_len = len;
  8649. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8650. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8651. ELEM_OPT_TV(ANSI_A_E_CHAN_NUM, "");
  8652. ELEM_OPT_TLV(ANSI_A_E_BAND_CLASS, "");
  8653. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8654. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8655. }
  8656. /*
  8657. * IOS 6.1.6.2
  8658. */
  8659. static void
  8660. bsmap_block(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8661. {
  8662. guint32 curr_offset;
  8663. guint32 consumed;
  8664. guint curr_len;
  8665. curr_offset = offset;
  8666. curr_len = len;
  8667. ELEM_MAND_TV(ANSI_A_E_CIC, "");
  8668. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8669. ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
  8670. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8671. }
  8672. /*
  8673. * IOS 6.1.6.3
  8674. */
  8675. static void
  8676. bsmap_block_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8677. {
  8678. guint32 curr_offset;
  8679. guint32 consumed;
  8680. guint curr_len;
  8681. curr_offset = offset;
  8682. curr_len = len;
  8683. ELEM_MAND_TV(ANSI_A_E_CIC, "");
  8684. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8685. }
  8686. /*
  8687. * IOS 6.1.6.4
  8688. */
  8689. static void
  8690. bsmap_unblock(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8691. {
  8692. guint32 curr_offset;
  8693. guint32 consumed;
  8694. guint curr_len;
  8695. curr_offset = offset;
  8696. curr_len = len;
  8697. ELEM_MAND_TV(ANSI_A_E_CIC, "");
  8698. ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
  8699. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8700. }
  8701. /*
  8702. * IOS 6.1.6.5
  8703. */
  8704. static void
  8705. bsmap_unblock_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8706. {
  8707. guint32 curr_offset;
  8708. guint32 consumed;
  8709. guint curr_len;
  8710. curr_offset = offset;
  8711. curr_len = len;
  8712. ELEM_MAND_TV(ANSI_A_E_CIC, "");
  8713. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8714. }
  8715. /*
  8716. * IOS 6.1.6.6
  8717. */
  8718. static void
  8719. bsmap_reset(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8720. {
  8721. guint32 curr_offset;
  8722. guint32 consumed;
  8723. guint curr_len;
  8724. curr_offset = offset;
  8725. curr_len = len;
  8726. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8727. ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
  8728. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8729. }
  8730. /*
  8731. * IOS 6.1.6.7
  8732. */
  8733. static void
  8734. bsmap_reset_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8735. {
  8736. guint32 curr_offset;
  8737. guint32 consumed;
  8738. guint curr_len;
  8739. curr_offset = offset;
  8740. curr_len = len;
  8741. ELEM_OPT_TLV(ANSI_A_E_SW_VER, "");
  8742. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8743. }
  8744. /*
  8745. * IOS 6.1.6.8
  8746. */
  8747. static void
  8748. bsmap_reset_cct(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8749. {
  8750. guint32 curr_offset;
  8751. guint32 consumed;
  8752. guint curr_len;
  8753. curr_offset = offset;
  8754. curr_len = len;
  8755. ELEM_MAND_TV(ANSI_A_E_CIC, "");
  8756. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8757. ELEM_OPT_TLV(ANSI_A_E_CCT_GROUP, "");
  8758. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8759. }
  8760. /*
  8761. * IOS 6.1.6.9
  8762. */
  8763. static void
  8764. bsmap_reset_cct_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8765. {
  8766. guint32 curr_offset;
  8767. guint32 consumed;
  8768. guint curr_len;
  8769. curr_offset = offset;
  8770. curr_len = len;
  8771. ELEM_MAND_TV(ANSI_A_E_CIC, "");
  8772. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8773. }
  8774. /*
  8775. * IOS 6.1.6.10
  8776. */
  8777. static void
  8778. bsmap_xmode_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8779. {
  8780. guint32 curr_offset;
  8781. guint32 consumed;
  8782. guint curr_len;
  8783. curr_offset = offset;
  8784. curr_len = len;
  8785. ELEM_MAND_TLV(ANSI_A_E_XMODE, "");
  8786. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8787. }
  8788. /*
  8789. * IOS 6.1.6.11
  8790. */
  8791. static void
  8792. bsmap_xmode_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8793. {
  8794. guint32 curr_offset;
  8795. guint32 consumed;
  8796. guint curr_len;
  8797. curr_offset = offset;
  8798. curr_len = len;
  8799. ELEM_MAND_TLV(ANSI_A_E_CAUSE, "");
  8800. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8801. }
  8802. /*
  8803. * IOS 6.1.7.1
  8804. */
  8805. static void
  8806. bsmap_adds_page(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8807. {
  8808. guint32 curr_offset;
  8809. guint32 consumed;
  8810. guint curr_len;
  8811. curr_offset = offset;
  8812. curr_len = len;
  8813. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8814. ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
  8815. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8816. ELEM_OPT_TLV(ANSI_A_E_CELL_ID_LIST, "");
  8817. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8818. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8819. ELEM_OPT_TLV(ANSI_A_E_P_REV, "");
  8820. ELEM_OPT_TLV(ANSI_A_E_MS_DES_FREQ, "");
  8821. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8822. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8823. }
  8824. /*
  8825. * IOS 6.1.7.2
  8826. */
  8827. static void
  8828. bsmap_adds_transfer(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8829. {
  8830. guint32 curr_offset;
  8831. guint32 consumed;
  8832. guint curr_len;
  8833. curr_offset = offset;
  8834. curr_len = len;
  8835. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8836. ELEM_MAND_TLV(ANSI_A_E_ADDS_USER_PART, "");
  8837. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8838. ELEM_OPT_TLV(ANSI_A_E_AUTH_RESP_PARAM, "");
  8839. ELEM_OPT_TV(ANSI_A_E_AUTH_CNF_PARAM, "");
  8840. ELEM_OPT_TV(ANSI_A_E_AUTH_PARAM_COUNT, "");
  8841. ELEM_OPT_TLV(ANSI_A_E_AUTH_CHLG_PARAM, "");
  8842. ELEM_OPT_TLV(ANSI_A_E_AUTH_EVENT, "");
  8843. ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
  8844. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  8845. ELEM_OPT_TLV(ANSI_A_E_AUTH_DATA, "");
  8846. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8847. ELEM_OPT_TLV(ANSI_A_E_CM_INFO_TYPE_2, "");
  8848. ELEM_OPT_TV(ANSI_A_E_SCI, "");
  8849. ELEM_OPT_TV(ANSI_A_E_SO, "");
  8850. ELEM_OPT_TLV(ANSI_A_E_UZ_ID, "");
  8851. ELEM_OPT_TLV(ANSI_A_E_IS2000_MOB_CAP, "");
  8852. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8853. ELEM_OPT_TLV(ANSI_A_E_MOB_SUB_INFO, "");
  8854. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8855. }
  8856. /*
  8857. * IOS 5 3.6.4
  8858. */
  8859. static void
  8860. bsmap_adds_transfer_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8861. {
  8862. guint32 curr_offset;
  8863. guint32 consumed;
  8864. guint curr_len;
  8865. curr_offset = offset;
  8866. curr_len = len;
  8867. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8868. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8869. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8870. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8871. }
  8872. /*
  8873. * IOS 6.1.7.3
  8874. */
  8875. static void
  8876. dtap_adds_deliver(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8877. {
  8878. guint32 curr_offset;
  8879. guint32 consumed;
  8880. guint curr_len;
  8881. curr_offset = offset;
  8882. curr_len = len;
  8883. ELEM_MAND_LV(ANSI_A_E_ADDS_USER_PART, "");
  8884. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8885. ELEM_OPT_TLV(ANSI_A_E_CDMA_SOWD, "");
  8886. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8887. }
  8888. /*
  8889. * IOS 6.1.7.4
  8890. */
  8891. static void
  8892. bsmap_adds_page_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8893. {
  8894. guint32 curr_offset;
  8895. guint32 consumed;
  8896. guint curr_len;
  8897. curr_offset = offset;
  8898. curr_len = len;
  8899. ELEM_MAND_TLV(ANSI_A_E_MID, "");
  8900. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8901. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8902. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8903. ELEM_OPT_TLV(ANSI_A_E_CELL_ID, "");
  8904. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8905. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8906. }
  8907. /*
  8908. * IOS 6.1.7.5
  8909. */
  8910. static void
  8911. dtap_adds_deliver_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8912. {
  8913. guint32 curr_offset;
  8914. guint32 consumed;
  8915. guint curr_len;
  8916. curr_offset = offset;
  8917. curr_len = len;
  8918. ELEM_OPT_TV(ANSI_A_E_TAG, "");
  8919. ELEM_OPT_TLV(ANSI_A_E_CAUSE, "");
  8920. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8921. }
  8922. /*
  8923. * IOS 6.1.8.1
  8924. */
  8925. static void
  8926. bsmap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8927. {
  8928. guint32 curr_offset;
  8929. guint32 consumed;
  8930. guint curr_len;
  8931. curr_offset = offset;
  8932. curr_len = len;
  8933. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8934. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8935. ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
  8936. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8937. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8938. }
  8939. static void
  8940. dtap_rejection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  8941. {
  8942. guint32 curr_offset;
  8943. guint32 consumed;
  8944. guint curr_len;
  8945. curr_offset = offset;
  8946. curr_len = len;
  8947. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8948. ELEM_OPT_TLV(ANSI_A_E_IS2000_CAUSE, "");
  8949. ELEM_OPT_TLV(ANSI_A_E_SOCI, "");
  8950. ELEM_OPT_TLV(ANSI_A_E_MID, "");
  8951. EXTRANEOUS_DATA_CHECK(curr_len, 0);
  8952. }
  8953. #define ANSI_A_IOS401_BSMAP_NUM_MSG (sizeof(ansi_a_ios401_bsmap_strings)/sizeof(ext_value_string_t))
  8954. #define ANSI_A_IOS501_BSMAP_NUM_MSG (sizeof(ansi_a_ios501_bsmap_strings)/sizeof(ext_value_string_t))
  8955. static gint ett_bsmap_msg[MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, ANSI_A_IOS501_BSMAP_NUM_MSG)];
  8956. static void (*bsmap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) =
  8957. {
  8958. bsmap_add_srvc_noti, /* Additional Service Notification */
  8959. bsmap_adds_page, /* ADDS Page */
  8960. bsmap_adds_page_ack, /* ADDS Page Ack */
  8961. bsmap_adds_transfer, /* ADDS Transfer */
  8962. bsmap_adds_transfer_ack, /* ADDS Transfer Ack */
  8963. bsmap_ass_complete, /* Assignment Complete */
  8964. bsmap_ass_failure, /* Assignment Failure */
  8965. bsmap_ass_req, /* Assignment Request */
  8966. bsmap_auth_req, /* Authentication Request */
  8967. bsmap_auth_resp, /* Authentication Response */
  8968. NULL /* no BSMAP definition */, /* Base Station Challenge */
  8969. NULL /* no BSMAP definition */, /* Base Station Challenge Response */
  8970. bsmap_block, /* Block */
  8971. bsmap_block_ack, /* Block Acknowledge */
  8972. bsmap_bs_srvc_req, /* BS Service Request */
  8973. bsmap_bs_srvc_resp, /* BS Service Response */
  8974. bsmap_clr_command, /* Clear Command */
  8975. bsmap_clr_complete, /* Clear Complete */
  8976. bsmap_clr_req, /* Clear Request */
  8977. bsmap_cl3_info, /* Complete Layer 3 Information */
  8978. bsmap_feat_noti, /* Feature Notification */
  8979. bsmap_feat_noti_ack, /* Feature Notification Ack */
  8980. bsmap_ho_command, /* Handoff Command */
  8981. NULL /* no associated data */, /* Handoff Commenced */
  8982. bsmap_ho_complete, /* Handoff Complete */
  8983. bsmap_ho_failure, /* Handoff Failure */
  8984. bsmap_ho_performed, /* Handoff Performed */
  8985. bsmap_ho_req, /* Handoff Request */
  8986. bsmap_ho_req_ack, /* Handoff Request Acknowledge */
  8987. bsmap_ho_reqd, /* Handoff Required */
  8988. bsmap_ho_reqd_rej, /* Handoff Required Reject */
  8989. bsmap_paca_command, /* PACA Command */
  8990. bsmap_paca_command_ack, /* PACA Command Ack */
  8991. bsmap_paca_update, /* PACA Update */
  8992. bsmap_paca_update_ack, /* PACA Update Ack */
  8993. bsmap_page_req, /* Paging Request */
  8994. bsmap_priv_mode_command, /* Privacy Mode Command */
  8995. bsmap_priv_mode_complete, /* Privacy Mode Complete */
  8996. bsmap_rm_pos_req, /* Radio Measurements for Position Request */
  8997. bsmap_rm_pos_resp, /* Radio Measurements for Position Response */
  8998. bsmap_rejection, /* Rejection */
  8999. bsmap_reg_req, /* Registration Request */
  9000. bsmap_reset, /* Reset */
  9001. bsmap_reset_ack, /* Reset Acknowledge */
  9002. bsmap_reset_cct, /* Reset Circuit */
  9003. bsmap_reset_cct_ack, /* Reset Circuit Acknowledge */
  9004. NULL /* no BSMAP definition */, /* SSD Update Request */
  9005. NULL /* no BSMAP definition */, /* SSD Update Response */
  9006. bsmap_status_req, /* Status Request */
  9007. bsmap_status_resp, /* Status Response */
  9008. bsmap_xmode_ack, /* Transcoder Control Acknowledge */
  9009. bsmap_xmode_req, /* Transcoder Control Request */
  9010. bsmap_unblock, /* Unblock */
  9011. bsmap_unblock_ack, /* Unblock Acknowledge */
  9012. bsmap_user_zone_reject, /* User Zone Reject */
  9013. bsmap_user_zone_update, /* User Zone Update */
  9014. bsmap_bearer_upd_req, /* Bearer Update Request *//* IOS 5.0.1 */
  9015. bsmap_bearer_upd_resp, /* Bearer Update Response *//* IOS 5.0.1 */
  9016. bsmap_bearer_upd_reqd, /* Bearer Update Required *//* IOS 5.0.1 */
  9017. bsmap_ms_reg_noti, /* Mobile Station Registered Notification *//* IOS 5.0.1 */
  9018. bsmap_bs_auth_req, /* BS Authentication Request *//* IOS 5.0.1 */
  9019. bsmap_bs_auth_req_ack, /* BS Authentication Request Ack *//* IOS 5.0.1 */
  9020. NULL, /* NONE */
  9021. };
  9022. #define ANSI_A_IOS401_DTAP_NUM_MSG (sizeof(ansi_a_ios401_dtap_strings)/sizeof(ext_value_string_t))
  9023. #define ANSI_A_IOS501_DTAP_NUM_MSG (sizeof(ansi_a_ios501_dtap_strings)/sizeof(ext_value_string_t))
  9024. static gint ett_dtap_msg[MAX(ANSI_A_IOS401_DTAP_NUM_MSG, ANSI_A_IOS501_DTAP_NUM_MSG)];
  9025. static void (*dtap_msg_fcn[])(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offset, guint len) =
  9026. {
  9027. dtap_add_srvc_req, /* Additional Service Request */
  9028. dtap_adds_deliver, /* ADDS Deliver */
  9029. dtap_adds_deliver_ack, /* ADDS Deliver Ack */
  9030. dtap_alert_with_info, /* Alert With Information */
  9031. dtap_auth_req, /* Authentication Request */
  9032. dtap_auth_resp, /* Authentication Response */
  9033. dtap_bs_challenge, /* Base Station Challenge */
  9034. dtap_bs_challenge_resp, /* Base Station Challenge Response */
  9035. dtap_cm_srvc_req, /* CM Service Request */
  9036. dtap_cm_srvc_req_cont, /* CM Service Request Continuation */
  9037. dtap_connect, /* Connect */
  9038. dtap_flash_with_info, /* Flash with Information */
  9039. dtap_flash_with_info_ack, /* Flash with Information Ack */
  9040. dtap_lu_accept, /* Location Updating Accept */
  9041. dtap_lu_reject, /* Location Updating Reject */
  9042. dtap_lu_req, /* Location Updating Request */
  9043. dtap_page_resp, /* Paging Response */
  9044. NULL /* no associated data */, /* Parameter Update Confirm */
  9045. NULL /* no associated data */, /* Parameter Update Request */
  9046. dtap_rejection, /* Rejection */
  9047. dtap_progress, /* Progress */
  9048. dtap_srvc_redirection, /* Service Redirection */
  9049. dtap_srvc_release, /* Service Release */
  9050. dtap_srvc_release_complete, /* Service Release Complete */
  9051. dtap_ssd_update_req, /* SSD Update Request */
  9052. dtap_ssd_update_resp, /* SSD Update Response */
  9053. dtap_status_req, /* Status Request */
  9054. dtap_status_resp, /* Status Response */
  9055. dtap_user_zone_reject, /* User Zone Reject */
  9056. dtap_user_zone_update, /* User Zone Update */
  9057. dtap_user_zone_update_req, /* User Zone Update Request */
  9058. NULL, /* NONE */
  9059. };
  9060. /* Utillity function to dissect CDMA200 A1 elements in ANSI MAP messages */
  9061. void
  9062. dissect_cdma2000_a1_elements(tvbuff_t *tvb, _U_ packet_info *pinfo, proto_tree *tree, guint32 offset, guint len)
  9063. {
  9064. guint32 curr_offset;
  9065. guint32 consumed;
  9066. guint curr_len;
  9067. unsigned idx;
  9068. guint8 oct;
  9069. curr_offset = offset;
  9070. curr_len = len;
  9071. /*
  9072. * require at least 2 octets for T(ype) and L(ength)
  9073. */
  9074. while (curr_len > 1)
  9075. {
  9076. /*
  9077. * peeking at T(ype)
  9078. */
  9079. oct = tvb_get_guint8(tvb, curr_offset);
  9080. for (idx=0; idx < (unsigned)ansi_a_elem_1_max; idx++)
  9081. {
  9082. if (oct == (guint8) ansi_a_elem_1_strings[idx].value)
  9083. {
  9084. ELEM_OPT_TLV((elem_idx_t)idx, "");
  9085. break;
  9086. }
  9087. }
  9088. if (idx == (elem_idx_t)ansi_a_elem_1_max)
  9089. {
  9090. /*
  9091. * didn't recognize the T(ype)
  9092. * assuming it is in TLV form, step over
  9093. */
  9094. consumed = 2 + tvb_get_guint8(tvb, curr_offset + 1);
  9095. curr_offset += consumed;
  9096. curr_len -= consumed;
  9097. }
  9098. }
  9099. EXTRANEOUS_DATA_CHECK_EXPERT(curr_len, 0);
  9100. }
  9101. /* GENERIC DISSECTOR FUNCTIONS */
  9102. static void
  9103. dissect_bsmap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean from_sip)
  9104. {
  9105. static ansi_a_tap_rec_t tap_rec[16];
  9106. static ansi_a_tap_rec_t *tap_p;
  9107. static int tap_current=0;
  9108. guint8 oct;
  9109. guint32 offset, saved_offset;
  9110. guint32 len;
  9111. gint dec_idx;
  9112. proto_item *bsmap_item = NULL;
  9113. proto_tree *bsmap_tree = NULL;
  9114. const gchar *msg_str;
  9115. void *pd_save;
  9116. col_append_str(pinfo->cinfo, COL_INFO, "(BSMAP) ");
  9117. /*
  9118. * set tap record pointer
  9119. */
  9120. tap_current++;
  9121. if (tap_current == array_length(tap_rec))
  9122. {
  9123. tap_current = 0;
  9124. }
  9125. tap_p = &tap_rec[tap_current];
  9126. offset = 0;
  9127. saved_offset = offset;
  9128. g_tree = tree;
  9129. len = tvb_length(tvb);
  9130. /*
  9131. * add BSMAP message name
  9132. */
  9133. oct = tvb_get_guint8(tvb, offset++);
  9134. msg_str = my_try_val_to_str_idx((guint32) oct, ansi_a_bsmap_strings, &dec_idx);
  9135. /*
  9136. * create the a protocol tree
  9137. */
  9138. if (msg_str == NULL)
  9139. {
  9140. bsmap_item =
  9141. proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, len,
  9142. "ANSI A-I/F BSMAP - Unknown BSMAP Message Type (%u)",
  9143. oct);
  9144. bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap);
  9145. }
  9146. else
  9147. {
  9148. bsmap_item =
  9149. proto_tree_add_protocol_format(tree, proto_a_bsmap, tvb, 0, -1,
  9150. "ANSI A-I/F BSMAP - %s",
  9151. msg_str);
  9152. bsmap_tree = proto_item_add_subtree(bsmap_item, ett_bsmap_msg[dec_idx]);
  9153. col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
  9154. }
  9155. /*
  9156. * add BSMAP message name
  9157. */
  9158. proto_tree_add_uint_format(bsmap_tree, hf_ansi_a_bsmap_msgtype,
  9159. tvb, saved_offset, 1, oct, "Message Type");
  9160. tap_p->pdu_type = BSSAP_PDU_TYPE_BSMAP;
  9161. tap_p->message_type = oct;
  9162. tap_queue_packet(ansi_a_tap, pinfo, tap_p);
  9163. if (msg_str == NULL) return;
  9164. if ((len - offset) <= 0) return;
  9165. a_meid_configured = FALSE;
  9166. pd_save = pinfo->private_data;
  9167. pinfo->private_data = GUINT_TO_POINTER((guint)from_sip);
  9168. /*
  9169. * decode elements
  9170. */
  9171. if (bsmap_msg_fcn[dec_idx] == NULL)
  9172. {
  9173. proto_tree_add_text(bsmap_tree,
  9174. tvb, offset, len - offset,
  9175. "Message Elements");
  9176. }
  9177. else
  9178. {
  9179. (*bsmap_msg_fcn[dec_idx])(tvb, pinfo, bsmap_tree, offset, len - offset);
  9180. }
  9181. pinfo->private_data = pd_save;
  9182. }
  9183. static void
  9184. dissect_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  9185. {
  9186. dissect_bsmap_common(tvb, pinfo, tree, FALSE);
  9187. }
  9188. static void
  9189. dissect_dtap_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gboolean from_sip)
  9190. {
  9191. static ansi_a_tap_rec_t tap_rec[16];
  9192. static ansi_a_tap_rec_t *tap_p;
  9193. static int tap_current=0;
  9194. guint8 oct;
  9195. guint32 offset, saved_offset;
  9196. guint32 len;
  9197. guint32 oct_1=0, oct_2=0;
  9198. gint dec_idx;
  9199. proto_item *dtap_item = NULL;
  9200. proto_tree *dtap_tree = NULL;
  9201. proto_item *oct_1_item = NULL;
  9202. proto_tree *oct_1_tree = NULL;
  9203. const gchar *msg_str;
  9204. const gchar *str;
  9205. void *pd_save;
  9206. len = tvb_length(tvb);
  9207. if ((len < 3) && !from_sip)
  9208. {
  9209. /*
  9210. * too short to be DTAP
  9211. */
  9212. call_dissector(data_handle, tvb, pinfo, tree);
  9213. return;
  9214. }
  9215. col_append_str(pinfo->cinfo, COL_INFO, "(DTAP) ");
  9216. /*
  9217. * set tap record pointer
  9218. */
  9219. tap_current++;
  9220. if (tap_current == array_length(tap_rec))
  9221. {
  9222. tap_current = 0;
  9223. }
  9224. tap_p = &tap_rec[tap_current];
  9225. offset = 0;
  9226. saved_offset = offset;
  9227. g_tree = tree;
  9228. /*
  9229. * get protocol discriminator
  9230. */
  9231. if (!from_sip) {
  9232. oct_1 = tvb_get_guint8(tvb, offset++);
  9233. oct_2 = tvb_get_guint8(tvb, offset++);
  9234. }
  9235. /*
  9236. * add DTAP message name
  9237. */
  9238. oct = tvb_get_guint8(tvb, offset++);
  9239. msg_str = my_try_val_to_str_idx((guint32) oct, ansi_a_dtap_strings, &dec_idx);
  9240. /*
  9241. * create the a protocol tree
  9242. */
  9243. if (msg_str == NULL)
  9244. {
  9245. dtap_item =
  9246. proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, len,
  9247. "ANSI A-I/F DTAP - Unknown DTAP Message Type (%u)",
  9248. oct);
  9249. dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap);
  9250. }
  9251. else
  9252. {
  9253. dtap_item =
  9254. proto_tree_add_protocol_format(tree, proto_a_dtap, tvb, 0, -1,
  9255. "ANSI A-I/F DTAP - %s",
  9256. msg_str);
  9257. dtap_tree = proto_item_add_subtree(dtap_item, ett_dtap_msg[dec_idx]);
  9258. col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", msg_str);
  9259. }
  9260. if (!from_sip) {
  9261. /*
  9262. * octet 1
  9263. */
  9264. switch (oct_1 & 0x0f)
  9265. {
  9266. case 3: str = "Call Control, call related SS"; break;
  9267. case 5: str = "Mobility Management"; break;
  9268. case 6: str = "Radio Resource Management"; break;
  9269. case 9: str = "Facility Management"; break;
  9270. case 11: str = "Other Signaling Procedures"; break;
  9271. case 15: str = "Reserved for tests"; break;
  9272. default:
  9273. str = "Unknown";
  9274. break;
  9275. }
  9276. oct_1_item =
  9277. proto_tree_add_text(dtap_tree,
  9278. tvb, 0, 1,
  9279. "Protocol Discriminator: %s",
  9280. str);
  9281. oct_1_tree = proto_item_add_subtree(oct_1_item, ett_dtap_oct_1);
  9282. other_decode_bitfield_value(a_bigbuf, oct_1, 0xf0, 8);
  9283. proto_tree_add_text(oct_1_tree,
  9284. tvb, 0, 1,
  9285. "%s : Reserved",
  9286. a_bigbuf);
  9287. other_decode_bitfield_value(a_bigbuf, oct_1, 0x0f, 8);
  9288. proto_tree_add_text(oct_1_tree,
  9289. tvb, 0, 1,
  9290. "%s : Protocol Discriminator: %u",
  9291. a_bigbuf,
  9292. oct_1 & 0x0f);
  9293. /*
  9294. * octet 2
  9295. */
  9296. switch (global_a_variant)
  9297. {
  9298. case A_VARIANT_IS634:
  9299. other_decode_bitfield_value(a_bigbuf, oct_2, 0x80, 8);
  9300. proto_tree_add_text(dtap_tree,
  9301. tvb, 1, 1,
  9302. "%s : Transaction Identifier (TI) Flag: %s",
  9303. a_bigbuf,
  9304. ((oct_2 & 0x80) ? "allocated by receiver" : "allocated by sender"));
  9305. other_decode_bitfield_value(a_bigbuf, oct_2, 0x70, 8);
  9306. proto_tree_add_text(dtap_tree,
  9307. tvb, 1, 1,
  9308. "%s : Transaction Identifier (TI): %u",
  9309. a_bigbuf,
  9310. (oct_2 & 0x70) >> 4);
  9311. other_decode_bitfield_value(a_bigbuf, oct_2, 0x0f, 8);
  9312. proto_tree_add_text(dtap_tree,
  9313. tvb, 1, 1,
  9314. "%s : Reserved",
  9315. a_bigbuf);
  9316. break;
  9317. default:
  9318. proto_tree_add_text(dtap_tree,
  9319. tvb, 1, 1,
  9320. "Reserved Octet");
  9321. break;
  9322. }
  9323. }
  9324. /*
  9325. * add DTAP message name
  9326. */
  9327. proto_tree_add_uint_format(dtap_tree, hf_ansi_a_dtap_msgtype,
  9328. tvb, saved_offset, 1, oct,
  9329. "Message Type");
  9330. tap_p->pdu_type = BSSAP_PDU_TYPE_DTAP;
  9331. tap_p->message_type = oct;
  9332. tap_queue_packet(ansi_a_tap, pinfo, tap_p);
  9333. if (msg_str == NULL) return;
  9334. if ((len - offset) <= 0) return;
  9335. a_meid_configured = FALSE;
  9336. pd_save = pinfo->private_data;
  9337. pinfo->private_data = GUINT_TO_POINTER((guint)from_sip);
  9338. /*
  9339. * decode elements
  9340. */
  9341. if (dtap_msg_fcn[dec_idx] == NULL)
  9342. {
  9343. proto_tree_add_text(dtap_tree,
  9344. tvb, offset, len - offset,
  9345. "Message Elements");
  9346. }
  9347. else
  9348. {
  9349. (*dtap_msg_fcn[dec_idx])(tvb, pinfo, dtap_tree, offset, len - offset);
  9350. }
  9351. pinfo->private_data = pd_save;
  9352. }
  9353. static void
  9354. dissect_dtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  9355. {
  9356. dissect_dtap_common(tvb, pinfo, tree, FALSE);
  9357. }
  9358. static void
  9359. dissect_sip_dtap_bsmap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  9360. {
  9361. gint linelen, offset, next_offset, begin;
  9362. guint8 *msg_type;
  9363. tvbuff_t *ansi_a_tvb;
  9364. gboolean is_dtap = TRUE;
  9365. offset = 0;
  9366. if ((linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE)) > 0) {
  9367. if (linelen >= 2) {
  9368. ansi_a_tvb = tvb_new_composite();
  9369. msg_type = (guint8*)wmem_alloc(pinfo->pool, 1);
  9370. msg_type[0] = (guint8)strtoul(tvb_get_ephemeral_string(tvb, offset, 2), NULL, 16);
  9371. if ((begin = tvb_find_guint8(tvb, offset, linelen, '"')) > 0) {
  9372. if (tvb_get_guint8(tvb, begin + 1) == '1') {
  9373. is_dtap = FALSE;
  9374. }
  9375. } else {
  9376. if (my_try_val_to_str_idx((guint32) msg_type[0], ansi_a_dtap_strings, &linelen) == NULL) {
  9377. is_dtap = FALSE;
  9378. }
  9379. }
  9380. tvb_composite_append(ansi_a_tvb, tvb_new_child_real_data(tvb, msg_type, 1, 1));
  9381. offset = next_offset;
  9382. while ((linelen = tvb_find_line_end(tvb, offset, -1, &next_offset, TRUE)) > 0) {
  9383. if ((begin = tvb_find_guint8(tvb, offset, linelen, '=')) > 0) {
  9384. begin++;
  9385. tvb_composite_append(ansi_a_tvb, base64_to_tvb(tvb, tvb_get_ephemeral_string(tvb, begin, offset + linelen - begin)));
  9386. }
  9387. offset = next_offset;
  9388. }
  9389. tvb_composite_finalize(ansi_a_tvb);
  9390. if (is_dtap) {
  9391. add_new_data_source(pinfo, ansi_a_tvb, "ANSI DTAP");
  9392. dissect_dtap_common(ansi_a_tvb, pinfo, tree, TRUE);
  9393. } else {
  9394. add_new_data_source(pinfo, ansi_a_tvb, "ANSI BSMAP");
  9395. dissect_bsmap_common(ansi_a_tvb, pinfo, tree, TRUE);
  9396. }
  9397. }
  9398. }
  9399. }
  9400. /* Register the protocol with Wireshark */
  9401. void
  9402. proto_register_ansi_a(void)
  9403. {
  9404. module_t *ansi_a_module;
  9405. guint i;
  9406. gint last_offset;
  9407. /* Setup list of header fields */
  9408. static hf_register_info hf[] =
  9409. {
  9410. { &hf_ansi_a_bsmap_msgtype,
  9411. { "BSMAP Message Type", "ansi_a_bsmap.msgtype",
  9412. FT_UINT8, BASE_HEX, NULL, 0x0,
  9413. NULL, HFILL }
  9414. },
  9415. { &hf_ansi_a_dtap_msgtype,
  9416. { "DTAP Message Type", "ansi_a_bsmap.dtap_msgtype",
  9417. FT_UINT8, BASE_HEX, NULL, 0x0,
  9418. NULL, HFILL }
  9419. },
  9420. { &hf_ansi_a_elem_id,
  9421. { "Element ID", "ansi_a_bsmap.elem_id",
  9422. FT_UINT8, BASE_DEC, NULL, 0,
  9423. NULL, HFILL }
  9424. },
  9425. { &hf_ansi_a_length,
  9426. { "Length", "ansi_a_bsmap.len",
  9427. FT_UINT8, BASE_DEC, NULL, 0,
  9428. NULL, HFILL }
  9429. },
  9430. #if 0
  9431. { &hf_ansi_a_none,
  9432. { "Sub tree", "ansi_a_bsmap.none",
  9433. FT_NONE, BASE_NONE, 0, 0,
  9434. NULL, HFILL }
  9435. },
  9436. #endif
  9437. { &hf_ansi_a_esn,
  9438. { "ESN", "ansi_a_bsmap.esn",
  9439. FT_UINT32, BASE_HEX, 0, 0x0,
  9440. NULL, HFILL }
  9441. },
  9442. { &hf_ansi_a_imsi,
  9443. { "IMSI", "ansi_a_bsmap.imsi",
  9444. FT_STRING, BASE_NONE, 0, 0,
  9445. NULL, HFILL }
  9446. },
  9447. { &hf_ansi_a_min,
  9448. { "MIN", "ansi_a_bsmap.min",
  9449. FT_STRING, BASE_NONE, 0, 0,
  9450. NULL, HFILL }
  9451. },
  9452. { &hf_ansi_a_meid,
  9453. { "MEID", "ansi_a_bsmap.meid",
  9454. FT_STRING, BASE_NONE, 0, 0,
  9455. NULL, HFILL }
  9456. },
  9457. { &hf_ansi_a_cld_party_bcd_num,
  9458. { "Called Party BCD Number", "ansi_a_bsmap.cld_party_bcd_num",
  9459. FT_STRING, BASE_NONE, 0, 0,
  9460. NULL, HFILL }
  9461. },
  9462. #ifdef MAYBE_USED_FOR_OLDER_CODECS
  9463. { &hf_ansi_a_clg_party_bcd_num,
  9464. { "Calling Party BCD Number", "ansi_a_bsmap.clg_party_bcd_num",
  9465. FT_STRING, BASE_NONE, 0, 0,
  9466. NULL, HFILL }
  9467. },
  9468. #endif
  9469. { &hf_ansi_a_cld_party_ascii_num,
  9470. { "Called Party ASCII Number", "ansi_a_bsmap.cld_party_ascii_num",
  9471. FT_STRING, BASE_NONE, 0, 0,
  9472. NULL, HFILL }
  9473. },
  9474. { &hf_ansi_a_clg_party_ascii_num,
  9475. { "Calling Party ASCII Number", "ansi_a_bsmap.clg_party_ascii_num",
  9476. FT_STRING, BASE_NONE, 0, 0,
  9477. NULL, HFILL }
  9478. },
  9479. { &hf_ansi_a_cell_ci,
  9480. { "Cell CI", "ansi_a_bsmap.cell_ci",
  9481. FT_UINT16, BASE_HEX, 0, 0x0,
  9482. NULL, HFILL }
  9483. },
  9484. { &hf_ansi_a_cell_lac,
  9485. { "Cell LAC", "ansi_a_bsmap.cell_lac",
  9486. FT_UINT16, BASE_HEX, 0, 0x0,
  9487. NULL, HFILL }
  9488. },
  9489. { &hf_ansi_a_cell_mscid,
  9490. { "Cell MSCID", "ansi_a_bsmap.cell_mscid",
  9491. FT_UINT24, BASE_HEX, 0, 0x0,
  9492. NULL, HFILL }
  9493. },
  9494. { &hf_ansi_a_pdsn_ip_addr,
  9495. { "PDSN IP Address", "ansi_a_bsmap.pdsn_ip_addr",
  9496. FT_IPv4, BASE_NONE, NULL, 0,
  9497. "IP Address", HFILL }
  9498. },
  9499. { &hf_ansi_a_s_pdsn_ip_addr,
  9500. { "Source PDSN Address", "ansi_a_bsmap.s_pdsn_ip_addr",
  9501. FT_IPv4, BASE_NONE, NULL, 0,
  9502. "IP Address", HFILL }
  9503. },
  9504. { &hf_ansi_a_anchor_ip_addr,
  9505. { "Anchor PDSN Address", "ansi_a_bsmap.anchor_pdsn_ip_addr",
  9506. FT_IPv4, BASE_NONE, NULL, 0,
  9507. "IP Address", HFILL }
  9508. },
  9509. { &hf_ansi_a_anchor_pp_ip_addr,
  9510. { "Anchor P-P Address", "ansi_a_bsmap.anchor_pp_ip_addr",
  9511. FT_IPv4, BASE_NONE, NULL, 0,
  9512. "IP Address", HFILL }
  9513. },
  9514. { &hf_ansi_a_a2p_bearer_ipv4_addr,
  9515. { "A2p Bearer IP Address", "ansi_a_bsmap.a2p_bearer_ipv4_addr",
  9516. FT_IPv4, BASE_NONE, NULL, 0,
  9517. NULL, HFILL }
  9518. },
  9519. { &hf_ansi_a_a2p_bearer_ipv6_addr,
  9520. { "A2p Bearer IP Address", "ansi_a_bsmap.a2p_bearer_ipv6_addr",
  9521. FT_IPv6, BASE_NONE, NULL, 0,
  9522. NULL, HFILL }
  9523. },
  9524. { &hf_ansi_a_a2p_bearer_udp_port,
  9525. { "A2p Bearer UDP Port", "ansi_a_bsmap.a2p_bearer_udp_port",
  9526. FT_UINT16, BASE_DEC, NULL, 0,
  9527. NULL, HFILL }
  9528. },
  9529. { &hf_ansi_a_so,
  9530. { "Service Option", "ansi_a_bsmap.so",
  9531. FT_UINT16, BASE_DEC, NULL, 0,
  9532. NULL, HFILL }
  9533. },
  9534. { &hf_ansi_a_cause_1,
  9535. { "Cause", "ansi_a_bsmap.cause_1",
  9536. FT_UINT8, BASE_DEC, NULL, 0,
  9537. NULL, HFILL }
  9538. },
  9539. { &hf_ansi_a_cause_2,
  9540. { "Cause", "ansi_a_bsmap.cause_2",
  9541. FT_UINT16, BASE_DEC, NULL, 0,
  9542. NULL, HFILL }
  9543. },
  9544. { &hf_ansi_a_meid_configured,
  9545. { "Is MEID configured", "ansi_a_bsmap.meid_configured",
  9546. FT_BOOLEAN, BASE_NONE, NULL, 0x0,
  9547. NULL, HFILL }
  9548. }
  9549. };
  9550. static ei_register_info ei[] = {
  9551. { &ei_ansi_a_extraneous_data, { "ansi_a.extraneous_data", PI_PROTOCOL, PI_NOTE, "Extraneous Data, dissector bug or later version spec(report to wireshark.org)", EXPFILL }},
  9552. };
  9553. expert_module_t* expert_a_bsmap;
  9554. static const enum_val_t a_variant_options[] = {
  9555. { "is-634-rev0", "IS-634 rev. 0", A_VARIANT_IS634 },
  9556. { "tsb-80", "TSB-80", A_VARIANT_TSB80 },
  9557. { "is-634-a", "IS-634-A", A_VARIANT_IS634A },
  9558. { "ios-2.x", "IOS 2.x", A_VARIANT_IOS2 },
  9559. { "ios-3.x", "IOS 3.x", A_VARIANT_IOS3 },
  9560. { "ios-4.0.1", "IOS 4.0.1", A_VARIANT_IOS401 },
  9561. { "ios-5.0.1", "IOS 5.0.1", A_VARIANT_IOS501 },
  9562. { NULL, NULL, 0 }
  9563. };
  9564. /* Setup protocol subtree array */
  9565. #define MAX_NUM_DTAP_MSG MAX(ANSI_A_IOS401_DTAP_NUM_MSG, ANSI_A_IOS501_DTAP_NUM_MSG)
  9566. #define MAX_NUM_BSMAP_MSG MAX(ANSI_A_IOS401_BSMAP_NUM_MSG, ANSI_A_IOS501_BSMAP_NUM_MSG)
  9567. #define MAX_NUM_ELEM_1 MAX(MAX_IOS401_NUM_ELEM_1, MAX_IOS501_NUM_ELEM_1)
  9568. #define NUM_INDIVIDUAL_ELEMS 18
  9569. gint **ett;
  9570. gint ett_len = (NUM_INDIVIDUAL_ELEMS+MAX_NUM_DTAP_MSG+MAX_NUM_BSMAP_MSG+MAX_NUM_ELEM_1+NUM_FWD_MS_INFO_REC+NUM_REV_MS_INFO_REC) * sizeof(gint *);
  9571. /*
  9572. * XXX - at least one version of the HP C compiler apparently doesn't
  9573. * recognize constant expressions using the "?" operator as being
  9574. * constant expressions, so you can't use the expression that
  9575. * initializes "ett_let" as an array size. Therefore, we dynamically
  9576. * allocate the array instead.
  9577. */
  9578. ett = (gint **) g_malloc(ett_len);
  9579. memset((void *) ett_dtap_msg, -1, sizeof(ett_dtap_msg));
  9580. memset((void *) ett_bsmap_msg, -1, sizeof(ett_bsmap_msg));
  9581. memset((void *) ett_ansi_elem_1, -1, sizeof(ett_ansi_elem_1));
  9582. memset((void *) ett_ansi_fwd_ms_info_rec, -1, sizeof(gint) * NUM_FWD_MS_INFO_REC);
  9583. memset((void *) ett_ansi_rev_ms_info_rec, -1, sizeof(gint) * NUM_REV_MS_INFO_REC);
  9584. ett[0] = &ett_bsmap;
  9585. ett[1] = &ett_dtap;
  9586. ett[2] = &ett_elems;
  9587. ett[3] = &ett_elem;
  9588. ett[4] = &ett_dtap_oct_1;
  9589. ett[5] = &ett_cm_srvc_type;
  9590. ett[6] = &ett_ansi_ms_info_rec_reserved;
  9591. ett[7] = &ett_ansi_enc_info;
  9592. ett[8] = &ett_cell_list;
  9593. ett[9] = &ett_bearer_list;
  9594. ett[10] = &ett_re_list;
  9595. ett[11] = &ett_so_list;
  9596. ett[12] = &ett_scm;
  9597. ett[13] = &ett_adds_user_part;
  9598. ett[14] = &ett_scr;
  9599. ett[15] = &ett_srvc_con_rec;
  9600. ett[16] = &ett_cm2_band_class;
  9601. ett[17] = &ett_vp_algs;
  9602. last_offset = NUM_INDIVIDUAL_ELEMS;
  9603. for (i=0; i < MAX_NUM_DTAP_MSG; i++, last_offset++)
  9604. {
  9605. ett[last_offset] = &ett_dtap_msg[i];
  9606. }
  9607. for (i=0; i < MAX_NUM_BSMAP_MSG; i++, last_offset++)
  9608. {
  9609. ett[last_offset] = &ett_bsmap_msg[i];
  9610. }
  9611. for (i=0; i < MAX_NUM_ELEM_1; i++, last_offset++)
  9612. {
  9613. ett[last_offset] = &ett_ansi_elem_1[i];
  9614. }
  9615. for (i=0; i < NUM_FWD_MS_INFO_REC; i++, last_offset++)
  9616. {
  9617. ett[last_offset] = &ett_ansi_fwd_ms_info_rec[i];
  9618. }
  9619. for (i=0; i < NUM_REV_MS_INFO_REC; i++, last_offset++)
  9620. {
  9621. ett[last_offset] = &ett_ansi_rev_ms_info_rec[i];
  9622. }
  9623. /* Register the protocol name and description */
  9624. proto_a_bsmap =
  9625. proto_register_protocol("ANSI A-I/F BSMAP", "ANSI BSMAP", "ansi_a_bsmap");
  9626. proto_register_field_array(proto_a_bsmap, hf, array_length(hf));
  9627. expert_a_bsmap = expert_register_protocol(proto_a_bsmap);
  9628. expert_register_field_array(expert_a_bsmap, ei, array_length(ei));
  9629. proto_a_dtap =
  9630. proto_register_protocol("ANSI A-I/F DTAP", "ANSI DTAP", "ansi_a_dtap");
  9631. is637_dissector_table =
  9632. register_dissector_table("ansi_a.sms", "IS-637-A (SMS)",
  9633. FT_UINT8, BASE_DEC);
  9634. is683_dissector_table =
  9635. register_dissector_table("ansi_a.ota", "IS-683-A (OTA)",
  9636. FT_UINT8, BASE_DEC);
  9637. is801_dissector_table =
  9638. register_dissector_table("ansi_a.pld", "IS-801 (PLD)",
  9639. FT_UINT8, BASE_DEC);
  9640. proto_register_subtree_array(ett, ett_len / (int)sizeof(gint *));
  9641. ansi_a_tap = register_tap("ansi_a");
  9642. /*
  9643. * setup for preferences
  9644. */
  9645. ansi_a_module = prefs_register_protocol(proto_a_bsmap, proto_reg_handoff_ansi_a);
  9646. prefs_register_enum_preference(ansi_a_module,
  9647. "global_variant",
  9648. "Dissect PDU as",
  9649. "(if other than the default of IOS 4.0.1)",
  9650. &global_a_variant,
  9651. a_variant_options,
  9652. FALSE);
  9653. g_free(ett);
  9654. }
  9655. void
  9656. proto_reg_handoff_ansi_a(void)
  9657. {
  9658. static gboolean ansi_a_prefs_initialized = FALSE;
  9659. if (!ansi_a_prefs_initialized)
  9660. {
  9661. dissector_handle_t bsmap_handle, sip_dtap_bsmap_handle;
  9662. bsmap_handle = create_dissector_handle(dissect_bsmap, proto_a_bsmap);
  9663. dtap_handle = create_dissector_handle(dissect_dtap, proto_a_dtap);
  9664. sip_dtap_bsmap_handle = create_dissector_handle(dissect_sip_dtap_bsmap, proto_a_dtap);
  9665. data_handle = find_dissector("data");
  9666. rtp_handle = find_dissector("rtp");
  9667. dissector_add_uint("bsap.pdu_type", BSSAP_PDU_TYPE_BSMAP, bsmap_handle);
  9668. dissector_add_uint("bsap.pdu_type", BSSAP_PDU_TYPE_DTAP, dtap_handle);
  9669. dissector_add_string("media_type", "application/femtointerfacemsg", sip_dtap_bsmap_handle);
  9670. dissector_add_string("media_type", "application/vnd.3gpp2.femtointerfacemsg", sip_dtap_bsmap_handle);
  9671. ansi_a_prefs_initialized = TRUE;
  9672. }
  9673. switch (global_a_variant)
  9674. {
  9675. case A_VARIANT_IOS501:
  9676. ansi_a_bsmap_strings = ansi_a_ios501_bsmap_strings;
  9677. ansi_a_dtap_strings = ansi_a_ios501_dtap_strings;
  9678. ansi_a_elem_1_strings = ansi_a_ios501_elem_1_strings;
  9679. ansi_a_elem_1_max = (elem_idx_t)MAX_IOS501_NUM_ELEM_1;
  9680. break;
  9681. default:
  9682. ansi_a_bsmap_strings = ansi_a_ios401_bsmap_strings;
  9683. ansi_a_dtap_strings = ansi_a_ios401_dtap_strings;
  9684. ansi_a_elem_1_strings = ansi_a_ios401_elem_1_strings;
  9685. ansi_a_elem_1_max = (elem_idx_t)MAX_IOS401_NUM_ELEM_1;
  9686. break;
  9687. }
  9688. }