Dario Nieuwenhuis
88256dbdcf
Update to Rust 2018. Fixes #271
2020-12-27 17:54:56 +01:00
Dario Nieuwenhuis
12f2e0f7e2
Merge pull request #372 from JOE1994/null_terminator
...
add null terminator to c-string passed to 'libc::open'
2020-12-26 00:24:27 +01:00
JOE1994
e12f4abaa0
add null terminator to c-string passed to libc API
2020-12-26 00:07:14 +01:00
Dario Nieuwenhuis
273f4d60b6
Fix MTU of RawSocket and TapInterface.
...
Linux's MTU is the IP MTU, while smoltcp's is the Ethernet MTU.
Therefore we have to add the ethernet header size to it.
2020-12-25 23:57:54 +01:00
YOUNGSUK KIM
f6a55fa3c7
replace deprecated item 'mem::uninitialized'
...
This commit replaces the use of deprecated item 'mem::uninitialized'
with 'mem::MaybeUninit'.
Thank you for reviewing :)
2020-06-22 14:46:56 +00:00
ficapy
d01e23e396
Support different types of ioctl request argument
2019-12-15 06:25:43 +00:00
Luka Atanasovski
04c9518dd2
Implement raw sockets via BPF on macOS.
2018-12-28 11:46:43 +00:00
Dan Robertson
1f9e14de71
Update iface and phy_wait to use new time types
...
Update the EthernetInterface poll functions to use Instant and Duration
instead of a simple u64 value.
Closes : #141
Approved by: whitequark
2018-02-16 10:44:02 +08:00
寧靜
1e5acf0799
Gate Linux-specific platform dependencies behind a #[cfg].
2018-01-27 12:38:47 +00:00
whitequark
dd0f4b706a
Enforce some lints.
2017-09-25 00:46:53 +00:00
whitequark
0a8a962e94
Reorganize features using namespaces, to match module hierarchy.
...
I'm about to add a whole lot more features, and it's going to get
quite confusing otherwise.
2017-09-24 23:51:19 +00:00
whitequark
996389d653
Compute soft deadline in poll() and use nonblocking sockets.
...
Before this commit, anything that touched RawSocket or TapInterface
worked partly by accident and partly because of a horrible crutch
that resulted in massive latencies as well as inevitable packet loss
every time an ARP request had to be issued. Also, there was no way
to use poll() other than by continuously calling it in a busy loop.
After this commit, poll() indicates when the earliest timer expires,
and so the caller can sleep until that moment (or until packets
arrive).
Note that there is a subtle problem remaining: every time poll()
is called, every socket with a pending outbound packet whose
IP address doesn't correspond to a MAC address will send a new
ARP request, resulting in potentially a whole lot of such requests.
ARP rate limiting is a separate topic though.
2017-08-29 19:47:11 +00:00
whitequark
ae7e956573
Add a missing \0 in a C string.
2017-08-24 12:18:07 +00:00
whitequark
15085bd8ba
Fix a file descriptor leak in TapInterfaceDesc::interface_mtu.
2017-08-21 07:28:32 +00:00
David Coffill
55ac6737b2
Fix build on i686 by using libc::suseseconds_t instead of i64
2017-08-02 07:12:36 +00:00
whitequark
051169a49d
Determine MTU in TapInterface instead of hardcoding 1536.
2017-07-23 04:40:35 +00:00
whitequark
74823b0dff
try! → ?
2017-06-24 16:34:32 +00:00
Egor Karavaev
59fc0c0358
Factor out the "raw_socket" and "tap_interface" features
...
This makes it possible to build smoltcp with the "std" feature on platforms
without libc, such as redox.
2017-06-15 10:12:11 +00:00
whitequark
cc67e1f753
Don't block forever in TapInterface.
...
Ideally Devices should be non-blocking, but that would be really
annoying to implement, so for now, to get the examples working,
I'm using this hack.
2017-03-05 05:30:03 +00:00
whitequark
e7d6237279
Implement TAP interface support.
2016-12-11 00:30:40 +00:00