net/psp/psp.h
Source file repositories/reference/linux-study-clean/net/psp/psp.h
File Facts
- System
- Linux kernel
- Corpus path
net/psp/psp.h- Extension
.h- Size
- 1556 bytes
- Lines
- 57
- 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/list.hlinux/lockdep.hlinux/mutex.hnet/netns/generic.hnet/psp.hnet/sock.h
Detected Declarations
function psp_dev_getfunction psp_dev_trygetfunction psp_dev_putfunction psp_dev_is_registered
Annotated Snippet
#ifndef __PSP_PSP_H
#define __PSP_PSP_H
#include <linux/list.h>
#include <linux/lockdep.h>
#include <linux/mutex.h>
#include <net/netns/generic.h>
#include <net/psp.h>
#include <net/sock.h>
extern struct xarray psp_devs;
extern struct mutex psp_devs_lock;
void psp_dev_free(struct psp_dev *psd);
int psp_dev_check_access(struct psp_dev *psd, struct net *net, bool admin);
bool psp_has_assoc_dev_in_ns(struct psp_dev *psd, struct net *net);
int psp_attach_netdev_notifier(void);
void psp_nl_notify_dev(struct psp_dev *psd, u32 cmd);
struct psp_assoc *psp_assoc_create(struct psp_dev *psd);
struct psp_dev *psp_dev_get_for_sock(struct sock *sk);
void psp_dev_tx_key_del(struct psp_dev *psd, struct psp_assoc *pas);
int psp_sock_assoc_set_rx(struct sock *sk, struct psp_assoc *pas,
struct psp_key_parsed *key,
struct netlink_ext_ack *extack);
int psp_sock_assoc_set_tx(struct sock *sk, struct psp_dev *psd,
u32 version, struct psp_key_parsed *key,
struct netlink_ext_ack *extack);
void psp_assocs_key_rotated(struct psp_dev *psd);
static inline void psp_dev_get(struct psp_dev *psd)
{
refcount_inc(&psd->refcnt);
}
static inline bool psp_dev_tryget(struct psp_dev *psd)
{
return refcount_inc_not_zero(&psd->refcnt);
}
static inline void psp_dev_put(struct psp_dev *psd)
{
if (refcount_dec_and_test(&psd->refcnt))
psp_dev_free(psd);
}
static inline bool psp_dev_is_registered(struct psp_dev *psd)
{
lockdep_assert_held(&psd->lock);
return !!psd->ops;
}
#endif /* __PSP_PSP_H */
Annotation
- Immediate include surface: `linux/list.h`, `linux/lockdep.h`, `linux/mutex.h`, `net/netns/generic.h`, `net/psp.h`, `net/sock.h`.
- Detected declarations: `function psp_dev_get`, `function psp_dev_tryget`, `function psp_dev_put`, `function psp_dev_is_registered`.
- 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.