Documentation ¶
Overview ¶
package for simulation-emulation packet
Index ¶
- Constants
- type Child
- type MediaType
- type Msg_xfer
- type NIC
- type Parent
- type Protocol_node
- func (pn *Protocol_node) Add_child(child *Protocol_node, child_id int)
- func (pn *Protocol_node) Add_parent(parent *Protocol_node, parent_id int)
- func (pn *Protocol_node) Handle(context any, message any)
- func (pn *Protocol_node) Push_down(frame []byte, from int)
- func (pn *Protocol_node) Push_up(context Protocol_node_context, frame []byte, from int)
- type Protocol_node_context
- type SMP
Constants ¶
View Source
const ( PhysLink int = iota // wired point-to-point link Broadcast // wired broadcast link DirectedWireless // point-to-point wireless BroadcastWireless // broadcast wireless Meta // aggregated connection )
a nic in i2s2 can be facing different kinds of connections.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NIC ¶
type NIC struct { Id int // Id numbers are used to identify endpoints. // We maintain a map of endpoint ids to NIC struct pointers MAC net.Interface // core golang net package representing a MAC address SymMAC int // MACs that face Meta media have some symbolic representation give // the index into a map that points to something describing it MAC_is_symbolic bool // flag indicating whether MAC is physical (contained in MAC) // or symbolic (contained in SymMAC IPAdrs net.IP // using net packages IP representation, which includes IPv6 Media MediaType // endpoints have integer identities that identify other NICs Endpoints map[int]bool }
a NIC object captures the important details of a NIC
func (*NIC) AddEndpoint ¶
remember that this NIC connects to the NIC with id ep
func (*NIC) AddEndpointSet ¶
remember that this NIC connects to all the NIC in a set of them
type Protocol_node ¶
type Protocol_node struct { Name string Id int Xfer_up Msg_xfer Xfer_down Msg_xfer Parents map[int]Parent Children map[int]Child }
-------- Protocol_node realization ------
func (*Protocol_node) Add_child ¶
func (pn *Protocol_node) Add_child(child *Protocol_node, child_id int)
func (*Protocol_node) Add_parent ¶
func (pn *Protocol_node) Add_parent(parent *Protocol_node, parent_id int)
func (*Protocol_node) Handle ¶
func (pn *Protocol_node) Handle(context any, message any)
event handler for message delivered to Protocol_node 'context' and 'message' are from event, handed up from event scheduler
func (*Protocol_node) Push_down ¶
func (pn *Protocol_node) Push_down(frame []byte, from int)
func (*Protocol_node) Push_up ¶
func (pn *Protocol_node) Push_up(context Protocol_node_context, frame []byte, from int)
process a message from below, push up to all parents
type Protocol_node_context ¶
type Protocol_node_context struct { // what scheduling queue to use Evtm *evtm.EventManager // entry index is integer identity of source of message being // passed along Index int // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.