Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPortToFile ¶
AddPortToFile adds a port rule to a configuration file
func RemovePortFromFile ¶
RemovePortFromFile removes a port rule from a configuration file
Types ¶
type PortConfig ¶
type PortConfig struct {
TCPPorts []int // All TCP ports (from T and B rules)
UDPPorts []int // All UDP ports (from U and B rules)
AllRules []PortRule // All rules with metadata
PortMap map[int][]string // port -> protocols (for deduplication)
}
PortConfig holds all port rules loaded from configuration
func LoadPortsFromDirectory ¶
func LoadPortsFromDirectory(dir string) (*PortConfig, error)
LoadPortsFromDirectory loads all port configuration files from a directory Expected format: PORT/PROTOCOL where PROTOCOL is T (TCP), U (UDP), or B (Both) Example: 22/T, 53/B, 80/T
func LoadPortsFromFile ¶
func LoadPortsFromFile(filePath string) (*PortConfig, error)
LoadPortsFromFile loads port rules from a single configuration file
func (*PortConfig) GetAllPorts ¶
func (c *PortConfig) GetAllPorts() []int
GetAllPorts returns all unique ports regardless of protocol
func (*PortConfig) GetTCPPorts ¶
func (c *PortConfig) GetTCPPorts() []int
GetTCPPorts returns all TCP ports (from T and B rules)
func (*PortConfig) GetUDPPorts ¶
func (c *PortConfig) GetUDPPorts() []int
GetUDPPorts returns all UDP ports (from U and B rules)
Click to show internal directories.
Click to hide internal directories.