include/net/tcp_ao.h
Source file repositories/reference/linux-study-clean/include/net/tcp_ao.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/tcp_ao.h- Extension
.h- Size
- 11929 bytes
- Lines
- 373
- 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
crypto/sha2.hlinux/jump_label.h
Detected Declarations
struct tcp_ao_hdrstruct tcp_ao_countersstruct tcp_ao_mac_ctxstruct tcp_ao_keystruct tcp_ao_infostruct tcp4_ao_contextstruct tcp6_ao_contextenum tcp_ao_algo_idfunction tcp_ao_hdr_maclenfunction tcp_ao_maclenfunction tcp_ao_lenfunction tcp_ao_len_alignedfunction tcp_ao_digest_sizefunction tcp_ao_sizeof_keyfunction tcp_ao_transmit_skbfunction tcp_inbound_ao_hashfunction tcp_ao_destroy_sockfunction tcp_ao_get_sock_infofunction tcp_ao_get_repairfunction tcp_ao_set_repairfunction tcp_do_parse_auth_options
Annotated Snippet
struct tcp_ao_hdr {
u8 kind;
u8 length;
u8 keyid;
u8 rnext_keyid;
};
static inline u8 tcp_ao_hdr_maclen(const struct tcp_ao_hdr *aoh)
{
return aoh->length - sizeof(struct tcp_ao_hdr);
}
struct tcp_ao_counters {
atomic64_t pkt_good;
atomic64_t pkt_bad;
atomic64_t key_not_found;
atomic64_t ao_required;
atomic64_t dropped_icmp;
};
enum tcp_ao_algo_id {
TCP_AO_ALGO_HMAC_SHA1 = 1, /* specified by RFC 5926 */
TCP_AO_ALGO_HMAC_SHA256, /* Linux extension */
TCP_AO_ALGO_AES_128_CMAC, /* specified by RFC 5926 */
};
/*
* This is the maximum untruncated MAC length, in bytes. Note that the MACs
* actually get truncated to 20 or fewer bytes to fit in the TCP options space.
*/
#define TCP_AO_MAX_MAC_LEN SHA256_DIGEST_SIZE
#define TCP_AO_MAX_TRAFFIC_KEY_LEN SHA256_DIGEST_SIZE
struct tcp_ao_mac_ctx;
struct tcp_ao_key {
struct hlist_node node;
union tcp_ao_addr addr;
u8 key[TCP_AO_MAXKEYLEN];
enum tcp_ao_algo_id algo;
unsigned int digest_size;
int l3index;
u8 prefixlen;
u8 family;
u8 keylen;
u8 keyflags;
u8 sndid;
u8 rcvid;
u8 maclen;
struct rcu_head rcu;
atomic64_t pkt_good;
atomic64_t pkt_bad;
u8 traffic_keys[];
};
static inline u8 *rcv_other_key(struct tcp_ao_key *key)
{
return key->traffic_keys;
}
static inline u8 *snd_other_key(struct tcp_ao_key *key)
{
return key->traffic_keys + key->digest_size;
}
static inline int tcp_ao_maclen(const struct tcp_ao_key *key)
{
return key->maclen;
}
/* Use tcp_ao_len_aligned() for TCP header calculations */
static inline int tcp_ao_len(const struct tcp_ao_key *key)
{
return tcp_ao_maclen(key) + sizeof(struct tcp_ao_hdr);
}
static inline int tcp_ao_len_aligned(const struct tcp_ao_key *key)
{
return round_up(tcp_ao_len(key), 4);
}
static inline unsigned int tcp_ao_digest_size(struct tcp_ao_key *key)
{
return key->digest_size;
}
static inline int tcp_ao_sizeof_key(const struct tcp_ao_key *key)
{
return sizeof(struct tcp_ao_key) + (key->digest_size << 1);
Annotation
- Immediate include surface: `crypto/sha2.h`, `linux/jump_label.h`.
- Detected declarations: `struct tcp_ao_hdr`, `struct tcp_ao_counters`, `struct tcp_ao_mac_ctx`, `struct tcp_ao_key`, `struct tcp_ao_info`, `struct tcp4_ao_context`, `struct tcp6_ao_context`, `enum tcp_ao_algo_id`, `function tcp_ao_hdr_maclen`, `function tcp_ao_maclen`.
- 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.