1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887
|
/* packet-btlmp.c
* Routines for Bluetooth LMP dissection
* Copyright 2009, Michael Ossmann <mike@ossmann.com>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#else
#include <wireshark/config.h>
#endif
#include <wireshark/config.h> /* needed for epan/gcc-4.x */
#include <epan/packet.h>
#include <epan/prefs.h>
/* LMP opcodes */
#define LMP_NAME_REQ 1
#define LMP_NAME_RES 2
#define LMP_ACCEPTED 3
#define LMP_NOT_ACCEPTED 4
#define LMP_CLKOFFSET_REQ 5
#define LMP_CLKOFFSET_RES 6
#define LMP_DETACH 7
#define LMP_IN_RAND 8
#define LMP_COMB_KEY 9
#define LMP_UNIT_KEY 10
#define LMP_AU_RAND 11
#define LMP_SRES 12
#define LMP_TEMP_RAND 13
#define LMP_TEMP_KEY 14
#define LMP_ENCRYPTION_MODE_REQ 15
#define LMP_ENCRYPTION_KEY_SIZE_REQ 16
#define LMP_START_ENCRYPTION_REQ 17
#define LMP_STOP_ENCRYPTION_REQ 18
#define LMP_SWITCH_REQ 19
#define LMP_HOLD 20
#define LMP_HOLD_REQ 21
#define LMP_SNIFF_REQ 23
#define LMP_UNSNIFF_REQ 24
#define LMP_PARK_REQ 25
#define LMP_SET_BROADCAST_SCAN_WINDOW 27
#define LMP_MODIFY_BEACON 28
#define LMP_UNPARK_BD_ADDR_REQ 29
#define LMP_UNPARK_PM_ADDR_REQ 30
#define LMP_INCR_POWER_REQ 31
#define LMP_DECR_POWER_REQ 32
#define LMP_MAX_POWER 33
#define LMP_MIN_POWER 34
#define LMP_AUTO_RATE 35
#define LMP_PREFERRED_RATE 36
#define LMP_VERSION_REQ 37
#define LMP_VERSION_RES 38
#define LMP_FEATURES_REQ 39
#define LMP_FEATURES_RES 40
#define LMP_QUALITY_OF_SERVICE 41
#define LMP_QUALITY_OF_SERVICE_REQ 42
#define LMP_SCO_LINK_REQ 43
#define LMP_REMOVE_SCO_LINK_REQ 44
#define LMP_MAX_SLOT 45
#define LMP_MAX_SLOT_REQ 46
#define LMP_TIMING_ACCURACY_REQ 47
#define LMP_TIMING_ACCURACY_RES 48
#define LMP_SETUP_COMPLETE 49
#define LMP_USE_SEMI_PERMANENT_KEY 50
#define LMP_HOST_CONNECTION_REQ 51
#define LMP_SLOT_OFFSET 52
#define LMP_PAGE_MODE_REQ 53
#define LMP_PAGE_SCAN_MODE_REQ 54
#define LMP_SUPERVISION_TIMEOUT 55
#define LMP_TEST_ACTIVATE 56
#define LMP_TEST_CONTROL 57
#define LMP_ENCRYPTION_KEY_SIZE_MASK_REQ 58
#define LMP_ENCRYPTION_KEY_SIZE_MASK_RES 59
#define LMP_SET_AFH 60
#define LMP_ENCAPSULATED_HEADER 61
#define LMP_ENCAPSULATED_PAYLOAD 62
#define LMP_SIMPLE_PAIRING_CONFIRM 63
#define LMP_SIMPLE_PAIRING_NUMBER 64
#define LMP_DHKEY_CHECK 65
#define LMP_ESCAPE_1 124
#define LMP_ESCAPE_2 125
#define LMP_ESCAPE_3 126
#define LMP_ESCAPE_4 127
/* LMP extended opcodes */
#define LMP_ACCEPTED_EXT 1
#define LMP_NOT_ACCEPTED_EXT 2
#define LMP_FEATURES_REQ_EXT 3
#define LMP_FEATURES_RES_EXT 4
#define LMP_PACKET_TYPE_TABLE_REQ 11
#define LMP_ESCO_LINK_REQ 12
#define LMP_REMOVE_ESCO_LINK_REQ 13
#define LMP_CHANNEL_CLASSIFICATION_REQ 16
#define LMP_CHANNEL_CLASSIFICATION 17
#define LMP_SNIFF_SUBRATING_REQ 21
#define LMP_SNIFF_SUBRATING_RES 22
#define LMP_PAUSE_ENCRYPTION_REQ 23
#define LMP_RESUME_ENCRYPTION_REQ 24
#define LMP_IO_CAPABILITY_REQ 25
#define LMP_IO_CAPABILITY_RES 26
#define LMP_NUMERIC_COMPARISON_FAILED 27
#define LMP_PASSKEY_FAILED 28
#define LMP_OOB_FAILED 29
#define LMP_KEYPRESS_NOTIFICATION 30
#define LMP_POWER_CONTROL_REQ 31
#define LMP_POWER_CONTROL_RES 32
/* initialize the protocol and registered fields */
static int proto_btlmp = -1;
static int hf_lmp_accscheme = -1;
static int hf_lmp_afhchmap = -1;
static int hf_lmp_afhclass = -1;
static int hf_lmp_afhinst = -1;
static int hf_lmp_afhmaxintvl = -1;
static int hf_lmp_afhminintvl = -1;
static int hf_lmp_afhmode = -1;
static int hf_lmp_afhrptmode = -1;
static int hf_lmp_airmode = -1;
static int hf_lmp_araddr = -1;
static int hf_lmp_authreqs = -1;
static int hf_lmp_authres = -1;
static int hf_lmp_bdaddr = -1;
static int hf_lmp_bdaddr1 = -1;
static int hf_lmp_bdaddr2 = -1;
static int hf_lmp_bsw = -1;
static int hf_lmp_clkoffset = -1;
static int hf_lmp_commit = -1;
static int hf_lmp_confirm = -1;
static int hf_lmp_compid = -1;
static int hf_lmp_cryptmode = -1;
static int hf_lmp_daccess = -1;
static int hf_lmp_db = -1;
static int hf_lmp_dbsleep = -1;
static int hf_lmp_deltab = -1;
static int hf_lmp_desco = -1;
static int hf_lmp_drift = -1;
static int hf_lmp_dsco = -1;
static int hf_lmp_dsniff = -1;
static int hf_lmp_encdata = -1;
static int hf_lmp_enclen = -1;
static int hf_lmp_encmaj = -1;
static int hf_lmp_encmin = -1;
static int hf_lmp_eop = -1;
static int hf_lmp_eopinre = -1;
static int hf_lmp_escolenms = -1;
static int hf_lmp_escolensm = -1;
static int hf_lmp_escotypems = -1;
static int hf_lmp_escotypesm = -1;
static int hf_lmp_err = -1;
static int hf_lmp_escohdl = -1;
static int hf_lmp_escoltaddr = -1;
static int hf_lmp_features = -1;
static int hf_lmp_fpage = -1;
static int hf_lmp_htime = -1;
static int hf_lmp_hinst = -1;
static int hf_lmp_hopmode = -1;
static int hf_lmp_iocaps = -1;
static int hf_lmp_jitter = -1;
static int hf_lmp_key = -1;
static int hf_lmp_keysz = -1;
static int hf_lmp_ksmask = -1;
static int hf_lmp_ltaddr1 = -1;
static int hf_lmp_ltaddr2 = -1;
static int hf_lmp_ltaddr3 = -1;
static int hf_lmp_ltaddr4 = -1;
static int hf_lmp_ltaddr5 = -1;
static int hf_lmp_ltaddr6 = -1;
static int hf_lmp_ltaddr7 = -1;
static int hf_lmp_maccess = -1;
static int hf_lmp_maxslots = -1;
static int hf_lmp_maxsp = -1;
static int hf_lmp_maxss = -1;
static int hf_lmp_minsmt = -1;
static int hf_lmp_naccslots = -1;
static int hf_lmp_namefrag = -1;
static int hf_lmp_namelen = -1;
static int hf_lmp_nameoffset = -1;
static int hf_lmp_nb = -1;
static int hf_lmp_nbc = -1;
static int hf_lmp_nbsleep = -1;
static int hf_lmp_negstate = -1;
static int hf_lmp_nonce = -1;
static int hf_lmp_nottype = -1;
static int hf_lmp_npoll = -1;
static int hf_lmp_oobauthdata = -1;
static int hf_lmp_op = -1;
static int hf_lmp_opinre = -1;
static int hf_lmp_pagesch = -1;
static int hf_lmp_pcmode = -1;
static int hf_lmp_pkttype = -1;
static int hf_lmp_pkttypetbl = -1;
static int hf_lmp_pmaddr = -1;
static int hf_lmp_pmaddr1 = -1;
static int hf_lmp_pmaddr2 = -1;
static int hf_lmp_pmaddr3 = -1;
static int hf_lmp_pmaddr4 = -1;
static int hf_lmp_pmaddr5 = -1;
static int hf_lmp_pmaddr6 = -1;
static int hf_lmp_pmaddr7 = -1;
static int hf_lmp_pollintvl = -1;
static int hf_lmp_pollper = -1;
static int hf_lmp_pssettings = -1;
static int hf_lmp_pwradjreq = -1;
static int hf_lmp_pwradjres = -1;
static int hf_lmp_pwradj_8dpsk = -1;
static int hf_lmp_pwradj_dqpsk = -1;
static int hf_lmp_pwradj_gfsk = -1;
static int hf_lmp_rand = -1;
static int hf_lmp_rate = -1;
static int hf_lmp_rate_fec = -1;
static int hf_lmp_rate_size = -1;
static int hf_lmp_rate_type = -1;
static int hf_lmp_rate_edrsize = -1;
static int hf_lmp_rxfreq = -1;
static int hf_lmp_scohdl = -1;
static int hf_lmp_scopkt = -1;
static int hf_lmp_slotoffset = -1;
static int hf_lmp_sniffatt = -1;
static int hf_lmp_sniffsi = -1;
static int hf_lmp_sniffto = -1;
static int hf_lmp_subversnr = -1;
static int hf_lmp_suptimeout = -1;
static int hf_lmp_swinst = -1;
static int hf_lmp_taccess = -1;
static int hf_lmp_tb = -1;
static int hf_lmp_tesco = -1;
static int hf_lmp_testlen = -1;
static int hf_lmp_testscen = -1;
static int hf_lmp_tid = -1;
static int hf_lmp_timectrl = -1;
static int hf_lmp_time_change = -1;
static int hf_lmp_time_init = -1;
static int hf_lmp_time_accwin = -1;
static int hf_lmp_tsco = -1;
static int hf_lmp_tsniff = -1;
static int hf_lmp_txfreq = -1;
static int hf_lmp_versnr = -1;
static int hf_lmp_wesco = -1;
/* timing control flags */
static const int *timectrl_fields[] = {
&hf_lmp_time_change,
&hf_lmp_time_init,
&hf_lmp_time_accwin,
/* bits 3-7 reserved */
NULL
};
static const true_false_string time_change = {
"timing change",
"no timing change"
};
static const true_false_string time_init = {
"use initialization 2",
"use initialization 1"
};
static const true_false_string time_accwin = {
"no access window",
"access window"
};
static const true_false_string fec = {
"do not use FEC",
"use FEC"
};
static const true_false_string tid = {
"transaction initiated by slave",
"transaction initiated by master"
};
/* short LMP opcodes */
static const value_string opcode[] = {
{ LMP_NAME_REQ, "LMP_name_req" },
{ LMP_NAME_RES, "LMP_name_res" },
{ LMP_ACCEPTED, "LMP_accepted" },
{ LMP_NOT_ACCEPTED, "LMP_not_accepted" },
{ LMP_CLKOFFSET_REQ, "LMP_clkoffset_req" },
{ LMP_CLKOFFSET_RES, "LMP_clkoffset_res" },
{ LMP_DETACH, "LMP_detach" },
{ LMP_IN_RAND, "LMP_in_rand" },
{ LMP_COMB_KEY, "LMP_comb_key" },
{ LMP_UNIT_KEY, "LMP_unit_key" },
{ LMP_AU_RAND, "LMP_au_rand" },
{ LMP_SRES, "LMP_sres" },
{ LMP_TEMP_RAND, "LMP_temp_rand" },
{ LMP_TEMP_KEY, "LMP_temp_key" },
{ LMP_ENCRYPTION_MODE_REQ, "LMP_encryption_mode_req" },
{ LMP_ENCRYPTION_KEY_SIZE_REQ, "LMP_encryption_key_size_req" },
{ LMP_START_ENCRYPTION_REQ, "LMP_start_encryption_req" },
{ LMP_STOP_ENCRYPTION_REQ, "LMP_stop_encryption_req" },
{ LMP_SWITCH_REQ, "LMP_switch_req" },
{ LMP_HOLD, "LMP_hold" },
{ LMP_HOLD_REQ, "LMP_hold_req" },
{ LMP_SNIFF_REQ, "LMP_sniff_req" },
{ LMP_UNSNIFF_REQ, "LMP_unsniff_req" },
{ LMP_PARK_REQ, "LMP_park_req" },
{ LMP_SET_BROADCAST_SCAN_WINDOW, "LMP_set_broadcast_scan_window" },
{ LMP_MODIFY_BEACON, "LMP_modify_beacon" },
{ LMP_UNPARK_BD_ADDR_REQ, "LMP_unpark_BD_ADDR_req" },
{ LMP_UNPARK_PM_ADDR_REQ, "LMP_unpark_PM_ADDR_req" },
{ LMP_INCR_POWER_REQ, "LMP_incr_power_req" },
{ LMP_DECR_POWER_REQ, "LMP_decr_power_req" },
{ LMP_MAX_POWER, "LMP_max_power" },
{ LMP_MIN_POWER, "LMP_min_power" },
{ LMP_AUTO_RATE, "LMP_auto_rate" },
{ LMP_PREFERRED_RATE, "LMP_preferred_rate" },
{ LMP_VERSION_REQ, "LMP_version_req" },
{ LMP_VERSION_RES, "LMP_version_res" },
{ LMP_FEATURES_REQ, "LMP_features_req" },
{ LMP_FEATURES_RES, "LMP_features_res" },
{ LMP_QUALITY_OF_SERVICE, "LMP_quality_of_service" },
{ LMP_QUALITY_OF_SERVICE_REQ, "LMP_quality_of_service_req" },
{ LMP_SCO_LINK_REQ, "LMP_SCO_link_req" },
{ LMP_REMOVE_SCO_LINK_REQ, "LMP_remove_SCO_link_req" },
{ LMP_MAX_SLOT, "LMP_max_slot" },
{ LMP_MAX_SLOT_REQ, "LMP_max_slot_req" },
{ LMP_TIMING_ACCURACY_REQ, "LMP_timing_accuracy_req" },
{ LMP_TIMING_ACCURACY_RES, "LMP_timing_accuracy_res" },
{ LMP_SETUP_COMPLETE, "LMP_setup_complete" },
{ LMP_USE_SEMI_PERMANENT_KEY, "LMP_use_semi_permanent_key" },
{ LMP_HOST_CONNECTION_REQ, "LMP_host_connection_req" },
{ LMP_SLOT_OFFSET, "LMP_slot_offset" },
{ LMP_PAGE_MODE_REQ, "LMP_page_mode_req" },
{ LMP_PAGE_SCAN_MODE_REQ, "LMP_page_scan_mode_req" },
{ LMP_SUPERVISION_TIMEOUT, "LMP_supervision_timeout" },
{ LMP_TEST_ACTIVATE, "LMP_test_activate" },
{ LMP_TEST_CONTROL, "LMP_test_control" },
{ LMP_ENCRYPTION_KEY_SIZE_MASK_REQ, "LMP_encryption_key_size_mask_req" },
{ LMP_ENCRYPTION_KEY_SIZE_MASK_RES, "LMP_encryption_key_size_mask_res" },
{ LMP_SET_AFH, "LMP_set_AFH" },
{ LMP_ENCAPSULATED_HEADER, "LMP_encapsulated_header" },
{ LMP_ENCAPSULATED_PAYLOAD, "LMP_encapsulated_payload" },
{ LMP_SIMPLE_PAIRING_CONFIRM, "LMP_Simple_Pairing_Confirm" },
{ LMP_SIMPLE_PAIRING_NUMBER, "LMP_Simple_Pairing_Number" },
{ LMP_DHKEY_CHECK, "LMP_DHkey_Check" },
{ LMP_ESCAPE_1, "Escape 1" },
{ LMP_ESCAPE_2, "Escape 2" },
{ LMP_ESCAPE_3, "Escape 3" },
{ LMP_ESCAPE_4, "Escape 4" },
{ 0, NULL }
};
/* extended LMP opcodes */
static const value_string ext_opcode[] = {
{ LMP_ACCEPTED_EXT, "LMP_accepted_ext" },
{ LMP_NOT_ACCEPTED_EXT, "LMP_not_accepted_ext" },
{ LMP_FEATURES_REQ_EXT, "LMP_features_req_ext" },
{ LMP_FEATURES_RES_EXT, "LMP_features_res_ext" },
{ LMP_PACKET_TYPE_TABLE_REQ, "LMP_packet_type_table_req" },
{ LMP_ESCO_LINK_REQ, "LMP_eSCO_link_req" },
{ LMP_REMOVE_ESCO_LINK_REQ, "LMP_remove_eSCO_link_req" },
{ LMP_CHANNEL_CLASSIFICATION_REQ, "LMP_channel_classification_req" },
{ LMP_CHANNEL_CLASSIFICATION, "LMP_channel_classification" },
{ LMP_SNIFF_SUBRATING_REQ, "LMP_sniff_subrating_req" },
{ LMP_SNIFF_SUBRATING_RES, "LMP_sniff_subrating_res" },
{ LMP_PAUSE_ENCRYPTION_REQ, "LMP_pause_encryption_req" },
{ LMP_RESUME_ENCRYPTION_REQ, "LMP_resume_encryption_req" },
{ LMP_IO_CAPABILITY_REQ, "LMP_IO_Capability_req" },
{ LMP_IO_CAPABILITY_RES, "LMP_IO_Capability_res" },
{ LMP_NUMERIC_COMPARISON_FAILED, "LMP_numeric_comparison_failed" },
{ LMP_PASSKEY_FAILED, "LMP_passkey_failed" },
{ LMP_OOB_FAILED, "LMP_oob_failed" },
{ LMP_KEYPRESS_NOTIFICATION, "LMP_keypress_notification" },
{ LMP_POWER_CONTROL_REQ, "LMP_power_control_req" },
{ LMP_POWER_CONTROL_RES, "LMP_power_control_res" },
{ 0, NULL }
};
/* LMP error codes */
static const value_string error_code[] = {
{ 0x00, "Success" },
{ 0x01, "Unknown HCI Command" },
{ 0x02, "Unknown Connection Identifier" },
{ 0x03, "Hardware Failure" },
{ 0x04, "Page Timeout" },
{ 0x05, "Authentication Failure" },
{ 0x06, "PIN or Key Missing" },
{ 0x07, "Memory Capacity Exceeded" },
{ 0x08, "Connection Timeout" },
{ 0x09, "Connection Limit Exceeded" },
{ 0x0A, "Synchronous Connection Limit To A Device Exceeded" },
{ 0x0B, "ACL Connection Already Exists" },
{ 0x0C, "Command Disallowed" },
{ 0x0D, "Connection Rejected due to Limited Resources" },
{ 0x0E, "Connection Rejected Due To Security Reasons" },
{ 0x0F, "Connection Rejected due to Unacceptable BD_ADDR" },
{ 0x10, "Connection Accept Timeout Exceeded" },
{ 0x11, "Unsupported Feature or Parameter Value" },
{ 0x12, "Invalid HCI Command Parameters" },
{ 0x13, "Remote User Terminated Connection" },
{ 0x14, "Remote Device Terminated Connection due to Low Resources" },
{ 0x15, "Remote Device Terminated Connection due to Power Off" },
{ 0x16, "Connection Terminated By Local Host" },
{ 0x17, "Repeated Attempts" },
{ 0x18, "Pairing Not Allowed" },
{ 0x19, "Unknown LMP PDU" },
{ 0x1A, "Unsupported Remote Feature / Unsupported LMP Feature" },
{ 0x1B, "SCO Offset Rejected" },
{ 0x1C, "SCO Interval Rejected" },
{ 0x1D, "SCO Air Mode Rejected" },
{ 0x1E, "Invalid LMP Parameters" },
{ 0x1F, "Unspecified Error" },
{ 0x20, "Unsupported LMP Parameter Value" },
{ 0x21, "Role Change Not Allowed" },
{ 0x22, "LMP Response Timeout" },
{ 0x23, "LMP Error Transaction Collision" },
{ 0x24, "LMP PDU Not Allowed" },
{ 0x25, "Encryption Mode Not Acceptable" },
{ 0x26, "Link Key Can Not be Changed" },
{ 0x27, "Requested QoS Not Supported" },
{ 0x28, "Instant Passed" },
{ 0x29, "Pairing With Unit Key Not Supported" },
{ 0x2A, "Different Transaction Collision" },
{ 0x2B, "Reserved" },
{ 0x2C, "QoS Unacceptable Parameter" },
{ 0x2D, "QoS Rejected" },
{ 0x2E, "Channel Classification Not Supported" },
{ 0x2F, "Insufficient Security" },
{ 0x30, "Parameter Out Of Mandatory Range" },
{ 0x31, "Reserved" },
{ 0x32, "Role Switch Pending" },
{ 0x33, "Reserved" },
{ 0x34, "Reserved Slot Violation" },
{ 0x35, "Role Switch Failed" },
{ 0x36, "Extended Inquiry Response Too Large" },
{ 0x37, "Secure Simple Pairing Not Supported By Host." },
{ 0x38, "Host Busy - Pairing" },
{ 0x39, "Connection Rejected due to No Suitable Channel Found" },
{ 0, NULL }
};
static const value_string encryption_mode[] = {
{ 0, "no encryption" },
{ 1, "encryption" },
{ 2, "encryption" },
/* 3 - 255 reserved */
{ 0, NULL }
};
static const value_string access_scheme[] = {
{ 0, "polling technique" },
/* 1 - 15 reserved */
{ 0, NULL }
};
static const value_string packet_size[] = {
{ 0, "no packet-size preference available" },
{ 1, "use 1-slot packets" },
{ 2, "use 3-slot packets" },
{ 3, "use 5-slot packets" },
{ 0, NULL }
};
static const value_string edr_type[] = {
{ 0, "use DM1 packets" },
{ 1, "use 2 Mbps packets" },
{ 2, "use 3 Mbps packets" },
/* 3 reserved */
{ 0, NULL }
};
static const value_string versnr[] = {
{ 0, "Bluetooth Core Specification 1.0b" },
{ 1, "Bluetooth Core Specification 1.1" },
{ 2, "Bluetooth Core Specification 1.2" },
{ 3, "Bluetooth Core Specification 2.0 + EDR" },
{ 4, "Bluetooth Core Specification 2.1 + EDR" },
{ 5, "Bluetooth Core Specification 3.0 + HS" },
/* 6 - 255 reserved */
{ 0, NULL }
};
static const value_string compid[] = {
{ 0, "Ericsson Technology Licensing" },
{ 1, "Nokia Mobile Phones" },
{ 2, "Intel Corp." },
{ 3, "IBM Corp." },
{ 4, "Toshiba Corp." },
{ 5, "3Com" },
{ 6, "Microsoft" },
{ 7, "Lucent" },
{ 8, "Motorola" },
{ 9, "Infineon Technologies AG" },
{ 10, "Cambridge Silicon Radio" },
{ 11, "Silicon Wave" },
{ 12, "Digianswer A/S" },
{ 13, "Texas Instruments Inc." },
{ 14, "Parthus Technologies Inc." },
{ 15, "Broadcom Corporation" },
{ 16, "Mitel Semiconductor" },
{ 17, "Widcomm, Inc." },
{ 18, "Zeevo, Inc." },
{ 19, "Atmel Corporation" },
{ 20, "Mitsubishi Electric Corporation" },
{ 21, "RTX Telecom A/S" },
{ 22, "KC Technology Inc." },
{ 23, "Newlogic" },
{ 24, "Transilica, Inc." },
{ 25, "Rohde & Schwarz GmbH & Co. KG" },
{ 26, "TTPCom Limited" },
{ 27, "Signia Technologies, Inc." },
{ 28, "Conexant Systems Inc." },
{ 29, "Qualcomm" },
{ 30, "Inventel" },
{ 31, "AVM Berlin" },
{ 32, "BandSpeed, Inc." },
{ 33, "Mansella Ltd" },
{ 34, "NEC Corporation" },
{ 35, "WavePlus Technology Co., Ltd." },
{ 36, "Alcatel" },
{ 37, "Philips Semiconductors" },
{ 38, "C Technologies" },
{ 39, "Open Interface" },
{ 40, "R F Micro Devices" },
{ 41, "Hitachi Ltd" },
{ 42, "Symbol Technologies, Inc." },
{ 43, "Tenovis" },
{ 44, "Macronix International Co. Ltd." },
{ 45, "GCT Semiconductor" },
{ 46, "Norwood Systems" },
{ 47, "MewTel Technology Inc." },
{ 48, "ST Microelectronics" },
{ 49, "Synopsys" },
{ 50, "Red-M (Communications) Ltd" },
{ 51, "Commil Ltd" },
{ 52, "Computer Access Technology Corporation (CATC)" },
{ 53, "Eclipse (HQ Espana) S.L." },
{ 54, "Renesas Technology Corp." },
{ 55, "Mobilian Corporation" },
{ 56, "Terax" },
{ 57, "Integrated System Solution Corp." },
{ 58, "Matsushita Electric Industrial Co., Ltd." },
{ 59, "Gennum Corporation" },
{ 60, "Research In Motion" },
{ 61, "IPextreme, Inc." },
{ 62, "Systems and Chips, Inc" },
{ 63, "Bluetooth SIG, Inc" },
{ 64, "Seiko Epson Corporation" },
{ 65, "Integrated Silicon Solution Taiwan, Inc." },
{ 66, "CONWISE Technology Corporation Ltd" },
{ 67, "PARROT SA" },
{ 68, "Socket Mobile" },
{ 69, "Atheros Communications, Inc." },
{ 70, "MediaTek, Inc." },
{ 71, "Bluegiga (tentative)" },
{ 72, "Marvell Technology Group Ltd." },
{ 73, "3DSP Corporation" },
{ 74, "Accel Semiconductor Ltd." },
{ 75, "Continental Automotive Systems" },
{ 76, "Apple, Inc." },
{ 77, "Staccato Communications, Inc." },
{ 78, "Avago Technologies" },
{ 79, "APT Ltd." },
{ 80, "SiRF Technology, Inc." },
{ 81, "Tzero Technologies, Inc." },
{ 82, "J&M Corporation" },
{ 83, "Free2move AB" },
/* 84 - 65534 reserved */
{ 65535, "test" },
{ 0, NULL }
};
static const value_string sco_packet[] = {
{ 0, "HV1" },
{ 1, "HV2" },
{ 2, "HV3" },
/* 3 - 255 reserved */
{ 0, NULL }
};
static const value_string air_mode[] = {
{ 0, "mu-law log" },
{ 1, "A-law log" },
{ 2, "CVSD" },
{ 3, "transparent data" },
/* 4 - 255 reserved */
{ 0, NULL }
};
static const value_string paging_scheme[] = {
{ 0, "mandatory scheme" },
/* 1 - 255 reserved */
{ 0, NULL }
};
static const value_string paging_scheme_settings[] = {
/* for mandatory scheme: */
{ 0, "R0" },
{ 1, "R1" },
{ 2, "R2" },
/* 3 - 255 reserved */
{ 0, NULL }
};
static const value_string afh_mode[] = {
{ 0, "AFH disabled" },
{ 1, "AFH enabled" },
/* 2 - 255 reserved */
{ 0, NULL }
};
static const value_string features_page[] = {
{ 0, "standard features" },
/* 1 - 255 other feature pages */
{ 0, NULL }
};
static const value_string packet_type_table[] = {
{ 0, "1 Mbps only" },
{ 1, "2/3 Mbps" },
/* 2 - 255 reserved */
{ 0, NULL }
};
static const value_string negotiation_state[] = {
{ 0, "Initiate negotiation" },
{ 1, "The latest received set of negotiable parameters were possible but these parameters are preferred." },
{ 2, "The latest received set of negotiable parameters would cause a reserved slot violation." },
{ 3, "The latest received set of negotiable parameters would cause a latency violation." },
{ 4, "The latest received set of negotiable parameters are not supported." },
/* 5 - 255 reserved */
{ 0, NULL }
};
static const value_string afh_reporting_mode[] = {
{ 0, "AFH reporting disabled" },
{ 1, "AFH reporting enabled" },
/* 2 - 255 reserved */
{ 0, NULL }
};
static const value_string io_capabilities[] = {
{ 0, "Display Only" },
{ 1, "Display Yes/No" },
{ 2, "Keyboard Only" },
{ 3, "No Input/No Output" },
/* 4 - 255 reserved */
{ 0, NULL }
};
static const value_string oob_auth_data[] = {
{ 0, "No OOB Authentication Data received" },
{ 1, "OOB Authentication Data received" },
/* 2 - 255 reserved */
{ 0, NULL }
};
static const value_string auth_requirements[] = {
{ 0x00, "MITM Protection Not Required - No Bonding" },
{ 0x01, "MITM Protection Required - No Bonding" },
{ 0x02, "MITM Protection Not Required - Dedicated Bonding" },
{ 0x03, "MITM Protection Required - Dedicated Bonding" },
{ 0x04, "MITM Protection Not Required - General Bonding" },
{ 0x05, "MITM Protection Required - General Bonding" },
/* 0x06 - 0xff reserved */
{ 0, NULL }
};
static const value_string power_adjust_req[] = {
{ 0, "decrement power one step" },
{ 1, "increment power one step" },
{ 2, "increase to maximum power" },
/* 3 - 255 reserved */
{ 0, NULL }
};
static const value_string power_adjust_res[] = {
{ 0, "not supported" },
{ 1, "changed one step (not min or max)" },
{ 2, "max power" },
{ 3, "min power" },
/* 4 - 255 reserved */
{ 0, NULL }
};
static const value_string test_scenario[] = {
{ 0, "Pause Test Mode" },
{ 1, "Transmitter test - 0 pattern" },
{ 2, "Transmitter test - 1 pattern" },
{ 3, "Transmitter test - 1010 pattern" },
{ 4, "Pseudorandom bit sequence" },
{ 5, "Closed Loop Back - ACL packets" },
{ 6, "Closed Loop Back - Synchronous packets" },
{ 7, "ACL Packets without whitening" },
{ 8, "Synchronous Packets without whitening" },
{ 9, "Transmitter test - 1111 0000 pattern" },
/* 10 - 254 reserved */
{ 255, "Exit Test Mode" },
{ 0, NULL }
};
static const value_string hopping_mode[] = {
{ 0, "RX/TX on single frequency" },
{ 1, "Normal hopping" },
/* 2 - 255 reserved */
{ 0, NULL }
};
static const value_string power_control_mode[] = {
{ 0, "fixed TX output power" },
{ 1, "adaptive power control" },
/* 2 - 255 reserved */
{ 0, NULL }
};
static const value_string esco_packet_type[] = {
{ 0x00, "NULL/POLL" },
{ 0x07, "EV3" },
{ 0x0C, "EV4" },
{ 0x0D, "EV5" },
{ 0x26, "2-EV3" },
{ 0x2C, "2-EV5" },
{ 0x37, "3-EV3" },
{ 0x3D, "3-EV5" },
/* other values reserved */
{ 0, NULL }
};
static const value_string notification_value[] = {
{ 0, "passkey entry started" },
{ 1, "passkey digit entered" },
{ 2, "passkey digit erased" },
{ 3, "passkey cleared" },
{ 4, "passkey entry completed" },
/* 5 - 255 reserved */
{ 0, NULL }
};
/* initialize the subtree pointers */
static gint ett_lmp = -1;
static gint ett_lmp_pwradjres = -1;
static gint ett_lmp_rate = -1;
static gint ett_lmp_timectrl = -1;
/* LMP PDUs with short opcodes */
void
dissect_name_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_nameoffset, tvb, offset, 1, ENC_NA);
}
void
dissect_name_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_nameoffset, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_lmp_namelen, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_lmp_namefrag, tvb, offset, 14, ENC_ASCII|ENC_NA);
}
void
dissect_accepted(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_opinre, tvb, offset, 1, ENC_NA);
}
void
dissect_not_accepted(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_opinre, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_lmp_err, tvb, offset, 1, ENC_NA);
}
void
dissect_clkoffset_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_clkoffset_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_clkoffset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_detach(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_err, tvb, offset, 1, ENC_NA);
}
void
dissect_in_rand(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_rand, tvb, offset, 16, ENC_NA);
}
void
dissect_comb_key(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_rand, tvb, offset, 16, ENC_NA);
}
void
dissect_unit_key(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_key, tvb, offset, 16, ENC_NA);
}
void
dissect_au_rand(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_rand, tvb, offset, 16, ENC_NA);
}
void
dissect_sres(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 5);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 4);
proto_tree_add_item(tree, hf_lmp_authres, tvb, offset, 4, ENC_NA);
}
void
dissect_temp_rand(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_rand, tvb, offset, 16, ENC_NA);
}
void
dissect_temp_key(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_key, tvb, offset, 16, ENC_NA);
}
void
dissect_encryption_mode_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_cryptmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_encryption_key_size_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_keysz, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_start_encryption_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_rand, tvb, offset, 16, ENC_NA);
}
void
dissect_stop_encryption_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_switch_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 5);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 4);
proto_tree_add_item(tree, hf_lmp_swinst, tvb, offset, 4, ENC_LITTLE_ENDIAN);
}
void
dissect_hold(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 7);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 6);
proto_tree_add_item(tree, hf_lmp_htime, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_hinst, tvb, offset, 4, ENC_LITTLE_ENDIAN);
}
void
dissect_hold_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 7);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 6);
proto_tree_add_item(tree, hf_lmp_htime, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_hinst, tvb, offset, 4, ENC_LITTLE_ENDIAN);
}
void
dissect_sniff_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 10);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 9);
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_dsniff, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_tsniff, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_sniffatt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_sniffto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_unsniff_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_park_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_db, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_tb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_nb, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_deltab, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_araddr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_nbsleep, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_dbsleep, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_daccess, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_taccess, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_naccslots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_npoll, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_maccess, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_lmp_accscheme, tvb, offset, 1, ENC_NA);
}
void
dissect_set_broadcast_scan_window(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
int db_present;
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
/* bit0 of timing control flags indicates presence of db */
db_present = tvb_get_guint8(tvb, offset) & 0x01;
offset += 1;
if (db_present) {
DISSECTOR_ASSERT(len == 6);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 4);
proto_tree_add_item(tree, hf_lmp_db, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
} else {
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
}
proto_tree_add_item(tree, hf_lmp_bsw, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_modify_beacon(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
int db_present;
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
/* bit0 of timing control flags indicates presence of db */
db_present = tvb_get_guint8(tvb, offset) & 0x01;
offset += 1;
if (db_present) {
DISSECTOR_ASSERT(len == 13);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 11);
proto_tree_add_item(tree, hf_lmp_db, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
} else {
DISSECTOR_ASSERT(len == 11);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 9);
}
proto_tree_add_item(tree, hf_lmp_tb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_nb, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_deltab, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_daccess, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_taccess, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_naccslots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_npoll, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_maccess, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_lmp_accscheme, tvb, offset, 1, ENC_NA);
}
void
dissect_unpark_bd_addr_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
int db_present;
proto_item *item;
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
/* bit0 of timing control flags indicates presence of db */
db_present = tvb_get_guint8(tvb, offset) & 0x01;
offset += 1;
if (db_present) {
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 15);
proto_tree_add_item(tree, hf_lmp_db, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
} else {
DISSECTOR_ASSERT(len == 15);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 13);
}
proto_tree_add_item(tree, hf_lmp_ltaddr1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_lmp_ltaddr2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_bdaddr1, tvb, offset, 6, ENC_LITTLE_ENDIAN);
offset += 6;
proto_tree_add_item(tree, hf_lmp_bdaddr2, tvb, offset, 6, ENC_LITTLE_ENDIAN);
offset += 6;
}
void
dissect_unpark_pm_addr_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
int db_present;
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
/* bit0 of timing control flags indicates presence of db */
db_present = tvb_get_guint8(tvb, offset) & 0x01;
offset += 1;
if (db_present) {
DISSECTOR_ASSERT(len == 15);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 13);
proto_tree_add_item(tree, hf_lmp_db, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
} else {
DISSECTOR_ASSERT(len == 13);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 11);
}
proto_tree_add_item(tree, hf_lmp_ltaddr1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_lmp_ltaddr2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_ltaddr3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_lmp_ltaddr4, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr4, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_ltaddr5, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(tree, hf_lmp_ltaddr6, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr5, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr6, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_ltaddr7, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pmaddr7, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_incr_power_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
/* skipping one byte "for future use" */
}
void
dissect_decr_power_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
/* skipping one byte "for future use" */
}
void
dissect_max_power(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_min_power(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_auto_rate(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_preferred_rate(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
proto_item *rate_item;
proto_tree *rate_tree;
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
rate_item = proto_tree_add_item(tree, hf_lmp_rate, tvb, offset, 1, ENC_LITTLE_ENDIAN);
rate_tree = proto_item_add_subtree(rate_item, ett_lmp_rate);
proto_tree_add_item(rate_tree, hf_lmp_rate_fec, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(rate_tree, hf_lmp_rate_size, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(rate_tree, hf_lmp_rate_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(rate_tree, hf_lmp_rate_edrsize, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_version_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 6);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 5);
proto_tree_add_item(tree, hf_lmp_versnr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_compid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_subversnr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_version_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 6);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 5);
proto_tree_add_item(tree, hf_lmp_versnr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_compid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_subversnr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_features_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 9);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 8);
proto_tree_add_item(tree, hf_lmp_features, tvb, offset, 8, ENC_NA);
}
void
dissect_features_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 9);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 8);
proto_tree_add_item(tree, hf_lmp_features, tvb, offset, 8, ENC_NA);
}
void
dissect_quality_of_service(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 3);
proto_tree_add_item(tree, hf_lmp_pollintvl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_nbc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_quality_of_service_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 3);
proto_tree_add_item(tree, hf_lmp_pollintvl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_nbc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_sco_link_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 7);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 6);
proto_tree_add_item(tree, hf_lmp_scohdl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_dsco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_tsco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_scopkt, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_airmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_remove_sco_link_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_scohdl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_err, tvb, offset, 1, ENC_NA);
}
void
dissect_max_slot(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_maxslots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_max_slot_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_maxslots, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_timing_accuracy_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_timing_accuracy_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_drift, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_jitter, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_setup_complete(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_use_semi_permanent_key(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_host_connection_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_slot_offset(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 9);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 8);
proto_tree_add_item(tree, hf_lmp_slotoffset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_bdaddr, tvb, offset, 6, ENC_LITTLE_ENDIAN);
}
void
dissect_page_mode_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_pagesch, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pssettings, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_page_scan_mode_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_pagesch, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pssettings, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_supervision_timeout(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_suptimeout, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_test_activate(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_test_control(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 10);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 9);
/* FIXME these fields should all be XORed with 0x55. . . */
proto_tree_add_item(tree, hf_lmp_testscen, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_hopmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_txfreq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_rxfreq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pcmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pollper, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_pkttype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_testlen, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_encryption_key_size_mask_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 1);
}
void
dissect_encryption_key_size_mask_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_ksmask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_set_afh(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 16);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 15);
proto_tree_add_item(tree, hf_lmp_afhinst, tvb, offset, 4, ENC_LITTLE_ENDIAN);
offset += 4;
proto_tree_add_item(tree, hf_lmp_afhmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_afhchmap, tvb, offset, 10, ENC_NA);
}
void
dissect_encapsulated_header(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 3);
proto_tree_add_item(tree, hf_lmp_encmaj, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_encmin, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_enclen, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_encapsulated_payload(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_encdata, tvb, offset, 16, ENC_NA);
}
void
dissect_simple_pairing_confirm(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_commit, tvb, offset, 16, ENC_NA);
}
void
dissect_simple_pairing_number(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_nonce, tvb, offset, 16, ENC_NA);
}
void
dissect_dhkey_check(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 17);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 16);
proto_tree_add_item(tree, hf_lmp_confirm, tvb, offset, 16, ENC_NA);
}
/* LMP PDUs with extended opcodes */
void
dissect_accepted_ext(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_opinre, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_eopinre, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_not_accepted_ext(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_opinre, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_eopinre, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_err, tvb, offset, 1, ENC_NA);
}
void
dissect_features_req_ext(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 12);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 10);
proto_tree_add_item(tree, hf_lmp_fpage, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_maxsp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
/*
* extended features might need to be different from hf_lmp_features
* if hf_lmp_features is broken out
*/
proto_tree_add_item(tree, hf_lmp_features, tvb, offset, 8, ENC_NA);
}
void
dissect_features_res_ext(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 12);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 10);
proto_tree_add_item(tree, hf_lmp_fpage, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_maxsp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
/*
* extended features might need to be different from hf_lmp_features
* if hf_lmp_features is broken out
*/
proto_tree_add_item(tree, hf_lmp_features, tvb, offset, 8, ENC_NA);
}
void
dissect_packet_type_table_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_pkttypetbl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_esco_link_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 16);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 14);
proto_tree_add_item(tree, hf_lmp_escohdl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_escoltaddr, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_bitmask(tree, tvb, offset, hf_lmp_timectrl,
ett_lmp_timectrl, timectrl_fields, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_desco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_tesco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_wesco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_escotypems, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_lmp_escotypesm, tvb, offset, 1, ENC_NA);
offset += 1;
proto_tree_add_item(tree, hf_lmp_escolenms, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_escolensm, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_airmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_negstate, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_remove_esco_link_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 4);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 2);
proto_tree_add_item(tree, hf_lmp_escohdl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_err, tvb, offset, 1, ENC_NA);
}
void
dissect_channel_classification_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 7);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 5);
proto_tree_add_item(tree, hf_lmp_afhrptmode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_afhminintvl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_afhmaxintvl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_channel_classification(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 12);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 10);
proto_tree_add_item(tree, hf_lmp_afhclass, tvb, offset, 10, ENC_NA);
}
void
dissect_sniff_subrating_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 9);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 7);
proto_tree_add_item(tree, hf_lmp_maxss, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_minsmt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_sniffsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_sniff_subrating_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 9);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 7);
proto_tree_add_item(tree, hf_lmp_maxss, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_minsmt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
offset += 2;
proto_tree_add_item(tree, hf_lmp_sniffsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
}
void
dissect_pause_encryption_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
}
void
dissect_resume_encryption_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
}
void
dissect_io_capability_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 5);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 3);
proto_tree_add_item(tree, hf_lmp_iocaps, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_oobauthdata, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_authreqs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_io_capability_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 5);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 3);
proto_tree_add_item(tree, hf_lmp_iocaps, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_oobauthdata, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
proto_tree_add_item(tree, hf_lmp_authreqs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_numeric_comparison_failed(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
}
void
dissect_passkey_failed(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
}
void
dissect_oob_failed(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 2);
}
void
dissect_keypress_notification(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_nottype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_power_control_req(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
proto_tree_add_item(tree, hf_lmp_pwradjreq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
void
dissect_power_control_res(proto_tree *tree, tvbuff_t *tvb, int offset, int len)
{
proto_item *pa_item;
proto_tree *pa_tree;
DISSECTOR_ASSERT(len == 3);
DISSECTOR_ASSERT(tvb_length_remaining(tvb, offset) >= 1);
pa_item = proto_tree_add_item(tree, hf_lmp_pwradjres, tvb, offset, 1, ENC_LITTLE_ENDIAN);
pa_tree = proto_item_add_subtree(pa_item, ett_lmp_pwradjres);
proto_tree_add_item(pa_tree, hf_lmp_pwradj_gfsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(pa_tree, hf_lmp_pwradj_dqpsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(pa_tree, hf_lmp_pwradj_8dpsk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
}
/* Link Manager Protocol */
static void
dissect_btlmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_item *lmp_item;
proto_tree *lmp_tree;
int offset;
int len;
int op; /* opcode */
int eop; /* extended opcode */
offset = 0;
len = tvb_length(tvb);
DISSECTOR_ASSERT(len >= 1);
/* make entries in protocol column and info column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LMP");
/* clear the info column first just in case of type fetching failure. */
col_clear(pinfo->cinfo, COL_INFO);
op = tvb_get_guint8(tvb, offset) >> 1;
if (op == LMP_ESCAPE_4) {
DISSECTOR_ASSERT(len >= 2);
eop = tvb_get_guint8(tvb, offset + 1);
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(eop,
opcode, "Unknown Extended Opcode (%d)"));
} else {
col_add_str(pinfo->cinfo, COL_INFO, val_to_str(op,
opcode, "Unknown Opcode (%d)"));
}
/* see if we are being asked for details */
if (!tree)
return;
lmp_item = proto_tree_add_item(tree, proto_btlmp, tvb, offset, -1, ENC_NA);
lmp_tree = proto_item_add_subtree(lmp_item, ett_lmp);
proto_tree_add_item(lmp_tree, hf_lmp_tid, tvb, offset, 1, ENC_LITTLE_ENDIAN);
proto_tree_add_item(lmp_tree, hf_lmp_op, tvb, offset, 1, ENC_LITTLE_ENDIAN);
offset += 1;
switch (op) {
case LMP_NAME_REQ:
dissect_name_req(lmp_tree, tvb, offset, len);
break;
case LMP_NAME_RES:
dissect_name_res(lmp_tree, tvb, offset, len);
break;
case LMP_ACCEPTED:
dissect_accepted(lmp_tree, tvb, offset, len);
break;
case LMP_NOT_ACCEPTED:
dissect_not_accepted(lmp_tree, tvb, offset, len);
break;
case LMP_CLKOFFSET_REQ:
dissect_clkoffset_req(lmp_tree, tvb, offset, len);
break;
case LMP_CLKOFFSET_RES:
dissect_clkoffset_res(lmp_tree, tvb, offset, len);
break;
case LMP_DETACH:
dissect_detach(lmp_tree, tvb, offset, len);
break;
case LMP_IN_RAND:
dissect_in_rand(lmp_tree, tvb, offset, len);
break;
case LMP_COMB_KEY:
dissect_comb_key(lmp_tree, tvb, offset, len);
break;
case LMP_UNIT_KEY:
dissect_unit_key(lmp_tree, tvb, offset, len);
break;
case LMP_AU_RAND:
dissect_au_rand(lmp_tree, tvb, offset, len);
break;
case LMP_SRES:
dissect_sres(lmp_tree, tvb, offset, len);
break;
case LMP_TEMP_RAND:
dissect_temp_rand(lmp_tree, tvb, offset, len);
break;
case LMP_TEMP_KEY:
dissect_temp_key(lmp_tree, tvb, offset, len);
break;
case LMP_ENCRYPTION_MODE_REQ:
dissect_encryption_mode_req(lmp_tree, tvb, offset, len);
break;
case LMP_ENCRYPTION_KEY_SIZE_REQ:
dissect_encryption_key_size_req(lmp_tree, tvb, offset, len);
break;
case LMP_START_ENCRYPTION_REQ:
dissect_start_encryption_req(lmp_tree, tvb, offset, len);
break;
case LMP_STOP_ENCRYPTION_REQ:
dissect_stop_encryption_req(lmp_tree, tvb, offset, len);
break;
case LMP_SWITCH_REQ:
dissect_switch_req(lmp_tree, tvb, offset, len);
break;
case LMP_HOLD:
dissect_hold(lmp_tree, tvb, offset, len);
break;
case LMP_HOLD_REQ:
dissect_hold_req(lmp_tree, tvb, offset, len);
break;
case LMP_SNIFF_REQ:
dissect_sniff_req(lmp_tree, tvb, offset, len);
break;
case LMP_UNSNIFF_REQ:
dissect_unsniff_req(lmp_tree, tvb, offset, len);
break;
case LMP_PARK_REQ:
dissect_park_req(lmp_tree, tvb, offset, len);
break;
case LMP_SET_BROADCAST_SCAN_WINDOW:
dissect_set_broadcast_scan_window(lmp_tree, tvb, offset, len);
break;
case LMP_MODIFY_BEACON:
dissect_modify_beacon(lmp_tree, tvb, offset, len);
break;
case LMP_UNPARK_BD_ADDR_REQ:
dissect_unpark_bd_addr_req(lmp_tree, tvb, offset, len);
break;
case LMP_UNPARK_PM_ADDR_REQ:
dissect_unpark_pm_addr_req(lmp_tree, tvb, offset, len);
break;
case LMP_INCR_POWER_REQ:
dissect_incr_power_req(lmp_tree, tvb, offset, len);
break;
case LMP_DECR_POWER_REQ:
dissect_decr_power_req(lmp_tree, tvb, offset, len);
break;
case LMP_MAX_POWER:
dissect_max_power(lmp_tree, tvb, offset, len);
break;
case LMP_MIN_POWER:
dissect_min_power(lmp_tree, tvb, offset, len);
break;
case LMP_AUTO_RATE:
dissect_auto_rate(lmp_tree, tvb, offset, len);
break;
case LMP_PREFERRED_RATE:
dissect_preferred_rate(lmp_tree, tvb, offset, len);
break;
case LMP_VERSION_REQ:
dissect_version_req(lmp_tree, tvb, offset, len);
break;
case LMP_VERSION_RES:
dissect_version_res(lmp_tree, tvb, offset, len);
break;
case LMP_FEATURES_REQ:
dissect_features_req(lmp_tree, tvb, offset, len);
break;
case LMP_FEATURES_RES:
dissect_features_res(lmp_tree, tvb, offset, len);
break;
case LMP_QUALITY_OF_SERVICE:
dissect_quality_of_service(lmp_tree, tvb, offset, len);
break;
case LMP_QUALITY_OF_SERVICE_REQ:
dissect_quality_of_service_req(lmp_tree, tvb, offset, len);
break;
case LMP_SCO_LINK_REQ:
dissect_sco_link_req(lmp_tree, tvb, offset, len);
break;
case LMP_REMOVE_SCO_LINK_REQ:
dissect_remove_sco_link_req(lmp_tree, tvb, offset, len);
break;
case LMP_MAX_SLOT:
dissect_max_slot(lmp_tree, tvb, offset, len);
break;
case LMP_MAX_SLOT_REQ:
dissect_max_slot_req(lmp_tree, tvb, offset, len);
break;
case LMP_TIMING_ACCURACY_REQ:
dissect_timing_accuracy_req(lmp_tree, tvb, offset, len);
break;
case LMP_TIMING_ACCURACY_RES:
dissect_timing_accuracy_res(lmp_tree, tvb, offset, len);
break;
case LMP_SETUP_COMPLETE:
dissect_setup_complete(lmp_tree, tvb, offset, len);
break;
case LMP_USE_SEMI_PERMANENT_KEY:
dissect_use_semi_permanent_key(lmp_tree, tvb, offset, len);
break;
case LMP_HOST_CONNECTION_REQ:
dissect_host_connection_req(lmp_tree, tvb, offset, len);
break;
case LMP_SLOT_OFFSET:
dissect_slot_offset(lmp_tree, tvb, offset, len);
break;
case LMP_PAGE_MODE_REQ:
dissect_page_mode_req(lmp_tree, tvb, offset, len);
break;
case LMP_PAGE_SCAN_MODE_REQ:
dissect_page_scan_mode_req(lmp_tree, tvb, offset, len);
break;
case LMP_SUPERVISION_TIMEOUT:
dissect_supervision_timeout(lmp_tree, tvb, offset, len);
break;
case LMP_TEST_ACTIVATE:
dissect_test_activate(lmp_tree, tvb, offset, len);
break;
case LMP_TEST_CONTROL:
dissect_test_control(lmp_tree, tvb, offset, len);
break;
case LMP_ENCRYPTION_KEY_SIZE_MASK_REQ:
dissect_encryption_key_size_mask_req(lmp_tree, tvb, offset, len);
break;
case LMP_ENCRYPTION_KEY_SIZE_MASK_RES:
dissect_encryption_key_size_mask_res(lmp_tree, tvb, offset, len);
break;
case LMP_SET_AFH:
dissect_set_afh(lmp_tree, tvb, offset, len);
break;
case LMP_ENCAPSULATED_HEADER:
dissect_encapsulated_header(lmp_tree, tvb, offset, len);
break;
case LMP_ENCAPSULATED_PAYLOAD:
dissect_encapsulated_payload(lmp_tree, tvb, offset, len);
break;
case LMP_SIMPLE_PAIRING_CONFIRM:
dissect_simple_pairing_confirm(lmp_tree, tvb, offset, len);
break;
case LMP_SIMPLE_PAIRING_NUMBER:
dissect_simple_pairing_number(lmp_tree, tvb, offset, len);
break;
case LMP_DHKEY_CHECK:
dissect_dhkey_check(lmp_tree, tvb, offset, len);
break;
case LMP_ESCAPE_1:
break;
case LMP_ESCAPE_2:
break;
case LMP_ESCAPE_3:
break;
case LMP_ESCAPE_4:
/* extended opcode */
DISSECTOR_ASSERT(len >= 2);
proto_tree_add_item(lmp_tree, hf_lmp_eop, tvb, offset, 1, ENC_NA);
offset += 1;
switch (eop) {
case LMP_ACCEPTED_EXT:
dissect_accepted_ext(lmp_tree, tvb, offset, len);
break;
case LMP_NOT_ACCEPTED_EXT:
dissect_not_accepted_ext(lmp_tree, tvb, offset, len);
break;
case LMP_FEATURES_REQ_EXT:
dissect_features_req_ext(lmp_tree, tvb, offset, len);
break;
case LMP_FEATURES_RES_EXT:
dissect_features_res_ext(lmp_tree, tvb, offset, len);
break;
case LMP_PACKET_TYPE_TABLE_REQ:
dissect_packet_type_table_req(lmp_tree, tvb, offset, len);
break;
case LMP_ESCO_LINK_REQ:
dissect_esco_link_req(lmp_tree, tvb, offset, len);
break;
case LMP_REMOVE_ESCO_LINK_REQ:
dissect_remove_esco_link_req(lmp_tree, tvb, offset, len);
break;
case LMP_CHANNEL_CLASSIFICATION_REQ:
dissect_channel_classification_req(lmp_tree, tvb, offset, len);
break;
case LMP_CHANNEL_CLASSIFICATION:
dissect_channel_classification(lmp_tree, tvb, offset, len);
break;
case LMP_SNIFF_SUBRATING_REQ:
dissect_sniff_subrating_req(lmp_tree, tvb, offset, len);
break;
case LMP_SNIFF_SUBRATING_RES:
dissect_sniff_subrating_res(lmp_tree, tvb, offset, len);
break;
case LMP_PAUSE_ENCRYPTION_REQ:
dissect_pause_encryption_req(lmp_tree, tvb, offset, len);
break;
case LMP_RESUME_ENCRYPTION_REQ:
dissect_resume_encryption_req(lmp_tree, tvb, offset, len);
break;
case LMP_IO_CAPABILITY_REQ:
dissect_io_capability_req(lmp_tree, tvb, offset, len);
break;
case LMP_IO_CAPABILITY_RES:
dissect_io_capability_res(lmp_tree, tvb, offset, len);
break;
case LMP_NUMERIC_COMPARISON_FAILED:
dissect_numeric_comparison_failed(lmp_tree, tvb, offset, len);
break;
case LMP_PASSKEY_FAILED:
dissect_passkey_failed(lmp_tree, tvb, offset, len);
break;
case LMP_OOB_FAILED:
dissect_oob_failed(lmp_tree, tvb, offset, len);
break;
case LMP_KEYPRESS_NOTIFICATION:
dissect_keypress_notification(lmp_tree, tvb, offset, len);
break;
case LMP_POWER_CONTROL_REQ:
dissect_power_control_req(lmp_tree, tvb, offset, len);
break;
case LMP_POWER_CONTROL_RES:
dissect_power_control_res(lmp_tree, tvb, offset, len);
break;
default:
break;
}
default:
break;
}
};
/* register the protocol with Wireshark */
void
proto_register_btlmp(void)
{
/* list of fields */
static hf_register_info hf[] = {
{ &hf_lmp_accscheme,
{ "Access Scheme", "btlmp.accscheme",
FT_UINT8, BASE_DEC, VALS(access_scheme), 0xf0,
NULL, HFILL }
},
{ &hf_lmp_afhchmap,
{ "AFH Channel Map", "btlmp.afhchmap",
/* could break out individual channels but long */
FT_BYTES, BASE_NONE, NULL, 0x0,
"Adaptive Frequency Hopping Channel Map", HFILL }
},
{ &hf_lmp_afhclass,
{ "AFH Channel Classification", "btlmp.afhclass",
/* could break out individual channels but long */
FT_BYTES, BASE_NONE, NULL, 0x0,
"Adaptive Frequency Hopping Channel Classification", HFILL }
},
{ &hf_lmp_afhinst,
{ "AFH Instant", "btlmp.afhinst",
FT_UINT32, BASE_HEX, NULL, 0x0,
"Adaptive Frequency Hopping Instant (slot)", HFILL }
},
{ &hf_lmp_afhmaxintvl,
{ "AFH Max Interval", "btlmp.maxintvl",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Adaptive Maximum Interval in slots", HFILL }
},
{ &hf_lmp_afhminintvl,
{ "AFH Min Interval", "btlmp.minintvl",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Adaptive Minimum Interval in slots", HFILL }
},
{ &hf_lmp_afhmode,
{ "AFH Mode", "btlmp.afhmode",
FT_UINT8, BASE_DEC, VALS(afh_mode), 0x0,
"Adaptive Frequency Hopping Mode", HFILL }
},
{ &hf_lmp_afhrptmode,
{ "AFH Reporting Mode", "btlmp.afhrptmode",
FT_UINT8, BASE_DEC, VALS(afh_reporting_mode), 0x0,
"Adaptive Frequency Hopping Reporting Mode", HFILL }
},
{ &hf_lmp_airmode,
{ "Air Mode", "btlmp.airmode",
FT_UINT8, BASE_HEX, VALS(air_mode), 0x0,
NULL, HFILL }
},
{ &hf_lmp_araddr,
{ "AR_ADDR", "btlmp.araddr",
FT_UINT8, BASE_HEX, NULL, 0xfe,
NULL, HFILL }
},
{ &hf_lmp_authreqs,
{ "Authentication Requirements", "btlmp.authreqs",
FT_UINT8, BASE_HEX, VALS(auth_requirements), 0xf0,
NULL, HFILL }
},
{ &hf_lmp_authres,
{ "Authentication Response", "btlmp.authres",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_bdaddr,
{ "BD_ADDR", "btlmp.bdaddr",
FT_UINT64, BASE_HEX, NULL, 0x0000ffffffffffff,
NULL, HFILL }
},
{ &hf_lmp_bdaddr1,
{ "BD_ADDR 1", "btlmp.bdaddr",
FT_UINT64, BASE_HEX, NULL, 0x0000ffffffffffff,
NULL, HFILL }
},
{ &hf_lmp_bdaddr2,
{ "BD_ADDR2", "btlmp.bdaddr",
FT_UINT64, BASE_HEX, NULL, 0x0000ffffffffffff,
"BD_ADDR 2", HFILL }
},
{ &hf_lmp_bsw,
{ "Broadcast Scan Window", "btlmp.bsw",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Broadcast Scan Window in slots", HFILL }
},
{ &hf_lmp_clkoffset,
{ "Clock Offset", "btlmp.clkoffset",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Clock Offset in units of 1.25 ms", HFILL }
},
{ &hf_lmp_commit,
{ "Commitment Value", "btlmp.commit",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_confirm,
{ "Confirmation Value", "btlmp.confirm",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_compid,
{ "Company ID", "btlmp.compid",
FT_UINT16, BASE_DEC, VALS(compid), 0x0,
NULL, HFILL }
},
{ &hf_lmp_cryptmode,
{ "Encryption Mode", "btlmp.cryptmode",
FT_UINT8, BASE_DEC, VALS(encryption_mode), 0x0,
NULL, HFILL }
},
{ &hf_lmp_daccess,
{ "Daccess", "btlmp.daccess",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Daccess in slots", HFILL }
},
{ &hf_lmp_db,
{ "Db", "btlmp.db",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Db in slots", HFILL }
},
{ &hf_lmp_dbsleep,
{ "Dbsleep", "btlmp.dbsleep",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_deltab,
{ "Deltab", "btlmp.deltab",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Deltab in slots", HFILL }
},
{ &hf_lmp_desco,
{ "Desco", "btlmp.desco",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Desco in slots", HFILL }
},
{ &hf_lmp_drift,
{ "Drift", "btlmp.drift",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Drift in ppm", HFILL }
},
{ &hf_lmp_dsco,
{ "Dsco", "btlmp.dsco",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Dsco in slots", HFILL }
},
{ &hf_lmp_dsniff,
{ "Dsniff", "btlmp.dsniff",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Dsniff in slots", HFILL }
},
{ &hf_lmp_encdata,
{ "Encapsulated Data", "btlmp.encdata",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_enclen,
{ "Encapsulated Length", "btlmp.enclen",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_encmaj,
{ "Encapsulated Major Type", "btlmp.encmaj",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_encmin,
{ "Encapsulated Minor Type", "btlmp.encmin",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_eop,
{ "Extended Opcode", "btlmp.eop",
FT_UINT8, BASE_DEC, VALS(ext_opcode), 0x0,
NULL, HFILL }
},
{ &hf_lmp_eopinre,
{ "In Response To", "btlmp.eopinre",
FT_UINT8, BASE_DEC, VALS(ext_opcode), 0x0,
"Extended Opcode this is in response to", HFILL }
},
{ &hf_lmp_escolenms,
{ "Packet Length M -> S", "btlmp.escolenms",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Packet Length in bytes Master to Slave", HFILL }
},
{ &hf_lmp_escolensm,
{ "Packet Length S -> M", "btlmp.escolensm",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Packet Length in bytes Slave to Master", HFILL }
},
{ &hf_lmp_escotypems,
{ "eSCO Packet Type M -> S", "btlmp.escotypems",
FT_UINT8, BASE_HEX, VALS(esco_packet_type), 0x0,
"eSCO Packet Type Master to Slave", HFILL }
},
{ &hf_lmp_escotypesm,
{ "eSCO Packet Type S -> M", "btlmp.escotypesm",
FT_UINT8, BASE_HEX, VALS(esco_packet_type), 0x0,
"eSCO Packet Type Slave to Master", HFILL }
},
{ &hf_lmp_err,
{ "Error Code", "btlmp.err",
FT_UINT8, BASE_HEX, VALS(error_code), 0x0,
NULL, HFILL }
},
{ &hf_lmp_escohdl,
{ "eSCO Handle", "btlmp.escohdl",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_escoltaddr,
{ "eSCO LT_ADDR", "btlmp.escoltaddr",
FT_UINT8, BASE_HEX, NULL, 0x0,
"eSCO Logical Transport Address", HFILL }
},
{ &hf_lmp_features,
{ "Features", "btlmp.features",
/* could break out individual features but long */
FT_BYTES, BASE_NONE, NULL, 0x0,
"Feature Mask", HFILL }
},
{ &hf_lmp_fpage,
{ "Features Page", "btlmp.fpage",
FT_UINT8, BASE_DEC, VALS(features_page), 0x0,
NULL, HFILL }
},
{ &hf_lmp_htime,
{ "Hold Time", "btlmp.htime",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Hold Time in slots", HFILL }
},
{ &hf_lmp_hinst,
{ "Hold Instant", "btlmp.hinst",
FT_UINT32, BASE_HEX, NULL, 0x0,
"Hold Instant (slot)", HFILL }
},
{ &hf_lmp_hopmode,
{ "Hopping Mode", "btlmp.hopmode",
FT_UINT8, BASE_DEC, VALS(hopping_mode), 0x0,
NULL, HFILL }
},
{ &hf_lmp_iocaps,
{ "IO Capabilities", "btlmp.iocaps",
FT_UINT8, BASE_DEC, VALS(io_capabilities), 0x0,
"Input/Output Capabilities", HFILL }
},
{ &hf_lmp_jitter,
{ "Jitter", "btlmp.jitter",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Jitter in microseconds", HFILL }
},
{ &hf_lmp_key,
{ "Key", "btlmp.key",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_keysz,
{ "Key Size", "btlmp.keysz",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Key Size in bytes", HFILL }
},
{ &hf_lmp_ksmask,
{ "Key Size Mask", "btlmp.ksmask",
FT_UINT16, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_ltaddr1,
{ "LT_ADDR 1", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0x0f,
"Logical Transport Address 1", HFILL }
},
{ &hf_lmp_ltaddr2,
{ "LT_ADDR 2", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0xf0,
"Logical Transport Address 2", HFILL }
},
{ &hf_lmp_ltaddr3,
{ "LT_ADDR 3", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0x0f,
"Logical Transport Address 3", HFILL }
},
{ &hf_lmp_ltaddr4,
{ "LT_ADDR 4", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0xf0,
"Logical Transport Address 4", HFILL }
},
{ &hf_lmp_ltaddr5,
{ "LT_ADDR 5", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0x0f,
"Logical Transport Address 5", HFILL }
},
{ &hf_lmp_ltaddr6,
{ "LT_ADDR 6", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0xf0,
"Logical Transport Address 6", HFILL }
},
{ &hf_lmp_ltaddr7,
{ "LT_ADDR 7", "btlmp.ltaddr",
FT_UINT8, BASE_HEX, NULL, 0x0f,
"Logical Transport Address 7", HFILL }
},
{ &hf_lmp_maccess,
{ "Maccess", "btlmp.maccess",
FT_UINT8, BASE_HEX, NULL, 0x0f,
"Number of access windows", HFILL }
},
{ &hf_lmp_maxslots,
{ "Max Slots", "btlmp.maxslots",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_maxsp,
{ "Max Supported Page", "btlmp.maxsp",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Highest extended features page with non-zero bit", HFILL }
},
{ &hf_lmp_maxss,
{ "Max Sniff Subrate", "btlmp.maxss",
FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_minsmt,
{ "Min Sniff Mode Timeout", "btlmp.minsmt",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Min Sniff Mode Timeout in slots", HFILL }
},
{ &hf_lmp_naccslots,
{ "Nacc-slots", "btlmp.naccslots",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_namefrag,
{ "Name Fragment", "btlmp.namefrag",
FT_STRING, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_namelen,
{ "Name Length", "btlmp.namelen",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Name Length in bytes", HFILL }
},
{ &hf_lmp_nameoffset,
{ "Name Offset", "btlmp.nameoffset",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Name Offset in bytes", HFILL }
},
{ &hf_lmp_nb,
{ "Nb", "btlmp.nb",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_nbc,
{ "Nbc", "btlmp.nbc",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_nbsleep,
{ "Nbsleep", "btlmp.nbsleep",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_negstate,
{ "Negotiation State", "btlmp.negstate",
FT_UINT8, BASE_DEC, VALS(negotiation_state), 0x0,
NULL, HFILL }
},
{ &hf_lmp_nonce,
{ "Nonce Value", "btlmp.nonce",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_nottype,
{ "Notification Type", "btlmp.nottype",
FT_UINT8, BASE_DEC, VALS(notification_value), 0x0,
NULL, HFILL }
},
{ &hf_lmp_npoll,
{ "Npoll", "btlmp.npoll",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_oobauthdata,
{ "OOB Authentication Data", "btlmp.oobauthdata",
FT_UINT8, BASE_DEC, VALS(oob_auth_data), 0xfe,
NULL, HFILL }
},
{ &hf_lmp_op,
{ "Opcode", "btlmp.op",
FT_UINT8, BASE_DEC, VALS(opcode), 0xfe,
NULL, HFILL }
},
{ &hf_lmp_opinre,
{ "In Response To", "btlmp.opinre",
FT_UINT8, BASE_DEC, VALS(opcode), 0x7f,
"Opcode this is in response to", HFILL }
},
{ &hf_lmp_pagesch,
{ "Paging Scheme", "btlmp.pagesch",
FT_UINT8, BASE_DEC, VALS(paging_scheme), 0x0,
NULL, HFILL }
},
{ &hf_lmp_pcmode,
{ "Power Control Mode", "btlmp.pcmode",
FT_UINT8, BASE_DEC, VALS(power_control_mode), 0x0,
NULL, HFILL }
},
{ &hf_lmp_pkttype,
{ "Packet Type", "btlmp.pkttype",
/* FIXME break out further */
FT_UINT8, BASE_HEX, NULL, 0x0,
"Packet Type", HFILL }
},
{ &hf_lmp_pkttypetbl,
{ "Packet Type Table", "btlmp.pkttypetbl",
FT_UINT8, BASE_DEC, VALS(packet_type_table), 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr,
{ "PM_ADDR", "btlmp.pmaddr",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr1,
{ "PM_ADDR 1", "btlmp.pmaddr1",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr2,
{ "PM_ADDR 2", "btlmp.pmaddr2",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr3,
{ "PM_ADDR 3", "btlmp.pmaddr3",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr4,
{ "PM_ADDR 4", "btlmp.pmaddr4",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr5,
{ "PM_ADDR 5", "btlmp.pmaddr5",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr6,
{ "PM_ADDR 6", "btlmp.pmaddr6",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pmaddr7,
{ "PM_ADDR 7", "btlmp.pmaddr7",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pollintvl,
{ "Poll Interval", "btlmp.pollintvl",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Poll Interval in slots", HFILL }
},
{ &hf_lmp_pollper,
{ "Poll Period", "btlmp.pollper",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Poll Period in units of 1.25 ms", HFILL }
},
{ &hf_lmp_pssettings,
{ "Paging Scheme Settings", "btlmp.pssettings",
FT_UINT8, BASE_DEC, VALS(paging_scheme_settings), 0x0,
NULL, HFILL }
},
{ &hf_lmp_pwradjreq,
{ "Power Adjustment Request", "btlmp.pwradjreq",
FT_UINT8, BASE_DEC, VALS(power_adjust_req), 0x0,
NULL, HFILL }
},
{ &hf_lmp_pwradjres,
{ "Power Adjustment Response", "btlmp.pwradjres",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_pwradj_8dpsk,
{ "8DPSK", "btlmp.pwradj_8dpsk",
FT_UINT8, BASE_DEC, VALS(power_adjust_res), 0x30,
"8DPSK Power Adjustment Response", HFILL }
},
{ &hf_lmp_pwradj_dqpsk,
{ "DQPSK", "btlmp.pwradj_dqpsk",
FT_UINT8, BASE_DEC, VALS(power_adjust_res), 0x0C,
"DQPSK Power Adjustment Response", HFILL }
},
{ &hf_lmp_pwradj_gfsk,
{ "GFSK", "btlmp.pwradj_gfsk",
FT_UINT8, BASE_DEC, VALS(power_adjust_res), 0x03,
"GFSK Power Adjustment Response", HFILL }
},
{ &hf_lmp_rand,
{ "Random Number", "btlmp.rand",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_rate,
{ "Data Rate", "btlmp.rate",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_rate_fec,
{ "FEC", "btlmp.rate.fec",
FT_BOOLEAN, BASE_DEC, TFS(&fec), 0x01,
"Forward Error Correction", HFILL }
},
{ &hf_lmp_rate_size,
{ "Packet Size", "btlmp.rate.size",
FT_UINT8, BASE_HEX, VALS(packet_size), 0x06,
"Basic Rate Packet Size", HFILL }
},
{ &hf_lmp_rate_type,
{ "EDR Type", "btlmp.rate.type",
FT_UINT8, BASE_HEX, VALS(edr_type), 0x18,
"Enhanced Data Rate type", HFILL }
},
{ &hf_lmp_rate_edrsize,
{ "EDR Size", "btlmp.rate.edrsize",
FT_UINT8, BASE_HEX, VALS(packet_size), 0x60,
"Enhanced Data Rate packet size", HFILL }
},
{ &hf_lmp_rxfreq,
{ "RX Frequency", "btlmp.rxfreq",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Receive Frequency in MHz above 2402", HFILL }
},
{ &hf_lmp_scohdl,
{ "SCO Handle", "btlmp.scohdl",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_scopkt,
{ "SCO Packet", "btlmp.scopkt",
FT_UINT8, BASE_DEC, VALS(sco_packet), 0x0,
NULL, HFILL }
},
{ &hf_lmp_slotoffset,
{ "Slot Offset", "btlmp.slotoffset",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Slot Offset in microseconds", HFILL }
},
{ &hf_lmp_sniffatt,
{ "Sniff Attempt", "btlmp.sniffatt",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Number of receive slots", HFILL }
},
{ &hf_lmp_sniffsi,
{ "Sniff Subrating Instant", "btlmp.sniffsi",
FT_UINT32, BASE_HEX, NULL, 0x0,
"Sniff Subrating Instant (slot)", HFILL }
},
{ &hf_lmp_sniffto,
{ "Sniff Timeout", "btlmp.sniffto",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Number of receive slots", HFILL }
},
{ &hf_lmp_subversnr,
{ "SubVersNr", "btlmp.subversnr",
FT_UINT16, BASE_DEC, NULL, 0x0,
"SubVersion", HFILL }
},
{ &hf_lmp_suptimeout,
{ "Supervision Timeout", "btlmp.suptimeout",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Supervision Timeout in slots", HFILL }
},
{ &hf_lmp_swinst,
{ "Switch Instant", "btlmp.swinst",
FT_UINT32, BASE_HEX, NULL, 0x0,
"Switch Instant (slot)", HFILL }
},
{ &hf_lmp_taccess,
{ "Taccess", "btlmp.taccess",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Taccess in slots", HFILL }
},
{ &hf_lmp_tb,
{ "Tb", "btlmp.tb",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Tb in slots", HFILL }
},
{ &hf_lmp_tesco,
{ "Tesco", "btlmp.tesco",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Tesco in slots", HFILL }
},
{ &hf_lmp_testlen,
{ "Test Length", "btlmp.testlen",
FT_UINT16, BASE_DEC, NULL, 0x0,
"Length of test sequence in bytes", HFILL }
},
{ &hf_lmp_testscen,
{ "Test Scenario", "btlmp.testscen",
FT_UINT8, BASE_DEC, VALS(test_scenario), 0x0,
NULL, HFILL }
},
{ &hf_lmp_tid,
{ "TID", "btlmp.tid",
FT_BOOLEAN, BASE_DEC, TFS(&tid), 0x01,
"Transaction ID", HFILL }
},
{ &hf_lmp_timectrl,
{ "Timing Control Flags", "btlmp.timectrl",
FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }
},
{ &hf_lmp_time_change,
{ "Timing Change", "btlmp.time.change",
FT_BOOLEAN, 8, TFS(&time_change), 0x01,
NULL, HFILL }
},
{ &hf_lmp_time_init,
{ "Initialization", "btlmp.time.init",
FT_BOOLEAN, 8, TFS(&time_init), 0x02,
NULL, HFILL }
},
{ &hf_lmp_time_accwin,
{ "Access Window", "btlmp.time.accwin",
FT_BOOLEAN, 8, TFS(&time_accwin), 0x04,
NULL, HFILL }
},
{ &hf_lmp_tsco,
{ "Tsco", "btlmp.tsco",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Tsco in slots", HFILL }
},
{ &hf_lmp_tsniff,
{ "Tsniff", "btlmp.tsniff",
FT_UINT16, BASE_HEX, NULL, 0x0,
"Tsniff in slots", HFILL }
},
{ &hf_lmp_txfreq,
{ "TX Frequency", "btlmp.txfreq",
FT_UINT8, BASE_DEC, NULL, 0x0,
"Transmit Frequency in MHz above 2402", HFILL }
},
{ &hf_lmp_versnr,
{ "VersNr", "btlmp.versnr",
FT_UINT8, BASE_DEC, VALS(versnr), 0x0,
"Version", HFILL }
},
{ &hf_lmp_wesco,
{ "Wesco", "btlmp.wesco",
FT_UINT8, BASE_HEX, NULL, 0x0,
"Number of slots in retransmission window", HFILL }
},
};
/* protocol subtree arrays */
static gint *ett[] = {
&ett_lmp,
&ett_lmp_pwradjres,
&ett_lmp_rate,
&ett_lmp_timectrl,
};
/* register the protocol name and description */
proto_btlmp = proto_register_protocol(
"Bluetooth Link Manager Protocol", /* full name */
"btlmp", /* short name */
"btlmp" /* abbreviation (e.g. for filters) */
);
register_dissector("btlmp", dissect_btlmp, proto_btlmp);
/* register the header fields and subtrees used */
proto_register_field_array(proto_btlmp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
void
proto_reg_handoff_btlmp(void)
{
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|