include/net/ipv6.h
Source file repositories/reference/linux-study-clean/include/net/ipv6.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/ipv6.h- Extension
.h- Size
- 38224 bytes
- Lines
- 1336
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ipv6.hlinux/hardirq.hlinux/jhash.hlinux/refcount.hlinux/jump_label_ratelimit.hnet/if_inet6.hnet/flow.hnet/flow_dissector.hnet/inet_dscp.hnet/snmp.hnet/netns/hash.hnet/sock.h
Detected Declarations
struct ip_tunnel_infostruct frag_hdrstruct ip6_fraglist_iterstruct ip6_frag_statestruct ip6_ra_chainstruct ipv6_txoptionsstruct ip6_flowlabelstruct ipv6_fl_sockliststruct ipcm6_cookiestruct group_source_reqstruct group_filterenum flowlabel_reflectfunction ipcm6_init_skfunction txopt_putfunction fl6_sock_releasefunction ipv6_fixup_optionsfunction ipv6_accept_rafunction ipv6_addr_typefunction ipv6_addr_scopefunction __ipv6_addr_src_scopefunction ipv6_addr_src_scopefunction __ipv6_addr_needs_scope_idfunction ipv6_iface_scope_idfunction ipv6_addr_cmpfunction ipv6_masked_addr_cmpfunction ipv6_addr_prefixfunction ipv6_addr_prefix_copyfunction __ipv6_addr_set_halffunction ipv6_addr_setfunction ipv6_addr_equalfunction __ipv6_prefix_equal64_halffunction ipv6_prefix_equalfunction ipv6_prefix_equalfunction ipv6_addr_anyfunction ipv6_addr_hashfunction __ipv6_addr_jhashfunction ipv6_addr_loopbackfunction ipv6_addr_v4mappedfunction ipv6_addr_v4mapped_loopbackfunction ipv6_portaddr_hashfunction ipv6_addr_orchidfunction ipv6_addr_is_multicastfunction ipv6_addr_set_v4mappedfunction __ipv6_addr_diff32function __ipv6_addr_diff64function __ipv6_addr_difffunction ipv6_addr_difffunction ip6_sk_dst_hoplimit
Annotated Snippet
extern const struct proto_ops inet6_stream_ops;
extern const struct proto_ops inet6_dgram_ops;
extern const struct proto_ops inet6_sockraw_ops;
struct group_source_req;
struct group_filter;
int ip6_mc_source(int add, int omode, struct sock *sk,
struct group_source_req *pgsr);
int ip6_mc_msfilter(struct sock *sk, struct group_filter *gsf,
struct sockaddr_storage *list);
int ip6_mc_msfget(struct sock *sk, struct group_filter *gsf,
sockptr_t optval, size_t ss_offset);
#ifdef CONFIG_PROC_FS
int ac6_proc_init(struct net *net);
void ac6_proc_exit(struct net *net);
int raw6_proc_init(void);
void raw6_proc_exit(void);
int tcp6_proc_init(struct net *net);
void tcp6_proc_exit(struct net *net);
int udp6_proc_init(struct net *net);
void udp6_proc_exit(struct net *net);
int ipv6_misc_proc_init(void);
void ipv6_misc_proc_exit(void);
int snmp6_register_dev(struct inet6_dev *idev);
int snmp6_unregister_dev(struct inet6_dev *idev);
#else
static inline int ac6_proc_init(struct net *net) { return 0; }
static inline void ac6_proc_exit(struct net *net) { }
static inline int snmp6_register_dev(struct inet6_dev *idev) { return 0; }
static inline int snmp6_unregister_dev(struct inet6_dev *idev) { return 0; }
#endif
#ifdef CONFIG_SYSCTL
struct ctl_table *ipv6_icmp_sysctl_init(struct net *net);
size_t ipv6_icmp_sysctl_table_size(void);
struct ctl_table *ipv6_route_sysctl_init(struct net *net);
size_t ipv6_route_sysctl_table_size(struct net *net);
int ipv6_sysctl_register(void);
void ipv6_sysctl_unregister(void);
#endif
int ipv6_sock_mc_join(struct sock *sk, int ifindex,
const struct in6_addr *addr);
int ipv6_sock_mc_join_ssm(struct sock *sk, int ifindex,
const struct in6_addr *addr, unsigned int mode);
int ipv6_sock_mc_drop(struct sock *sk, int ifindex,
const struct in6_addr *addr);
static inline int ip6_sock_set_v6only(struct sock *sk)
{
int ret = 0;
lock_sock(sk);
if (inet_sk(sk)->inet_num)
ret = -EINVAL;
else
sk->sk_ipv6only = true;
release_sock(sk);
return ret;
}
static inline void ip6_sock_set_recverr(struct sock *sk)
{
inet6_set_bit(RECVERR6, sk);
}
#define IPV6_PREFER_SRC_MASK (IPV6_PREFER_SRC_TMP | IPV6_PREFER_SRC_PUBLIC | \
IPV6_PREFER_SRC_COA)
static inline int ip6_sock_set_addr_preferences(struct sock *sk, int val)
{
unsigned int prefmask = ~IPV6_PREFER_SRC_MASK;
unsigned int pref = 0;
/* check PUBLIC/TMP/PUBTMP_DEFAULT conflicts */
switch (val & (IPV6_PREFER_SRC_PUBLIC |
IPV6_PREFER_SRC_TMP |
IPV6_PREFER_SRC_PUBTMP_DEFAULT)) {
case IPV6_PREFER_SRC_PUBLIC:
pref |= IPV6_PREFER_SRC_PUBLIC;
prefmask &= ~(IPV6_PREFER_SRC_PUBLIC |
IPV6_PREFER_SRC_TMP);
break;
case IPV6_PREFER_SRC_TMP:
pref |= IPV6_PREFER_SRC_TMP;
prefmask &= ~(IPV6_PREFER_SRC_PUBLIC |
IPV6_PREFER_SRC_TMP);
Annotation
- Immediate include surface: `linux/ipv6.h`, `linux/hardirq.h`, `linux/jhash.h`, `linux/refcount.h`, `linux/jump_label_ratelimit.h`, `net/if_inet6.h`, `net/flow.h`, `net/flow_dissector.h`.
- Detected declarations: `struct ip_tunnel_info`, `struct frag_hdr`, `struct ip6_fraglist_iter`, `struct ip6_frag_state`, `struct ip6_ra_chain`, `struct ipv6_txoptions`, `struct ip6_flowlabel`, `struct ipv6_fl_socklist`, `struct ipcm6_cookie`, `struct group_source_req`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.