Documentation
¶
Index ¶
- Constants
- type Action
- type ActionType
- type Endpoint
- type EndpointType
- type Hop
- type Link
- type LinkAttribute
- type LinkType
- type NetNode
- func (n *NetNode) ActionOf(input *Link) *Action
- func (n *NetNode) AddSuspicion(level SuspicionLevel, msg string)
- func (n *NetNode) DoAction(action *Action)
- func (n *NetNode) GetID() string
- func (n *NetNode) GetSuspicions() []Suspicion
- func (n *NetNode) GetType() NetNodeType
- func (n *NetNode) MaxSuspicionLevel() SuspicionLevel
- type NetNodeAction
- type NetNodeType
- type NullAttribute
- type Packet
- type PacketPath
- type Protocol
- type SimpleLinkAttribute
- type Suspicion
- type SuspicionLevel
- type Transmission
- type VEthLinkAttribute
Constants ¶
View Source
const ( ActionTypeService = "service" ActionTypeServe = "serve" ActionTypeForward = "forward" ActionTypeSend = "send" )
View Source
const ( SuspicionLevelInfo = iota SuspicionLevelWarning SuspicionLevelCritical SuspicionLevelFatal )
View Source
const ( EndpointTypePod = "pod" EndpointTypeNode = "node" EndpointTypeService = "service" EndpointTypeLoadbalancer = "lb" EndpointTypeExternal = "external" )
View Source
const ( NetNodeTypePod = "pod" NetNodeTypeNode = "node" NetNodeTypeExternal = "external" NetNodeTypeGeneric = "generic" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { Type ActionType Input *Link Outputs []*Link }
func ActionForward ¶
func ActionSend ¶
func ActionServe ¶
func ActionService ¶
type ActionType ¶
type ActionType string
type Endpoint ¶
type Endpoint struct { IP string `json:"ip"` Type EndpointType `json:"type"` Port uint16 `json:"port"` }
type EndpointType ¶
type EndpointType string
type Hop ¶
type Hop struct { Type NetNodeType ID string }
type Link ¶
type Link struct { Type LinkType Source *NetNode Destination *NetNode Packet *Packet SourceAttribute LinkAttribute DestinationAttribute LinkAttribute Level int // for print }
type LinkAttribute ¶
type NetNode ¶
type NetNode struct { Type NetNodeType ID string Actions map[*Link]*Action Suspicions []Suspicion // contains filtered or unexported fields }
func NewNetNode ¶
func NewNetNode(id string, nodeType NetNodeType) *NetNode
func (*NetNode) AddSuspicion ¶
func (n *NetNode) AddSuspicion(level SuspicionLevel, msg string)
func (*NetNode) GetSuspicions ¶
func (*NetNode) GetType ¶
func (n *NetNode) GetType() NetNodeType
func (*NetNode) MaxSuspicionLevel ¶
func (n *NetNode) MaxSuspicionLevel() SuspicionLevel
type NetNodeAction ¶
type NetNodeAction interface { Send(dst Endpoint, protocol Protocol) ([]Transmission, error) Receive(upstream *Link) ([]Transmission, error) }
type NetNodeType ¶
type NetNodeType string
type NullAttribute ¶
type NullAttribute struct { }
func (NullAttribute) GetAttrs ¶
func (a NullAttribute) GetAttrs() map[string]string
type Packet ¶
type PacketPath ¶
type PacketPath struct {
// contains filtered or unexported fields
}
func NewPacketPath ¶
func NewPacketPath(origin *NetNode) *PacketPath
func (*PacketPath) GetLinkLabel ¶
func (p *PacketPath) GetLinkLabel(link *Link, action *Action) string
func (*PacketPath) GetOriginNode ¶
func (p *PacketPath) GetOriginNode() *NetNode
func (*PacketPath) Links ¶
func (p *PacketPath) Links() []*Link
func (*PacketPath) Nodes ¶
func (p *PacketPath) Nodes() []*NetNode
func (*PacketPath) Paths ¶
func (p *PacketPath) Paths() string
type SimpleLinkAttribute ¶
func (SimpleLinkAttribute) GetAttrs ¶
func (a SimpleLinkAttribute) GetAttrs() map[string]string
type Suspicion ¶
type Suspicion struct { Level SuspicionLevel Message string }
type SuspicionLevel ¶
type SuspicionLevel int
func (SuspicionLevel) String ¶
func (s SuspicionLevel) String() string
type Transmission ¶
type VEthLinkAttribute ¶
type VEthLinkAttribute struct { SimpleLinkAttribute PeerIndex int }
func (VEthLinkAttribute) GetAttrs ¶
func (v VEthLinkAttribute) GetAttrs() map[string]string
Click to show internal directories.
Click to hide internal directories.