[netstack] Update tcpip nic to allow address removal.

- Adds remove methods for addresses and subnets.
- Adds capability to query the "main" address to show the user for
a given NIC when multiple are configured in the stack.
- Fixes string formatting bugs several tcpip objects.

Corresponding changes to netstack in:
Change-Id: Ib0bf3b8739e178bc489424de4fccb2972558b2d0

NET-1160
Test: manual test of adding/removing addresses via ifconfig.

Change-Id: Iccbadebec2fb3d5ad60b354e161be796a39dd306
4 files changed
tree: f40ea7f78c2c848376c5d74f62b92ed324dec7f6
  1. dhcp/
  2. ilist/
  3. sleep/
  4. tcpip/
  5. tmutex/
  6. waiter/
  7. AUTHORS
  8. CONTRIBUTING.md
  9. CONTRIBUTORS
  10. LICENSE
  11. README.fuchsia
  12. README.md
README.md

Netstack

Netstack is a network stack written in Go.

Getting started

Try it out on Linux by installing the tun_tcp_echo demo:

go install github.com/google/netstack/tcpip/sample/tun_tcp_echo

Create a TUN device with:

[sudo] ip tuntap add user <username> mode tun <device-name>
[sudo] ip link set <device-name> up
[sudo] ip addr add <ipv4-address>/<mask-length> dev <device-name>

Then run with:

tun_tcp_echo <device-name> <ipv4-address> <port>

Contributions

We would love to accept contributions, but we have not yet worked out how to handle them. Please contact us before sending any pull requests.

Whatever we do decide on will require signing the Google Contributor License. Please see CONTRIBUTING.md for more details.

Disclaimer

This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.