/usr/share/gocode/src/github.com/AudriusButkevicius/pfilter/misc.go is in golang-github-audriusbutkevicius-pfilter-dev 0.0.3-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | package pfilter
import (
"net"
"sync"
)
var (
maxPacketSize = 1500
bufPool = sync.Pool{
New: func() interface{} {
return make([]byte, maxPacketSize)
},
}
errTimeout = &netError{
msg: "i/o timeout",
timeout: true,
temporary: true,
}
errClosed = &netError{
msg: "use of closed network connection",
timeout: false,
temporary: false,
}
// Compile time interface assertion.
_ net.Error = (*netError)(nil)
)
type netError struct {
msg string
timeout bool
temporary bool
}
func (e *netError) Error() string { return e.msg }
func (e *netError) Timeout() bool { return e.timeout }
func (e *netError) Temporary() bool { return e.temporary }
type filteredConnList []*FilteredConn
func (r filteredConnList) Len() int { return len(r) }
func (r filteredConnList) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r filteredConnList) Less(i, j int) bool { return r[i].priority < r[j].priority }
type packet struct {
n int
addr net.Addr
err error
buf []byte
}
|