Add Chain API for managing nftables chains, including Add, Create, Delete, Clear, and Rename operations.
This commit is contained in:
21
chain/policy.go
Normal file
21
chain/policy.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package chain
|
||||
|
||||
import "fmt"
|
||||
|
||||
type Policy int8
|
||||
|
||||
const (
|
||||
PolicyAccept Policy = iota + 1
|
||||
PolicyDrop
|
||||
)
|
||||
|
||||
func (p Policy) String() string {
|
||||
switch p {
|
||||
case PolicyAccept:
|
||||
return "accept"
|
||||
case PolicyDrop:
|
||||
return "drop"
|
||||
default:
|
||||
return fmt.Sprintf("unknown policy %d", p)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user