include/net/seg6_hmac.h

Source file repositories/reference/linux-study-clean/include/net/seg6_hmac.h

File Facts

System
Linux kernel
Corpus path
include/net/seg6_hmac.h
Extension
.h
Size
1663 bytes
Lines
61
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct seg6_hmac_info {
	struct rhash_head node;
	struct rcu_head rcu;

	u32 hmackeyid;
	/* The raw key, kept only so it can be returned back to userspace */
	char secret[SEG6_HMAC_SECRET_LEN];
	u8 slen;
	u8 alg_id;
	/* The prepared key, which the calculations actually use */
	union {
		struct hmac_sha1_key sha1;
		struct hmac_sha256_key sha256;
	} key;
};

extern int seg6_hmac_compute(struct seg6_hmac_info *hinfo,
			     struct ipv6_sr_hdr *hdr, struct in6_addr *saddr,
			     u8 *output);
extern struct seg6_hmac_info *seg6_hmac_info_lookup(struct net *net, u32 key);
extern int seg6_hmac_info_add(struct net *net, u32 key,
			      struct seg6_hmac_info *hinfo);
extern int seg6_hmac_info_del(struct net *net, u32 key);
extern int seg6_push_hmac(struct net *net, struct in6_addr *saddr,
			  struct ipv6_sr_hdr *srh);
extern bool seg6_hmac_validate_skb(struct sk_buff *skb);
#ifdef CONFIG_IPV6_SEG6_HMAC
extern int seg6_hmac_net_init(struct net *net);
extern void seg6_hmac_net_exit(struct net *net);
#else
static inline int seg6_hmac_net_init(struct net *net) { return 0; }
static inline void seg6_hmac_net_exit(struct net *net) {}
#endif

#endif

Annotation

Implementation Notes