| // 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 netbsd openbsd |
| type rawICMPFilter struct { |
| func (f *rawICMPFilter) set(typ ICMPType, block bool) { |
| f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31) |
| f.Filt[typ>>5] |= 1 << (uint32(typ) & 31) |
| func (f *rawICMPFilter) setAll(block bool) { |
| func (f *rawICMPFilter) willBlock(typ ICMPType) bool { |
| return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0 |