STRUCT OVPN_PEER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 for dst_entry used to send to peer.
  • route_key β€” route key matching the current dst cache contents.
  • route_key_seq β€” seqcount protecting lockless route_key reads.
  • 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_key and keepalive* 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:


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