| 1 | // Copyright The Prometheus Authors |
| 2 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 3 | // you may not use this file except in compliance with the License. |
| 4 | // You may obtain a copy of the License at |
| 5 | // |
| 6 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | // |
| 8 | // Unless required by applicable law or agreed to in writing, software |
| 9 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | // See the License for the specific language governing permissions and |
| 12 | // limitations under the License. |
| 13 | |
| 14 | //go:build !linux && !windows |
| 15 | // +build !linux,!windows |
| 16 | |
| 17 | package probing |
| 18 | |
| 19 | // Returns the length of an ICMP message. |
| 20 | func (p *Pinger) getMessageLength() int { |
| 21 | return p.Size + 8 |
| 22 | } |
| 23 | |
| 24 | // Attempts to match the ID of an ICMP packet. |
| 25 | func (p *Pinger) matchID(ID int) bool { |
| 26 | return ID == p.id |
| 27 | } |
| 28 | |
| 29 | // SetMark sets the SO_MARK socket option on outgoing ICMP packets. |
| 30 | // Setting this option requires CAP_NET_ADMIN. |
| 31 | func (c *icmpConn) SetMark(mark uint) error { |
| 32 | return ErrMarkNotSupported |
| 33 | } |
| 34 | |
| 35 | // SetMark sets the SO_MARK socket option on outgoing ICMP packets. |
| 36 | // Setting this option requires CAP_NET_ADMIN. |
| 37 | func (c *icmpv4Conn) SetMark(mark uint) error { |
| 38 | return ErrMarkNotSupported |
| 39 | } |
| 40 | |
| 41 | // SetMark sets the SO_MARK socket option on outgoing ICMP packets. |
| 42 | // Setting this option requires CAP_NET_ADMIN. |
| 43 | func (c *icmpV6Conn) SetMark(mark uint) error { |
| 44 | return ErrMarkNotSupported |
| 45 | } |
| 46 | |
| 47 | // SetDoNotFragment sets the do-not-fragment bit in the IP header of outgoing ICMP packets. |
| 48 | func (c *icmpConn) SetDoNotFragment() error { |
| 49 | return ErrDFNotSupported |
| 50 | } |
| 51 | |
| 52 | // SetDoNotFragment sets the do-not-fragment bit in the IP header of outgoing ICMP packets. |
| 53 | func (c *icmpv4Conn) SetDoNotFragment() error { |
| 54 | return ErrDFNotSupported |
| 55 | } |
| 56 | |
| 57 | // SetDoNotFragment sets the do-not-fragment bit in the IPv6 header of outgoing ICMPv6 packets. |
| 58 | func (c *icmpV6Conn) SetDoNotFragment() error { |
| 59 | return ErrDFNotSupported |
| 60 | } |
| 61 | |
| 62 | // No need for SetBroadcastFlag in non-linux OSes |
| 63 | func (c *icmpConn) SetBroadcastFlag() error { |
| 64 | return nil |
| 65 | } |
| 66 | |
| 67 | func (c *icmpv4Conn) SetBroadcastFlag() error { |
| 68 | return nil |
| 69 | } |
| 70 | |
| 71 | func (c *icmpV6Conn) SetBroadcastFlag() error { |
| 72 | return nil |
| 73 | } |
| 74 | |
| 75 | func (c *icmpv4Conn) InstallICMPIDFilter(id int) error { |
| 76 | return nil |
| 77 | } |
| 78 | |
| 79 | func (c *icmpV6Conn) InstallICMPIDFilter(id int) error { |
| 80 | return nil |
| 81 | } |