{"modulePath":"github.com/EMnify/vpp-agent","version":"v2.3.0+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package linuxcalls\n\n## Types\n\n```go\ntype IPTablesAPI interface {\n\t// Init initializes an iptables handler.\n\tInit() error\n\n\tIPTablesAPIWrite\n\tIPTablesAPIRead\n}\n```\nIPTablesAPI interface covers all methods inside linux calls package needed to manage linux iptables rules.\n\n```go\ntype IPTablesAPIRead interface {\n\t// ListRules lists all rules within the specified chain.\n\tListRules(protocol L3Protocol, table, chain string) (rules []string, err error)\n}\n```\nIPTablesAPIRead interface covers read methods inside linux calls package needed to manage linux iptables rules.\n\n```go\ntype IPTablesAPIWrite interface {\n\t// CreateChain creates an iptables chain in the specified table.\n\tCreateChain(protocol L3Protocol, table, chain string) error\n\n\t// DeleteChain deletes an iptables chain in the specified table.\n\tDeleteChain(protocol L3Protocol, table, chain string) error\n\n\t// SetChainDefaultPolicy sets default policy in the specified chain. Should be called only on FILTER tables.\n\tSetChainDefaultPolicy(protocol L3Protocol, table, chain, defaultPolicy string) error\n\n\t// AppendRule appends a rule into the specified chain.\n\tAppendRule(protocol L3Protocol, table, chain string, rule string) error\n\n\t// DeleteRule deletes a rule from the specified chain.\n\tDeleteRule(protocol L3Protocol, table, chain string, rule string) error\n\n\t// protocol deletes all rules within the specified chain.\n\tDeleteAllRules(proto L3Protocol, table, chain string) error\n}\n```\nIPTablesAPIWrite interface covers write methods inside linux calls package needed to manage linux iptables rules.\n\n```go\ntype IPTablesHandler struct {\n\t// contains filtered or unexported fields\n}\n```\nIPTablesHandler is a handler for all operations on Linux iptables / ip6tables.\n\n```go\nfunc NewIPTablesHandler() *IPTablesHandler\n```\nNewIPTablesHandler creates new instance of iptables handler.\n\n```go\nfunc (h *IPTablesHandler) AppendRule(protocol L3Protocol, table, chain string, rule string) error\n```\nAppendRule appends a rule into the specified chain.\n\n```go\nfunc (h *IPTablesHandler) CreateChain(protocol L3Protocol, table, chain string) error\n```\nCreateChain creates an iptables chain in the specified table.\n\n```go\nfunc (h *IPTablesHandler) DeleteAllRules(protocol L3Protocol, table, chain string) error\n```\nDeleteAllRules deletes all rules within the specified chain.\n\n```go\nfunc (h *IPTablesHandler) DeleteChain(protocol L3Protocol, table, chain string) error\n```\nDeleteChain deletes an iptables chain in the specified table.\n\n```go\nfunc (h *IPTablesHandler) DeleteRule(protocol L3Protocol, table, chain string, rule string) error\n```\nDeleteRule deletes a rule from the specified chain.\n\n```go\nfunc (h *IPTablesHandler) Init() error\n```\nInit initializes an iptables handler.\n\n```go\nfunc (h *IPTablesHandler) ListRules(protocol L3Protocol, table, chain string) (rules []string, err error)\n```\nListRules lists all rules within the specified chain.\n\n```go\nfunc (h *IPTablesHandler) SetChainDefaultPolicy(protocol L3Protocol, table, chain, defaultPolicy string) error\n```\nSetChainDefaultPolicy sets default policy in the specified chain. Should be called only on FILTER tables.\n\n```go\ntype L3Protocol byte\n```\nL3Protocol to differentiate between IPv4 and IPv6\n\n```go\nconst (\n\tProtocolIPv4 L3Protocol = iota\n\tProtocolIPv6\n)\n```\n\n","path":"github.com/EMnify/vpp-agent/plugins/linux/iptablesplugin/linuxcalls","name":"linuxcalls","synopsis":"","isRedistributable":true}
