Lines Matching +full:mode +full:- +full:xxx

4  *	Dmitry Eremin-Solenikov (dbaryshkov@gmail.com)
27 #include "netdissect-stdinc.h"
39 /* Frame types from Table 7-1 of 802.15.4-2015 */
51 /* Element IDs for Header IEs from Table 7-7 of 802.15.4-2015 */
183 /* Payload IE Group IDs from Table 7-15 of 802.15.4-2015 */
203 /* Sub-ID for short format from Table 7-16 of 802.15.4-2015 */
241 "Mode Switch Parameter IE", /* 0x24 */
243 "O-QPSK PHY Mode IE", /* 0x26 */
245 "LECIM DSSS Operating Mode IE", /* 0x28 */
246 "LECIM FSK Operating Mode IE", /* 0x29 */
248 "TVWS PHY Operating Mode Description IE", /* 0x2b */
259 "RCC PHY Operating Mode IE", /* 0x36 */
335 /* Sub-ID for long format from Table 7-17 of 802.15.4-2015 */
355 /* MAC commands from Table 7-49 of 802.15.4-2015 */
421 * See section 7.2.10 of 802.15.4-2015 for more information.
446 data_len--; in ieee802_15_4_crc16()
457 * Reverses the bits of the 32-bit word.
471 * IEEE 802.15.4 CRC 32 function. This is using the ANSI X3.66-1979 polynomial of
473 * in and out. See section 7.2.10 of 802.15.4-2015 for more information.
497 data_len--; in ieee802_15_4_crc32()
505 * Find out the address length based on the address type. See table 7-3 of
506 * 802.15.4-2015. Returns the address length.
515 case FC_ADDRESSING_MODE_RESERVED: /* Reserved, there used to be 8-bit in ieee802_15_4_addr_len()
518 * removed during 802.15.4-2015 in ieee802_15_4_addr_len()
520 return -1; in ieee802_15_4_addr_len()
555 * 802.15.4-2015.
561 if (ndo->ndo_vflag < 1) { in ieee802_15_4_print_superframe_specification()
575 * in the DSME PAN Descriptor IE. See section 7.3.1.4 of 802.15.4-2015.
577 * Returns number of byts consumed from the packet or -1 in case of error.
592 if (ndo->ndo_vflag > 0) { in ieee802_15_4_print_gts_info()
601 return -1; in ieee802_15_4_print_gts_info()
603 if (ndo->ndo_vflag < 2) { in ieee802_15_4_print_gts_info()
623 * in the DSME PAN Descriptor IE. See section 7.3.1.5 of 802.15.4-2015.
625 * Returns number of byts consumed from the packet or -1 in case of error.
638 if (ndo->ndo_vflag > 0) { in ieee802_15_4_print_pending_addresses()
645 return -1; in ieee802_15_4_print_pending_addresses()
647 if (ndo->ndo_vflag < 2) { in ieee802_15_4_print_pending_addresses()
740 ie_len - in ieee802_15_4_print_header_ie()
755 ND_PRINT("Multi-superframe Order = %d", ss & 0xff); in ieee802_15_4_print_header_ie()
757 "Channel hopping mode" : in ieee802_15_4_print_header_ie()
758 "Channel adaptation mode")); in ieee802_15_4_print_header_ie()
776 ND_PRINT("Multi-superframe Order = %d", in ieee802_15_4_print_header_ie()
779 "Channel hopping mode" : in ieee802_15_4_print_header_ie()
780 "Channel adaptation mode")); in ieee802_15_4_print_header_ie()
871 ND_PRINT("Rendezvous time = %d, Wake-up Interval = %d", in ieee802_15_4_print_header_ie()
893 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
895 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
897 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
899 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
901 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
903 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
905 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
907 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
909 /* XXX Not implemented */ in ieee802_15_4_print_header_ie()
920 * Parse and print Header IE list. See 7.4.2 of 802.15.4-2015 for
923 * Returns number of byts consumed from the packet or -1 in case of error.
939 return -1; in ieee802_15_4_print_header_ie_list()
962 return -1; in ieee802_15_4_print_header_ie_list()
968 if (ndo->ndo_vflag > 3 && ie_len != 0) { in ieee802_15_4_print_header_ie_list()
982 caplen -= 2 + ie_len; in ieee802_15_4_print_header_ie_list()
1029 sub_ie_len--; in ieee802_15_4_print_mlme_ie()
1035 sub_ie_len--; in ieee802_15_4_print_mlme_ie()
1047 sub_ie_len -= 7; in ieee802_15_4_print_mlme_ie()
1060 sub_ie_len -= len; in ieee802_15_4_print_mlme_ie()
1068 sub_ie_len -= 2; in ieee802_15_4_print_mlme_ie()
1080 sub_ie_len -= len * 2; in ieee802_15_4_print_mlme_ie()
1185 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1187 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1189 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1191 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1193 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1195 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1197 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1198 case 0x24: /* Mode Switch Parameter IE */ in ieee802_15_4_print_mlme_ie()
1199 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1201 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1202 case 0x26: /* O-QPSK PHY Mode IE */ in ieee802_15_4_print_mlme_ie()
1203 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1205 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1206 case 0x28: /* LECIM DSSS Operating Mode IE */ in ieee802_15_4_print_mlme_ie()
1207 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1208 case 0x29: /* LECIM FSK Operating Mode IE */ in ieee802_15_4_print_mlme_ie()
1209 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1210 case 0x2b: /* TVWS PHY Operating Mode Description IE */ in ieee802_15_4_print_mlme_ie()
1211 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1213 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1215 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1217 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1219 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1221 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1223 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1225 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1227 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1229 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1231 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1232 case 0x36: /* TCC PHY Operating Mode IE */ in ieee802_15_4_print_mlme_ie()
1233 /* XXX Not implemented */ in ieee802_15_4_print_mlme_ie()
1244 * MLME IE list parsing and printing. See 7.4.3.2 of 802.15.4-2015
1288 if (ndo->ndo_vflag > 3) { in ieee802_15_4_print_mlme_ie_list()
1290 } else if (ndo->ndo_vflag > 2) { in ieee802_15_4_print_mlme_ie_list()
1299 ie_len -= 2 + sub_ie_len; in ieee802_15_4_print_mlme_ie_list()
1306 * Returns number of bytes consumed from packet or -1 in case of error.
1407 * Payload IE list parsing and printing. See 7.4.3 of 802.15.4-2015
1410 * Returns number of byts consumed from the packet or -1 in case of error.
1424 return -1; in ieee802_15_4_print_payload_ie_list()
1444 return -1; in ieee802_15_4_print_payload_ie_list()
1446 if (ndo->ndo_vflag > 3 && ie_len != 0) { in ieee802_15_4_print_payload_ie_list()
1499 caplen -= 2 + ie_len; in ieee802_15_4_print_payload_ie_list()
1510 * Returns number of byts consumed from the packet or -1 in case of error.
1522 return -1; in ieee802_15_4_print_aux_sec_header()
1529 caplen -= 1; in ieee802_15_4_print_aux_sec_header()
1532 if (ndo->ndo_vflag > 0) { in ieee802_15_4_print_aux_sec_header()
1533 ND_PRINT("\n\tSecurity Level %d, Key Id Mode %d, ", in ieee802_15_4_print_aux_sec_header()
1539 return -1; in ieee802_15_4_print_aux_sec_header()
1541 if (ndo->ndo_vflag > 1) { in ieee802_15_4_print_aux_sec_header()
1546 caplen -= 4; in ieee802_15_4_print_aux_sec_header()
1551 if (ndo->ndo_vflag > 1) { in ieee802_15_4_print_aux_sec_header()
1561 return -1; in ieee802_15_4_print_aux_sec_header()
1563 if (ndo->ndo_vflag > 1) { in ieee802_15_4_print_aux_sec_header()
1568 caplen -= 4; in ieee802_15_4_print_aux_sec_header()
1574 return -1; in ieee802_15_4_print_aux_sec_header()
1576 if (ndo->ndo_vflag > 1) { in ieee802_15_4_print_aux_sec_header()
1580 caplen -= 4; in ieee802_15_4_print_aux_sec_header()
1586 return -1; in ieee802_15_4_print_aux_sec_header()
1588 if (ndo->ndo_vflag > 1) { in ieee802_15_4_print_aux_sec_header()
1591 caplen -= 1; in ieee802_15_4_print_aux_sec_header()
1600 * Returns number of byts consumed from the packet or -1 in case of error.
1614 return -1; in ieee802_15_4_print_command_data()
1637 return -1; in ieee802_15_4_print_command_data()
1668 return -1; in ieee802_15_4_print_command_data()
1697 return -1; in ieee802_15_4_print_command_data()
1728 return -1; in ieee802_15_4_print_command_data()
1736 "Receive-only GTS" : "Transmit-only GTS"), in ieee802_15_4_print_command_data()
1743 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1745 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1747 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1749 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1751 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1753 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1755 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1757 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1759 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1761 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1763 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1765 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1767 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1769 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1771 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1773 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1775 /* XXX Not implemented */ in ieee802_15_4_print_command_data()
1816 fcs = GET_LE_U_4(p + caplen - 4); in ieee802_15_4_std_frames()
1817 crc_check = ieee802_15_4_crc32(ndo, p, caplen - 4); in ieee802_15_4_std_frames()
1820 caplen -= 4; in ieee802_15_4_std_frames()
1823 fcs = GET_LE_U_2(p + caplen - 2); in ieee802_15_4_std_frames()
1824 crc_check = ieee802_15_4_crc16(ndo, p, caplen - 2); in ieee802_15_4_std_frames()
1827 caplen -= 2; in ieee802_15_4_std_frames()
1840 if (ndo->ndo_vflag > 2) { in ieee802_15_4_std_frames()
1857 if (ndo->ndo_vflag) in ieee802_15_4_std_frames()
1864 caplen -= 2; in ieee802_15_4_std_frames()
1867 if (ndo->ndo_vflag) in ieee802_15_4_std_frames()
1874 caplen -= 3; in ieee802_15_4_std_frames()
1881 ND_PRINT("[ERROR: Invalid src address mode]"); in ieee802_15_4_std_frames()
1885 ND_PRINT("[ERROR: Invalid dst address mode]"); in ieee802_15_4_std_frames()
1984 caplen -= 2; in ieee802_15_4_std_frames()
1986 ND_PRINT("-:"); in ieee802_15_4_std_frames()
1994 caplen -= dst_addr_len; in ieee802_15_4_std_frames()
2006 caplen -= 2; in ieee802_15_4_std_frames()
2008 ND_PRINT("-:"); in ieee802_15_4_std_frames()
2017 caplen -= src_addr_len; in ieee802_15_4_std_frames()
2020 * XXX - if frame_version is 0, this is the 2003 in ieee802_15_4_std_frames()
2023 * for the AES-CTR and AES-CCM security suites but in ieee802_15_4_std_frames()
2024 * not for the AES-CBC-MAC security suite. in ieee802_15_4_std_frames()
2033 caplen -= len; in ieee802_15_4_std_frames()
2063 caplen -= miclen; in ieee802_15_4_std_frames()
2076 caplen -= len; in ieee802_15_4_std_frames()
2088 caplen -= len; in ieee802_15_4_std_frames()
2093 if (ndo->ndo_vflag > 2 && miclen != 0) { in ieee802_15_4_std_frames()
2103 if (ndo->ndo_vflag > 2) { in ieee802_15_4_std_frames()
2125 caplen -= 2; in ieee802_15_4_std_frames()
2139 caplen -= len; in ieee802_15_4_std_frames()
2152 caplen -= len; in ieee802_15_4_std_frames()
2155 if (!ndo->ndo_suppress_default_print) in ieee802_15_4_std_frames()
2161 if (!ndo->ndo_suppress_default_print) in ieee802_15_4_std_frames()
2179 caplen--; in ieee802_15_4_std_frames()
2184 caplen -= len; in ieee802_15_4_std_frames()
2188 if (!ndo->ndo_suppress_default_print) in ieee802_15_4_std_frames()
2228 fcs = GET_LE_U_4(p + caplen - 4); in ieee802_15_4_mp_frame()
2229 crc_check = ieee802_15_4_crc32(ndo, p, caplen - 4); in ieee802_15_4_mp_frame()
2232 caplen -= 4; in ieee802_15_4_mp_frame()
2234 fcs = GET_LE_U_2(p + caplen - 2); in ieee802_15_4_mp_frame()
2235 crc_check = ieee802_15_4_crc16(ndo, p, caplen - 2); in ieee802_15_4_mp_frame()
2238 caplen -= 2; in ieee802_15_4_mp_frame()
2242 fcs = GET_LE_U_2(p + caplen - 2); in ieee802_15_4_mp_frame()
2243 crc_check = ieee802_15_4_crc16(ndo, p, caplen - 2); in ieee802_15_4_mp_frame()
2246 caplen -= 2; in ieee802_15_4_mp_frame()
2262 if (ndo->ndo_vflag > 2) { in ieee802_15_4_mp_frame()
2281 caplen -= 2; in ieee802_15_4_mp_frame()
2284 if (ndo->ndo_vflag) in ieee802_15_4_mp_frame()
2291 caplen -= 3; in ieee802_15_4_mp_frame()
2297 caplen -= 2; in ieee802_15_4_mp_frame()
2298 if (ndo->ndo_vflag) in ieee802_15_4_mp_frame()
2306 ND_PRINT("[ERROR: Invalid src address mode]"); in ieee802_15_4_mp_frame()
2310 ND_PRINT("[ERROR: Invalid dst address mode]"); in ieee802_15_4_mp_frame()
2322 caplen -= 2; in ieee802_15_4_mp_frame()
2324 ND_PRINT("-:"); in ieee802_15_4_mp_frame()
2332 caplen -= dst_addr_len; in ieee802_15_4_mp_frame()
2337 ND_PRINT(" -:"); in ieee802_15_4_mp_frame()
2345 caplen -= src_addr_len; in ieee802_15_4_mp_frame()
2355 caplen -= len; in ieee802_15_4_mp_frame()
2385 caplen -= miclen; in ieee802_15_4_mp_frame()
2398 caplen -= len; in ieee802_15_4_mp_frame()
2411 caplen -= len; in ieee802_15_4_mp_frame()
2416 if (ndo->ndo_vflag > 2 && miclen != 0) { in ieee802_15_4_mp_frame()
2427 if (ndo->ndo_vflag > 2) { in ieee802_15_4_mp_frame()
2436 if (!ndo->ndo_suppress_default_print) in ieee802_15_4_mp_frame()
2472 ndo->ndo_protocol = "802.15.4"; in ieee802_15_4_print()
2519 u_int caplen = h->caplen; in ieee802_15_4_if_print()
2520 ndo->ndo_protocol = "802.15.4"; in ieee802_15_4_if_print()
2521 ndo->ndo_ll_hdr_len += ieee802_15_4_print(ndo, p, caplen); in ieee802_15_4_if_print()
2525 /* https://github.com/jkcko/ieee802.15.4-tap */
2533 ndo->ndo_protocol = "802.15.4_tap"; in ieee802_15_4_tap_if_print()
2534 if (h->caplen < 4) { in ieee802_15_4_tap_if_print()
2536 ndo->ndo_ll_hdr_len += h->caplen; in ieee802_15_4_tap_if_print()
2547 if (h->caplen < length) { in ieee802_15_4_tap_if_print()
2549 ndo->ndo_ll_hdr_len += h->caplen; in ieee802_15_4_tap_if_print()
2553 ndo->ndo_ll_hdr_len += ieee802_15_4_print(ndo, p+length, h->caplen-length) + length; in ieee802_15_4_tap_if_print()