Lines Matching +full:len +full:- +full:or +full:- +full:define

10  * This program is free software; you can redistribute it and/or modify
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
28 * Redistribution and use in source and binary forms, with or without
35 * documentation and/or other materials provided with the distribution.
37 * may be used to endorse or promote products derived from this software
41 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
44 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 #define __6LOWPAN_H__
61 /* special link-layer handling */
64 #define EUI64_ADDR_LEN 8
66 #define LOWPAN_NHC_MAX_ID_LEN 1
70 #define LOWPAN_NHC_MAX_HDR_LEN (sizeof(struct udphdr))
71 /* Max IPHC Header len without IPv6 hdr specific inline data.
76 #define LOWPAN_IPHC_MAX_HEADER_LEN (2 + 1 + LOWPAN_NHC_MAX_ID_LEN)
78 #define LOWPAN_IPHC_MAX_HC_BUF_LEN (sizeof(struct ipv6hdr) + \
82 #define LOWPAN_IPHC_CTX_TABLE_SIZE (1 << 4)
84 #define LOWPAN_DISPATCH_IPV6 0x41 /* 01000001 = 65 */
85 #define LOWPAN_DISPATCH_IPHC 0x60 /* 011xxxxx = ... */
86 #define LOWPAN_DISPATCH_IPHC_MASK 0xe0
98 #define LOWPAN_PRIV_SIZE(llpriv_size) \
126 return test_bit(LOWPAN_IPHC_CTX_FLAG_ACTIVE, &ctx->flags); in lowpan_iphc_ctx_is_active()
132 return test_bit(LOWPAN_IPHC_CTX_FLAG_COMPRESSION, &ctx->flags); in lowpan_iphc_ctx_is_compression()
169 return (struct lowpan_802154_dev *)lowpan_dev(dev)->priv; in lowpan_802154_dev()
181 BUILD_BUG_ON(sizeof(struct lowpan_802154_cb) > sizeof(skb->cb)); in lowpan_802154_cb()
182 return (struct lowpan_802154_cb *)skb->cb; in lowpan_802154_cb()
192 ipaddr->s6_addr[0] = 0xFE; in lowpan_iphc_uncompress_eui64_lladdr()
193 ipaddr->s6_addr[1] = 0x80; in lowpan_iphc_uncompress_eui64_lladdr()
194 memcpy(&ipaddr->s6_addr[8], lladdr, EUI64_ADDR_LEN); in lowpan_iphc_uncompress_eui64_lladdr()
195 /* second bit-flip (Universe/Local) in lowpan_iphc_uncompress_eui64_lladdr()
198 ipaddr->s6_addr[8] ^= 0x02; in lowpan_iphc_uncompress_eui64_lladdr()
208 ipaddr->s6_addr[0] = 0xFE; in lowpan_iphc_uncompress_eui48_lladdr()
209 ipaddr->s6_addr[1] = 0x80; in lowpan_iphc_uncompress_eui48_lladdr()
210 memcpy(&ipaddr->s6_addr[8], lladdr, 3); in lowpan_iphc_uncompress_eui48_lladdr()
211 ipaddr->s6_addr[11] = 0xFF; in lowpan_iphc_uncompress_eui48_lladdr()
212 ipaddr->s6_addr[12] = 0xFE; in lowpan_iphc_uncompress_eui48_lladdr()
213 memcpy(&ipaddr->s6_addr[13], lladdr + 3, 3); in lowpan_iphc_uncompress_eui48_lladdr()
219 const unsigned char *buf, int len) in raw_dump_inline() argument
224 print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, buf, len, false); in raw_dump_inline()
234 const unsigned char *buf, int len) in raw_dump_table() argument
239 print_hex_dump_debug("\t", DUMP_PREFIX_OFFSET, 16, 1, buf, len, false); in raw_dump_table()
243 const unsigned char *buf, int len) { } in raw_dump_table() argument
245 const unsigned char *buf, int len) { } in raw_dump_inline() argument
249 * lowpan_fetch_skb - getting inline data from 6LoWPAN header
254 * by len.
258 * @len: amount of data which should be pulled in bytes.
261 unsigned int len) in lowpan_fetch_skb() argument
263 if (unlikely(!pskb_may_pull(skb, len))) in lowpan_fetch_skb()
266 skb_copy_from_linear_data(skb, data, len); in lowpan_fetch_skb()
267 skb_pull(skb, len); in lowpan_fetch_skb()
274 /* First bit of addr is multicast, reserved or 802.15.4 specific */ in lowpan_802154_is_valid_src_short_addr()
279 const size_t len) in lowpan_push_hc_data() argument
281 memcpy(*hc_ptr, data, len); in lowpan_push_hc_data()
282 *hc_ptr += len; in lowpan_push_hc_data()
293 * lowpan_header_decompress - replace 6LoWPAN header with IPv6 header
296 * skb->data and skb_network_header, with the IPv6 header.
312 * lowpan_header_compress - replace IPv6 header with 6LoWPAN header
315 * skb->data and skb_network_header, with the IPHC 6LoWPAN header.
317 * at least a headroom which is smaller or equal LOWPAN_IPHC_MAX_HEADER_LEN,