From 3700eb1e61166eb9f95d1a2a6c7d606be5cbb614 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Fri, 28 Mar 2014 11:04:48 +0100 Subject: Use IPv4 multicast discovery --- Godeps/Godeps.json | 7 +- .../src/code.google.com/p/go.net/ipv6/control.go | 83 ------- .../p/go.net/ipv6/control_rfc2292_unix.go | 151 ------------- .../p/go.net/ipv6/control_rfc3542_stub.go | 27 --- .../p/go.net/ipv6/control_rfc3542_unix.go | 210 ------------------ .../p/go.net/ipv6/control_rfc3542_windows.go | 27 --- .../p/go.net/ipv6/dgramopt_posix.go | 178 --------------- .../code.google.com/p/go.net/ipv6/dgramopt_stub.go | 95 -------- .../src/code.google.com/p/go.net/ipv6/doc.go | 193 ---------------- .../src/code.google.com/p/go.net/ipv6/endpoint.go | 119 ---------- .../src/code.google.com/p/go.net/ipv6/gen.go | 241 -------------------- .../p/go.net/ipv6/genericopt_posix.go | 60 ----- .../p/go.net/ipv6/genericopt_stub.go | 34 --- .../src/code.google.com/p/go.net/ipv6/gentest.go | 195 ----------------- .../src/code.google.com/p/go.net/ipv6/helper.go | 33 --- .../code.google.com/p/go.net/ipv6/helper_stub.go | 22 -- .../code.google.com/p/go.net/ipv6/helper_unix.go | 46 ---- .../p/go.net/ipv6/helper_windows.go | 45 ---- .../src/code.google.com/p/go.net/ipv6/iana.go | 224 ------------------- .../src/code.google.com/p/go.net/ipv6/iana_test.go | 38 ---- .../src/code.google.com/p/go.net/ipv6/icmp.go | 47 ---- .../src/code.google.com/p/go.net/ipv6/icmp_bsd.go | 33 --- .../code.google.com/p/go.net/ipv6/icmp_linux.go | 31 --- .../src/code.google.com/p/go.net/ipv6/icmp_stub.go | 24 -- .../src/code.google.com/p/go.net/ipv6/icmp_test.go | 102 --------- .../code.google.com/p/go.net/ipv6/icmp_windows.go | 22 -- .../code.google.com/p/go.net/ipv6/mockicmp_test.go | 130 ----------- .../p/go.net/ipv6/mocktransponder_test.go | 88 -------- .../p/go.net/ipv6/multicast_test.go | 205 ----------------- .../p/go.net/ipv6/multicastlistener_test.go | 243 --------------------- .../p/go.net/ipv6/multicastsockopt_test.go | 76 ------- .../src/code.google.com/p/go.net/ipv6/payload.go | 15 -- .../code.google.com/p/go.net/ipv6/payload_cmsg.go | 70 ------ .../p/go.net/ipv6/payload_noncmsg.go | 41 ---- .../p/go.net/ipv6/readwrite_test.go | 168 -------------- .../p/go.net/ipv6/sockopt_rfc2292_unix.go | 73 ------- .../p/go.net/ipv6/sockopt_rfc3493_bsd.go | 20 -- .../p/go.net/ipv6/sockopt_rfc3493_linux.go | 18 -- .../p/go.net/ipv6/sockopt_rfc3493_unix.go | 124 ----------- .../p/go.net/ipv6/sockopt_rfc3493_windows.go | 116 ---------- .../p/go.net/ipv6/sockopt_rfc3542_stub.go | 12 - .../p/go.net/ipv6/sockopt_rfc3542_unix.go | 90 -------- .../p/go.net/ipv6/sockopt_rfc3542_windows.go | 62 ------ .../code.google.com/p/go.net/ipv6/sockopt_test.go | 136 ------------ .../src/code.google.com/p/go.net/ipv6/sys.go | 23 -- .../src/code.google.com/p/go.net/ipv6/sys_bsd.go | 48 ---- .../code.google.com/p/go.net/ipv6/sys_darwin.go | 54 ----- .../src/code.google.com/p/go.net/ipv6/sys_linux.go | 45 ---- .../src/code.google.com/p/go.net/ipv6/sys_unix.go | 16 -- .../code.google.com/p/go.net/ipv6/sys_windows.go | 33 --- .../p/go.net/ipv6/syscall_linux_386.go | 42 ---- .../p/go.net/ipv6/syscall_linux_386.s | 56 ----- .../p/go.net/ipv6/syscall_nosplit4_linux_386.go | 15 -- .../p/go.net/ipv6/syscall_nosplit7_linux_386.go | 15 -- .../code.google.com/p/go.net/ipv6/syscall_unix.go | 26 --- .../code.google.com/p/go.net/ipv6/unicast_test.go | 172 --------------- .../p/go.net/ipv6/unicastsockopt_test.go | 101 --------- discover/discover.go | 95 ++------ mc/beacon.go | 91 ++++++++ mc/debug.go | 12 + 60 files changed, 120 insertions(+), 4698 deletions(-) delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc2292_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_stub.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_windows.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_posix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_stub.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/doc.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/endpoint.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gen.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_posix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_stub.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gentest.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_stub.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_windows.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/iana.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/iana_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/icmp.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/icmp_bsd.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/icmp_linux.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/icmp_stub.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/icmp_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/icmp_windows.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/mockicmp_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/mocktransponder_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/multicast_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/multicastlistener_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/multicastsockopt_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/payload.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/payload_cmsg.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/payload_noncmsg.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/readwrite_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc2292_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3493_bsd.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3493_linux.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3493_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3493_windows.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3542_stub.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3542_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_rfc3542_windows.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sockopt_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sys.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sys_bsd.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sys_darwin.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sys_linux.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sys_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/sys_windows.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/syscall_linux_386.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/syscall_linux_386.s delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/syscall_nosplit4_linux_386.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/syscall_nosplit7_linux_386.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/syscall_unix.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/unicast_test.go delete mode 100644 Godeps/_workspace/src/code.google.com/p/go.net/ipv6/unicastsockopt_test.go create mode 100644 mc/beacon.go create mode 100644 mc/debug.go diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index a8e9902b62..fdb729751f 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,15 +1,10 @@ { "ImportPath": "github.com/calmh/syncthing", - "GoVersion": "devel +3ca54dd30864 Sat Mar 22 11:05:40 2014 -0700", + "GoVersion": "go1.2.1", "Packages": [ "./cmd/syncthing" ], "Deps": [ - { - "ImportPath": "code.google.com/p/go.net/ipv6", - "Comment": "null-117", - "Rev": "c17ad62118ea511e1051721b429779fa40bddc74" - }, { "ImportPath": "code.google.com/p/go.text/transform", "Comment": "null-81", diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control.go deleted file mode 100644 index e2101903bf..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control.go +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "errors" - "fmt" - "net" - "sync" -) - -var ( - errMissingAddress = errors.New("missing address") - errInvalidConnType = errors.New("invalid conn type") - errNoSuchInterface = errors.New("no such interface") -) - -// References: -// -// RFC 2292 Advanced Sockets API for IPv6 -// http://tools.ietf.org/html/rfc2292 -// RFC 2460 Internet Protocol, Version 6 (IPv6) Specification -// http://tools.ietf.org/html/rfc2460 -// RFC 3493 Basic Socket Interface Extensions for IPv6 -// http://tools.ietf.org/html/rfc3493.html -// RFC 3542 Advanced Sockets Application Program Interface (API) for IPv6 -// http://tools.ietf.org/html/rfc3542 -// -// Note that RFC 3542 obsoltes RFC 2292 but OS X Snow Leopard and the -// former still support RFC 2292 only. Please be aware that almost -// all protocol implementations prohibit using a combination of RFC -// 2292 and RFC 3542 for some practical reasons. - -type rawOpt struct { - sync.Mutex - cflags ControlFlags -} - -func (c *rawOpt) set(f ControlFlags) { c.cflags |= f } -func (c *rawOpt) clear(f ControlFlags) { c.cflags &^= f } -func (c *rawOpt) isset(f ControlFlags) bool { return c.cflags&f != 0 } - -// A ControlFlags reprensents per packet basis IP-level socket option -// control flags. -type ControlFlags uint - -const ( - FlagTrafficClass ControlFlags = 1 << iota // pass the traffic class on the received packet - FlagHopLimit // pass the hop limit on the received packet - FlagSrc // pass the source address on the received packet - FlagDst // pass the destination address on the received packet - FlagInterface // pass the interface index on the received packet - FlagPathMTU // pass the path MTU on the received packet path -) - -// A ControlMessage represents per packet basis IP-level socket -// options. -type ControlMessage struct { - // Receiving socket options: SetControlMessage allows to - // receive the options from the protocol stack using ReadFrom - // method of PacketConn. - // - // Specifying socket options: ControlMessage for WriteTo - // method of PacketConn allows to send the options to the - // protocol stack. - // - TrafficClass int // traffic class, must be 1 <= value <= 255 when specifying - HopLimit int // hop limit, must be 1 <= value <= 255 when specifying - Src net.IP // source address, specifying only - Dst net.IP // destination address, receiving only - IfIndex int // interface index, must be 1 <= value when specifying - NextHop net.IP // next hop address, specifying only - MTU int // path MTU, receiving only -} - -func (cm *ControlMessage) String() string { - if cm == nil { - return "" - } - return fmt.Sprintf("tclass: %#x, hoplim: %v, src: %v, dst: %v, ifindex: %v, nexthop: %v, mtu: %v", cm.TrafficClass, cm.HopLimit, cm.Src, cm.Dst, cm.IfIndex, cm.NextHop, cm.MTU) -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc2292_unix.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc2292_unix.go deleted file mode 100644 index 47196c58f0..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc2292_unix.go +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin - -package ipv6 - -import ( - "net" - "os" - "syscall" - "unsafe" -) - -const pktinfo = FlagDst | FlagInterface - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - opt.Lock() - defer opt.Unlock() - if cf&FlagHopLimit != 0 { - if err := setIPv6ReceiveHopLimit(fd, on); err != nil { - return err - } - if on { - opt.set(FlagHopLimit) - } else { - opt.clear(FlagHopLimit) - } - } - if cf&pktinfo != 0 { - if err := setIPv6ReceivePacketInfo(fd, on); err != nil { - return err - } - if on { - opt.set(cf & pktinfo) - } else { - opt.clear(cf & pktinfo) - } - } - return nil -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - opt.Lock() - defer opt.Unlock() - l, off := 0, 0 - if opt.isset(FlagHopLimit) { - l += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if l > 0 { - oob = make([]byte, l) - if opt.isset(FlagHopLimit) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292HopLimit - m.SetLen(syscall.CmsgLen(4)) - off += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292PacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - } - return -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - if len(b) == 0 { - return nil, nil - } - cmsgs, err := syscall.ParseSocketControlMessage(b) - if err != nil { - return nil, os.NewSyscallError("parse socket control message", err) - } - cm := &ControlMessage{} - for _, m := range cmsgs { - if m.Header.Level != ianaProtocolIPv6 { - continue - } - switch m.Header.Type { - case sysSockopt2292HopLimit: - cm.HopLimit = int(*(*byte)(unsafe.Pointer(&m.Data[:1][0]))) - case sysSockopt2292PacketInfo: - pi := (*sysPacketInfo)(unsafe.Pointer(&m.Data[0])) - cm.IfIndex = int(pi.IfIndex) - cm.Dst = pi.IP[:] - } - } - return cm, nil -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - if cm == nil { - return - } - l, off := 0, 0 - if cm.HopLimit > 0 { - l += syscall.CmsgSpace(4) - } - pion := false - if cm.Src.To4() == nil && cm.Src.To16() != nil || cm.IfIndex != 0 { - pion = true - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - l += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - if l > 0 { - oob = make([]byte, l) - if cm.HopLimit > 0 { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292HopLimit - m.SetLen(syscall.CmsgLen(4)) - data := oob[off+syscall.CmsgLen(0):] - *(*byte)(unsafe.Pointer(&data[:1][0])) = byte(cm.HopLimit) - off += syscall.CmsgSpace(4) - } - if pion { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292PacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - pi := (*sysPacketInfo)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { - copy(pi.IP[:], ip) - } - if cm.IfIndex != 0 { - pi.IfIndex = uint32(cm.IfIndex) - } - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockopt2292NextHop - m.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrInet6)) - sa := (*syscall.RawSockaddrInet6)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - setSockaddr(sa, cm.NextHop, cm.IfIndex) - off += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - } - return -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_stub.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_stub.go deleted file mode 100644 index 4419bf5183..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_stub.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly plan9 solaris - -package ipv6 - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - // TODO(mikio): Implement this - return nil -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - // TODO(mikio): Implement this - return nil -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_unix.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_unix.go deleted file mode 100644 index 882a77be35..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_unix.go +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build freebsd linux netbsd openbsd - -package ipv6 - -import ( - "net" - "os" - "syscall" - "unsafe" -) - -const pktinfo = FlagDst | FlagInterface - -func setControlMessage(fd int, opt *rawOpt, cf ControlFlags, on bool) error { - opt.Lock() - defer opt.Unlock() - if cf&FlagTrafficClass != 0 { - if err := setIPv6ReceiveTrafficClass(fd, on); err != nil { - return err - } - if on { - opt.set(FlagTrafficClass) - } else { - opt.clear(FlagTrafficClass) - } - } - if cf&FlagHopLimit != 0 { - if err := setIPv6ReceiveHopLimit(fd, on); err != nil { - return err - } - if on { - opt.set(FlagHopLimit) - } else { - opt.clear(FlagHopLimit) - } - } - if cf&pktinfo != 0 { - if err := setIPv6ReceivePacketInfo(fd, on); err != nil { - return err - } - if on { - opt.set(cf & pktinfo) - } else { - opt.clear(cf & pktinfo) - } - } - if cf&FlagPathMTU != 0 { - if err := setIPv6ReceivePathMTU(fd, on); err != nil { - return err - } - if on { - opt.set(FlagPathMTU) - } else { - opt.clear(FlagPathMTU) - } - } - return nil -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - opt.Lock() - defer opt.Unlock() - l, off := 0, 0 - if opt.isset(FlagTrafficClass) { - l += syscall.CmsgSpace(4) - } - if opt.isset(FlagHopLimit) { - l += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if opt.isset(FlagPathMTU) { - l += syscall.CmsgSpace(sysSizeofMTUInfo) - } - if l > 0 { - oob = make([]byte, l) - if opt.isset(FlagTrafficClass) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceiveTrafficClass - m.SetLen(syscall.CmsgLen(4)) - off += syscall.CmsgSpace(4) - } - if opt.isset(FlagHopLimit) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceiveHopLimit - m.SetLen(syscall.CmsgLen(4)) - off += syscall.CmsgSpace(4) - } - if opt.isset(pktinfo) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceivePacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if opt.isset(FlagPathMTU) { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptReceivePathMTU - m.SetLen(syscall.CmsgLen(sysSizeofMTUInfo)) - off += syscall.CmsgSpace(sysSizeofMTUInfo) - } - } - return -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - if len(b) == 0 { - return nil, nil - } - cmsgs, err := syscall.ParseSocketControlMessage(b) - if err != nil { - return nil, os.NewSyscallError("parse socket control message", err) - } - cm := &ControlMessage{} - for _, m := range cmsgs { - if m.Header.Level != ianaProtocolIPv6 { - continue - } - switch m.Header.Type { - case sysSockoptTrafficClass: - cm.TrafficClass = int(*(*byte)(unsafe.Pointer(&m.Data[:1][0]))) - case sysSockoptHopLimit: - cm.HopLimit = int(*(*byte)(unsafe.Pointer(&m.Data[:1][0]))) - case sysSockoptPacketInfo: - pi := (*sysPacketInfo)(unsafe.Pointer(&m.Data[0])) - cm.Dst = pi.IP[:] - cm.IfIndex = int(pi.IfIndex) - case sysSockoptPathMTU: - mi := (*sysMTUInfo)(unsafe.Pointer(&m.Data[0])) - cm.Dst = mi.Addr.Addr[:] - cm.IfIndex = int(mi.Addr.Scope_id) - cm.MTU = int(mi.MTU) - } - } - return cm, nil -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - if cm == nil { - return - } - l, off := 0, 0 - if cm.TrafficClass > 0 { - l += syscall.CmsgSpace(4) - } - if cm.HopLimit > 0 { - l += syscall.CmsgSpace(4) - } - pion := false - if cm.Src.To4() == nil && cm.Src.To16() != nil || cm.IfIndex != 0 { - pion = true - l += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - l += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - if l > 0 { - oob = make([]byte, l) - if cm.TrafficClass > 0 { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptTrafficClass - m.SetLen(syscall.CmsgLen(4)) - data := oob[off+syscall.CmsgLen(0):] - *(*byte)(unsafe.Pointer(&data[:1][0])) = byte(cm.TrafficClass) - off += syscall.CmsgSpace(4) - } - if cm.HopLimit > 0 { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptHopLimit - m.SetLen(syscall.CmsgLen(4)) - data := oob[off+syscall.CmsgLen(0):] - *(*byte)(unsafe.Pointer(&data[:1][0])) = byte(cm.HopLimit) - off += syscall.CmsgSpace(4) - } - if pion { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptPacketInfo - m.SetLen(syscall.CmsgLen(sysSizeofPacketInfo)) - pi := (*sysPacketInfo)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - if ip := cm.Src.To16(); ip != nil && ip.To4() == nil { - copy(pi.IP[:], ip) - } - if cm.IfIndex != 0 { - pi.IfIndex = uint32(cm.IfIndex) - } - off += syscall.CmsgSpace(sysSizeofPacketInfo) - } - if len(cm.NextHop) == net.IPv6len { - m := (*syscall.Cmsghdr)(unsafe.Pointer(&oob[off])) - m.Level = ianaProtocolIPv6 - m.Type = sysSockoptNextHop - m.SetLen(syscall.CmsgLen(syscall.SizeofSockaddrInet6)) - sa := (*syscall.RawSockaddrInet6)(unsafe.Pointer(&oob[off+syscall.CmsgLen(0)])) - setSockaddr(sa, cm.NextHop, cm.IfIndex) - off += syscall.CmsgSpace(syscall.SizeofSockaddrInet6) - } - } - return -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_windows.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_windows.go deleted file mode 100644 index b4d53fb650..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/control_rfc3542_windows.go +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import "syscall" - -func setControlMessage(fd syscall.Handle, opt *rawOpt, cf ControlFlags, on bool) error { - // TODO(mikio): Implement this - return syscall.EWINDOWS -} - -func newControlMessage(opt *rawOpt) (oob []byte) { - // TODO(mikio): Implement this - return nil -} - -func parseControlMessage(b []byte) (*ControlMessage, error) { - // TODO(mikio): Implement this - return nil, syscall.EWINDOWS -} - -func marshalControlMessage(cm *ControlMessage) (oob []byte) { - // TODO(mikio): Implement this - return nil -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_posix.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_posix.go deleted file mode 100644 index c52f48dab7..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_posix.go +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd linux netbsd openbsd windows - -package ipv6 - -import ( - "net" - "syscall" -) - -// MulticastHopLimit returns the hop limit field value for outgoing -// multicast packets. -func (c *dgramOpt) MulticastHopLimit() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return ipv6MulticastHopLimit(fd) -} - -// SetMulticastHopLimit sets the hop limit field value for future -// outgoing multicast packets. -func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6MulticastHopLimit(fd, hoplim) -} - -// MulticastInterface returns the default interface for multicast -// packet transmissions. -func (c *dgramOpt) MulticastInterface() (*net.Interface, error) { - if !c.ok() { - return nil, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return nil, err - } - return ipv6MulticastInterface(fd) -} - -// SetMulticastInterface sets the default interface for future -// multicast packet transmissions. -func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6MulticastInterface(fd, ifi) -} - -// MulticastLoopback reports whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) MulticastLoopback() (bool, error) { - if !c.ok() { - return false, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return false, err - } - return ipv6MulticastLoopback(fd) -} - -// SetMulticastLoopback sets whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) SetMulticastLoopback(on bool) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6MulticastLoopback(fd, on) -} - -// JoinGroup joins the group address group on the interface ifi. -// It uses the system assigned multicast interface when ifi is nil, -// although this is not recommended because the assignment depends on -// platforms and sometimes it might require routing configuration. -func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - grp := netAddrToIP16(group) - if grp == nil { - return errMissingAddress - } - return joinIPv6Group(fd, ifi, grp) -} - -// LeaveGroup leaves the group address group on the interface ifi. -func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - grp := netAddrToIP16(group) - if grp == nil { - return errMissingAddress - } - return leaveIPv6Group(fd, ifi, grp) -} - -// Checksum reports whether the kernel will compute, store or verify a -// checksum for both incoming and outgoing packets. If on is true, it -// returns an offset in bytes into the data of where the checksum -// field is located. -func (c *dgramOpt) Checksum() (on bool, offset int, err error) { - if !c.ok() { - return false, 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return false, 0, err - } - return ipv6Checksum(fd) -} - -// SetChecksum enables the kernel checksum processing. If on is ture, -// the offset should be an offset in bytes into the data of where the -// checksum field is located. -func (c *dgramOpt) SetChecksum(on bool, offset int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6Checksum(fd, on, offset) -} - -// ICMPFilter returns an ICMP filter. -func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) { - if !c.ok() { - return nil, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return nil, err - } - return ipv6ICMPFilter(fd) -} - -// SetICMPFilter deploys the ICMP filter. -func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6ICMPFilter(fd, f) -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_stub.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_stub.go deleted file mode 100644 index 9c760dfcd2..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/dgramopt_stub.go +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly plan9 solaris - -package ipv6 - -import "net" - -// MulticastHopLimit returns the hop limit field value for outgoing -// multicast packets. -func (c *dgramOpt) MulticastHopLimit() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -// SetMulticastHopLimit sets the hop limit field value for future -// outgoing multicast packets. -func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// MulticastInterface returns the default interface for multicast -// packet transmissions. -func (c *dgramOpt) MulticastInterface() (*net.Interface, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -// SetMulticastInterface sets the default interface for future -// multicast packet transmissions. -func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// MulticastLoopback reports whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) MulticastLoopback() (bool, error) { - // TODO(mikio): Implement this - return false, errOpNoSupport -} - -// SetMulticastLoopback sets whether transmitted multicast packets -// should be copied and send back to the originator. -func (c *dgramOpt) SetMulticastLoopback(on bool) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// JoinGroup joins the group address group on the interface ifi. -// It uses the system assigned multicast interface when ifi is nil, -// although this is not recommended because the assignment depends on -// platforms and sometimes it might require routing configuration. -func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// LeaveGroup leaves the group address group on the interface ifi. -func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// Checksum reports whether the kernel will compute, store or verify a -// checksum for both incoming and outgoing packets. If on is true, it -// returns an offset in bytes into the data of where the checksum -// field is located. -func (c *dgramOpt) Checksum() (on bool, offset int, err error) { - // TODO(mikio): Implement this - return false, 0, errOpNoSupport -} - -// SetChecksum enables the kernel checksum processing. If on is ture, -// the offset should be an offset in bytes into the data of where the -// checksum field is located. -func (c *dgramOpt) SetChecksum(on bool, offset int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// ICMPFilter returns an ICMP filter. -func (c *dgramOpt) ICMPFilter() (*ICMPFilter, error) { - // TODO(mikio): Implement this - return nil, errOpNoSupport -} - -// SetICMPFilter deploys the ICMP filter. -func (c *dgramOpt) SetICMPFilter(f *ICMPFilter) error { - // TODO(mikio): Implement this - return errOpNoSupport -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/doc.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/doc.go deleted file mode 100644 index b4578c5868..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/doc.go +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package ipv6 implements IP-level socket options for the Internet -// Protocol version 6. -// -// The package provides IP-level socket options that allow -// manipulation of IPv6 facilities. The IPv6 and socket options for -// IPv6 are defined in RFC 2460, RFC 3493 and RFC 3542. -// -// -// Unicasting -// -// The options for unicasting are available for net.TCPConn, -// net.UDPConn and net.IPConn which are created as network connections -// that use the IPv6 transport. When a single TCP connection carrying -// a data flow of multiple packets needs to indicate the flow is -// important, ipv6.Conn is used to set the traffic class field on the -// IPv6 header for each packet. -// -// ln, err := net.Listen("tcp6", "[::]:1024") -// if err != nil { -// // error handling -// } -// defer ln.Close() -// for { -// c, err := ln.Accept() -// if err != nil { -// // error handling -// } -// go func(c net.Conn) { -// defer c.Close() -// -// The outgoing packets will be labeled DiffServ assured forwarding -// class 1 low drop precedence, as known as AF11 packets. -// -// if err := ipv6.NewConn(c).SetTrafficClass(DiffServAF11); err != nil { -// // error handling -// } -// if _, err := c.Write(data); err != nil { -// // error handling -// } -// }(c) -// } -// -// -// Multicasting -// -// The options for multicasting are available for net.UDPConn and -// net.IPconn which are created as network connections that use the -// IPv6 transport. A few network facilities must be prepared before -// you begin multicasting, at a minimum joining network interfaces and -// multicast groups. -// -// en0, err := net.InterfaceByName("en0") -// if err != nil { -// // error handling -// } -// en1, err := net.InterfaceByIndex(911) -// if err != nil { -// // error handling -// } -// group := net.ParseIP("ff02::114") -// -// First, an application listens to an appropriate address with an -// appropriate service port. -// -// c, err := net.ListenPacket("udp6", "[::]:1024") -// if err != nil { -// // error handling -// } -// defer c.Close() -// -// Second, the application joins multicast groups, starts listening to -// the groups on the specified network interfaces. Note that the -// service port for transport layer protocol does not matter with this -// operation as joining groups affects only network and link layer -// protocols, such as IPv6 and Ethernet. -// -// p := ipv6.NewPacketConn(c) -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: group}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en1, &net.UDPAddr{IP: group}); err != nil { -// // error handling -// } -// -// The application might set per packet control message transmissions -// between the protocol stack within the kernel. When the application -// needs a destination address on an incoming packet, -// SetControlMessage of ipv6.PacketConn is used to enable control -// message transmissons. -// -// if err := p.SetControlMessage(ipv6.FlagDst, true); err != nil { -// // error handling -// } -// -// The application could identify whether the received packets are -// of interest by using the control message that contains the -// destination address of the received packet. -// -// b := make([]byte, 1500) -// for { -// n, rcm, src, err := p.ReadFrom(b) -// if err != nil { -// // error handling -// } -// if rcm.Dst.IsMulticast() { -// if rcm.Dst.Equal(group) -// // joined group, do something -// } else { -// // unknown group, discard -// continue -// } -// } -// -// The application can also send both unicast and multicast packets. -// -// p.SetTrafficClass(DiffServCS0) -// p.SetHopLimit(16) -// if _, err := p.WriteTo(data[:n], nil, src); err != nil { -// // error handling -// } -// dst := &net.UDPAddr{IP: group, Port: 1024} -// wcm := ipv6.ControlMessage{TrafficClass: DiffServCS7, HopLimit: 1} -// for _, ifi := range []*net.Interface{en0, en1} { -// wcm.IfIndex = ifi.Index -// if _, err := p.WriteTo(data[:n], &wcm, dst); err != nil { -// // error handling -// } -// } -// } -// -// -// More multicasting -// -// An application that uses PacketConn may join multiple multicast -// groups. For example, a UDP listener with port 1024 might join two -// different groups across over two different network interfaces by -// using: -// -// c, err := net.ListenPacket("udp6", "[::]:1024") -// if err != nil { -// // error handling -// } -// defer c.Close() -// p := ipv6.NewPacketConn(c) -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::1:114")}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::2:114")}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en1, &net.UDPAddr{IP: net.ParseIP("ff02::2:114")}); err != nil { -// // error handling -// } -// -// It is possible for multiple UDP listeners that listen on the same -// UDP port to join the same multicast group. The net package will -// provide a socket that listens to a wildcard address with reusable -// UDP port when an appropriate multicast address prefix is passed to -// the net.ListenPacket or net.ListenUDP. -// -// c1, err := net.ListenPacket("udp6", "[ff02::]:1024") -// if err != nil { -// // error handling -// } -// defer c1.Close() -// c2, err := net.ListenPacket("udp6", "[ff02::]:1024") -// if err != nil { -// // error handling -// } -// defer c2.Close() -// p1 := ipv6.NewPacketConn(c1) -// if err := p1.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil { -// // error handling -// } -// p2 := ipv6.NewPacketConn(c2) -// if err := p2.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil { -// // error handling -// } -// -// Also it is possible for the application to leave or rejoin a -// multicast group on the network interface. -// -// if err := p.LeaveGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff02::114")}); err != nil { -// // error handling -// } -// if err := p.JoinGroup(en0, &net.UDPAddr{IP: net.ParseIP("ff01::114")}); err != nil { -// // error handling -// } -package ipv6 diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/endpoint.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/endpoint.go deleted file mode 100644 index 04eee35faa..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/endpoint.go +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "syscall" - "time" -) - -// A Conn represents a network endpoint that uses IPv6 transport. -// It allows to set basic IP-level socket options such as traffic -// class and hop limit. -type Conn struct { - genericOpt -} - -type genericOpt struct { - net.Conn -} - -func (c *genericOpt) ok() bool { return c != nil && c.Conn != nil } - -// PathMTU returns a path MTU value for the destination associated -// with the endpoint. -func (c *Conn) PathMTU() (int, error) { - if !c.genericOpt.ok() { - return 0, syscall.EINVAL - } - fd, err := c.genericOpt.sysfd() - if err != nil { - return 0, err - } - return ipv6PathMTU(fd) -} - -// NewConn returns a new Conn. -func NewConn(c net.Conn) *Conn { - return &Conn{ - genericOpt: genericOpt{Conn: c}, - } -} - -// A PacketConn represents a packet network endpoint that uses IPv6 -// transport. It is used to control several IP-level socket options -// including IPv6 header manipulation. It also provides datagram -// based network I/O methods specific to the IPv6 and higher layer -// protocols such as OSPF, GRE, and UDP. -type PacketConn struct { - genericOpt - dgramOpt - payloadHandler -} - -type dgramOpt struct { - net.PacketConn -} - -func (c *dgramOpt) ok() bool { return c != nil && c.PacketConn != nil } - -// SetControlMessage allows to receive the per packet basis IP-level -// socket options. -func (c *PacketConn) SetControlMessage(cf ControlFlags, on bool) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - fd, err := c.payloadHandler.sysfd() - if err != nil { - return err - } - return setControlMessage(fd, &c.payloadHandler.rawOpt, cf, on) -} - -// SetDeadline sets the read and write deadlines associated with the -// endpoint. -func (c *PacketConn) SetDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.SetDeadline(t) -} - -// SetReadDeadline sets the read deadline associated with the -// endpoint. -func (c *PacketConn) SetReadDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.SetReadDeadline(t) -} - -// SetWriteDeadline sets the write deadline associated with the -// endpoint. -func (c *PacketConn) SetWriteDeadline(t time.Time) error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.SetWriteDeadline(t) -} - -// Close closes the endpoint. -func (c *PacketConn) Close() error { - if !c.payloadHandler.ok() { - return syscall.EINVAL - } - return c.payloadHandler.Close() -} - -// NewPacketConn returns a new PacketConn using c as its underlying -// transport. -func NewPacketConn(c net.PacketConn) *PacketConn { - return &PacketConn{ - genericOpt: genericOpt{Conn: c.(net.Conn)}, - dgramOpt: dgramOpt{PacketConn: c}, - payloadHandler: payloadHandler{PacketConn: c}, - } -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gen.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gen.go deleted file mode 100644 index 5680bac761..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gen.go +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This program generates internet protocol constatns and tables by -// reading IANA protocol registries. -// -// Usage: -// go run gen.go > iana.go -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "net/http" - "os" - "strconv" - "strings" -) - -var registries = []struct { - url string - parse func(io.Writer, io.Reader) error -}{ - { - "http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xml", - parseICMPv6Parameters, - }, - { - "http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml", - parseProtocolNumbers, - }, -} - -func main() { - var bb bytes.Buffer - fmt.Fprintf(&bb, "// go run gen.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") - fmt.Fprintf(&bb, "package ipv6\n\n") - for _, r := range registries { - resp, err := http.Get(r.url) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) - os.Exit(1) - } - if err := r.parse(&bb, resp.Body); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - fmt.Fprintf(&bb, "\n") - } - b, err := format.Source(bb.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - os.Stdout.Write(b) -} - -func parseICMPv6Parameters(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var icp icmpv6Parameters - if err := dec.Decode(&icp); err != nil { - return err - } - prs := icp.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) - fmt.Fprintf(w, "const (\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "ICMPType%s ICMPType = %d", pr.Name, pr.Value) - fmt.Fprintf(w, "// %s\n", pr.OrigName) - } - fmt.Fprintf(w, ")\n\n") - fmt.Fprintf(w, "// %s, Updated: %s\n", icp.Title, icp.Updated) - fmt.Fprintf(w, "var icmpTypes = map[ICMPType]string{\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "%d: %q,\n", pr.Value, strings.ToLower(pr.OrigName)) - } - fmt.Fprintf(w, "}\n") - return nil -} - -type icmpv6Parameters struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Registries []struct { - Title string `xml:"title"` - Records []struct { - Value string `xml:"value"` - Name string `xml:"name"` - } `xml:"record"` - } `xml:"registry"` -} - -type canonICMPv6ParamRecord struct { - OrigName string - Name string - Value int -} - -func (icp *icmpv6Parameters) escape() []canonICMPv6ParamRecord { - id := -1 - for i, r := range icp.Registries { - if strings.Contains(r.Title, "Type") || strings.Contains(r.Title, "type") { - id = i - break - } - } - if id < 0 { - return nil - } - prs := make([]canonICMPv6ParamRecord, len(icp.Registries[id].Records)) - sr := strings.NewReplacer( - "Messages", "", - "Message", "", - "ICMP", "", - "+", "P", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, pr := range icp.Registries[id].Records { - if strings.Contains(pr.Name, "Reserved") || - strings.Contains(pr.Name, "Unassigned") || - strings.Contains(pr.Name, "Deprecated") || - strings.Contains(pr.Name, "Experiment") || - strings.Contains(pr.Name, "experiment") { - continue - } - ss := strings.Split(pr.Name, "\n") - if len(ss) > 1 { - prs[i].Name = strings.Join(ss, " ") - } else { - prs[i].Name = ss[0] - } - s := strings.TrimSpace(prs[i].Name) - prs[i].OrigName = s - prs[i].Name = sr.Replace(s) - prs[i].Value, _ = strconv.Atoi(pr.Value) - } - return prs -} - -func parseProtocolNumbers(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var pn protocolNumbers - if err := dec.Decode(&pn); err != nil { - return err - } - prs := pn.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", pn.Title, pn.Updated) - fmt.Fprintf(w, "const (\n") - for _, pr := range prs { - if pr.Name == "" { - continue - } - fmt.Fprintf(w, "ianaProtocol%s = %d", pr.Name, pr.Value) - s := pr.Descr - if s == "" { - s = pr.OrigName - } - fmt.Fprintf(w, "// %s\n", s) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type protocolNumbers struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - RegTitle string `xml:"registry>title"` - Note string `xml:"registry>note"` - Records []struct { - Value string `xml:"value"` - Name string `xml:"name"` - Descr string `xml:"description"` - } `xml:"registry>record"` -} - -type canonProtocolRecord struct { - OrigName string - Name string - Descr string - Value int -} - -func (pn *protocolNumbers) escape() []canonProtocolRecord { - prs := make([]canonProtocolRecord, len(pn.Records)) - sr := strings.NewReplacer( - "-in-", "in", - "-within-", "within", - "-over-", "over", - "+", "P", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, pr := range pn.Records { - prs[i].OrigName = pr.Name - s := strings.TrimSpace(pr.Name) - switch pr.Name { - case "ISIS over IPv4": - prs[i].Name = "ISIS" - case "manet": - prs[i].Name = "MANET" - default: - prs[i].Name = sr.Replace(s) - } - ss := strings.Split(pr.Descr, "\n") - for i := range ss { - ss[i] = strings.TrimSpace(ss[i]) - } - if len(ss) > 1 { - prs[i].Descr = strings.Join(ss, " ") - } else { - prs[i].Descr = ss[0] - } - prs[i].Value, _ = strconv.Atoi(pr.Value) - } - return prs -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_posix.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_posix.go deleted file mode 100644 index a3a9af9a43..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_posix.go +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd linux netbsd openbsd windows - -package ipv6 - -import "syscall" - -// TrafficClass returns the traffic class field value for outgoing -// packets. -func (c *genericOpt) TrafficClass() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return ipv6TrafficClass(fd) -} - -// SetTrafficClass sets the traffic class field value for future -// outgoing packets. -func (c *genericOpt) SetTrafficClass(tclass int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6TrafficClass(fd, tclass) -} - -// HopLimit returns the hop limit field value for outgoing packets. -func (c *genericOpt) HopLimit() (int, error) { - if !c.ok() { - return 0, syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return 0, err - } - return ipv6HopLimit(fd) -} - -// SetHopLimit sets the hop limit field value for future outgoing -// packets. -func (c *genericOpt) SetHopLimit(hoplim int) error { - if !c.ok() { - return syscall.EINVAL - } - fd, err := c.sysfd() - if err != nil { - return err - } - return setIPv6HopLimit(fd, hoplim) -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_stub.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_stub.go deleted file mode 100644 index 1b4219590b..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/genericopt_stub.go +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly plan9 solaris - -package ipv6 - -// TrafficClass returns the traffic class field value for outgoing -// packets. -func (c *genericOpt) TrafficClass() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -// SetTrafficClass sets the traffic class field value for future -// outgoing packets. -func (c *genericOpt) SetTrafficClass(tclass int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} - -// HopLimit returns the hop limit field value for outgoing packets. -func (c *genericOpt) HopLimit() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -// SetHopLimit sets the hop limit field value for future outgoing -// packets. -func (c *genericOpt) SetHopLimit(hoplim int) error { - // TODO(mikio): Implement this - return errOpNoSupport -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gentest.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gentest.go deleted file mode 100644 index 606930f63d..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/gentest.go +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build ignore - -// This program generates internet protocol constants by reading IANA -// protocol registries. -// -// Usage: -// go run gentest.go > iana_test.go -package main - -import ( - "bytes" - "encoding/xml" - "fmt" - "go/format" - "io" - "net/http" - "os" - "strconv" - "strings" -) - -var registries = []struct { - url string - parse func(io.Writer, io.Reader) error -}{ - { - "http://www.iana.org/assignments/dscp-registry/dscp-registry.xml", - parseDSCPRegistry, - }, - { - "http://www.iana.org/assignments/ipv4-tos-byte/ipv4-tos-byte.xml", - parseTOSTCByte, - }, -} - -func main() { - var bb bytes.Buffer - fmt.Fprintf(&bb, "// go run gentest.go\n") - fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n") - fmt.Fprintf(&bb, "package ipv6_test\n\n") - for _, r := range registries { - resp, err := http.Get(r.url) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - defer resp.Body.Close() - if resp.StatusCode != http.StatusOK { - fmt.Fprintf(os.Stderr, "got HTTP status code %v for %v\n", resp.StatusCode, r.url) - os.Exit(1) - } - if err := r.parse(&bb, resp.Body); err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - fmt.Fprintf(&bb, "\n") - } - b, err := format.Source(bb.Bytes()) - if err != nil { - fmt.Fprintln(os.Stderr, err) - os.Exit(1) - } - os.Stdout.Write(b) -} - -func parseDSCPRegistry(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var dr dscpRegistry - if err := dec.Decode(&dr); err != nil { - return err - } - drs := dr.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", dr.Title, dr.Updated) - fmt.Fprintf(w, "const (\n") - for _, dr := range drs { - fmt.Fprintf(w, "DiffServ%s = %#x", dr.Name, dr.Value) - fmt.Fprintf(w, "// %s\n", dr.OrigName) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type dscpRegistry struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Note string `xml:"note"` - RegTitle string `xml:"registry>title"` - PoolRecords []struct { - Name string `xml:"name"` - Space string `xml:"space"` - } `xml:"registry>record"` - Records []struct { - Name string `xml:"name"` - Space string `xml:"space"` - } `xml:"registry>registry>record"` -} - -type canonDSCPRecord struct { - OrigName string - Name string - Value int -} - -func (drr *dscpRegistry) escape() []canonDSCPRecord { - drs := make([]canonDSCPRecord, len(drr.Records)) - sr := strings.NewReplacer( - "+", "", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, dr := range drr.Records { - s := strings.TrimSpace(dr.Name) - drs[i].OrigName = s - drs[i].Name = sr.Replace(s) - n, err := strconv.ParseUint(dr.Space, 2, 8) - if err != nil { - continue - } - drs[i].Value = int(n) << 2 - } - return drs -} - -func parseTOSTCByte(w io.Writer, r io.Reader) error { - dec := xml.NewDecoder(r) - var ttb tosTCByte - if err := dec.Decode(&ttb); err != nil { - return err - } - trs := ttb.escape() - fmt.Fprintf(w, "// %s, Updated: %s\n", ttb.Title, ttb.Updated) - fmt.Fprintf(w, "const (\n") - for _, tr := range trs { - fmt.Fprintf(w, "%s = %#x", tr.Keyword, tr.Value) - fmt.Fprintf(w, "// %s\n", tr.OrigKeyword) - } - fmt.Fprintf(w, ")\n") - return nil -} - -type tosTCByte struct { - XMLName xml.Name `xml:"registry"` - Title string `xml:"title"` - Updated string `xml:"updated"` - Note string `xml:"note"` - RegTitle string `xml:"registry>title"` - Records []struct { - Binary string `xml:"binary"` - Keyword string `xml:"keyword"` - } `xml:"registry>record"` -} - -type canonTOSTCByteRecord struct { - OrigKeyword string - Keyword string - Value int -} - -func (ttb *tosTCByte) escape() []canonTOSTCByteRecord { - trs := make([]canonTOSTCByteRecord, len(ttb.Records)) - sr := strings.NewReplacer( - "Capable", "", - "(", "", - ")", "", - "+", "", - "-", "", - "/", "", - ".", "", - " ", "", - ) - for i, tr := range ttb.Records { - s := strings.TrimSpace(tr.Keyword) - trs[i].OrigKeyword = s - ss := strings.Split(s, " ") - if len(ss) > 1 { - trs[i].Keyword = strings.Join(ss[1:], " ") - } else { - trs[i].Keyword = ss[0] - } - trs[i].Keyword = sr.Replace(trs[i].Keyword) - n, err := strconv.ParseUint(tr.Binary, 2, 8) - if err != nil { - continue - } - trs[i].Value = int(n) - } - return trs -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper.go deleted file mode 100644 index 6493484815..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "errors" - "net" -) - -var errOpNoSupport = errors.New("operation not supported") - -func boolint(b bool) int { - if b { - return 1 - } - return 0 -} - -func netAddrToIP16(a net.Addr) net.IP { - switch v := a.(type) { - case *net.UDPAddr: - if ip := v.IP.To16(); ip != nil && ip.To4() == nil { - return ip - } - case *net.IPAddr: - if ip := v.IP.To16(); ip != nil && ip.To4() == nil { - return ip - } - } - return nil -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_stub.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_stub.go deleted file mode 100644 index 0b5b35a3d5..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_stub.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build dragonfly plan9 solaris - -package ipv6 - -func (c *genericOpt) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *dgramOpt) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} - -func (c *payloadHandler) sysfd() (int, error) { - // TODO(mikio): Implement this - return 0, errOpNoSupport -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_unix.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_unix.go deleted file mode 100644 index 6ad8db453f..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_unix.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// +build darwin freebsd linux netbsd openbsd - -package ipv6 - -import ( - "net" - "reflect" -) - -func (c *genericOpt) sysfd() (int, error) { - switch p := c.Conn.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - return sysfd(p) - } - return 0, errInvalidConnType -} - -func (c *dgramOpt) sysfd() (int, error) { - switch p := c.PacketConn.(type) { - case *net.UDPConn, *net.IPConn: - return sysfd(p.(net.Conn)) - } - return 0, errInvalidConnType -} - -func (c *payloadHandler) sysfd() (int, error) { - return sysfd(c.PacketConn.(net.Conn)) -} - -func sysfd(c net.Conn) (int, error) { - cv := reflect.ValueOf(c) - switch ce := cv.Elem(); ce.Kind() { - case reflect.Struct: - nfd := ce.FieldByName("conn").FieldByName("fd") - switch fe := nfd.Elem(); fe.Kind() { - case reflect.Struct: - fd := fe.FieldByName("sysfd") - return int(fd.Int()), nil - } - } - return 0, errInvalidConnType -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_windows.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_windows.go deleted file mode 100644 index 28c401b53c..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/helper_windows.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package ipv6 - -import ( - "net" - "reflect" - "syscall" -) - -func (c *genericOpt) sysfd() (syscall.Handle, error) { - switch p := c.Conn.(type) { - case *net.TCPConn, *net.UDPConn, *net.IPConn: - return sysfd(p) - } - return syscall.InvalidHandle, errInvalidConnType -} - -func (c *dgramOpt) sysfd() (syscall.Handle, error) { - switch p := c.PacketConn.(type) { - case *net.UDPConn, *net.IPConn: - return sysfd(p.(net.Conn)) - } - return syscall.InvalidHandle, errInvalidConnType -} - -func (c *payloadHandler) sysfd() (syscall.Handle, error) { - return sysfd(c.PacketConn.(net.Conn)) -} - -func sysfd(c net.Conn) (syscall.Handle, error) { - cv := reflect.ValueOf(c) - switch ce := cv.Elem(); ce.Kind() { - case reflect.Struct: - netfd := ce.FieldByName("conn").FieldByName("fd") - switch fe := netfd.Elem(); fe.Kind() { - case reflect.Struct: - fd := fe.FieldByName("sysfd") - return syscall.Handle(fd.Uint()), nil - } - } - return syscall.InvalidHandle, errInvalidConnType -} diff --git a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/iana.go b/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/iana.go deleted file mode 100644 index 429087c5fd..0000000000 --- a/Godeps/_workspace/src/code.google.com/p/go.net/ipv6/iana.go +++ /dev/null @@ -1,224 +0,0 @@ -// go run gen.go -// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT - -package ipv6 - -// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2013-07-03 -const ( - ICMPTypeDestinationUnreachable ICMPType = 1 // Destination Unreachable - ICMPTypePacketTooBig ICMPType = 2 // Packet Too Big - ICMPTypeTimeExceeded ICMPType = 3 // Time Exceeded - ICMPTypeParameterProblem ICMPType = 4 // Parameter Problem - ICMPTypeEchoRequest ICMPType = 128 // Echo Request - ICMPTypeEchoReply ICMPType = 129 // Echo Reply - ICMPTypeMulticastListenerQuery ICMPType = 130 // Multicast Listener Query - ICMPTypeMulticastListenerReport ICMPType = 131 // Multicast Listener Report - ICMPTypeMulticastListenerDone ICMPType = 132 // Multicast Listener Done - ICMPTypeRouterSolicitation ICMPType = 133 // Router Solicitation - ICMPTypeRouterAdvertisement ICMPType = 134 // Router Advertisement - ICMPTypeNeighborSolicitation ICMPType = 135 // Neighbor Solicitation - ICMPTypeNeighborAdvertisement ICMPType = 136 // Neighbor Advertisement - ICMPTypeRedirect ICMPType = 137 // Redirect Message - ICMPTypeRouterRenumbering ICMPType = 138 // Router Renumbering - ICMPTypeNodeInformationQuery ICMPType = 139 // ICMP Node Information Query - ICMPTypeNodeInformationResponse ICMPType = 140 // ICMP Node Information Response - ICMPTypeInverseNeighborDiscoverySolicitation ICMPType = 141 // Inverse Neighbor Discovery Solicitation Message - ICMPTypeInverseNeighborDiscoveryAdvertisement ICMPType = 142 // Inverse Neighbor Discovery Advertisement Message - ICMPTypeVersion2MulticastListenerReport ICMPType = 143 // Version 2 Multicast Listener Report - ICMPTypeHomeAgentAddressDiscoveryRequest ICMPType = 144 // Home Agent Address Discovery Request Message - ICMPTypeHomeAgentAddressDiscoveryReply ICMPType = 145 // Home Agent Address Discovery Reply Message - ICMPTypeMobilePrefixSolicitation ICMPType = 146 // Mobile Prefix Solicitation - ICMPTypeMobilePrefixAdvertisement ICMPType = 147 // Mobile Prefix Advertisement - ICMPTypeCertificationPathSolicitation ICMPType = 148 // Certification Path Solicitation Message - ICMPTypeCertificationPathAdvertisement ICMPType = 149 // Certification Path Advertisement Message - ICMPTypeMulticastRouterAdvertisement