include/net/6lowpan.h
Source file repositories/reference/linux-study-clean/include/net/6lowpan.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/6lowpan.h- Extension
.h- Size
- 10270 bytes
- Lines
- 331
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hnet/ipv6.hnet/net_namespace.hnet/mac802154.h
Detected Declarations
struct lowpan_iphc_ctxstruct lowpan_iphc_ctx_tablestruct lowpan_devstruct lowpan_802154_neighstruct lowpan_802154_devstruct lowpan_802154_cbenum lowpan_lltypesenum lowpan_iphc_ctx_flagsfunction lowpan_is_ipv6function lowpan_is_iphcfunction lowpan_iphc_ctx_is_activefunction lowpan_iphc_ctx_is_compressionfunction lowpan_iphc_uncompress_eui64_lladdrfunction lowpan_iphc_uncompress_eui48_lladdrfunction raw_dump_inlinefunction raw_dump_tablefunction raw_dump_tablefunction lowpan_802154_is_valid_src_short_addrfunction lowpan_push_hc_data
Annotated Snippet
struct lowpan_iphc_ctx {
u8 id;
struct in6_addr pfx;
u8 plen;
unsigned long flags;
};
struct lowpan_iphc_ctx_table {
spinlock_t lock;
const struct lowpan_iphc_ctx_ops *ops;
struct lowpan_iphc_ctx table[LOWPAN_IPHC_CTX_TABLE_SIZE];
};
static inline bool lowpan_iphc_ctx_is_active(const struct lowpan_iphc_ctx *ctx)
{
return test_bit(LOWPAN_IPHC_CTX_FLAG_ACTIVE, &ctx->flags);
}
static inline bool
lowpan_iphc_ctx_is_compression(const struct lowpan_iphc_ctx *ctx)
{
return test_bit(LOWPAN_IPHC_CTX_FLAG_COMPRESSION, &ctx->flags);
}
struct lowpan_dev {
enum lowpan_lltypes lltype;
struct dentry *iface_debugfs;
struct lowpan_iphc_ctx_table ctx;
/* must be last */
u8 priv[] __aligned(sizeof(void *));
};
struct lowpan_802154_neigh {
__le16 short_addr;
};
static inline
struct lowpan_802154_neigh *lowpan_802154_neigh(void *neigh_priv)
{
return neigh_priv;
}
static inline
struct lowpan_dev *lowpan_dev(const struct net_device *dev)
{
return netdev_priv(dev);
}
/* private device info */
struct lowpan_802154_dev {
struct net_device *wdev; /* wpan device ptr */
u16 fragment_tag;
};
static inline struct
lowpan_802154_dev *lowpan_802154_dev(const struct net_device *dev)
{
return (struct lowpan_802154_dev *)lowpan_dev(dev)->priv;
}
struct lowpan_802154_cb {
u16 d_tag;
unsigned int d_size;
u8 d_offset;
};
static inline
struct lowpan_802154_cb *lowpan_802154_cb(const struct sk_buff *skb)
{
BUILD_BUG_ON(sizeof(struct lowpan_802154_cb) > sizeof(skb->cb));
return (struct lowpan_802154_cb *)skb->cb;
}
static inline void lowpan_iphc_uncompress_eui64_lladdr(struct in6_addr *ipaddr,
const void *lladdr)
{
/* fe:80::XXXX:XXXX:XXXX:XXXX
* \_________________/
* hwaddr
*/
ipaddr->s6_addr[0] = 0xFE;
ipaddr->s6_addr[1] = 0x80;
memcpy(&ipaddr->s6_addr[8], lladdr, EUI64_ADDR_LEN);
/* second bit-flip (Universe/Local)
* is done according RFC2464
*/
ipaddr->s6_addr[8] ^= 0x02;
}
Annotation
- Immediate include surface: `linux/debugfs.h`, `net/ipv6.h`, `net/net_namespace.h`, `net/mac802154.h`.
- Detected declarations: `struct lowpan_iphc_ctx`, `struct lowpan_iphc_ctx_table`, `struct lowpan_dev`, `struct lowpan_802154_neigh`, `struct lowpan_802154_dev`, `struct lowpan_802154_cb`, `enum lowpan_lltypes`, `enum lowpan_iphc_ctx_flags`, `function lowpan_is_ipv6`, `function lowpan_is_iphc`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.