^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef __IEEE802154_6LOWPAN_I_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define __IEEE802154_6LOWPAN_I_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #include <net/ieee802154_netdev.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <net/inet_frag.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <net/6lowpan.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) typedef unsigned __bitwise lowpan_rx_result;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define RX_CONTINUE ((__force lowpan_rx_result) 0u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define RX_DROP_UNUSABLE ((__force lowpan_rx_result) 1u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define RX_DROP ((__force lowpan_rx_result) 2u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define RX_QUEUED ((__force lowpan_rx_result) 3u)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define LOWPAN_DISPATCH_FRAG1 0xc0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define LOWPAN_DISPATCH_FRAGN 0xe0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct frag_lowpan_compare_key {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) u16 tag;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) u16 d_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct ieee802154_addr src;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) struct ieee802154_addr dst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) /* Equivalent of ipv4 struct ipq
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) struct lowpan_frag_queue {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) struct inet_frag_queue q;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) void lowpan_net_frag_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) int lowpan_net_frag_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) void lowpan_rx_init(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void lowpan_rx_exit(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) int lowpan_header_create(struct sk_buff *skb, struct net_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned short type, const void *_daddr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) const void *_saddr, unsigned int len);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) netdev_tx_t lowpan_xmit(struct sk_buff *skb, struct net_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) int lowpan_iphc_decompress(struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) lowpan_rx_result lowpan_rx_h_ipv6(struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #endif /* __IEEE802154_6LOWPAN_I_H__ */