diff --git a/dhcp/dhcp.go b/dhcp/dhcp.go index 445f8f2..e33415c 100644 --- a/dhcp/dhcp.go +++ b/dhcp/dhcp.go @@ -69,7 +69,8 @@ type Packet struct { Options Options } -func (p *Packet) testString() string { +// DebugString prints the contents of a DHCP packet for human consumption. +func (p *Packet) DebugString() string { var b bytes.Buffer bcast := "Unicast" if p.Broadcast { diff --git a/dhcp/dhcp_test.go b/dhcp/dhcp_test.go index 4dc4262..3f29398 100644 --- a/dhcp/dhcp_test.go +++ b/dhcp/dhcp_test.go @@ -54,7 +54,7 @@ func TestParse(t *testing.T) { if err != nil { t.Fatalf("Parsing DHCP packet #%d: %s", i+1, err) } - pkts.WriteString(pkt.testString()) + pkts.WriteString(pkt.DebugString()) pkts.WriteString("======\n") }