Make the debug string function public, so that the pxe package can use it.

This commit is contained in:
David Anderson 2016-02-28 01:08:42 -08:00
parent d6ac0332dd
commit e8fa791c89
2 changed files with 3 additions and 2 deletions

View File

@ -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 {

View File

@ -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")
}