David Anderson
9c43c0a5c9
Output pcap timestamps as UnixNano.
...
Stringifying ends up outputting them with a machine-dependent timezone,
and a numeric timestamp is easier to grok in a test like this anyway.
2016-03-24 17:37:34 -07:00
David Anderson
0cca8f4c85
Remove dependency on prettyprint library.
...
We only really use it to pretty-print pcap.Packet, and it was making
`go vet` angry. So we replaced it with a specialized pretty printer
instead. As a nice side-effect, it shows nicer timestamps now.
2016-03-24 17:26:45 -07:00
David Anderson
247c54b082
Install atftp so that the tftp interop test isn't skipped.
2016-03-24 13:22:53 -07:00
David Anderson
0900f7157c
Remove OSX from the build matrix, it's just too slow.
2016-03-24 13:20:23 -07:00
David Anderson
b1dab55266
Tell Travis about the custom import path.
2016-03-24 13:18:10 -07:00
David Anderson
bd7be1a19a
Enable custom import paths.
2016-03-24 13:12:10 -07:00
David Anderson
b21d961610
Fix travis build instructions.
2016-03-24 12:20:25 -07:00
David Anderson
b7ae49bdb6
Add a Travis configuration for running tests.
2016-03-24 12:15:37 -07:00
David Anderson
60581f4259
Document dhcp.Options.Uint16.
2016-03-23 23:46:32 -07:00
David Anderson
21d22e747d
Make dhcp.Conn also be an io.Closer.
2016-03-23 23:43:52 -07:00
David Anderson
05cf66722e
Implement a Conn using linux AF_PACKET/SOCK_RAW sockets and BPF packet filtering.
...
This is a fairly advanced, linux-specific implementation that lets you run a DHCP
listener on a machine that's already running some other DHCP service.
2016-03-23 23:41:25 -07:00
David Anderson
aa6bf25654
Add a Conn type for sending and receiving DHCP packets.
2016-03-23 23:30:42 -07:00
David Anderson
668c1a3b32
Add a DHCPREQUEST from a DHCP relay to the test dataset.
2016-03-23 23:18:58 -07:00
David Anderson
6f642bb5ed
Rename dhcp.go to packet.go in preparation for introduction of server.
2016-03-15 20:25:24 -07:00
David Anderson
55722d2f87
Add skeleton README.
2016-03-05 15:23:37 -08:00
David Anderson
587558e05a
Add a contributing doc.
2016-03-05 15:18:01 -08:00
David Anderson
576e70e92c
Add copyright/license headers to source.
2016-03-05 15:14:52 -08:00
David Anderson
d0e46c66a9
Add a license file.
2016-03-05 15:08:13 -08:00
David Anderson
8175ab5f5c
Add a Copy method to options, and tests for options.
2016-02-29 19:34:07 -08:00
David Anderson
e8fa791c89
Make the debug string function public, so that the pxe package can use it.
2016-02-28 01:08:42 -08:00
David Anderson
d6ac0332dd
Strip option 53 out of the options map, as the value is parsed into Type.
2016-02-28 01:08:12 -08:00
David Anderson
621a0c28e5
Implicitly add DHCP option 53 when marshalling.
2016-02-28 01:06:37 -08:00
David Anderson
af2fc8892a
Add a Uint16 reader for dhcp.Options.
2016-02-28 01:05:54 -08:00
David Anderson
33e5e06817
Change the separation between packets to help PXE testing.
2016-02-27 23:15:07 -08:00
David Anderson
3cbc2e2788
Add a test for DHCP marshalling.
...
And fix a bug in DHCP marshalling that the test found :).
2016-02-27 22:51:45 -08:00
David Anderson
e799b6e1ab
Correct the parsing of the server IP address.
...
It's the address of the responding server, not the boot server. Which
makes sense, since there's another field for the boot server name.
2016-02-27 22:36:49 -08:00
David Anderson
fa657ad649
Add a basic regression test for DHCP parsing.
2016-02-27 22:34:18 -08:00
David Anderson
178a83f3e0
Make pcap.Reader's API look like bufio.Scanner's.
...
The Next/Packet/Err structure makes read loops much
cleaner, and presents a more familiar interface for people
familiar with the stdlib.
2016-02-27 21:21:10 -08:00
David Anderson
6b9cba0085
Add brief package documentation.
2016-02-27 20:31:08 -08:00
David Anderson
7549f62395
Implement a pcap writer.
2016-02-27 20:25:43 -08:00
David Anderson
67755cdc83
Add a basic pcap reader.
...
Very basic, it only parses the pcap structure to pull out the packets,
nothing more.
2016-02-27 19:11:23 -08:00
David Anderson
133baa88bd
Initial implementation of DHCP parsing.
2016-02-27 16:35:40 -08:00
David Anderson
90c89c2bd7
Implement the documented default listening behavior for TFTP.
2016-02-27 16:35:03 -08:00
David Anderson
7f4b62d890
Drop the retransmit timeout on the lossy connection test.
...
Since this is a test to localhost, a 10ms RTO is more than enough,
and speeds up the test 10x.
2016-02-18 09:36:19 -08:00
David Anderson
af8e62003b
Implement a read-only TFTP server.
...
Testing is done against the atftp client.
2016-02-18 00:41:31 -08:00