Documentation
¶
Index ¶
- Constants
- func GetErrno() int
- func RelayCall(f RelayedFunc, context string, e ErrorFunc) error
- func XtablesLock(wait bool, maxSeconds uint) (result bool, osErr error)
- func XtablesUnlock() (result bool, osErr error)
- type ErrorFunc
- type Not
- type RelayedCall
- type RelayedFunc
- type Rule
- type XtChainLabel
- type XtCounters
Constants ¶
View Source
const ( // the constants are copied from #define declarations in libiptc.h IPTC_LABEL_ACCEPT = "ACCEPT" IPTC_LABEL_DROP = "DROP" IPTC_LABEL_QUEUE = "QUEUE" IPTC_LABEL_RETURN = "RETURN" )
Variables ¶
This section is empty.
Functions ¶
func GetErrno ¶
func GetErrno() int
GetErrno returns the OS-level errno value. It is used internally to properly report about errors.
func RelayCall ¶
func RelayCall(f RelayedFunc, context string, e ErrorFunc) error
RelayCall will perform the C call on a OS-locked goroutine, serially.
func XtablesLock ¶
XtablesLock acquires the same lock that a call to `iptables --wait` would.
func XtablesUnlock ¶
XtablesUnlock releases an iptables lock previously acquired with XtablesLock().
Types ¶
type ErrorFunc ¶
type ErrorFunc func() string
ErrorFunc generates an error based on a libip*tc_strerror call. Used internally to report about errors.
type RelayedCall ¶
type RelayedCall struct { // Context is the C function being called. Context string // Func is the function that performs the wrapper around the C function call that does the conversion of input/output parameters. Func RelayedFunc // Error is the specific ErrorFunc needed to extract an error after the C call. Error ErrorFunc }
RelayedCall
type RelayedFunc ¶
type RelayedFunc func() bool
RelayedFunc is a function that returns false if there is an 'errno' to query about. Used internally to perform all lib*iptc calls serially.
type Rule ¶
type Rule struct { Src *net.IPNet Dest *net.IPNet InDev string OutDev string Not struct { Src Not Dest Not InDev Not OutDev Not } Target string XtCounters }
Rule is a complete iptables rule descriptor.
type XtCounters ¶
type XtCounters struct { // Pcnt is the packet counter. Pcnt uint64 // Bcnt is the byte counter. Bcnt uint64 }
XtCounters contains packet and byte counters.
Click to show internal directories.
Click to hide internal directories.