Documentation
¶
Index ¶
- func WithNetworkBroadcastAddress(broadcastAddress *Address) GenericApplier[*Network]
- func WithNetworkDropPercent(dropPercent float32) GenericApplier[*Network]
- func WithNetworkName(name string) GenericApplier[*Network]
- func WithNetworkTrafficLogger(trafficLogger TrafficLogger) GenericApplier[*Network]
- func WithNodeLan(lan NodeNetworkReference) GenericApplier[*Node]
- func WithNodeName(name string) GenericApplier[*Node]
- func WithNodePromiscuous(promiscuous bool) GenericApplier[*Node]
- func WithNodeSpoofing(spoofing bool) GenericApplier[*Node]
- type IPNetwork
- type IPNode
- type IPRouter
- type IPRouterNode
- func (n *IPRouterNode) Confirmation(args Args, kwArgs KWArgs) error
- func (n *IPRouterNode) Format(s fmt.State, v rune)
- func (n *IPRouterNode) ProcessPDU(pdu PDU) error
- func (d *IPRouterNode) Serialize() ([]byte, error)
- func (d *IPRouterNode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *IPRouterNode) String() string
- type Network
- type NetworkNode
- type Node
- func (n *Node) AlternateString() (string, bool)
- func (n *Node) Format(s fmt.State, v rune)
- func (n *Node) Indication(args Args, kwArgs KWArgs) error
- func (d *Node) Serialize() ([]byte, error)
- func (d *Node) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (n *Node) SetPromiscuous(promiscuous bool)
- func (n *Node) SetSpoofing(spoofing bool)
- func (d *Node) String() string
- type NodeNetworkReference
- type TrafficLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithNetworkBroadcastAddress ¶
func WithNetworkBroadcastAddress(broadcastAddress *Address) GenericApplier[*Network]
func WithNetworkDropPercent ¶
func WithNetworkName ¶
func WithNetworkTrafficLogger ¶
func WithNetworkTrafficLogger(trafficLogger TrafficLogger) GenericApplier[*Network]
func WithNodeLan ¶
func WithNodeLan(lan NodeNetworkReference) GenericApplier[*Node]
func WithNodeName ¶
func WithNodePromiscuous ¶
func WithNodeSpoofing ¶
Types ¶
type IPNetwork ¶
type IPNetwork struct {
*Network
}
IPNetwork instances are Network objects where the addresses on the
network are tuples that would be used for sockets like ('1.2.3.4', 5). The first node added to the network sets the broadcast address, like ('1.2.3.255', 5) and the other nodes must have the same tuple.
func NewIPNetwork ¶
func (*IPNetwork) AddNode ¶
func (n *IPNetwork) AddNode(node NetworkNode)
AddNode Add a node to this network, let the node know which network it's on.
type IPNode ¶
type IPNode struct { *Node // contains filtered or unexported fields }
An IPNode is a Node where the address is an Address that has an address
tuple and a broadcast tuple that would be used for socket communications.
func (*IPNode) SerializeWithWriteBuffer ¶
type IPRouter ¶
type IPRouter struct {
// contains filtered or unexported fields
}
func NewIPRouter ¶
func (*IPRouter) AddNetwork ¶
func (*IPRouter) ProcessPDU ¶
func (n *IPRouter) ProcessPDU(node *IPRouterNode, pdu PDU)
type IPRouterNode ¶
type IPRouterNode struct { ClientContract // contains filtered or unexported fields }
func NewIPRouterNode ¶
func (*IPRouterNode) Confirmation ¶
func (n *IPRouterNode) Confirmation(args Args, kwArgs KWArgs) error
func (*IPRouterNode) ProcessPDU ¶
func (n *IPRouterNode) ProcessPDU(pdu PDU) error
func (*IPRouterNode) Serialize ¶
func (d *IPRouterNode) Serialize() ([]byte, error)
func (*IPRouterNode) SerializeWithWriteBuffer ¶
func (d *IPRouterNode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*IPRouterNode) String ¶
func (d *IPRouterNode) String() string
type Network ¶
type Network struct { *DefaultRFormatter // contains filtered or unexported fields }
func NewNetwork ¶
func (*Network) AddNode ¶
func (n *Network) AddNode(node NetworkNode)
AddNode Add a node to this network, let the node know which network it's on.
func (*Network) ProcessPDU ¶
ProcessPDU Process a PDU by sending a copy to each node as dictated by the addressing and if a node is promiscuous.
func (*Network) RemoveNode ¶
func (n *Network) RemoveNode(node NetworkNode)
RemoveNode Remove a node from this network.
type NetworkNode ¶
type Node ¶
type Node struct { ServerContract // contains filtered or unexported fields }
func (*Node) AlternateString ¶
func (*Node) Indication ¶
func (*Node) SerializeWithWriteBuffer ¶
func (*Node) SetPromiscuous ¶
func (*Node) SetSpoofing ¶
type NodeNetworkReference ¶
type NodeNetworkReference interface { fmt.Stringer AddNode(node NetworkNode) ProcessPDU(pdu PDU) error }
NodeNetworkReference allows Network and IPNetwork to be used from Node.
type TrafficLogger ¶
type TrafficLogger interface {
Call(args Args)
}
Click to show internal directories.
Click to hide internal directories.