include/net/macsec.h
Source file repositories/reference/linux-study-clean/include/net/macsec.h
File Facts
- System
- Linux kernel
- Corpus path
include/net/macsec.h- Extension
.h- Size
- 11011 bytes
- Lines
- 388
- 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/u64_stats_sync.hlinux/if_vlan.hlinux/workqueue.huapi/linux/if_link.huapi/linux/if_macsec.h
Detected Declarations
struct metadata_dststruct macsec_keystruct macsec_rx_sc_statsstruct macsec_rx_sa_statsstruct macsec_tx_sa_statsstruct macsec_tx_sc_statsstruct macsec_dev_statsstruct macsec_rx_sastruct pcpu_rx_sc_statsstruct pcpu_tx_sc_statsstruct macsec_rx_scstruct macsec_tx_sastruct macsec_tx_scstruct macsec_secystruct macsec_contextstruct macsec_opsfunction macsec_send_scifunction sci_to_cpu
Annotated Snippet
struct macsec_key {
u8 id[MACSEC_KEYID_LEN];
struct crypto_aead *tfm;
salt_t salt;
};
struct macsec_rx_sc_stats {
__u64 InOctetsValidated;
__u64 InOctetsDecrypted;
__u64 InPktsUnchecked;
__u64 InPktsDelayed;
__u64 InPktsOK;
__u64 InPktsInvalid;
__u64 InPktsLate;
__u64 InPktsNotValid;
__u64 InPktsNotUsingSA;
__u64 InPktsUnusedSA;
};
struct macsec_rx_sa_stats {
__u32 InPktsOK;
__u32 InPktsInvalid;
__u32 InPktsNotValid;
__u32 InPktsNotUsingSA;
__u32 InPktsUnusedSA;
};
struct macsec_tx_sa_stats {
__u32 OutPktsProtected;
__u32 OutPktsEncrypted;
};
struct macsec_tx_sc_stats {
__u64 OutPktsProtected;
__u64 OutPktsEncrypted;
__u64 OutOctetsProtected;
__u64 OutOctetsEncrypted;
};
struct macsec_dev_stats {
__u64 OutPktsUntagged;
__u64 InPktsUntagged;
__u64 OutPktsTooLong;
__u64 InPktsNoTag;
__u64 InPktsBadTag;
__u64 InPktsUnknownSCI;
__u64 InPktsNoSCI;
__u64 InPktsOverrun;
};
/**
* struct macsec_rx_sa - receive secure association
* @active:
* @next_pn: packet number expected for the next packet
* @lock: protects next_pn manipulations
* @key: key structure
* @ssci: short secure channel identifier
* @stats: per-SA stats
* @destroy_work: deferred work to free the SA in process context after RCU grace period
*/
struct macsec_rx_sa {
struct macsec_key key;
ssci_t ssci;
spinlock_t lock;
union {
pn_t next_pn_halves;
u64 next_pn;
};
refcount_t refcnt;
bool active;
struct macsec_rx_sa_stats __percpu *stats;
struct macsec_rx_sc *sc;
struct rcu_work destroy_work;
};
struct pcpu_rx_sc_stats {
struct macsec_rx_sc_stats stats;
struct u64_stats_sync syncp;
};
struct pcpu_tx_sc_stats {
struct macsec_tx_sc_stats stats;
struct u64_stats_sync syncp;
};
/**
* struct macsec_rx_sc - receive secure channel
* @sci: secure channel identifier for this SC
* @active: channel is active
* @sa: array of secure associations
Annotation
- Immediate include surface: `linux/u64_stats_sync.h`, `linux/if_vlan.h`, `linux/workqueue.h`, `uapi/linux/if_link.h`, `uapi/linux/if_macsec.h`.
- Detected declarations: `struct metadata_dst`, `struct macsec_key`, `struct macsec_rx_sc_stats`, `struct macsec_rx_sa_stats`, `struct macsec_tx_sa_stats`, `struct macsec_tx_sc_stats`, `struct macsec_dev_stats`, `struct macsec_rx_sa`, `struct pcpu_rx_sc_stats`, `struct pcpu_tx_sc_stats`.
- 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.