Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: smoltcp-rs/smoltcp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 03212f284359
Choose a base ref
...
head repository: smoltcp-rs/smoltcp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 73de85eb19ae
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on Dec 28, 2016

  1. Copy the full SHA
    85e7359 View commit details
  2. Copy the full SHA
    05cadcf View commit details
  3. Update Cargo metadata.

    whitequark committed Dec 28, 2016
    Copy the full SHA
    73de85e View commit details
Showing with 28 additions and 14 deletions.
  1. +11 −0 .travis.yml
  2. +6 −1 Cargo.toml
  3. +10 −10 README.md
  4. +1 −3 examples/{smoltcpserver.rs → server.rs}
  5. 0 examples/{smoltcpdump.rs → tcpdump.rs}
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: rust
rust:
- stable
- beta
- nightly
notifications:
irc:
channels:
- "chat.freenode.net#m-labs"
use_notice: true
skip_join: true
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -2,8 +2,13 @@
name = "smoltcp"
version = "0.1.0"
authors = ["whitequark <whitequark@whitequark.org>"]
description = "A TCP/IP stack designed for bare-metal, real-time systems without a heap."
documentation = "https://docs.rs/smoltcp/"
homepage = "https://github.com/m-labs/smoltcp"
repository = "https://github.com/m-labs/smoltcp.git"
readme = "README.md"
keywords = ["ip", "tcp", "udp", "ethernet", "network"]
license = "0BSD"
readme-file = "README.md"

[dependencies]
byteorder = { version = "0.5", default-features = false }
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ at cost of performance degradation.
_smoltcp_ does not need heap allocation *at all*, is [extensively documented][docs],
and compiles on stable Rust.

[docs]: https://m-labs.github.io/smoltcp/smoltcp/index.html
[docs]: https://docs.rs/smoltcp/

Features
--------
@@ -112,30 +112,30 @@ sudo ip link set tap0 up
sudo ip addr add 192.168.69.100/24 dev tap0
```

### smoltcpdump
### examples/tcpdump.rs

_smoltcpdump_ is a tiny clone of the _tcpdump_ utility.
_examples/tcpdump.rs_ is a tiny clone of the _tcpdump_ utility.

Unlike the rest of the examples, it uses raw sockets, and so it can be used on regular interfaces,
e.g. `eth0` or `wlan0`, as well as the `tap0` interface we've created above.

Read its [source code](/examples/smoltcpdump.rs), then run it as:
Read its [source code](/examples/tcpdump.rs), then run it as:

```sh
cargo build --example smoltcpdump
sudo ./target/debug/smoltcpdump eth0
cargo build --example tcpdump
sudo ./target/debug/tcpdump eth0
```

### smoltcpserver
### examples/server.rs

_smoltcpserver_ emulates a network host that can serve requests.
_examples/server.rs_ emulates a network host that can serve requests.

The host is assigned the hardware address `02-00-00-00-00-01` and IPv4 address `192.168.69.1`.

Read its [source code](/examples/smoltcpserver.rs), then run it as:
Read its [source code](/examples/server.rs), then run it as:

```sh
cargo run --example smoltcpserver -- tap0
cargo run --example server -- tap0
```

It responds to:
4 changes: 1 addition & 3 deletions examples/smoltcpserver.rs → examples/server.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(associated_consts, type_ascription)]
#[macro_use]
extern crate log;
extern crate env_logger;
@@ -56,8 +55,7 @@ fn main() {

let tcp_rx_buffer = TcpSocketBuffer::new(vec![0; 64]);
let tcp_tx_buffer = TcpSocketBuffer::new(vec![0; 128]);
let mut tcp_socket = TcpSocket::new(tcp_rx_buffer, tcp_tx_buffer);
(tcp_socket.as_socket() : &mut TcpSocket).listen(endpoint).unwrap();
let tcp_socket = TcpSocket::new(tcp_rx_buffer, tcp_tx_buffer);

let hardware_addr = EthernetAddress([0x02, 0x00, 0x00, 0x00, 0x00, 0x01]);
let protocol_addrs = [IpAddress::v4(192, 168, 69, 1)];
File renamed without changes.