1
// Copyright 2013 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.
5
// +build darwin freebsd netbsd openbsd
9
type sysICMPFilter struct {
13
func (f *sysICMPFilter) set(typ ICMPType, block bool) {
15
f.Filt[typ>>5] &^= 1 << (uint32(typ) & 31)
17
f.Filt[typ>>5] |= 1 << (uint32(typ) & 31)
21
func (f *sysICMPFilter) setAll(block bool) {
22
for i := range f.Filt {
31
func (f *sysICMPFilter) willBlock(typ ICMPType) bool {
32
return f.Filt[typ>>5]&(1<<(uint32(typ)&31)) == 0