1 /* 2 * Copyright (c) 2018 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __OPENTHREAD_UTILS_H__ 8 #define __OPENTHREAD_UTILS_H__ 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #if defined(CONFIG_OPENTHREAD_L2_DEBUG_DUMP_15_4) || \ 15 defined(CONFIG_OPENTHREAD_L2_DEBUG_DUMP_IPV6) 16 17 void dump_pkt(const char *str, struct net_pkt *pkt); 18 #else 19 #define dump_pkt(...) 20 #endif 21 22 void add_ipv6_addr_to_zephyr(struct openthread_context *context); 23 void add_ipv6_addr_to_ot(struct openthread_context *context, 24 const struct in6_addr *addr6); 25 void add_ipv6_maddr_to_ot(struct openthread_context *context, 26 const struct in6_addr *addr6); 27 void add_ipv6_maddr_to_zephyr(struct openthread_context *context); 28 void rm_ipv6_addr_from_zephyr(struct openthread_context *context); 29 void rm_ipv6_maddr_from_zephyr(struct openthread_context *context); 30 31 int pkt_list_add(struct openthread_context *context, struct net_pkt *pkt); 32 struct net_pkt *pkt_list_peek(struct openthread_context *context); 33 void pkt_list_remove_last(struct openthread_context *context); 34 void pkt_list_remove_first(struct openthread_context *context); 35 pkt_list_is_full(struct openthread_context * context)36static inline int pkt_list_is_full(struct openthread_context *context) 37 { 38 return context->pkt_list_full; 39 } 40 41 #ifdef __cplusplus 42 } 43 #endif 44 45 #endif /* __OPENTHREAD_UTILS_H__ */ 46