Documentation ¶
Index ¶
- Constants
- Variables
- type Converter
- func (c *Converter) GetJSONRulesFromIptableFile(tableName string, npmCacheFile string, iptableSaveFile string) ([][]byte, error)
- func (c *Converter) GetJSONRulesFromIptables(tableName string) ([][]byte, error)
- func (c *Converter) GetProtobufRulesFromIptable(tableName string) ([]*pb.RuleResponse, error)
- func (c *Converter) GetProtobufRulesFromIptableFile(tableName string, npmCacheFile string, iptableSaveFile string) ([]*pb.RuleResponse, error)
- func (c *Converter) NpmCache() error
- func (c *Converter) NpmCacheFromFile(npmCacheJSONFile string) error
- type Input
- type InputType
- type Tuple
Constants ¶
const ( // ANY string ANY string = "ANY" // MinUnsortedIPSetLength indicates the minimum length of an unsorted IP set's origin (i.e dst,dst) MinUnsortedIPSetLength int = 3 // Base indicate the base for ParseInt Base int = 10 // Bitsize indicate the bitsize for ParseInt Bitsize int = 32 )
Variables ¶
var AzureNPMChains = []string{
"AZURE-NPM-INGRESS-DROPS",
"AZURE-NPM-INGRESS-FROM",
"AZURE-NPM-INGRESS-PORT",
"AZURE-NPM-EGRESS-DROPS",
"AZURE-NPM-EGRESS-PORT",
"AZURE-NPM-EGRESS-TO",
}
AzureNPMChains contains names of chain that will be include in the result of the converter
var MembersBytes = []byte("Members")
MembersBytes is the string "Members" in bytes array
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter struct { ListMap map[string]string // key: hash(value), value: one of namespace, label of namespace, multiple values SetMap map[string]string // key: hash(value), value: one of label of pods, cidr, namedport AzureNPMChains map[string]bool NPMCache *cache.NPMCache }
Converter struct
func (*Converter) GetJSONRulesFromIptableFile ¶
func (c *Converter) GetJSONRulesFromIptableFile( tableName string, npmCacheFile string, iptableSaveFile string, ) ([][]byte, error)
GetJSONRulesFromIptableFile returns a list of json rules from npmCache and iptable-save files.
func (*Converter) GetJSONRulesFromIptables ¶
GetJSONRulesFromIptables returns a list of json rules from node
func (*Converter) GetProtobufRulesFromIptable ¶
func (c *Converter) GetProtobufRulesFromIptable(tableName string) ([]*pb.RuleResponse, error)
GetProtobufRulesFromIptable returns a list of protobuf rules from node.
func (*Converter) GetProtobufRulesFromIptableFile ¶
func (c *Converter) GetProtobufRulesFromIptableFile( tableName string, npmCacheFile string, iptableSaveFile string, ) ([]*pb.RuleResponse, error)
GetProtobufRulesFromIptableFile returns a list of protobuf rules from npmCache and iptable-save files.
func (*Converter) NpmCacheFromFile ¶
NpmCacheFromFile initialize NPM cache from file.
type InputType ¶
type InputType int32
InputType indicates allowed typle for source and destination input
func GetInputType ¶
GetInputType returns the type of the input for GetNetworkTuple.
type Tuple ¶
type Tuple struct { RuleType string `json:"ruleType"` Direction string `json:"direction"` SrcIP string `json:"srcIP"` SrcPort string `json:"srcPort"` DstIP string `json:"dstIP"` DstPort string `json:"dstPort"` Protocol string `json:"protocol"` }
Tuple struct
func GetNetworkTuple ¶
GetNetworkTuple read from node's NPM cache and iptables-save and returns a list of hit rules between the source and the destination in JSON format and a list of tuples from those rules.
func GetNetworkTupleFile ¶
func GetNetworkTupleFile( src, dst *Input, npmCacheFile string, iptableSaveFile string, ) ([][]byte, []*Tuple, error)
GetNetworkTupleFile read from NPM cache and iptables-save files and returns a list of hit rules between the source and the destination in JSON format and a list of tuples from those rules.