nrfxlib API 3.3.99
Loading...
Searching...
No Matches
nrf_802154_frame.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025, Nordic Semiconductor ASA
3 * All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright notice, this
11 * list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * 3. Neither the name of Nordic Semiconductor ASA nor the names of its
18 * contributors may be used to endorse or promote products derived from this
19 * software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
34
40#ifndef NRF_802154_FRAME_H
41#define NRF_802154_FRAME_H
42
43#include "nrfx.h"
44#include "nrf_802154_const.h"
46#include <stdbool.h>
47#include <stdint.h>
48#include <stddef.h>
49
50#ifdef __STATIC_INLINE__
51#undef __STATIC_INLINE__
52#endif
53
54#ifdef NRF_802154_FRAME_DECLARE_ONLY
55#define __STATIC_INLINE__
56#else
57#define __STATIC_INLINE__ __STATIC_INLINE
58#endif
59
60#define NRF_802154_FRAME_INVALID_OFFSET 0xff
61
137
138typedef struct
139{
140 uint8_t * p_frame;
143
144 struct
145 {
146 struct
147 {
148 uint8_t panid_offset;
149 uint8_t addr_offset;
150 } dst;
151
152 struct
153 {
154 uint8_t panid_offset;
155 uint8_t addr_offset;
156 } src;
157
158 struct
159 {
165 } aux_sec_hdr;
166
168 } mhr;
169
170 struct
171 {
173 } mac_payload;
174
175 struct
176 {
182 uint8_t key_src_size;
183 uint8_t mic_size;
184 } helper;
186
195 const nrf_802154_frame_t * p_parser_data);
196
206__STATIC_INLINE__ uint8_t nrf_802154_frame_length_get(
207 const nrf_802154_frame_t * p_parser_data);
208
216__STATIC_INLINE__ uint8_t nrf_802154_frame_psdu_offset_get(
217 const nrf_802154_frame_t * p_parser_data);
218
226__STATIC_INLINE__ const uint8_t * nrf_802154_frame_psdu_get(
227 const nrf_802154_frame_t * p_parser_data);
228
236__STATIC_INLINE__ uint8_t nrf_802154_frame_version_get(
237 const nrf_802154_frame_t * p_parser_data);
238
247__STATIC_INLINE__ bool nrf_802154_frame_dsn_suppress_bit_is_set(
248 const nrf_802154_frame_t * p_parser_data);
249
257__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_addr_type_get(
258 const nrf_802154_frame_t * p_parser_data);
259
268__STATIC_INLINE__ bool nrf_802154_frame_dst_addr_is_extended(
269 const nrf_802154_frame_t * p_parser_data);
270
278__STATIC_INLINE__ uint8_t nrf_802154_frame_src_addr_type_get(
279 const nrf_802154_frame_t * p_parser_data);
280
289__STATIC_INLINE__ bool nrf_802154_frame_src_addr_is_extended(
290 const nrf_802154_frame_t * p_parser_data);
291
300__STATIC_INLINE__ bool nrf_802154_frame_src_addr_is_short(
301 const nrf_802154_frame_t * p_parser_data);
302
312 const nrf_802154_frame_t * p_parser_data);
313
322__STATIC_INLINE__ bool nrf_802154_frame_ie_present_bit_is_set(
323 const nrf_802154_frame_t * p_parser_data);
324
325__STATIC_INLINE__ bool nrf_802154_frame_pending_bit_is_set(
326 const nrf_802154_frame_t * p_parser_data);
327
335__STATIC_INLINE__ uint8_t nrf_802154_frame_type_get(
336 const nrf_802154_frame_t * p_parser_data);
337
346__STATIC_INLINE__ bool nrf_802154_frame_panid_compression_is_set(
347 const nrf_802154_frame_t * p_parser_data);
348
357__STATIC_INLINE__ bool nrf_802154_frame_ar_bit_is_set(
358 const nrf_802154_frame_t * p_parser_data);
359
367__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dsn_get(
368 const nrf_802154_frame_t * p_parser_data);
369
377__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_panid_offset_get(
378 const nrf_802154_frame_t * p_parser_data);
379
387__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dst_panid_get(
388 const nrf_802154_frame_t * p_parser_data);
389
397__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_addr_offset_get(
398 const nrf_802154_frame_t * p_parser_data);
399
407__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dst_addr_get(
408 const nrf_802154_frame_t * p_parser_data);
409
417__STATIC_INLINE__ uint8_t nrf_802154_frame_src_panid_offset_get(
418 const nrf_802154_frame_t * p_parser_data);
419
427__STATIC_INLINE__ const uint8_t * nrf_802154_frame_src_panid_get(
428 const nrf_802154_frame_t * p_parser_data);
429
437__STATIC_INLINE__ uint8_t nrf_802154_frame_src_addr_offset_get(
438 const nrf_802154_frame_t * p_parser_data);
439
447__STATIC_INLINE__ const uint8_t * nrf_802154_frame_src_addr_get(
448 const nrf_802154_frame_t * p_parser_data);
449
457__STATIC_INLINE__ uint8_t nrf_802154_frame_src_addr_size_get(
458 const nrf_802154_frame_t * p_parser_data);
459
467__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_addr_size_get(
468 const nrf_802154_frame_t * p_parser_data);
469
477__STATIC_INLINE__ uint8_t nrf_802154_frame_sec_ctrl_offset_get(
478 const nrf_802154_frame_t * p_parser_data);
479
487__STATIC_INLINE__ uint8_t nrf_802154_frame_sec_ctrl_sec_lvl_get(
488 const nrf_802154_frame_t * p_parser_data);
489
499 const nrf_802154_frame_t * p_parser_data);
500
508__STATIC_INLINE__ uint8_t nrf_802154_frame_sec_ctrl_key_id_mode_get(
509 const nrf_802154_frame_t * p_parser_data);
510
520 const nrf_802154_frame_t * p_parser_data);
521
529__STATIC_INLINE__ const uint8_t * nrf_802154_frame_sec_ctrl_get(
530 const nrf_802154_frame_t * p_parser_data);
531
539__STATIC_INLINE__ uint8_t nrf_802154_frame_counter_offset_get(
540 const nrf_802154_frame_t * p_parser_data);
541
549__STATIC_INLINE__ const uint8_t * nrf_802154_frame_counter_get(
550 const nrf_802154_frame_t * p_parser_data);
551
559__STATIC_INLINE__ uint8_t nrf_802154_frame_key_id_offset_get(
560 const nrf_802154_frame_t * p_parser_data);
561
569__STATIC_INLINE__ const uint8_t * nrf_802154_frame_key_id_get(
570 const nrf_802154_frame_t * p_parser_data);
571
579__STATIC_INLINE__ uint8_t nrf_802154_frame_key_source_offset_get(
580 const nrf_802154_frame_t * p_parser_data);
581
589__STATIC_INLINE__ const uint8_t * nrf_802154_frame_key_source_get(
590 const nrf_802154_frame_t * p_parser_data);
591
599__STATIC_INLINE__ uint8_t nrf_802154_frame_key_source_length_get(
600 const nrf_802154_frame_t * p_parser_data);
601
609__STATIC_INLINE__ uint8_t nrf_802154_frame_key_index_offset_get(
610 const nrf_802154_frame_t * p_parser_data);
611
619__STATIC_INLINE__ uint8_t nrf_802154_frame_key_index_get(
620 const nrf_802154_frame_t * p_parser_data);
621
629__STATIC_INLINE__ uint8_t nrf_802154_frame_ie_header_offset_get(
630 const nrf_802154_frame_t * p_parser_data);
631
639__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_header_get(
640 const nrf_802154_frame_t * p_parser_data);
641
649__STATIC_INLINE__ uint8_t nrf_802154_frame_mac_payload_offset_get(
650 const nrf_802154_frame_t * p_parser_data);
651
659__STATIC_INLINE__ const uint8_t * nrf_802154_frame_mac_payload_get(
660 const nrf_802154_frame_t * p_parser_data);
661
669__STATIC_INLINE__ uint8_t nrf_802154_frame_mac_command_id_offset_get(
670 const nrf_802154_frame_t * p_parser_data);
671
679__STATIC_INLINE__ const uint8_t * nrf_802154_frame_mac_command_id_get(
680 const nrf_802154_frame_t * p_parser_data);
681
689__STATIC_INLINE__ uint8_t nrf_802154_frame_mfr_offset_get(
690 const nrf_802154_frame_t * p_parser_data);
691
699__STATIC_INLINE__ const uint8_t * nrf_802154_frame_mfr_get(
700 const nrf_802154_frame_t * p_parser_data);
701
709__STATIC_INLINE__ uint8_t nrf_802154_frame_mic_size_get(
710 const nrf_802154_frame_t * p_parser_data);
711
719__STATIC_INLINE__ uint8_t nrf_802154_frame_mac_payload_length_get(
720 const nrf_802154_frame_t * p_parser_data);
721
729__STATIC_INLINE__ uint8_t nrf_802154_frame_mac_header_length_get(
730 const nrf_802154_frame_t * p_parser_data);
731
739__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_addressing_end_offset_get(
740 const nrf_802154_frame_t * p_parser_data);
741
749__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dst_addressing_end_get(
750 const nrf_802154_frame_t * p_parser_data);
751
759__STATIC_INLINE__ uint8_t nrf_802154_frame_addressing_end_offset_get(
760 const nrf_802154_frame_t * p_parser_data);
761
769__STATIC_INLINE__ const uint8_t * nrf_802154_frame_addressing_end_get(
770 const nrf_802154_frame_t * p_parser_data);
771
779__STATIC_INLINE__ uint8_t nrf_802154_frame_aux_sec_hdr_end_offset_get(
780 const nrf_802154_frame_t * p_parser_data);
781
790__STATIC_INLINE__ const uint8_t * nrf_802154_frame_header_ie_iterator_begin(
791 const uint8_t * p_ie_header);
792
803__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_content_address_get(
804 const uint8_t * p_ie_iterator);
805
814__STATIC_INLINE__ uint8_t nrf_802154_frame_ie_length_get(const uint8_t * p_ie_iterator);
815
824__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_iterator_next(
825 const uint8_t * p_ie_iterator);
826
835__STATIC_INLINE__ uint8_t nrf_802154_frame_ie_id_get(const uint8_t * p_ie_iterator);
836
847__STATIC_INLINE__ bool nrf_802154_frame_ie_iterator_end(const uint8_t * p_ie_iterator,
848 const uint8_t * p_end_addr);
849
864__STATIC_INLINE__ uint32_t nrf_802154_frame_ie_vendor_oui_get(const uint8_t * p_ie_iterator);
865
882__STATIC_INLINE__ uint8_t nrf_802154_frame_ie_vendor_thread_subtype_get(
883 const uint8_t * p_ie_iterator);
884
904__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_vendor_thread_data_addr_get(
905 const uint8_t * p_ie_iterator);
906
907#ifndef NRF_802154_FRAME_DECLARE_ONLY
908
910 const nrf_802154_frame_t * p_parser_data)
911{
912 return p_parser_data->parse_level;
913}
914
915__STATIC_INLINE__ uint8_t nrf_802154_frame_length_get(
916 const nrf_802154_frame_t * p_parser_data)
917{
918 return p_parser_data->p_frame[PHR_OFFSET];
919}
920
921__STATIC_INLINE__ uint8_t nrf_802154_frame_psdu_offset_get(
922 const nrf_802154_frame_t * p_parser_data)
923{
924 return PSDU_OFFSET;
925}
926
927__STATIC_INLINE__ const uint8_t * nrf_802154_frame_psdu_get(
928 const nrf_802154_frame_t * p_parser_data)
929{
930 return &p_parser_data->p_frame[PSDU_OFFSET];
931}
932
933__STATIC_INLINE__ uint8_t nrf_802154_frame_version_get(
934 const nrf_802154_frame_t * p_parser_data)
935{
936 return p_parser_data->p_frame[FRAME_VERSION_OFFSET] & FRAME_VERSION_MASK;
937}
938
940 const nrf_802154_frame_t * p_parser_data)
941{
942 return (p_parser_data->p_frame[DSN_SUPPRESS_OFFSET] & DSN_SUPPRESS_BIT) ? true : false;
943}
944
945__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_addr_type_get(
946 const nrf_802154_frame_t * p_parser_data)
947{
948 return p_parser_data->p_frame[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK;
949}
950
952 const nrf_802154_frame_t * p_parser_data)
953{
954 return (p_parser_data->p_frame[DEST_ADDR_TYPE_OFFSET] & DEST_ADDR_TYPE_MASK) ==
956}
957
958__STATIC_INLINE__ uint8_t nrf_802154_frame_src_addr_type_get(
959 const nrf_802154_frame_t * p_parser_data)
960{
961 return p_parser_data->p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK;
962}
963
965 const nrf_802154_frame_t * p_parser_data)
966{
967 return (p_parser_data->p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) ==
969}
970
972 const nrf_802154_frame_t * p_parser_data)
973{
974 return (p_parser_data->p_frame[SRC_ADDR_TYPE_OFFSET] & SRC_ADDR_TYPE_MASK) ==
976}
977
979 const nrf_802154_frame_t * p_parser_data)
980{
981 return (p_parser_data->p_frame[SECURITY_ENABLED_OFFSET] & SECURITY_ENABLED_BIT) ? true : false;
982}
983
985 const nrf_802154_frame_t * p_parser_data)
986{
987 return (p_parser_data->p_frame[IE_PRESENT_OFFSET] & IE_PRESENT_BIT) ? true : false;
988}
989
991 const nrf_802154_frame_t * p_parser_data)
992{
993 return (p_parser_data->p_frame[FRAME_PENDING_OFFSET] & FRAME_PENDING_BIT) != 0;
994}
995
996__STATIC_INLINE__ uint8_t nrf_802154_frame_type_get(
997 const nrf_802154_frame_t * p_parser_data)
998{
999 return p_parser_data->p_frame[FRAME_TYPE_OFFSET] & FRAME_TYPE_MASK;
1000}
1001
1003 const nrf_802154_frame_t * p_parser_data)
1004{
1005 return (p_parser_data->p_frame[PAN_ID_COMPR_OFFSET] & PAN_ID_COMPR_MASK) ? true : false;
1006}
1007
1008__STATIC_INLINE__ bool nrf_802154_frame_ar_bit_is_set(
1009 const nrf_802154_frame_t * p_parser_data)
1010{
1012 {
1013 return false;
1014 }
1015 else
1016 {
1017 return (p_parser_data->p_frame[ACK_REQUEST_OFFSET] & ACK_REQUEST_BIT) ? true : false;
1018 }
1019}
1020
1021__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dsn_get(
1022 const nrf_802154_frame_t * p_parser_data)
1023{
1025 {
1026 return NULL;
1027 }
1028
1029 return &p_parser_data->p_frame[DSN_OFFSET];
1030}
1031
1033 const nrf_802154_frame_t * p_parser_data)
1034{
1035 return p_parser_data->mhr.dst.panid_offset;
1036}
1037
1038__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dst_panid_get(
1039 const nrf_802154_frame_t * p_parser_data)
1040{
1041 uint8_t offset = nrf_802154_frame_dst_panid_offset_get(p_parser_data);
1042
1043 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1044 {
1045 return NULL;
1046 }
1047
1048 return &p_parser_data->p_frame[offset];
1049}
1050
1052 const nrf_802154_frame_t * p_parser_data)
1053{
1054 return p_parser_data->mhr.dst.addr_offset;
1055}
1056
1057__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dst_addr_get(
1058 const nrf_802154_frame_t * p_parser_data)
1059{
1060 uint8_t offset = nrf_802154_frame_dst_addr_offset_get(p_parser_data);
1061
1062 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1063 {
1064 return NULL;
1065 }
1066
1067 return &p_parser_data->p_frame[offset];
1068}
1069
1071 const nrf_802154_frame_t * p_parser_data)
1072{
1073 return p_parser_data->mhr.src.panid_offset;
1074}
1075
1076__STATIC_INLINE__ const uint8_t * nrf_802154_frame_src_panid_get(
1077 const nrf_802154_frame_t * p_parser_data)
1078{
1079 uint8_t offset = nrf_802154_frame_src_panid_offset_get(p_parser_data);
1080
1081 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1082 {
1083 return NULL;
1084 }
1085
1086 return &p_parser_data->p_frame[offset];
1087}
1088
1090 const nrf_802154_frame_t * p_parser_data)
1091{
1092 return p_parser_data->mhr.src.addr_offset;
1093}
1094
1095__STATIC_INLINE__ const uint8_t * nrf_802154_frame_src_addr_get(
1096 const nrf_802154_frame_t * p_parser_data)
1097{
1098 uint8_t offset = nrf_802154_frame_src_addr_offset_get(p_parser_data);
1099
1100 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1101 {
1102 return NULL;
1103 }
1104
1105 return &p_parser_data->p_frame[offset];
1106}
1107
1108__STATIC_INLINE__ uint8_t nrf_802154_frame_src_addr_size_get(
1109 const nrf_802154_frame_t * p_parser_data)
1110{
1111 return p_parser_data->helper.src_addr_size;
1112}
1113
1114__STATIC_INLINE__ uint8_t nrf_802154_frame_dst_addr_size_get(
1115 const nrf_802154_frame_t * p_parser_data)
1116{
1117 return p_parser_data->helper.dst_addr_size;
1118}
1119
1121 const nrf_802154_frame_t * p_parser_data)
1122{
1123 return p_parser_data->mhr.aux_sec_hdr.sec_ctrl_offset;
1124}
1125
1127 const nrf_802154_frame_t * p_parser_data)
1128{
1129 uint8_t offset = nrf_802154_frame_sec_ctrl_offset_get(p_parser_data);
1130
1131 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1132 {
1133 return 0;
1134 }
1135
1136 return p_parser_data->p_frame[offset] & SECURITY_LEVEL_MASK;
1137}
1138
1140 const nrf_802154_frame_t * p_parser_data)
1141{
1142 uint8_t offset = nrf_802154_frame_sec_ctrl_offset_get(p_parser_data);
1143
1144 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1145 {
1146 return false;
1147 }
1148
1149 return p_parser_data->p_frame[offset] & FRAME_COUNTER_SUPPRESS_BIT;
1150}
1151
1153 const nrf_802154_frame_t * p_parser_data)
1154{
1155 uint8_t offset = nrf_802154_frame_sec_ctrl_offset_get(p_parser_data);
1156
1157 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1158 {
1159 return 0;
1160 }
1161
1162 return (p_parser_data->p_frame[offset] & KEY_ID_MODE_MASK) >> KEY_ID_MODE_BIT_OFFSET;
1163}
1164
1166 const nrf_802154_frame_t * p_parser_data)
1167{
1168 uint8_t offset = nrf_802154_frame_sec_ctrl_offset_get(p_parser_data);
1169
1170 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1171 {
1172 return false;
1173 }
1174
1175 return p_parser_data->p_frame[offset] & ASN_IN_NONCE_BIT;
1176}
1177
1178__STATIC_INLINE__ const uint8_t * nrf_802154_frame_sec_ctrl_get(
1179 const nrf_802154_frame_t * p_parser_data)
1180{
1181 uint8_t offset = nrf_802154_frame_sec_ctrl_offset_get(p_parser_data);
1182
1183 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1184 {
1185 return NULL;
1186 }
1187
1188 return &p_parser_data->p_frame[offset];
1189}
1190
1191__STATIC_INLINE__ uint8_t nrf_802154_frame_counter_offset_get(
1192 const nrf_802154_frame_t * p_parser_data)
1193{
1194 return p_parser_data->mhr.aux_sec_hdr.frame_counter_offset;
1195}
1196
1197__STATIC_INLINE__ const uint8_t * nrf_802154_frame_counter_get(
1198 const nrf_802154_frame_t * p_parser_data)
1199{
1200 uint8_t offset = nrf_802154_frame_counter_offset_get(p_parser_data);
1201
1202 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1203 {
1204 return NULL;
1205 }
1206
1207 return &p_parser_data->p_frame[offset];
1208}
1209
1210__STATIC_INLINE__ uint8_t nrf_802154_frame_key_id_offset_get(
1211 const nrf_802154_frame_t * p_parser_data)
1212{
1213 return p_parser_data->mhr.aux_sec_hdr.key_id_offset;
1214}
1215
1216__STATIC_INLINE__ const uint8_t * nrf_802154_frame_key_id_get(
1217 const nrf_802154_frame_t * p_parser_data)
1218{
1219 uint8_t offset = nrf_802154_frame_key_id_offset_get(p_parser_data);
1220
1221 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1222 {
1223 return NULL;
1224 }
1225
1226 return &p_parser_data->p_frame[offset];
1227}
1228
1230 const nrf_802154_frame_t * p_parser_data)
1231{
1232 return p_parser_data->mhr.aux_sec_hdr.key_src_offset;
1233}
1234
1235__STATIC_INLINE__ const uint8_t * nrf_802154_frame_key_source_get(
1236 const nrf_802154_frame_t * p_parser_data)
1237{
1238 uint8_t offset = nrf_802154_frame_key_source_offset_get(p_parser_data);
1239
1240 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1241 {
1242 return NULL;
1243 }
1244
1245 return &p_parser_data->p_frame[offset];
1246}
1247
1249 const nrf_802154_frame_t * p_parser_data)
1250{
1251 return p_parser_data->helper.key_src_size;
1252}
1253
1255 const nrf_802154_frame_t * p_parser_data)
1256{
1257 return p_parser_data->mhr.aux_sec_hdr.key_idx_offset;
1258}
1259
1260__STATIC_INLINE__ uint8_t nrf_802154_frame_key_index_get(
1261 const nrf_802154_frame_t * p_parser_data)
1262{
1263 uint8_t offset = nrf_802154_frame_key_index_offset_get(p_parser_data);
1264
1265 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1266 {
1267 return 0;
1268 }
1269
1270 return p_parser_data->p_frame[offset];
1271}
1272
1274 const nrf_802154_frame_t * p_parser_data)
1275{
1276 return p_parser_data->mhr.header_ie_offset;
1277}
1278
1279__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_header_get(
1280 const nrf_802154_frame_t * p_parser_data)
1281{
1282 uint8_t offset = nrf_802154_frame_ie_header_offset_get(p_parser_data);
1283
1284 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1285 {
1286 return NULL;
1287 }
1288
1289 return &p_parser_data->p_frame[offset];
1290}
1291
1293 const nrf_802154_frame_t * p_parser_data)
1294{
1295 return p_parser_data->mac_payload.mac_payload_offset;
1296}
1297
1298__STATIC_INLINE__ const uint8_t * nrf_802154_frame_mac_payload_get(
1299 const nrf_802154_frame_t * p_parser_data)
1300{
1301 uint8_t offset = nrf_802154_frame_mac_payload_offset_get(p_parser_data);
1302
1303 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1304 {
1305 return NULL;
1306 }
1307
1308 return &p_parser_data->p_frame[offset];
1309}
1310
1312 const nrf_802154_frame_t * p_parser_data)
1313{
1314 if (nrf_802154_frame_type_get(p_parser_data) != FRAME_TYPE_COMMAND)
1315 {
1317 }
1318
1319 // MAC command frames containing Payload Information Elements are not supported.
1320 return nrf_802154_frame_mac_payload_offset_get(p_parser_data);
1321}
1322
1323__STATIC_INLINE__ const uint8_t * nrf_802154_frame_mac_command_id_get(
1324 const nrf_802154_frame_t * p_parser_data)
1325{
1326 uint8_t offset = nrf_802154_frame_mac_command_id_offset_get(p_parser_data);
1327
1328 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1329 {
1330 return NULL;
1331 }
1332
1333 return &p_parser_data->p_frame[offset];
1334}
1335
1336__STATIC_INLINE__ uint8_t nrf_802154_frame_mfr_offset_get(
1337 const nrf_802154_frame_t * p_parser_data)
1338{
1339 return nrf_802154_frame_length_get(p_parser_data) - FCS_SIZE + PHR_SIZE;
1340}
1341
1342__STATIC_INLINE__ const uint8_t * nrf_802154_frame_mfr_get(
1343 const nrf_802154_frame_t * p_parser_data)
1344{
1345 uint8_t offset = nrf_802154_frame_mfr_offset_get(p_parser_data);
1346
1347 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1348 {
1349 return NULL;
1350 }
1351
1352 return &p_parser_data->p_frame[offset];
1353}
1354
1355__STATIC_INLINE__ uint8_t nrf_802154_frame_mic_size_get(
1356 const nrf_802154_frame_t * p_parser_data)
1357{
1358 return p_parser_data->helper.mic_size;
1359}
1360
1362 const nrf_802154_frame_t * p_parser_data)
1363{
1364 uint8_t mic_len = nrf_802154_frame_mic_size_get(p_parser_data);
1365 uint8_t payload_start = nrf_802154_frame_mac_payload_offset_get(p_parser_data);
1366 uint8_t payload_end = nrf_802154_frame_mfr_offset_get(p_parser_data) - mic_len;
1367
1368 return payload_end - payload_start;
1369}
1370
1372 const nrf_802154_frame_t * p_parser_data)
1373{
1374 uint8_t mhr_start = nrf_802154_frame_psdu_offset_get(p_parser_data);
1375 uint8_t mhr_end = nrf_802154_frame_mac_payload_offset_get(p_parser_data);
1376
1377 if (mhr_end == NRF_802154_FRAME_INVALID_OFFSET)
1378 {
1379 mhr_end = nrf_802154_frame_mfr_offset_get(p_parser_data);
1380 }
1381
1382 return mhr_end - mhr_start;
1383}
1384
1386 const nrf_802154_frame_t * p_parser_data)
1387{
1388 return p_parser_data->helper.dst_addressing_end_offset;
1389}
1390
1391__STATIC_INLINE__ const uint8_t * nrf_802154_frame_dst_addressing_end_get(
1392 const nrf_802154_frame_t * p_parser_data)
1393{
1394 uint8_t offset = nrf_802154_frame_dst_addressing_end_offset_get(p_parser_data);
1395
1396 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1397 {
1398 return NULL;
1399 }
1400
1401 return &p_parser_data->p_frame[offset];
1402}
1403
1405 const nrf_802154_frame_t * p_parser_data)
1406{
1407 return p_parser_data->helper.addressing_end_offset;
1408}
1409
1410__STATIC_INLINE__ const uint8_t * nrf_802154_frame_addressing_end_get(
1411 const nrf_802154_frame_t * p_parser_data)
1412{
1413 uint8_t offset = nrf_802154_frame_addressing_end_offset_get(p_parser_data);
1414
1415 if (offset == NRF_802154_FRAME_INVALID_OFFSET)
1416 {
1417 return NULL;
1418 }
1419
1420 return &p_parser_data->p_frame[offset];
1421}
1422
1424 const nrf_802154_frame_t * p_parser_data)
1425{
1426 return p_parser_data->helper.aux_sec_hdr_end_offset;
1427}
1428
1429__STATIC_INLINE__ const uint8_t * nrf_802154_frame_header_ie_iterator_begin(
1430 const uint8_t * p_ie_header)
1431{
1432 return p_ie_header;
1433}
1434
1435__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_content_address_get(
1436 const uint8_t * p_ie_iterator)
1437{
1438 return p_ie_iterator + IE_DATA_OFFSET;
1439}
1440
1441__STATIC_INLINE__ uint8_t nrf_802154_frame_ie_length_get(const uint8_t * p_ie_iterator)
1442{
1443 return p_ie_iterator[IE_LENGTH_OFFSET] & IE_LENGTH_MASK;
1444}
1445
1446__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_iterator_next(
1447 const uint8_t * p_ie_iterator)
1448{
1449 return nrf_802154_frame_ie_content_address_get(p_ie_iterator)
1450 + nrf_802154_frame_ie_length_get(p_ie_iterator);
1451}
1452
1453__STATIC_INLINE__ uint8_t nrf_802154_frame_ie_id_get(const uint8_t * p_ie_iterator)
1454{
1455 return (p_ie_iterator[IE_ID_OFFSET_0] >> 7) | (p_ie_iterator[IE_ID_OFFSET_1] << 1);
1456}
1457
1458__STATIC_INLINE__ bool nrf_802154_frame_ie_iterator_end(const uint8_t * p_ie_iterator,
1459 const uint8_t * p_end_addr)
1460{
1461 uint8_t ie_id = nrf_802154_frame_ie_id_get(p_ie_iterator);
1462
1463 return ((nrf_802154_frame_ie_length_get(p_ie_iterator) == 0) &&
1464 ((ie_id == IE_HT1) || (ie_id == IE_HT2)))
1465 || (p_ie_iterator >= p_end_addr);
1466}
1467
1468__STATIC_INLINE__ uint32_t nrf_802154_frame_ie_vendor_oui_get(const uint8_t * p_ie_iterator)
1469{
1470 return little_24_to_host((uint8_t *)&p_ie_iterator[IE_DATA_OFFSET + IE_VENDOR_OUI_OFFSET]);
1471}
1472
1474 const uint8_t * p_ie_iterator)
1475{
1476 return p_ie_iterator[IE_DATA_OFFSET + IE_VENDOR_THREAD_SUBTYPE_OFFSET];
1477}
1478
1479__STATIC_INLINE__ const uint8_t * nrf_802154_frame_ie_vendor_thread_data_addr_get(
1480 const uint8_t * p_ie_iterator)
1481{
1482 return nrf_802154_frame_ie_content_address_get(p_ie_iterator) +
1484}
1485
1486#endif /* NRF_802154_FRAME_DECLARE_ONLY */
1487
1488#endif // NRF_802154_FRAME_H
#define FRAME_TYPE_OFFSET
Definition nrf_802154_const.h:70
#define FRAME_PENDING_OFFSET
Definition nrf_802154_const.h:67
#define IE_ID_OFFSET_1
Definition nrf_802154_const.h:227
#define DSN_SUPPRESS_OFFSET
Definition nrf_802154_const.h:62
#define SECURITY_LEVEL_MASK
Definition nrf_802154_const.h:133
#define FCS_SIZE
Definition nrf_802154_const.h:154
#define PHR_SIZE
Definition nrf_802154_const.h:166
#define SRC_ADDR_TYPE_SHORT
Definition nrf_802154_const.h:147
#define IE_VENDOR_THREAD_DATA_OFFSET
Definition nrf_802154_const.h:201
#define IE_HT1
Definition nrf_802154_const.h:222
#define FRAME_TYPE_MULTIPURPOSE
Definition nrf_802154_const.h:78
#define IE_LENGTH_OFFSET
Definition nrf_802154_const.h:225
#define ACK_REQUEST_OFFSET
Definition nrf_802154_const.h:49
#define SECURITY_ENABLED_BIT
Definition nrf_802154_const.h:132
#define FRAME_VERSION_OFFSET
Definition nrf_802154_const.h:80
#define IE_HT2
Definition nrf_802154_const.h:223
#define IE_DATA_OFFSET
Definition nrf_802154_const.h:228
#define IE_VENDOR_OUI_OFFSET
Definition nrf_802154_const.h:198
#define PSDU_OFFSET
Definition nrf_802154_const.h:129
#define FRAME_TYPE_COMMAND
Definition nrf_802154_const.h:74
#define IE_PRESENT_OFFSET
Definition nrf_802154_const.h:88
#define ASN_IN_NONCE_BIT
Definition nrf_802154_const.h:52
#define FRAME_TYPE_MASK
Definition nrf_802154_const.h:71
#define PHR_OFFSET
Definition nrf_802154_const.h:126
#define IE_VENDOR_THREAD_SUBTYPE_OFFSET
Definition nrf_802154_const.h:200
#define FRAME_PENDING_BIT
Definition nrf_802154_const.h:68
#define DSN_OFFSET
Definition nrf_802154_const.h:61
#define DSN_SUPPRESS_BIT
Definition nrf_802154_const.h:63
#define SRC_ADDR_TYPE_EXTENDED
Definition nrf_802154_const.h:143
#define DEST_ADDR_TYPE_EXTENDED
Definition nrf_802154_const.h:56
#define IE_ID_OFFSET_0
Definition nrf_802154_const.h:226
#define KEY_ID_MODE_BIT_OFFSET
Definition nrf_802154_const.h:97
#define SECURITY_ENABLED_OFFSET
Definition nrf_802154_const.h:131
#define PAN_ID_COMPR_OFFSET
Definition nrf_802154_const.h:121
#define ACK_REQUEST_BIT
Definition nrf_802154_const.h:50
#define FRAME_VERSION_MASK
Definition nrf_802154_const.h:81
#define KEY_ID_MODE_MASK
Definition nrf_802154_const.h:96
#define IE_PRESENT_BIT
Definition nrf_802154_const.h:89
#define PAN_ID_COMPR_MASK
Definition nrf_802154_const.h:122
#define DEST_ADDR_TYPE_OFFSET
Definition nrf_802154_const.h:54
#define FRAME_COUNTER_SUPPRESS_BIT
Definition nrf_802154_const.h:65
#define IE_LENGTH_MASK
Definition nrf_802154_const.h:224
#define SRC_ADDR_TYPE_MASK
Definition nrf_802154_const.h:145
#define SRC_ADDR_TYPE_OFFSET
Definition nrf_802154_const.h:146
#define DEST_ADDR_TYPE_MASK
Definition nrf_802154_const.h:55
__STATIC_INLINE uint8_t nrf_802154_frame_sec_ctrl_sec_lvl_get(const nrf_802154_frame_t *p_parser_data)
Gets the value of the Security Level field from the Security Control Field.
Definition nrf_802154_frame.h:1126
__STATIC_INLINE const uint8_t * nrf_802154_frame_src_panid_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Source PAN ID field.
Definition nrf_802154_frame.h:1076
__STATIC_INLINE uint8_t nrf_802154_frame_mac_header_length_get(const nrf_802154_frame_t *p_parser_data)
Gets the length of the MAC header.
Definition nrf_802154_frame.h:1371
__STATIC_INLINE const uint8_t * nrf_802154_frame_dst_panid_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Destination PAN field.
Definition nrf_802154_frame.h:1038
__STATIC_INLINE const uint8_t * nrf_802154_frame_key_id_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Key ID field.
Definition nrf_802154_frame.h:1216
__STATIC_INLINE const uint8_t * nrf_802154_frame_psdu_get(const nrf_802154_frame_t *p_parser_data)
Gets the PSDU start address of the frame.
Definition nrf_802154_frame.h:927
__STATIC_INLINE uint8_t nrf_802154_frame_src_panid_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of frame Source PAN ID.
Definition nrf_802154_frame.h:1070
__STATIC_INLINE bool nrf_802154_frame_dst_addr_is_extended(const nrf_802154_frame_t *p_parser_data)
Determines if the destination address is extended.
Definition nrf_802154_frame.h:951
__STATIC_INLINE const uint8_t * nrf_802154_frame_key_source_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Key Source field.
Definition nrf_802154_frame.h:1235
__STATIC_INLINE const uint8_t * nrf_802154_frame_src_addr_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Source Address field.
Definition nrf_802154_frame.h:1095
__STATIC_INLINE bool nrf_802154_frame_panid_compression_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the PAN ID compressions bit from the Frame Control Field.
Definition nrf_802154_frame.h:1002
__STATIC_INLINE uint8_t nrf_802154_frame_ie_header_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the IE header.
Definition nrf_802154_frame.h:1273
__STATIC_INLINE uint8_t nrf_802154_frame_mac_payload_length_get(const nrf_802154_frame_t *p_parser_data)
Gets the length of the MAC payload.
Definition nrf_802154_frame.h:1361
__STATIC_INLINE uint8_t nrf_802154_frame_ie_id_get(const uint8_t *p_ie_iterator)
Gets identifier of currently iterated IE.
Definition nrf_802154_frame.h:1453
__STATIC_INLINE uint8_t nrf_802154_frame_mic_size_get(const nrf_802154_frame_t *p_parser_data)
Gets the length of the MIC field.
Definition nrf_802154_frame.h:1355
__STATIC_INLINE bool nrf_802154_frame_ie_present_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the IE present bit from the Frame Control Field.
Definition nrf_802154_frame.h:984
__STATIC_INLINE const uint8_t * nrf_802154_frame_mac_command_id_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the MAC Command ID field.
Definition nrf_802154_frame.h:1323
__STATIC_INLINE const uint8_t * nrf_802154_frame_ie_vendor_thread_data_addr_get(const uint8_t *p_ie_iterator)
Gets vendor-specific IE thread data address of currently iterated IE.
Definition nrf_802154_frame.h:1479
__STATIC_INLINE const uint8_t * nrf_802154_frame_ie_content_address_get(const uint8_t *p_ie_iterator)
Gets payload address of currently iterated IE.
Definition nrf_802154_frame.h:1435
__STATIC_INLINE const uint8_t * nrf_802154_frame_ie_header_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the IE header.
Definition nrf_802154_frame.h:1279
__STATIC_INLINE uint8_t nrf_802154_frame_counter_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the Frame Counter field.
Definition nrf_802154_frame.h:1191
__STATIC_INLINE uint8_t nrf_802154_frame_dst_addressing_end_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the end offset of the destination addressing section.
Definition nrf_802154_frame.h:1385
__STATIC_INLINE uint8_t nrf_802154_frame_ie_vendor_thread_subtype_get(const uint8_t *p_ie_iterator)
Gets subtype of Thread vendor-specific IE.
Definition nrf_802154_frame.h:1473
__STATIC_INLINE const uint8_t * nrf_802154_frame_dsn_get(const nrf_802154_frame_t *p_parser_data)
Gets the value of the DSN field.
Definition nrf_802154_frame.h:1021
__STATIC_INLINE bool nrf_802154_frame_sec_ctrl_fc_suppress_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the Frame Counter Suppress bit from the Security Control Field.
Definition nrf_802154_frame.h:1139
__STATIC_INLINE const uint8_t * nrf_802154_frame_ie_iterator_next(const uint8_t *p_ie_iterator)
Gets next information element iterator.
Definition nrf_802154_frame.h:1446
__STATIC_INLINE const uint8_t * nrf_802154_frame_header_ie_iterator_begin(const uint8_t *p_ie_header)
Initializes the IE iterator with given IE header address.
Definition nrf_802154_frame.h:1429
__STATIC_INLINE bool nrf_802154_frame_sec_ctrl_asn_in_nonce_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the ASN in Nonce bit from the Security Control Field.
Definition nrf_802154_frame.h:1165
__STATIC_INLINE bool nrf_802154_frame_security_enabled_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the Security Enabled bit from the Frame Control Field.
Definition nrf_802154_frame.h:978
__STATIC_INLINE uint8_t nrf_802154_frame_type_get(const nrf_802154_frame_t *p_parser_data)
Gets the value of the frame type field from the Frame Control Field.
Definition nrf_802154_frame.h:996
nrf_802154_frame_parser_level_t
Definition nrf_802154_frame.h:63
@ PARSE_LEVEL_FULL
Parse level for fully parsed frame. All fields can be considered valid and complete.
Definition nrf_802154_frame.h:133
@ PARSE_LEVEL_NONE
Parse level at which no parsing has been performed on the frame.
Definition nrf_802154_frame.h:69
@ PARSE_LEVEL_ADDRESSING_END
Parse level at which the data under offsets determined by the FCF can be considered complete.
Definition nrf_802154_frame.h:102
@ PARSE_LEVEL_SEC_CTRL_OFFSETS
Parse level at which the offsets that can be determined based on Security Control Field can be consid...
Definition nrf_802154_frame.h:112
@ PARSE_LEVEL_MAX
Definition nrf_802154_frame.h:135
@ PARSE_LEVEL_AUX_SEC_HDR_END
Parse level at which the data under offsets determined by the Security Control Field can be considere...
Definition nrf_802154_frame.h:122
@ PARSE_LEVEL_DST_ADDRESSING_END
Parse level at which the destination address data can be considered complete.
Definition nrf_802154_frame.h:92
@ PARSE_LEVEL_FCF_OFFSETS
Parse level at which the offsets that can be determined based on the FCF can be considered valid.
Definition nrf_802154_frame.h:82
__STATIC_INLINE uint8_t nrf_802154_frame_sec_ctrl_key_id_mode_get(const nrf_802154_frame_t *p_parser_data)
Gets the value of the Key ID Mode field from the Security Control Field.
Definition nrf_802154_frame.h:1152
__STATIC_INLINE uint8_t nrf_802154_frame_length_get(const nrf_802154_frame_t *p_parser_data)
Gets the PSDU length of the frame.
Definition nrf_802154_frame.h:915
__STATIC_INLINE uint8_t nrf_802154_frame_dst_addr_type_get(const nrf_802154_frame_t *p_parser_data)
Gets the MAC frame destination address type from the Frame Control Field.
Definition nrf_802154_frame.h:945
__STATIC_INLINE uint8_t nrf_802154_frame_dst_addr_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of frame Destination Address.
Definition nrf_802154_frame.h:1051
__STATIC_INLINE uint8_t nrf_802154_frame_version_get(const nrf_802154_frame_t *p_parser_data)
Gets the MAC frame version value from the Frame Control Field.
Definition nrf_802154_frame.h:933
__STATIC_INLINE bool nrf_802154_frame_ie_iterator_end(const uint8_t *p_ie_iterator, const uint8_t *p_end_addr)
Checks if the current IE is a terminator.
Definition nrf_802154_frame.h:1458
__STATIC_INLINE const uint8_t * nrf_802154_frame_sec_ctrl_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Security Control Field.
Definition nrf_802154_frame.h:1178
__STATIC_INLINE uint8_t nrf_802154_frame_aux_sec_hdr_end_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the end offset of the security header section.
Definition nrf_802154_frame.h:1423
__STATIC_INLINE const uint8_t * nrf_802154_frame_counter_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Frame Counter field.
Definition nrf_802154_frame.h:1197
#define NRF_802154_FRAME_INVALID_OFFSET
Definition nrf_802154_frame.h:60
__STATIC_INLINE uint8_t nrf_802154_frame_key_source_length_get(const nrf_802154_frame_t *p_parser_data)
Gets the length of the Key Source field.
Definition nrf_802154_frame.h:1248
__STATIC_INLINE const uint8_t * nrf_802154_frame_dst_addr_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Destination Address field.
Definition nrf_802154_frame.h:1057
__STATIC_INLINE uint8_t nrf_802154_frame_sec_ctrl_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the Security Control Field.
Definition nrf_802154_frame.h:1120
__STATIC_INLINE bool nrf_802154_frame_ar_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the AR bit from the Frame Control Field.
Definition nrf_802154_frame.h:1008
__STATIC_INLINE uint8_t nrf_802154_frame_src_addr_type_get(const nrf_802154_frame_t *p_parser_data)
Gets the MAC frame source address type from the Frame Control Field.
Definition nrf_802154_frame.h:958
__STATIC_INLINE uint8_t nrf_802154_frame_key_index_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the Key Index field.
Definition nrf_802154_frame.h:1254
__STATIC_INLINE bool nrf_802154_frame_src_addr_is_short(const nrf_802154_frame_t *p_parser_data)
Determines if the source address is short.
Definition nrf_802154_frame.h:971
__STATIC_INLINE uint8_t nrf_802154_frame_mac_command_id_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the MAC Command ID field.
Definition nrf_802154_frame.h:1311
__STATIC_INLINE const uint8_t * nrf_802154_frame_mfr_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the MFR field.
Definition nrf_802154_frame.h:1342
__STATIC_INLINE bool nrf_802154_frame_dsn_suppress_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Gets the value of the DSN suppress bit from the Frame Control Field.
Definition nrf_802154_frame.h:939
__STATIC_INLINE uint32_t nrf_802154_frame_ie_vendor_oui_get(const uint8_t *p_ie_iterator)
Gets vendor-specific OUI (organizationally unique identifier) of currently iterated IE.
Definition nrf_802154_frame.h:1468
__STATIC_INLINE uint8_t nrf_802154_frame_key_source_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the Key Source field.
Definition nrf_802154_frame.h:1229
__STATIC_INLINE uint8_t nrf_802154_frame_dst_addr_size_get(const nrf_802154_frame_t *p_parser_data)
Gets the size of the destination address.
Definition nrf_802154_frame.h:1114
__STATIC_INLINE uint8_t nrf_802154_frame_mac_payload_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the MAC payload.
Definition nrf_802154_frame.h:1292
__STATIC_INLINE uint8_t nrf_802154_frame_addressing_end_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the end offset of the addressing section.
Definition nrf_802154_frame.h:1404
__STATIC_INLINE uint8_t nrf_802154_frame_src_addr_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of frame Source Address.
Definition nrf_802154_frame.h:1089
__STATIC_INLINE uint8_t nrf_802154_frame_psdu_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the PSDU start offset of the frame.
Definition nrf_802154_frame.h:921
__STATIC_INLINE uint8_t nrf_802154_frame_dst_panid_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the Destination PAN ID field.
Definition nrf_802154_frame.h:1032
__STATIC_INLINE const uint8_t * nrf_802154_frame_dst_addressing_end_get(const nrf_802154_frame_t *p_parser_data)
Gets the end address of the destination addressing section.
Definition nrf_802154_frame.h:1391
__STATIC_INLINE uint8_t nrf_802154_frame_ie_length_get(const uint8_t *p_ie_iterator)
Gets length of currently iterated IE.
Definition nrf_802154_frame.h:1441
__STATIC_INLINE const uint8_t * nrf_802154_frame_mac_payload_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the MAC payload.
Definition nrf_802154_frame.h:1298
__STATIC_INLINE uint8_t nrf_802154_frame_mfr_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the MFR field.
Definition nrf_802154_frame.h:1336
__STATIC_INLINE bool nrf_802154_frame_src_addr_is_extended(const nrf_802154_frame_t *p_parser_data)
Determines if the source address is extended.
Definition nrf_802154_frame.h:964
__STATIC_INLINE const uint8_t * nrf_802154_frame_addressing_end_get(const nrf_802154_frame_t *p_parser_data)
Gets the end address of the addressing section.
Definition nrf_802154_frame.h:1410
__STATIC_INLINE uint8_t nrf_802154_frame_key_index_get(const nrf_802154_frame_t *p_parser_data)
Gets the address of the Key Index field.
Definition nrf_802154_frame.h:1260
__STATIC_INLINE nrf_802154_frame_parser_level_t nrf_802154_frame_parse_level_get(const nrf_802154_frame_t *p_parser_data)
Gets current parse level of the provided parser data.
Definition nrf_802154_frame.h:909
__STATIC_INLINE uint8_t nrf_802154_frame_src_addr_size_get(const nrf_802154_frame_t *p_parser_data)
Gets the size of the source address.
Definition nrf_802154_frame.h:1108
__STATIC_INLINE uint8_t nrf_802154_frame_key_id_offset_get(const nrf_802154_frame_t *p_parser_data)
Gets the offset of the Key ID field.
Definition nrf_802154_frame.h:1210
__STATIC_INLINE bool nrf_802154_frame_pending_bit_is_set(const nrf_802154_frame_t *p_parser_data)
Definition nrf_802154_frame.h:990
#define NULL
Definition osal_types.h:36
uint8_t valid_data_len
Number of valid bytes in the frame.
Definition nrf_802154_frame.h:142
uint8_t addr_offset
Destination address offset.
Definition nrf_802154_frame.h:149
uint8_t frame_counter_offset
Frame Counter field offset.
Definition nrf_802154_frame.h:161
uint8_t addressing_end_offset
Addressing end offset.
Definition nrf_802154_frame.h:180
uint8_t src_addr_size
Source address size;.
Definition nrf_802154_frame.h:178
nrf_802154_frame_parser_level_t parse_level
Current frame parse level.
Definition nrf_802154_frame.h:141
uint8_t sec_ctrl_offset
Security Control Field offset.
Definition nrf_802154_frame.h:160
uint8_t aux_sec_hdr_end_offset
Auxiliary Security Header offset.
Definition nrf_802154_frame.h:181
uint8_t mac_payload_offset
MAC payload offset.
Definition nrf_802154_frame.h:172
uint8_t key_id_offset
Key ID offset.
Definition nrf_802154_frame.h:162
struct nrf_802154_frame_t::@19 helper
uint8_t * p_frame
Pointer to a buffer containing the frame bytes.
Definition nrf_802154_frame.h:140
uint8_t dst_addr_size
Destination address size;.
Definition nrf_802154_frame.h:177
struct nrf_802154_frame_t::@17::@20 dst
uint8_t panid_offset
Destination PAN ID offset.
Definition nrf_802154_frame.h:148
uint8_t key_idx_offset
Key Index offset.
Definition nrf_802154_frame.h:164
uint8_t key_src_offset
Key Source offset.
Definition nrf_802154_frame.h:163
uint8_t key_src_size
Key Source size.
Definition nrf_802154_frame.h:182
uint8_t dst_addressing_end_offset
Destination addressing end offset.
Definition nrf_802154_frame.h:179
struct nrf_802154_frame_t::@17 mhr
uint8_t mic_size
Message Integrity Code size.
Definition nrf_802154_frame.h:183
struct nrf_802154_frame_t::@17::@22 aux_sec_hdr
struct nrf_802154_frame_t::@17::@21 src
struct nrf_802154_frame_t::@18 mac_payload
uint8_t header_ie_offset
Header IE offset.
Definition nrf_802154_frame.h:167
Definition nrf_802154_frame.h:139