net/sctp/ipv6.c
Source file repositories/reference/linux-study-clean/net/sctp/ipv6.c
File Facts
- System
- Linux kernel
- Corpus path
net/sctp/ipv6.c- Extension
.c- Size
- 31891 bytes
- Lines
- 1200
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/errno.hlinux/types.hlinux/socket.hlinux/sockios.hlinux/net.hlinux/in.hlinux/in6.hlinux/netdevice.hlinux/init.hlinux/ipsec.hlinux/slab.hlinux/ipv6.hlinux/icmpv6.hlinux/random.hlinux/seq_file.hnet/protocol.hnet/ndisc.hnet/ip.hnet/ipv6.hnet/transp_v6.hnet/addrconf.hnet/ip6_route.hnet/inet_common.hnet/inet_ecn.hnet/sctp/sctp.hnet/udp_tunnel.hlinux/uaccess.h
Detected Declarations
function notifiersfunction list_for_each_entry_safefunction sctp_v6_err_handlefunction sctp_v6_errfunction sctp_udp_v6_errfunction sctp_v6_xmitfunction sctp_v6_get_dstfunction list_for_each_entry_rcufunction sctp_v6_addr_match_lenfunction sctp_v6_get_saddrfunction sctp_v6_copy_addrlistfunction sctp_v6_copy_ip_optionsfunction sctp_v6_ip_options_lenfunction sctp_v6_from_skbfunction sctp_v6_from_skfunction sctp_v6_to_sk_saddrfunction sctp_v6_to_sk_daddrfunction sctp_v6_from_addr_paramfunction sctp_v6_to_addr_paramfunction sctp_v6_to_addrfunction __sctp_v6_cmp_addrfunction sctp_v6_cmp_addrfunction sctp_v6_inaddr_anyfunction sctp_v6_is_anyfunction sctp_v6_availablefunction sctp_v6_addr_validfunction sctp_v6_scopefunction sctp_v6_addr_to_userfunction sctp_v6_skb_iiffunction sctp_v6_skb_sdiffunction sctp_v6_is_cefunction sctp_v6_seq_dump_addrfunction sctp_v6_ecn_capablefunction sctp_inet6_event_msgnamefunction sctp_inet6_skb_msgnamefunction sctp_inet6_af_supportedfunction sctp_inet6_cmp_addrfunction sctp_inet6_bind_verifyfunction sctp_inet6_send_verifyfunction sctp_inet6_supported_addrsfunction sctp_getnamefunction sctp6_rcvfunction sctp_v6_pf_initfunction sctp_v6_pf_exitfunction sctp_v6_protosw_initfunction sctp_v6_protosw_exitfunction sctp_v6_add_protocolfunction sctp_v6_del_protocol
Annotated Snippet
static const struct proto_ops inet6_seqpacket_ops = {
.family = PF_INET6,
.owner = THIS_MODULE,
.release = inet6_release,
.bind = inet6_bind,
.connect = sctp_inet_connect,
.socketpair = sock_no_socketpair,
.accept = inet_accept,
.getname = sctp_getname,
.poll = sctp_poll,
.ioctl = inet6_ioctl,
.gettstamp = sock_gettstamp,
.listen = sctp_inet_listen,
.shutdown = inet_shutdown,
.setsockopt = sock_common_setsockopt,
.getsockopt = sock_common_getsockopt,
.sendmsg = inet_sendmsg,
.recvmsg = inet_recvmsg,
.mmap = sock_no_mmap,
#ifdef CONFIG_COMPAT
.compat_ioctl = inet6_compat_ioctl,
#endif
};
static struct inet_protosw sctpv6_seqpacket_protosw = {
.type = SOCK_SEQPACKET,
.protocol = IPPROTO_SCTP,
.prot = &sctpv6_prot,
.ops = &inet6_seqpacket_ops,
.flags = SCTP_PROTOSW_FLAG
};
static struct inet_protosw sctpv6_stream_protosw = {
.type = SOCK_STREAM,
.protocol = IPPROTO_SCTP,
.prot = &sctpv6_prot,
.ops = &inet6_seqpacket_ops,
.flags = SCTP_PROTOSW_FLAG,
};
static int sctp6_rcv(struct sk_buff *skb)
{
SCTP_INPUT_CB(skb)->encap_port = 0;
return sctp_rcv(skb) ? -1 : 0;
}
static const struct inet6_protocol sctpv6_protocol = {
.handler = sctp6_rcv,
.err_handler = sctp_v6_err,
.flags = INET6_PROTO_NOPOLICY | INET6_PROTO_FINAL,
};
static struct sctp_af sctp_af_inet6 = {
.sa_family = AF_INET6,
.sctp_xmit = sctp_v6_xmit,
.setsockopt = ipv6_setsockopt,
.getsockopt = ipv6_getsockopt,
.get_dst = sctp_v6_get_dst,
.get_saddr = sctp_v6_get_saddr,
.copy_addrlist = sctp_v6_copy_addrlist,
.from_skb = sctp_v6_from_skb,
.from_sk = sctp_v6_from_sk,
.from_addr_param = sctp_v6_from_addr_param,
.to_addr_param = sctp_v6_to_addr_param,
.cmp_addr = sctp_v6_cmp_addr,
.scope = sctp_v6_scope,
.addr_valid = sctp_v6_addr_valid,
.inaddr_any = sctp_v6_inaddr_any,
.is_any = sctp_v6_is_any,
.available = sctp_v6_available,
.skb_iif = sctp_v6_skb_iif,
.skb_sdif = sctp_v6_skb_sdif,
.is_ce = sctp_v6_is_ce,
.seq_dump_addr = sctp_v6_seq_dump_addr,
.ecn_capable = sctp_v6_ecn_capable,
.net_header_len = sizeof(struct ipv6hdr),
.sockaddr_len = sizeof(struct sockaddr_in6),
.ip_options_len = sctp_v6_ip_options_len,
};
static struct sctp_pf sctp_pf_inet6 = {
.event_msgname = sctp_inet6_event_msgname,
.skb_msgname = sctp_inet6_skb_msgname,
.af_supported = sctp_inet6_af_supported,
.cmp_addr = sctp_inet6_cmp_addr,
.bind_verify = sctp_inet6_bind_verify,
.send_verify = sctp_inet6_send_verify,
.supported_addrs = sctp_inet6_supported_addrs,
.addr_to_user = sctp_v6_addr_to_user,
.to_sk_saddr = sctp_v6_to_sk_saddr,
.to_sk_daddr = sctp_v6_to_sk_daddr,
Annotation
- Immediate include surface: `linux/module.h`, `linux/errno.h`, `linux/types.h`, `linux/socket.h`, `linux/sockios.h`, `linux/net.h`, `linux/in.h`, `linux/in6.h`.
- Detected declarations: `function notifiers`, `function list_for_each_entry_safe`, `function sctp_v6_err_handle`, `function sctp_v6_err`, `function sctp_udp_v6_err`, `function sctp_v6_xmit`, `function sctp_v6_get_dst`, `function list_for_each_entry_rcu`, `function sctp_v6_addr_match_len`, `function sctp_v6_get_saddr`.
- 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.