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
Dmitri Shuralyov
5d997795f7 all: make copyright headers consistent with one space after period
Go policy has been single space after periods in comments for some time.

The copyright header template at:

	https://golang.org/doc/contribute.html#copyright

also uses a single space.

Make them all consistent.

This CL was generated with:

	perl -i -npe 's,^(// Copyright [0-9]+ The Go Authors\.)  (All rights reserved\.)$,$1 $2,' $(git grep -l -E '^// Copyright [0-9]+ The Go Authors\.  All rights reserved\.$')

Follows https://golang.org/cl/20111.

Change-Id: I66671dddf821f5dc027bc254e0196b3e3a2bdf3b
Reviewed-on: https://go-review.googlesource.com/32878
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-11-07 23:52:11 +00:00
Mikio Hara
a896e565e9 icmp: fix potential misaligned memory access
Also makes use of encoding/binary package.

Change-Id: Ia771290aaccb936fbb7052abaaf96290a9ed4644
Reviewed-on: https://go-review.googlesource.com/19535
Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-02-17 01:11:45 +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
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