7 Commits

Author SHA1 Message Date
Mikio Hara
56fb01167e icmp: add simple multipart message validation
This change adds simple validation for multipart messages to avoid
generating incorrect messages and introduces RawBody and RawExtension
to control message validation. RawBody and RawExtension are excluded
from normal message processing and can be used to construct crafted
messages for applications such as wire format testing.

Fixes golang/go#28686.

Change-Id: I56f51d6566142f5e1dcc75cfce5250801e583d6d
Reviewed-on: https://go-review.googlesource.com/c/net/+/155859
Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-11 03:10:20 +00:00
Mikio Hara
6078986fec icmp: add support for extended echo request and echo reply messages
This change implements support for extended echo request and reply
messages, and interface identification object that can be used to test
the status of a probed interface via a proxy interface from a probing
interface as defined in RFC 8335.

It's package user's responsibility to make a complete RFC-compliant
PROBE initiator implementation using ipv4, ipv6 and icmp packages of
x/net repository.

Fixes golang/go#24440.

Change-Id: I87ab8a7581c4d41a0c579805b0e3043e48ac85f0
Reviewed-on: https://go-review.googlesource.com/63999
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-03-20 00:21:17 +00:00
Mikio Hara
62ac18b461 icmp: fix miscalculation on multipart message bodies
Also adds test cases for the Len method of MessageBody interface.

Fixes golang/go#13141.

Change-Id: I8ab9e38727104ca094dfdb3020e8d42e611911e0
Reviewed-on: https://go-review.googlesource.com/16616
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-11-28 09:06:56 +00:00
Mikio Hara
71586c3cf9 icmp: add extensions for MPLS
This change implements ICMP multi-part message marshaler, parser and
extensions for MPLS which are used for route trace applications as
described in RFC 4950.

API breaking changes:

type MessageBody interface, Len() int
type Extension interface, Len() int
type Extension interface, Marshal() ([]byte, error)

are replaced with

type MessageBody interface, Len(int) int
type Extension interface, Len(int) int
type Extension interface, Marshal(int) ([]byte, error)

Change-Id: Iee1f2e03916d49b8dfe3a89fe682c702d40ecc85
Reviewed-on: https://go-review.googlesource.com/2794
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-02-06 05:26:11 +00:00
Mikio Hara
e3b9e70d93 icmp: add support for multi-part messages
ICMP extension structures allow a few existing ICMP error messages to
convey extra information for troubleshooting; especially the root cause
of why the original datagram could not be delivered.

This CL adds generic support for ICMP extension stuructures to
DstUnreach, TimeExceeded and ParamProb structs. Specific extensions such
as MPLS label-stack, interface and next-hop identification will be
inplemneted in separate followup CLs.

Change-Id: I90798c135bdf76b806e2dde2bdd57c2c11d7e7e9
2015-01-07 15:24:15 +09:00
Mikio Hara
7ed368b9e7 icmp: make Marshal of MessageBody, ParseMessage work correctly on parameter problem message
The wire format of parameter problem message is slightly different
between ICMPv4 and ICMPv6. We need to distinguish each message's
protocol family for avoiding dropping wrong wire format stuff on the
wire.

This is an API breaking change.

type MessageBody interface, Marshal() ([]byte, error)

is replaced with

type MessageBody interface, Marshal(int) ([]byte, error)

Fixes #9394.

Change-Id: Id692c76f85a2714dd011342e648b31395ca668bf
2014-12-25 11:55:55 +09:00
Mikio Hara
b745b482fe x/net/icmp: new package
This CL makes icmp an external package.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/182370043
2014-12-03 12:32:52 +09:00