David K. Bainbridge | 215e024 | 2017-09-05 23:18:24 -0700 | [diff] [blame] | 1 | // Copyright 2012 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | package ipv4 |
| 6 | |
| 7 | import ( |
| 8 | "net" |
| 9 | |
| 10 | "golang.org/x/net/internal/socket" |
| 11 | ) |
| 12 | |
| 13 | // BUG(mikio): On Windows, the ControlMessage for ReadFrom and WriteTo |
| 14 | // methods of PacketConn is not implemented. |
| 15 | |
| 16 | // A payloadHandler represents the IPv4 datagram payload handler. |
| 17 | type payloadHandler struct { |
| 18 | net.PacketConn |
| 19 | *socket.Conn |
| 20 | rawOpt |
| 21 | } |
| 22 | |
| 23 | func (c *payloadHandler) ok() bool { return c != nil && c.PacketConn != nil && c.Conn != nil } |