Alexander Aring | 8691ee5 | 2015-01-04 17:10:54 +0100 | [diff] [blame^] | 1 | #ifndef __IEEE802154_6LOWPAN_I_H__ |
| 2 | #define __IEEE802154_6LOWPAN_I_H__ |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 3 | |
| 4 | #include <net/inet_frag.h> |
| 5 | |
| 6 | struct lowpan_create_arg { |
Alexander Aring | f870b8c | 2014-10-06 11:00:51 +0200 | [diff] [blame] | 7 | u16 tag; |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 8 | u16 d_size; |
Phoebe Buckheister | ae531b9 | 2014-03-14 21:24:02 +0100 | [diff] [blame] | 9 | const struct ieee802154_addr *src; |
| 10 | const struct ieee802154_addr *dst; |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 11 | }; |
| 12 | |
| 13 | /* Equivalent of ipv4 struct ip |
| 14 | */ |
| 15 | struct lowpan_frag_queue { |
| 16 | struct inet_frag_queue q; |
| 17 | |
Alexander Aring | f870b8c | 2014-10-06 11:00:51 +0200 | [diff] [blame] | 18 | u16 tag; |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 19 | u16 d_size; |
Phoebe Buckheister | ae531b9 | 2014-03-14 21:24:02 +0100 | [diff] [blame] | 20 | struct ieee802154_addr saddr; |
| 21 | struct ieee802154_addr daddr; |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 22 | }; |
| 23 | |
Phoebe Buckheister | ae531b9 | 2014-03-14 21:24:02 +0100 | [diff] [blame] | 24 | static inline u32 ieee802154_addr_hash(const struct ieee802154_addr *a) |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 25 | { |
Phoebe Buckheister | ae531b9 | 2014-03-14 21:24:02 +0100 | [diff] [blame] | 26 | switch (a->mode) { |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 27 | case IEEE802154_ADDR_LONG: |
Phoebe Buckheister | ae531b9 | 2014-03-14 21:24:02 +0100 | [diff] [blame] | 28 | return (((__force u64)a->extended_addr) >> 32) ^ |
| 29 | (((__force u64)a->extended_addr) & 0xffffffff); |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 30 | case IEEE802154_ADDR_SHORT: |
| 31 | return (__force u32)(a->short_addr); |
| 32 | default: |
| 33 | return 0; |
| 34 | } |
| 35 | } |
| 36 | |
Alexander Aring | 7240cde | 2014-02-28 07:32:50 +0100 | [diff] [blame] | 37 | int lowpan_frag_rcv(struct sk_buff *skb, const u8 frag_type); |
| 38 | void lowpan_net_frag_exit(void); |
| 39 | int lowpan_net_frag_init(void); |
| 40 | |
Alexander Aring | 8691ee5 | 2015-01-04 17:10:54 +0100 | [diff] [blame^] | 41 | #endif /* __IEEE802154_6LOWPAN_I_H__ */ |