diff --git a/README.md b/README.md index 845b290..2fd69f5 100644 --- a/README.md +++ b/README.md @@ -259,7 +259,7 @@ cat arp.cache | ./sx udp --json -p 53 192.168.0.171 sample output: ``` -{"scan":"udp","ip":"192.168.0.171","icmp":{"Type":3,"Code":3}} +{"scan":"udp","ip":"192.168.0.171","icmp":{"type":3,"code":3}} ``` In this case we find out that host sent ICMP reply packet with **Destination Unreachable** type and **Port Unreachable** code (typical response for a closed port according to the rfc1122). diff --git a/pkg/scan/icmp/icmp.go b/pkg/scan/icmp/icmp.go index b18a157..494a32e 100644 --- a/pkg/scan/icmp/icmp.go +++ b/pkg/scan/icmp/icmp.go @@ -1,6 +1,6 @@ package icmp type Response struct { - Type uint8 - Code uint8 + Type uint8 `json:"type"` + Code uint8 `json:"code"` } diff --git a/pkg/scan/udp/result_easyjson.go b/pkg/scan/udp/result_easyjson.go index c9e1830..ad1d0c4 100644 --- a/pkg/scan/udp/result_easyjson.go +++ b/pkg/scan/udp/result_easyjson.go @@ -129,9 +129,9 @@ func easyjsonD3b49167DecodeGithubComVByteCpuSxPkgScanIcmp(in *jlexer.Lexer, out continue } switch key { - case "Type": + case "type": out.Type = uint8(in.Uint8()) - case "Code": + case "code": out.Code = uint8(in.Uint8()) default: in.SkipRecursive() @@ -148,12 +148,12 @@ func easyjsonD3b49167EncodeGithubComVByteCpuSxPkgScanIcmp(out *jwriter.Writer, i first := true _ = first { - const prefix string = ",\"Type\":" + const prefix string = ",\"type\":" out.RawString(prefix[1:]) out.Uint8(uint8(in.Type)) } { - const prefix string = ",\"Code\":" + const prefix string = ",\"code\":" out.RawString(prefix) out.Uint8(uint8(in.Code)) }