|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
Wireguard VPN service. More...
Data Structures | |
| struct | wireguard_allowed_ip |
| Wireguard allowed IP address struct. More... | |
| struct | wireguard_peer_config |
| Wireguard peer configuration information. More... | |
| struct | net_stats_vpn |
| Wireguard VPN statistics. More... | |
| struct | net_event_vpn_peer |
| Network Management event information structure Used to pass information on network event NET_EVENT_VPN_PEER_ADD when CONFIG_NET_MGMT_EVENT_INFO enabled and event generator pass the information. More... | |
Macros | |
| #define | WIREGUARD_TIMESTAMP_LEN (sizeof(uint64_t) + sizeof(uint32_t)) |
| Timestamp length (64-bit seconds and 32-bit nanoseconds). | |
Functions | |
| int | wireguard_peer_add (struct wireguard_peer_config *peer_config, struct net_if **peer_iface) |
| Add a Wireguard peer to the system. | |
| int | wireguard_peer_remove (int peer_id) |
| Remove a Wireguard peer from the system. | |
| int | wireguard_peer_keepalive (int peer_id) |
| Send a Wireguard keepalive message to peer. | |
| int | wireguard_get_current_time (uint64_t *seconds, uint32_t *nanoseconds) |
| Get current time in seconds and nanoseconds from Unix epoch. | |
Wireguard VPN service.
#include <zephyr/net/wireguard.h>
Timestamp length (64-bit seconds and 32-bit nanoseconds).
#include <zephyr/net/wireguard.h>
Get current time in seconds and nanoseconds from Unix epoch.
This function is used to get the current time in seconds and nanoseconds. The time is used to calculate the timestamp in the Wireguard handshake. User can override this function to provide the current time. The default implementation uses k_uptime_get() to get the current time.
| seconds | Pointer to store the current time in seconds. |
| nanoseconds | Pointer to store the current time in nanoseconds. |
| int wireguard_peer_add | ( | struct wireguard_peer_config * | peer_config, |
| struct net_if ** | peer_iface ) |
#include <zephyr/net/wireguard.h>
Add a Wireguard peer to the system.
If successful, a virtual network interface is returned which can be used to communicate with the peer.
| peer_config | Peer configuration data. |
| peer_iface | A pointer to network interface is returned to the caller if adding the peer was successful. |
| int wireguard_peer_keepalive | ( | int | peer_id | ) |
#include <zephyr/net/wireguard.h>
Send a Wireguard keepalive message to peer.
| peer_id | Peer id returned by wireguard_peer_add() |
| int wireguard_peer_remove | ( | int | peer_id | ) |
#include <zephyr/net/wireguard.h>
Remove a Wireguard peer from the system.
If successful, the virtual network interface is also removed and user is no longer be able to communicate with the peer.
| peer_id | Peer id returned by wireguard_peer_add() |