Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/WireGuard/wireguard-rs
/ functions
Functions
320 in github.com/WireGuard/wireguard-rs
⨍
Functions
320
◇
Types & classes
119
↓ 82 callers
Method
lock
(&self)
src/configuration/config.rs:41
↓ 37 callers
Method
len
(&self)
src/wireguard/handshake/device.rs:70
↓ 32 callers
Method
push
(&self, job: J)
src/wireguard/router/queue.rs:40
↓ 31 callers
Method
get
Enables lookup by public key without exposing internal peer type.
src/wireguard/handshake/device.rs:83
↓ 31 callers
Method
write
(&self, _buf: &[u8], _dst: &mut UnitEndpoint)
src/platform/dummy/udp.rs:57
↓ 30 callers
Method
parse
(bytes: B)
src/wireguard/handshake/messages.rs:93
↓ 30 callers
Method
read
(&self, _buf: &mut [u8])
src/platform/dummy/udp.rs:49
↓ 20 callers
Method
clone
(&self)
src/wireguard/wireguard.rs:83
↓ 19 callers
Function
now
()
src/wireguard/handshake/timestamp.rs:9
↓ 12 callers
Method
clone
(&self)
src/wireguard/router/send.rs:30
↓ 12 callers
Function
safe_cast
(v: &mut T)
src/platform/linux/udp.rs:128
↓ 12 callers
Method
timers
(&self)
src/wireguard/peer.rs:77
↓ 10 callers
Method
iter
Enables enumeration of (public key, opaque) pairs without exposing internal peer type.
src/wireguard/handshake/device.rs:76
↓ 10 callers
Method
process
Process a CookieReply message # Arguments - reply: CookieReply to process # Returns Can fail if the cookie reply fails to validate (either indicat
src/wireguard/handshake/macs.rs:141
↓ 9 callers
Method
clone
(&self)
src/wireguard/router/peer.rs:78
↓ 8 callers
Method
clear
(&mut self)
src/wireguard/handshake/device.rs:65
↓ 8 callers
Method
opaque
(&self)
src/wireguard/router/peer.rs:368
↓ 7 callers
Method
local_id
(&self)
src/wireguard/types.rs:53
↓ 7 callers
Method
reset
(&self)
src/wireguard/router/tests/bench.rs:37
↓ 6 callers
Method
add_allowed_ip
Map a subnet to the peer # Arguments - `ip`, the mask of the subnet - `masklen`, the length of the mask # Note The `ip` must not have any bits set
src/wireguard/router/peer.rs:519
↓ 6 callers
Method
add_keypair
Add a new keypair # Arguments - new: The new confirmed/unconfirmed key pair # Returns A vector of ids which has been released. These should be rel
src/wireguard/router/peer.rs:436
↓ 6 callers
Method
consume
(&self)
src/wireguard/router/queue.rs:44
↓ 6 callers
Function
make_packet
(size: usize, src: IpAddr, dst: IpAddr, id: u64)
src/wireguard/tests.rs:15
↓ 6 callers
Method
release
Release an id back to the pool # Arguments `id` - The (sender) id to release
src/wireguard/handshake/device.rs:268
↓ 6 callers
Method
remove
(&self, value: &T)
src/wireguard/router/route.rs:62
↓ 6 callers
Method
send
(&self, v: T)
src/wireguard/queue.rs:29
↓ 5 callers
Method
begin
Begin a new handshake # Arguments `pk` - Public key of peer to initiate handshake for
src/wireguard/handshake/device.rs:278
↓ 5 callers
Function
dummy_keypair
(initiator: bool)
src/wireguard/router/tests/mod.rs:24
↓ 5 callers
Method
insert
(&self, ip: IpAddr, cidr: u32, value: T)
src/wireguard/router/route.rs:40
↓ 5 callers
Method
new_peer
Adds a new peer to the device # Returns A atomic ref. counted peer (with liftime matching the device)
src/wireguard/router/device.rs:172
↓ 5 callers
Method
next
(&mut self)
src/wireguard/handshake/device.rs:52
↓ 5 callers
Method
packet_send_queued_handshake_initiation
(&self, is_retry: bool)
src/wireguard/timers.rs:225
↓ 5 callers
Method
recv
Receive an encrypted transport message # Arguments - src: Source address of the packet - msg: Encrypted transport message # Returns
src/wireguard/router/device.rs:211
↓ 5 callers
Function
setsockopt_int
( fd: RawFd, level: libc::c_int, name: libc::c_int, value: libc::c_int, )
src/platform/linux/udp.rs:108
↓ 4 callers
Function
hammer
(queue: &Arc<Queue<TestJob>>, cnt: Arc<AtomicUsize>)
src/wireguard/router/queue.rs:124
↓ 4 callers
Method
log
(&self, e: E)
src/wireguard/router/tests/tests.rs:35
↓ 4 callers
Function
pad
(msg: &[u8])
src/wireguard/router/tests/mod.rs:18
↓ 4 callers
Method
remove
Remove a peer by public key To remove public keys, you must create a new machine instance # Arguments `pk` - The public key of the peer to remove #
src/wireguard/handshake/device.rs:213
↓ 4 callers
Method
send
(t: &Self::Opaque, size: usize, sent: bool, _keypair: &Arc<KeyPair>, _counter: u64)
src/wireguard/router/tests/tests.rs:104
↓ 4 callers
Method
set_outbound_writer
Set outbound writer
src/wireguard/router/device.rs:253
↓ 4 callers
Method
timers_any_authenticated_packet_traversal
Should be called before a packet with authentication, whether * keepalive, data, or handshake is sent, or after one is received. */
src/wireguard/timers.rs:173
↓ 3 callers
Method
add
Add a new public key to the state machine To remove public keys, you must create a new machine instance # Arguments `pk` - The public key to add `id
src/wireguard/handshake/device.rs:174
↓ 3 callers
Method
add_tun_reader
(&self, reader: T::Reader)
src/wireguard/wireguard.rs:251
↓ 3 callers
Method
add_udp_reader
Begin consuming messages from the reader. Multiple readers can be added to support multi-queue and individual Ipv6/Ipv4 sockets interfaces Any previo
src/wireguard/wireguard.rs:240
↓ 3 callers
Method
allow
(&self, addr: &IpAddr)
src/wireguard/handshake/ratelimiter.rs:48
↓ 3 callers
Method
clone
(&self)
src/wireguard/router/device.rs:58
↓ 3 callers
Function
new_peer
( device: Device<E, C, T, B>, opaque: C::Opaque, )
src/wireguard/router/peer.rs:187
↓ 3 callers
Function
profiler_stop
()
src/main.rs:30
↓ 3 callers
Method
send_keepalive
(&self)
src/wireguard/router/peer.rs:500
↓ 3 callers
Method
send_raw
Send a raw message to the peer (used for handshake messages) # Arguments - `msg`, message body to send to peer # Returns Unit if packet was sent,
src/wireguard/router/peer.rs:225
↓ 3 callers
Method
set_endpoint
Set the endpoint of the peer # Arguments - `endpoint`, socket address converted to bind endpoint # Note This API still permits support for the "st
src/wireguard/router/peer.rs:363
↓ 3 callers
Method
set_key
(&self, sk: Option<StaticSecret>)
src/wireguard/wireguard.rs:185
↓ 3 callers
Method
set_sk
Update the secret key of the device # Arguments `sk` - x25519 scalar representing the local private key
src/wireguard/handshake/device.rs:134
↓ 3 callers
Method
set_writer
(&self, writer: B::Writer)
src/wireguard/wireguard.rs:247
↓ 3 callers
Method
timers_any_authenticated_packet_sent
Should be called after any type of authenticated packet is sent, whether: * - keepalive * - data * - handshake */
src/wireguard/timers.rs:112
↓ 3 callers
Method
timers_mut
(&self)
src/wireguard/peer.rs:82
↓ 3 callers
Method
up
Brings the WireGuard device up. Usually called when the associated interface is brought up.
src/wireguard/wireguard.rs:153
↓ 3 callers
Function
wait
()
src/wireguard/handshake/tests.rs:52
↓ 2 callers
Function
CMSG_LEN
(len: usize)
src/platform/linux/udp.rs:123
↓ 2 callers
Method
add_peer
(&self, pk: PublicKey)
src/wireguard/wireguard.rs:205
↓ 2 callers
Function
addr_to_mac_bytes
(addr: &SocketAddr)
src/wireguard/handshake/macs.rs:95
↓ 2 callers
Method
allocate
Internal function Allocated a new receiver identifier for the peer. Implemented via rejection sampling.
src/wireguard/handshake/device.rs:463
↓ 2 callers
Method
check_mac1
Check the mac1 field against the inner message # Arguments - inner: The inner message covered by the mac1 field - macs: The mac footer
src/wireguard/handshake/macs.rs:264
↓ 2 callers
Method
check_mac2
(&self, inner: &[u8], src: &SocketAddr, macs: &MacsFooter)
src/wireguard/handshake/macs.rs:273
↓ 2 callers
Method
clear_src
(&self)
src/wireguard/router/peer.rs:542
↓ 2 callers
Method
contains_key
(&self, pk: &PublicKey)
src/wireguard/handshake/device.rs:87
↓ 2 callers
Method
create_cookie_reply
( &self, rng: &mut R, receiver: u32, // receiver id of incoming message
src/wireguard/handshake/macs.rs:237
↓ 2 callers
Function
errno
()
src/platform/linux/udp.rs:71
↓ 2 callers
Function
fork_and_exit
()
src/util.rs:31
↓ 2 callers
Method
generate
Generate both mac fields for an inner message # Arguments - inner: A byteslice representing the inner message to be covered - macs: The destination
src/wireguard/handshake/macs.rs:165
↓ 2 callers
Method
get_peers
(&self)
src/configuration/config.rs:354
↓ 2 callers
Function
init
()
src/wireguard/router/tests/mod.rs:14
↓ 2 callers
Method
into_address
(&self)
src/platform/linux/udp.rs:168
↓ 2 callers
Method
lookup_id
Internal function Return the peer currently associated with the receiver identifier
src/wireguard/handshake/device.rs:445
↓ 2 callers
Function
max
(a: usize, b: usize)
src/wireguard/handshake/messages.rs:26
↓ 2 callers
Function
message_data_len
(payload: usize)
src/wireguard/router/mod.rs:30
↓ 2 callers
Function
min
(a: usize, b: usize)
src/wireguard/workers.rs:49
↓ 2 callers
Method
parallel_work
(&self)
src/wireguard/router/send.rs:59
↓ 2 callers
Method
parse_line
(&mut self, key: &str, value: &str)
src/configuration/uapi/set.rs:55
↓ 2 callers
Method
queue
(&self)
src/wireguard/router/send.rs:55
↓ 2 callers
Function
readline
read string up to maximum length (why is this not in std?)
src/configuration/uapi/mod.rs:19
↓ 2 callers
Method
recv
(t: &Self::Opaque, size: usize, sent: bool, _keypair: &Arc<KeyPair>)
src/wireguard/router/tests/tests.rs:108
↓ 2 callers
Method
remove_peer
(&self, peer: &PublicKey)
src/configuration/config.rs:299
↓ 2 callers
Method
send
Encrypt and send a message to the peer Arguments: - `msg` : A padded vector holding the message (allows in-place construction of the transport heade
src/wireguard/router/peer.rs:252
↓ 2 callers
Method
send_staged
Transmit all staged packets
src/wireguard/router/peer.rs:301
↓ 2 callers
Method
set_fwmark
(&self, mark: Option<u32>)
src/configuration/config.rs:281
↓ 2 callers
Method
set_psk
Add a psk to the peer # Arguments `pk` - The public key of the peer `psk` - The psk to set / unset # Returns The call might fail if the public key
src/wireguard/handshake/device.rs:235
↓ 2 callers
Function
setsockopt
( fd: RawFd, level: libc::c_int, name: libc::c_int, value: &V, )
src/platform/linux/udp.rs:82
↓ 2 callers
Function
setup_devices
( rng1: &mut R, rng2: &mut R, rng3: &mut R, )
src/wireguard/handshake/tests.rs:17
↓ 2 callers
Function
start_listener
( mut cfg: MutexGuard<Inner<T, B>>, )
src/configuration/config.rs:195
↓ 2 callers
Method
timers_handshake_complete
Should be called after a handshake response message is received and processed * or when getting key confirmation via the first data message.
src/wireguard/timers.rs:146
↓ 2 callers
Method
zero_keys
Zero all key-material related to the peer
src/wireguard/router/peer.rs:383
↓ 1 callers
Function
CMSG_ALIGN
(len: usize)
src/platform/linux/udp.rs:118
↓ 1 callers
Method
add_allowed_ip
(&self, peer: &PublicKey, ip: IpAddr, masklen: u32)
src/configuration/config.rs:329
↓ 1 callers
Method
add_peer
(&self, peer: &PublicKey)
src/configuration/config.rs:303
↓ 1 callers
Method
check
Returns true if check is passed, i.e., not a replay or too old. Unlike RFC 6479, zero is allowed.
src/wireguard/router/anti_replay.rs:50
↓ 1 callers
Method
check_replay_flood
Set the mutable state of the peer conditioned on the timestamp being newer # Arguments st_new - The updated state of the peer ts_new - The associate
src/wireguard/handshake/peer.rs:87
↓ 1 callers
Method
check_route
(&self, peer: &T, packet: &[u8])
src/wireguard/router/route.rs:117
↓ 1 callers
Method
clear_peers
(&self)
src/wireguard/wireguard.rs:177
↓ 1 callers
Method
clear_sending_keys
A new secret key has been set for the device. According to WireGuard semantics, this should cause all "sending" keys to be discarded.
src/wireguard/router/device.rs:162
next →
1–100 of 320, ranked by callers