LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2012 The Go Authors. All rights reserved. | 1 // Copyright 2012 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package ipv4 | 5 package ipv4 |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "net" | 9 "net" |
10 "sync" | 10 "sync" |
(...skipping 22 matching lines...) Expand all Loading... |
33 // Receiving socket options: SetControlMessage allows to | 33 // Receiving socket options: SetControlMessage allows to |
34 // receive the options from the protocol stack using ReadFrom | 34 // receive the options from the protocol stack using ReadFrom |
35 // method of PacketConn or RawConn. | 35 // method of PacketConn or RawConn. |
36 // | 36 // |
37 // Specifying socket options: ControlMessage for WriteTo | 37 // Specifying socket options: ControlMessage for WriteTo |
38 // method of PacketConn or RawConn allows to send the options | 38 // method of PacketConn or RawConn allows to send the options |
39 // to the protocol stack. | 39 // to the protocol stack. |
40 // | 40 // |
41 TTL int // time-to-live, receiving only | 41 TTL int // time-to-live, receiving only |
42 Src net.IP // source address, specifying only | 42 Src net.IP // source address, specifying only |
| 43 SpecDst net.IP // local address of packet |
43 Dst net.IP // destination address, receiving only | 44 Dst net.IP // destination address, receiving only |
44 IfIndex int // interface index, must be 1 <= value when specifying | 45 IfIndex int // interface index, must be 1 <= value when specifying |
45 } | 46 } |
46 | 47 |
47 func (cm *ControlMessage) String() string { | 48 func (cm *ControlMessage) String() string { |
48 if cm == nil { | 49 if cm == nil { |
49 return "<nil>" | 50 return "<nil>" |
50 } | 51 } |
51 » return fmt.Sprintf("ttl: %v, src: %v, dst: %v, ifindex: %v", cm.TTL, cm.
Src, cm.Dst, cm.IfIndex) | 52 » return fmt.Sprintf("ttl: %v, src: %v, specdst: %v, dst: %v, ifindex: %v"
, cm.TTL, cm.Src, cm.SpecDst, cm.Dst, cm.IfIndex) |
52 } | 53 } |
LEFT | RIGHT |