Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/canndrew/netsim
/ functions
Functions
164 in github.com/canndrew/netsim
⨍
Functions
164
◇
Types & classes
35
↓ 21 callers
Function
spawn
(func: F)
src/namespace.rs:72
↓ 20 callers
Method
push
(self: Pin<&mut Self>, delay: Duration, value: T)
src/adapter/delay.rs:38
↓ 18 callers
Method
ipv4_header_len
(&self)
src/packet.rs:374
↓ 18 callers
Method
source_addr
(&self)
src/packet.rs:286
↓ 17 callers
Method
destination_addr
(&self)
src/packet.rs:293
↓ 13 callers
Method
build
Builds the interface. The returned [`IpIface`](crate::IpIface) can be used to send/receive packets to/from this interface. # Panics If there is no t
src/iface/create.rs:105
↓ 11 callers
Method
write_u16
(&mut self, word: u16)
src/packet.rs:27
↓ 10 callers
Method
fix_checksum
(&mut self)
src/packet.rs:378
↓ 10 callers
Method
spawn
Executes a future on the machine. The future will start executing immediately. You can use the returned [`JoinHandle`](crate::JoinHandle) to await the
src/machine.rs:67
↓ 9 callers
Method
add_ip_iface
Adds a network interface to the machine. See the [`IpIfaceBuilder`](crate::IpIfaceBuilder) docs for details.
src/machine.rs:83
↓ 9 callers
Method
finish
(self)
src/packet.rs:49
↓ 9 callers
Method
ipv4_addr
Sets the interface's IPv4 address.
src/iface/create.rs:41
↓ 9 callers
Method
ipv4_default_route
Adds an IPv4 route for this interface to the machine's routing table and sets it as the default route.
src/iface/create.rs:76
↓ 8 callers
Method
contains
Checks whether this range contains the given IPv4 address.
src/network.rs:101
↓ 8 callers
Method
insert_iface
Insert a `Sink`/`Stream` of IP packets into the hub. Any packet created by this `Stream` will be forwarded to all other inserted `Sink`s and this `Sin
src/device/hub.rs:32
↓ 8 callers
Method
next
(&mut self)
src/network.rs:379
↓ 7 callers
Method
start_send
(self: Pin<&mut Self>, packet: T)
src/device/channel.rs:54
↓ 6 callers
Function
socket
(domain: libc::c_int, ty: libc::c_int, protocol: libc::c_int)
src/iface/configure.rs:316
↓ 5 callers
Function
connect
Convenience method for connecting two [`IpSinkStream`](crate::IpSinkStream)s to each other. Packets from either `IpSinkStream` are forwarded to the o
src/connect.rs:7
↓ 5 callers
Method
poll_next
(self: Pin<&mut Self>, cx: &mut task::Context)
src/device/channel.rs:30
↓ 5 callers
Method
random_addr
Generate a random address in this range and not in any reserved IPv4 range strictly contained within this range.
src/network.rs:141
↓ 4 callers
Function
as_io_error
(err: SendError)
src/device/channel.rs:132
↓ 4 callers
Method
destination_port
(&self)
src/packet.rs:490
↓ 4 callers
Method
protocol_number
(&self)
src/packet.rs:435
↓ 4 callers
Method
reset
(&mut self, switch_instant: Instant)
src/adapter/loss.rs:37
↓ 4 callers
Function
round_up
( x: usize, multiple: usize, )
src/iface/configure.rs:63
↓ 4 callers
Method
subnet_mask_bits
The length of the subnet mask.
src/network.rs:122
↓ 4 callers
Method
write_u32
(&mut self, word: u32)
src/packet.rs:42
↓ 3 callers
Function
as_sockaddr_in6
(ptr: &mut libc::sockaddr)
src/iface/configure.rs:261
↓ 3 callers
Method
dispatch_incoming_external
(&mut self, packet: Box<IpPacket>)
src/device/nat/mod.rs:269
↓ 3 callers
Function
expovariate_duration
( mean_duration: Duration, rng: &mut R, )
src/adapter/mod.rs:15
↓ 3 callers
Method
join
Wait for the future executing on the machine to complete and get its result. # Returns `Ok(Some(value))` if the future completed normally and return
src/machine.rs:102
↓ 3 callers
Function
new_req
(iface_name: &str)
src/iface/configure.rs:301
↓ 3 callers
Method
poll_flush
(self: Pin<&mut Self>, cx: &mut task::Context)
src/device/channel.rs:39
↓ 3 callers
Method
poll_ready
(self: Pin<&mut Self>, cx: &mut task::Context)
src/device/channel.rs:44
↓ 3 callers
Method
protocol_box
(self: Box<Ipv4Packet>)
src/packet.rs:315
↓ 3 callers
Method
set_destination_addr
(&mut self, addr: Ipv4Addr)
src/packet.rs:369
↓ 3 callers
Method
set_source_addr
(&mut self, addr: Ipv4Addr)
src/packet.rs:364
↓ 3 callers
Method
version_box
(self: Box<IpPacket>)
src/packet.rs:251
↓ 3 callers
Method
version_ref
(&self)
src/packet.rs:269
↓ 2 callers
Method
advance
(&mut self)
src/adapter/loss.rs:43
↓ 2 callers
Method
base_addr
The base address of the network range. Not necessarily the same value passed to `Ipv4Network::new` since the address will be masked to zero all bits a
src/network.rs:117
↓ 2 callers
Method
contains_network
Checks whether this range contains the given range.
src/network.rs:109
↓ 2 callers
Method
currently_dropping
(&self)
src/adapter/loss.rs:56
↓ 2 callers
Method
destination_ip_addr
(&self)
src/packet.rs:480
↓ 2 callers
Method
incoming_addr
(&self, port: u16)
src/device/nat/port_map.rs:51
↓ 2 callers
Method
incoming_allowed
(&self, external_port: u16, source_addr: SocketAddrV4)
src/device/nat/restrictions.rs:26
↓ 2 callers
Method
join_inner
(&mut self, ret_rx: oneshot::Receiver<thread::Result<R>>)
src/namespace.rs:30
↓ 2 callers
Method
outgoing_port
(&mut self, internal_addr: SocketAddrV4)
src/device/nat/port_map.rs:20
↓ 2 callers
Method
pop
(self: Pin<&mut Self>, cx: &mut task::Context)
src/adapter/delay.rs:56
↓ 2 callers
Method
port_restricted
Makes this NAT [port restricted](https://en.wikipedia.org/wiki/Network_address_translation#Methods_of_translation).
src/device/nat/mod.rs:65
↓ 2 callers
Method
protocol_ref
(&self)
src/packet.rs:335
↓ 2 callers
Function
put_up
(iface_name: &str)
src/iface/configure.rs:3
↓ 2 callers
Method
sending
(&mut self, external_port: u16, destination_addr: SocketAddrV4)
src/device/nat/restrictions.rs:14
↓ 2 callers
Method
seq_number
(&self)
src/packet.rs:508
↓ 2 callers
Method
set_destination_port
(&mut self, port: u16)
src/packet.rs:556
↓ 2 callers
Method
set_next_switch_instant
(&mut self)
src/adapter/loss.rs:60
↓ 2 callers
Method
set_source_port
(&mut self, port: u16)
src/packet.rs:550
↓ 2 callers
Method
source_ip_addr
(&self)
src/packet.rs:476
↓ 2 callers
Method
source_port
(&self)
src/packet.rs:484
↓ 2 callers
Method
with_delay
Delays items sent/received through this `Sink`/`Stream`. `min_delay` is the minimum delay which is applied to all items. `mean_additional_delay` is t
src/stream_ext.rs:11
↓ 2 callers
Method
with_loss
Randomly drops items sent through this `Sink`/`Stream`. `loss_rate` is what proportion of the items to drop. Setting to `1.0` will drop everything, s
src/stream_ext.rs:29
↓ 1 callers
Method
ack_number
(&self)
src/packet.rs:514
↓ 1 callers
Function
add_ipv4_route
( iface_name: &str, destination: Ipv4Network, gateway_opt: Option<Ipv4Addr>, )
src/iface/configure.rs:201
↓ 1 callers
Function
add_ipv6_route
( iface_name: &str, destination: Ipv6Network, next_hop: Ipv6Addr, )
src/iface/configure.rs:251
↓ 1 callers
Method
build_raw
Builds the interface, returning a raw file descriptor to the interface's TUN device. Unlike [`build`](Self::build) this can be called in non-async con
src/iface/create.rs:112
↓ 1 callers
Function
create_tun_interface
(build_config: BuildConfig)
src/iface/create.rs:125
↓ 1 callers
Method
dispatch_incoming_internal
(&mut self, iface_index: usize, packet: Box<IpPacket>)
src/device/nat/mod.rs:396
↓ 1 callers
Method
flags
(&self)
src/packet.rs:520
↓ 1 callers
Function
futex
( uaddr: *mut u32, futex_op: c_int, val: u32, timeout: *const libc::timespec, uaddr2: *mut
src/namespace.rs:14
↓ 1 callers
Function
futex_wait
(ptr: *mut u32, value: u32)
src/namespace.rs:25
↓ 1 callers
Method
into_iter
(self)
src/network.rs:484
↓ 1 callers
Method
ipv4_route
Adds an IPv4 route for this interface to the machine's routing table.
src/iface/create.rs:57
↓ 1 callers
Method
ipv4_route_with_gateway
Adds an IPv4 route to the machine's routing table which forwards through this interface via the specified gateway.
src/iface/create.rs:64
↓ 1 callers
Method
join
(mut self)
src/namespace.rs:58
↓ 1 callers
Method
join_blocking
Block the current thread, wait for the future executing on the machine the complete and get its result. # Returns `Ok(Some(value))` if the future co
src/machine.rs:118
↓ 1 callers
Function
parse_ipv4_network
(s: &str)
netsim-macros/src/lib.rs:39
↓ 1 callers
Function
parse_ipv6_network
(s: &str)
netsim-macros/src/lib.rs:89
↓ 1 callers
Method
poll
(self: Pin<&mut Self>, cx: &mut task::Context)
src/device/hub.rs:172
↓ 1 callers
Method
poll_flush_outgoing
(&mut self, cx: &mut task::Context)
src/device/hub.rs:42
↓ 1 callers
Method
poll_flush_outgoing
(&mut self, cx: &mut task::Context)
src/device/nat/mod.rs:144
↓ 1 callers
Method
poll_inner
(&mut self, cx: &mut task::Context)
src/device/hub.rs:136
↓ 1 callers
Method
poll_inner
(&mut self, cx: &mut task::Context)
src/device/nat/mod.rs:521
↓ 1 callers
Method
poll_next_incoming
(&mut self, cx: &mut task::Context)
src/device/hub.rs:118
↓ 1 callers
Method
poll_next_incoming_external
(&mut self, cx: &mut task::Context)
src/device/nat/mod.rs:229
↓ 1 callers
Method
poll_next_incoming_internal
(&mut self, cx: &mut task::Context)
src/device/nat/mod.rs:245
↓ 1 callers
Method
poll_ready
(self: Pin<&mut Self>, _cx: &mut task::Context)
src/adapter/delay.rs:148
↓ 1 callers
Method
poll_ready_outgoing
(&mut self, cx: &mut task::Context)
src/device/hub.rs:65
↓ 1 callers
Method
poll_ready_outgoing
(&mut self, cx: &mut task::Context)
src/device/nat/mod.rs:184
↓ 1 callers
Method
reply_with_rst_to_unexpected_tcp_packets
(mut self)
src/device/nat/mod.rs:53
↓ 1 callers
Method
set_ack_number
(&mut self, ack_number: u32)
src/packet.rs:579
↓ 1 callers
Method
set_flags
(&mut self, flags: TcpPacketFlags)
src/packet.rs:535
↓ 1 callers
Function
set_ipv4_addr
( iface_name: &str, ipv4_addr: Ipv4Addr, subnet_mask_bits: u8, )
src/iface/configure.rs:21
↓ 1 callers
Function
set_ipv6_addr
( iface_name: &str, ipv6_addr: Ipv6Addr, subnet_mask_bits: u8, )
src/iface/configure.rs:73
↓ 1 callers
Method
start_send
(self: Pin<&mut Self>, item: T)
src/adapter/delay.rs:152
↓ 1 callers
Method
start_send_outgoing
(&mut self, mut recv_index: usize, packet: Box<IpPacket>)
src/device/hub.rs:93
Method
address_restricted
Makes this NAT [address restricted](https://en.wikipedia.org/wiki/Network_address_translation#Methods_of_translation).
src/device/nat/mod.rs:59
Method
build
Build the NAT. The returned `IpChannel` is the external interface of the NAT.
src/device/nat/mod.rs:71
Function
clone_cb
(arg: *mut c_void)
src/namespace.rs:105
Function
connect_to_outside_world
()
src/tests/nat.rs:4
next →
1–100 of 164, ranked by callers