github.com/TeaOSLab/EdgeNode@v1.3.8/internal/firewalls/firewall_nftables_others.go (about) 1 // Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. 2 //go:build !linux 3 // +build !linux 4 5 package firewalls 6 7 import ( 8 "errors" 9 ) 10 11 func NewNFTablesFirewall() (*NFTablesFirewall, error) { 12 return nil, errors.New("not implemented") 13 } 14 15 type NFTablesFirewall struct { 16 } 17 18 // Name 名称 19 func (this *NFTablesFirewall) Name() string { 20 return "nftables" 21 } 22 23 // IsReady 是否已准备被调用 24 func (this *NFTablesFirewall) IsReady() bool { 25 return false 26 } 27 28 // IsMock 是否为模拟 29 func (this *NFTablesFirewall) IsMock() bool { 30 return true 31 } 32 33 // AllowPort 允许端口 34 func (this *NFTablesFirewall) AllowPort(port int, protocol string) error { 35 return nil 36 } 37 38 // RemovePort 删除端口 39 func (this *NFTablesFirewall) RemovePort(port int, protocol string) error { 40 return nil 41 } 42 43 // AllowSourceIP Allow把IP加入白名单 44 func (this *NFTablesFirewall) AllowSourceIP(ip string) error { 45 return nil 46 } 47 48 // RejectSourceIP 拒绝某个源IP连接 49 func (this *NFTablesFirewall) RejectSourceIP(ip string, timeoutSeconds int) error { 50 return nil 51 } 52 53 // DropSourceIP 丢弃某个源IP数据 54 func (this *NFTablesFirewall) DropSourceIP(ip string, timeoutSeconds int, async bool) error { 55 return nil 56 } 57 58 // RemoveSourceIP 删除某个源IP 59 func (this *NFTablesFirewall) RemoveSourceIP(ip string) error { 60 return nil 61 }