STRUCT OVPN_PEER(9)
β¨ NAME β¨
okay bestie, welcome to the struct ovpn_peer(9) page from the Kernel API Manual β she's the main remote peer object and the moment is absolutely hers ππ
π SYNOPSIS π
no cap, here's the exact struct, because we do not mess with C definitions:
struct ovpn_peer {
struct ovpn_priv *ovpn;
netdevice_tracker dev_tracker;
u32 id;
u32 tx_id;
struct {
struct in_addr ipv4;
struct in6_addr ipv6;
} vpn_addrs;
struct hlist_node hash_entry_id;
struct hlist_nulls_node hash_entry_addr4;
struct hlist_nulls_node hash_entry_addr6;
struct hlist_nulls_node hash_entry_transp_addr;
struct ovpn_socket *sock;
struct {
struct strparser strp;
struct sk_buff_head user_queue;
struct sk_buff_head out_queue;
bool tx_in_progress;
struct {
struct sk_buff *skb;
int offset;
int len;
} out_msg;
struct {
void (*sk_data_ready)(struct sock *sk);
void (*sk_write_space)(struct sock *sk);
struct proto *prot;
const struct proto_ops *ops;
} sk_cb;
struct work_struct defer_del_work;
} tcp;
struct ovpn_crypto_state crypto;
struct dst_cache dst_cache;
struct ovpn_route_key route_key;
seqcount_spinlock_t route_key_seq;
struct ovpn_bind *bind;
unsigned long keepalive_interval;
unsigned long keepalive_xmit_exp;
time64_t last_sent;
unsigned long keepalive_timeout;
unsigned long keepalive_recv_exp;
time64_t last_recv;
struct ovpn_peer_stats vpn_stats;
struct ovpn_peer_stats link_stats;
enum ovpn_del_peer_reason delete_reason;
spinlock_t lock;
struct kref refcount;
struct rcu_head rcu;
struct llist_node release_entry;
struct work_struct keepalive_work;
};
she's long, she's nested, she's got a whole TCP situation inside her, and she ate π β¨
πΈ Members πΈ
field-by-field, bestie β every single one gets her moment:
ovpnβ main openvpn instance this peer belongs to.dev_trackerβ reference tracker for associated dev.idβ unique identifier, used to match incoming packets.tx_idβ identifier to be used in TX packets.vpn_addrsβ IP addresses assigned over the tunnel.vpn_addrs.ipv4β IPv4 assigned to peer on the tunnel.vpn_addrs.ipv6β IPv6 assigned to peer on the tunnel.
hash_entry_idβ entry in the peer ID hashtable.hash_entry_addr4β entry in the peer IPv4 hashtable.hash_entry_addr6β entry in the peer IPv6 hashtable.hash_entry_transp_addrβ entry in the peer transport address hashtable.sockβ the socket being used to talk to this peer.tcpβ keeps track of TCP specific state.tcp.strpβ stream parser context (TCP only).tcp.user_queueβ received packets that have to go to userspace (TCP only).tcp.out_queueβ packets on hold while socket is taken by user (TCP only).tcp.tx_in_progressβ true if TX is already ongoing (TCP only).tcp.out_msg.skbβ packet scheduled for sending (TCP only).tcp.out_msg.offsetβ offset where next send should start (TCP only).tcp.out_msg.lenβ remaining data to send within packet (TCP only).tcp.sk_cb.sk_data_readyβ pointer to original cb (TCP only).tcp.sk_cb.sk_write_spaceβ pointer to original cb (TCP only).tcp.sk_cb.protβ pointer to original prot object (TCP only).tcp.sk_cb.opsβ pointer to the original prot_ops object (TCP only).
cryptoβ the crypto configuration (ciphers, keys, etc..).dst_cacheβ cache fordst_entryused to send to peer.route_keyβ route key matching the current dst cache contents.route_key_seqβ seqcount protecting locklessroute_keyreads.bindβ remote peer binding.keepalive_intervalβ seconds after which a new keepalive should be sent.keepalive_xmit_expβ future timestamp when next keepalive should be sent.last_sentβ timestamp of the last successfully sent packet.keepalive_timeoutβ seconds after which an inactive peer is considered dead.keepalive_recv_expβ future timestamp when the peer should expire.last_recvβ timestamp of the last authenticated received packet.vpn_statsβ per-peer in-VPN TX/RX stats.link_statsβ per-peer link/transport TX/RX stats.delete_reasonβ why peer was deleted (i.e. timeout, transport error, ..).lockβ protects binding to peer (bind),route_keyandkeepalive*fields.refcountβ reference counter.rcuβ used to free peer in an RCU safe way.release_entryβ entry for the socket release list.keepalive_workβ used to schedule keepalive sending.
π¦ SEE ALSO π¦
go give these a little read, bestie:
- Kernel file
./drivers/net/ovpn/peer.hβstruct ovpn_route_key(9),ovpn_peer_hold(9),ovpn_peer_put(9)
mwah π this page is brought to you by ./drivers/net/ovpn, dated October 2026, and titled struct ovpn_peer(9) β now go hydrate and be iconic π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms