Documentation ¶
Index ¶
- Constants
- Variables
- func IsDefaultChain(chain Chain) bool
- func NeedQuotes(option MatchModuleOption) bool
- type Chain
- type IPTableRules
- type Manager
- type MatchModule
- type MatchModuleOption
- type MatchOption
- type Protocol
- type ProtocolFamily
- type Rule
- type Table
- type TableData
- type Target
- type TargetOption
Constants ¶
View Source
const ( ChainPreRouting Chain = "PREROUTING" ChainInput = "INPUT" ChainForward = "FORWARD" ChainOutput = "OUTPUT" ChainPostRouting = "POSTROUTING" )
View Source
const ( TargetMarkOptionSetMark TargetOption = "--set-xmark" TargetMarkOptionXorMark = "--xor-mark" TargetMarkOptionOrMark = "--or-mark" TargetMasqueradeOptionFullyRandomized = "--random-fully" )
View Source
const ( TargetAccept Target = "ACCEPT" TargetDrop = "DROP" TargetReturn = "RETURN" TargetMasquerade = "MASQUERADE" TargetMark = "MARK" )
View Source
const ( MatchModuleComment MatchModule = "comment" MatchModuleAddrType = "addrtype" MatchModuleSet = "set" MatchModuleMark = "mark" MatchModuleConnTrack = "conntrack" MatchModulePhysDev = "physdev" )
View Source
const ( MatchModuleCommentOptionComment MatchModuleOption = "--comment" MatchModuleMarkOptionMark = "--mark" MatchModuleSetOptionSet = "--match-set" MatchModuleConnTrackOptionConnState = "--ctstate" MatchModulePhysDevOptionPhysDevIsIn = "--physdev-is-in" MatchModuleAddrTypeOptionSrcType = "--src-type" MatchModuleAddrTypeOptionDstType = "--dst-type" )
View Source
const ( ProtocolTCP Protocol = "tcp" ProtocolUDP = "udp" ProtocolSCTP = "sctp" )
View Source
const ChainTemplate = `` /* 363-byte string literal not displayed */
View Source
const MatchTemplate = `` /* 618-byte string literal not displayed */
View Source
const ProtocolTemplate = `` /* 209-byte string literal not displayed */
View Source
const RuleTemplate = `` /* 1004-byte string literal not displayed */
View Source
const TableTemplate = `` /* 390-byte string literal not displayed */
View Source
const Template = `` /* 160-byte string literal not displayed */
Variables ¶
View Source
var DefaultChains = []Chain{ChainPreRouting, ChainInput, ChainForward, ChainOutput, ChainPostRouting}
Functions ¶
func IsDefaultChain ¶
func NeedQuotes ¶
func NeedQuotes(option MatchModuleOption) bool
Types ¶
type IPTableRules ¶
type IPTableRules struct {
NatRules []Rule
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) AddChain ¶
func (m *Manager) AddChain(chain Chain, table Table, protocolFamily ProtocolFamily)
type MatchModule ¶
type MatchModule string
type MatchModuleOption ¶
type MatchModuleOption string
type MatchOption ¶
type MatchOption struct { Module MatchModule ModuleOption MatchModuleOption Value string Inverted bool }
type ProtocolFamily ¶
type ProtocolFamily string
const ( ProtocolFamilyIPv4 ProtocolFamily = "inet" ProtocolFamilyIPv6 = "inet6" )
type Rule ¶
type Rule struct { From Chain To Chain Target Target TargetOption TargetOption TargetOptionValue string Protocol Protocol MatchOptions []MatchOption }
type TableData ¶
type TableData struct { Table Table Chains []Chain Rules []Rule ProtocolFamily ProtocolFamily }
type TargetOption ¶
type TargetOption string
Click to show internal directories.
Click to hide internal directories.