Documentation ¶
Index ¶
Constants ¶
View Source
const ( PF_ANCHOR_NAME_SIZE = 64 Pfioc_rulesetSize = 1092 )
View Source
const IOCPARM_MASK uint32 = 0x1fff
View Source
const IOC_GROUP_D = 68 // 'D'
View Source
const IOC_IN uint32 = 0x80000000
View Source
const IOC_INOUT uint32 = IOC_IN | IOC_OUT
View Source
const IOC_OUT uint32 = 0x40000000
View Source
const MAXPATHLEN = 1024
View Source
const (
PF_OUT = 2
)
View Source
const Pfioc_natlookSize = 84
View Source
const Pfioc_pooladdrSize = 1136
View Source
const Pfioc_ruleSize = 3104
Variables ¶
View Source
var ( DIOCBEGINADDRS uint32 = _IOC(IOC_INOUT, IOC_GROUP_D, 51, Pfioc_pooladdrSize) DIOCCHANGERULE uint32 = _IOC(IOC_INOUT, IOC_GROUP_D, 26, Pfioc_ruleSize) DIOCNATLOOK uint32 = _IOC(IOC_INOUT, IOC_GROUP_D, 23, Pfioc_natlookSize) DIOCGETRULESETS uint32 = _IOC(IOC_INOUT, IOC_GROUP_D, 58, Pfioc_rulesetSize) DIOCGETRULESET uint32 = _IOC(IOC_INOUT, IOC_GROUP_D, 59, Pfioc_rulesetSize) )
https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/bsd/net/pfvar.h (also https://www.mirbsd.org/htman/i386/man4/pf.htm) (also https://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/p/pf.html)
Functions ¶
Types ¶
type LookUpNATOpts ¶
type Pfctl ¶
type Pfctl struct {
// contains filtered or unexported fields
}
func (*Pfctl) AddAnchorIfNotExist ¶
func (p *Pfctl) AddAnchorIfNotExist(name string, ruleAction RuleAction) error
func (*Pfctl) DeleteAnchorIfExists ¶
func (p *Pfctl) DeleteAnchorIfExists(name string, ruleActions []RuleAction) error
type Pfioc_natlook ¶
type Pfioc_natlook struct {
// contains filtered or unexported fields
}
func (*Pfioc_natlook) GetIP ¶
func (natlook *Pfioc_natlook) GetIP() net.IP
func (*Pfioc_natlook) GetPort ¶
func (natlook *Pfioc_natlook) GetPort() int
func (*Pfioc_natlook) SetDstIP ¶
func (natlook *Pfioc_natlook) SetDstIP(ip net.IP)
func (*Pfioc_natlook) SetDstPort ¶
func (natlook *Pfioc_natlook) SetDstPort(port int32)
func (*Pfioc_natlook) SetSrcIP ¶
func (natlook *Pfioc_natlook) SetSrcIP(ip net.IP)
func (*Pfioc_natlook) SetSrcPort ¶
func (natlook *Pfioc_natlook) SetSrcPort(port int32)
type Pfioc_pooladdr ¶
type Pfioc_rule ¶
type Pfioc_rule struct { Action uint32 // type Action Ticket uint32 Pool_ticket uint32 Nr uint32 Anchor [MAXPATHLEN]byte Anchor_call [MAXPATHLEN]byte Padding__ [1040]byte // struct pf_rule rule; }
func (*Pfioc_rule) SetAction ¶
func (rule *Pfioc_rule) SetAction(action Action)
func (*Pfioc_rule) SetAnchor ¶
func (rule *Pfioc_rule) SetAnchor(name string)
func (*Pfioc_rule) SetAnchorCall ¶
func (rule *Pfioc_rule) SetAnchorCall(name string)
func (*Pfioc_rule) SetPoolTicket ¶
func (rule *Pfioc_rule) SetPoolTicket(pooladdr Pfioc_pooladdr)
func (*Pfioc_rule) SetRuleAction ¶
func (rule *Pfioc_rule) SetRuleAction(ruleAction RuleAction)
type Pfioc_ruleset ¶
type Pfioc_ruleset struct { Nr uint32 Path [MAXPATHLEN]byte Name [PF_ANCHOR_NAME_SIZE]byte }
func (Pfioc_ruleset) NameString ¶
func (ruleset Pfioc_ruleset) NameString() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.