include/net/inet_ecn.h
Source file repositories/reference/linux-study-clean/include/net/inet_ecn.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/inet_ecn.h- Extension
.h- Size
- 8363 bytes
- Lines
- 338
- 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/ip.hlinux/skbuff.hlinux/if_vlan.hnet/inet_sock.hnet/dsfield.hnet/checksum.h
Detected Declarations
struct ipv6hdrfunction INET_ECN_is_cefunction INET_ECN_is_not_ectfunction INET_ECN_is_capablefunction ECTfunction __INET_ECN_xmitfunction INET_ECN_xmitfunction INET_ECN_dontxmitfunction IP_ECN_set_cefunction IP_ECN_set_ect1function IP_ECN_clearfunction ipv4_copy_dscpfunction IP_ECN_set_cefunction IP6_ECN_set_ect1function ipv6_copy_dscpfunction INET_ECN_set_cefunction skb_get_dsfieldfunction INET_ECN_set_ect1function headerfunction INET_ECN_decapsulatefunction IP_ECN_decapsulatefunction IP6_ECN_decapsulate
Annotated Snippet
switch (outer & INET_ECN_MASK) {
case INET_ECN_NOT_ECT:
return 0;
case INET_ECN_ECT_0:
case INET_ECN_ECT_1:
return 1;
case INET_ECN_CE:
return 2;
}
}
*set_ce = INET_ECN_is_ce(outer);
return 0;
}
static inline int INET_ECN_decapsulate(struct sk_buff *skb,
__u8 outer, __u8 inner)
{
bool set_ce = false;
int rc;
rc = __INET_ECN_decapsulate(outer, inner, &set_ce);
if (!rc) {
if (set_ce)
INET_ECN_set_ce(skb);
else if ((outer & INET_ECN_MASK) == INET_ECN_ECT_1)
INET_ECN_set_ect1(skb);
}
return rc;
}
static inline int IP_ECN_decapsulate(const struct iphdr *oiph,
struct sk_buff *skb)
{
__u8 inner;
switch (skb_protocol(skb, true)) {
case htons(ETH_P_IP):
inner = ip_hdr(skb)->tos;
break;
case htons(ETH_P_IPV6):
inner = ipv6_get_dsfield(ipv6_hdr(skb));
break;
default:
return 0;
}
return INET_ECN_decapsulate(skb, oiph->tos, inner);
}
static inline int IP6_ECN_decapsulate(const struct ipv6hdr *oipv6h,
struct sk_buff *skb)
{
__u8 inner;
switch (skb_protocol(skb, true)) {
case htons(ETH_P_IP):
inner = ip_hdr(skb)->tos;
break;
case htons(ETH_P_IPV6):
inner = ipv6_get_dsfield(ipv6_hdr(skb));
break;
default:
return 0;
}
return INET_ECN_decapsulate(skb, ipv6_get_dsfield(oipv6h), inner);
}
#endif
Annotation
- Immediate include surface: `linux/ip.h`, `linux/skbuff.h`, `linux/if_vlan.h`, `net/inet_sock.h`, `net/dsfield.h`, `net/checksum.h`.
- Detected declarations: `struct ipv6hdr`, `function INET_ECN_is_ce`, `function INET_ECN_is_not_ect`, `function INET_ECN_is_capable`, `function ECT`, `function __INET_ECN_xmit`, `function INET_ECN_xmit`, `function INET_ECN_dontxmit`, `function IP_ECN_set_ce`, `function IP_ECN_set_ect1`.
- 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.