
commit a1a37d335a8e89ac89d85c00c8585d3fc02e064a Author: Josh Baker <joshbaker77@gmail.com> Date: Thu Oct 5 07:36:54 2017 -0700 use symlink instead of copy commit 96399c2c92620f633611c778e5473200bfd48d41 Author: Josh Baker <joshbaker77@gmail.com> Date: Thu Oct 5 07:19:26 2017 -0700 use dep for vendoring
26 lines
538 B
Go
26 lines
538 B
Go
// Copyright 2014 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.
|
|
|
|
package ipv4
|
|
|
|
func (f *icmpFilter) accept(typ ICMPType) {
|
|
f.Data &^= 1 << (uint32(typ) & 31)
|
|
}
|
|
|
|
func (f *icmpFilter) block(typ ICMPType) {
|
|
f.Data |= 1 << (uint32(typ) & 31)
|
|
}
|
|
|
|
func (f *icmpFilter) setAll(block bool) {
|
|
if block {
|
|
f.Data = 1<<32 - 1
|
|
} else {
|
|
f.Data = 0
|
|
}
|
|
}
|
|
|
|
func (f *icmpFilter) willBlock(typ ICMPType) bool {
|
|
return f.Data&(1<<(uint32(typ)&31)) != 0
|
|
}
|