The DecodingLayerParser example in doc.go has a minor error. This fixes it:
diff --git a/doc.go b/doc.go
index a60867f..aa128bd 100644
--- a/doc.go
+++ b/doc.go
@@ -291,9 +291,9 @@ the packet's information. A quick example:
err := parser.DecodeLayers(packetDat, &decoded)
for _, layerType := range decoded {
switch layerType {
- case layers.LayerTypeIPv6:
- fmt.Println(" IP4 ", ip4.SrcIP, ip4.DstIP)
case layers.LayerTypeIPv4:
+ fmt.Println(" IP4 ", ip4.SrcIP, ip4.DstIP)
+ case layers.LayerTypeIPv6:
fmt.Println(" IP6 ", ip6.SrcIP, ip6.DstIP)
}
}
Original issue reported on code.google.com by har...@typetypetype.net on 9 Nov 2014 at 10:44
Original issue reported on code.google.com by
har...@typetypetype.net
on 9 Nov 2014 at 10:44