Versions in this module Expand all Collapse all v0 v0.5.0 Jun 22, 2021 Changes in this version + var TcpRxCh chan *TcpRxMessage + var TcpTxCh chan *TcpTxMessage + func RandU32() uint32 type EthType + const EtARP + const EtIPV4 + const EtIPV6 type IP + func V4FromByte(b [V4AddrLen]byte) IP type ProtocolNumber + const PnICMP + const PnTCP + const PnUDP + type TcpRxMessage struct + Dst [V4AddrLen]byte + Iface *Iface + ProtoNum uint8 + RawSegment []byte + Src [V4AddrLen]byte + type TcpTxMessage struct v0.4.0 Jun 8, 2021 Changes in this version + var IcmpDeadLetterQueue chan *IcmpQueueEntry + func RandU16() uint16 + func RandU8() uint8 + type IcmpQueueEntry struct + Payload []byte v0.3.2 Jun 7, 2021 Changes in this version + const EthAddrLen + const EthFrameLenMax + const EthFrameLenMin + const EthHdrLen + const EthPayloadLenMax + const EthPayloadLenMin + const LoopbackBroadcast + const LoopbackIpAddr + const LoopbackNetmask + const LoopbackNetwork + const V4AddrLen + const V6AddrLen + var ArpRxCh chan *ArpRxMessage + var ArpTxCh chan *ArpTxMessage + var EthAny = EthAddr + var EthBroadcast = EthAddr + var EthRxCh chan *EthMessage + var EthTxCh chan *EthMessage + var IcmpRxCh chan *IcmpRxMessage + var IcmpTxCh chan *IcmpTxMessage + var IpRxCh chan *EthMessage + var IpTxCh chan *IpMessage + var V4Any = V4(0, 0, 0, 0) + var V4Broadcast = V4(255, 255, 255, 255) + func Checksum(b []byte) uint16 + func WriteFrame(fd int, dst EthAddr, src EthAddr, typ EthType, payload []byte) psErr.E + type AddrFamily int + const V4AddrFamily + const V6AddrFamily + func (v AddrFamily) String() string + type ArpRxMessage struct + Dev IDevice + Packet []byte + type ArpTxMessage struct + IP IP + Iface *Iface + type DevFlag uint16 + const BroadcastFlag + const LoopbackFlag + const NeedArpFlag + const UpFlag + type DevType int + const EthernetDevice + const LoopbackDevice + const NullDevice + func (v DevType) String() string + type Device struct + Addr_ EthAddr + Flag_ DevFlag + MTU_ uint16 + Name_ string + Priv_ Privilege + Type_ DevType + func (p *Device) Addr() EthAddr + func (p *Device) Down() + func (p *Device) Equal(pp IDevice) bool + func (p *Device) Flag() DevFlag + func (p *Device) IsUp() bool + func (p *Device) MTU() uint16 + func (p *Device) Name() string + func (p *Device) Priv() Privilege + func (p *Device) Type() DevType + func (p *Device) Up() + type EthAddr [EthAddrLen]byte + func (v EthAddr) Equal(vv EthAddr) bool + func (v EthAddr) String() string + type EthHdr struct + Dst EthAddr + Src EthAddr + Type EthType + type EthMessage struct + Content []byte + Dev IDevice + Type EthType + func ReadFrame(fd int, addr EthAddr) (*EthMessage, psErr.E) + type EthType uint16 + const ARP + const IPv4 + const IPv6 + func (v EthType) String() string + type IDevice interface + Addr func() EthAddr + Close func() psErr.E + Down func() + Equal func(dev IDevice) bool + Flag func() DevFlag + IsUp func() bool + MTU func() uint16 + Name func() string + Open func() psErr.E + Poll func() psErr.E + Priv func() Privilege + Transmit func(dst EthAddr, payload []byte, typ EthType) psErr.E + Type func() DevType + Up func() + type IP []byte + func LongestIP(ip1 IP, ip2 IP) IP + func ParseIP(s string) IP + func V4(a, b, c, d byte) IP + func (v IP) Equal(x IP) bool + func (v IP) EqualV4(v4 [V4AddrLen]byte) bool + func (v IP) Mask(mask IP) IP + func (v IP) String() string + func (v IP) ToV4() (ip [V4AddrLen]byte) + type IcmpRxMessage struct + Dev IDevice + Dst [V4AddrLen]byte + Payload []byte + Src [V4AddrLen]byte + type IcmpTxMessage struct + Code uint8 + Content uint32 + Dst IP + Payload []byte + Src IP + Type uint8 + type Iface struct + Broadcast IP + Dev IDevice + Family AddrFamily + Netmask IP + Unicast IP + type IpHdr struct + Checksum uint16 + Dst [V4AddrLen]byte + ID uint16 + Offset uint16 + Options [0]byte + Protocol ProtocolNumber + Src [V4AddrLen]byte + TOS uint8 + TTL uint8 + TotalLen uint16 + VHL uint8 + type IpMessage struct + Dst IP + Packet []byte + ProtoNum ProtocolNumber + Src IP + type MockIDevice struct + func NewMockIDevice(ctrl *gomock.Controller) *MockIDevice + func (m *MockIDevice) Addr() EthAddr + func (m *MockIDevice) Close() error.E + func (m *MockIDevice) Down() + func (m *MockIDevice) EXPECT() *MockIDeviceMockRecorder + func (m *MockIDevice) Equal(dev IDevice) bool + func (m *MockIDevice) Flag() DevFlag + func (m *MockIDevice) IsUp() bool + func (m *MockIDevice) MTU() uint16 + func (m *MockIDevice) Name() string + func (m *MockIDevice) Open() error.E + func (m *MockIDevice) Poll() error.E + func (m *MockIDevice) Priv() Privilege + func (m *MockIDevice) Transmit(dst EthAddr, payload []byte, typ EthType) error.E + func (m *MockIDevice) Type() DevType + func (m *MockIDevice) Up() + type MockIDeviceMockRecorder struct + func (mr *MockIDeviceMockRecorder) Addr() *gomock.Call + func (mr *MockIDeviceMockRecorder) Close() *gomock.Call + func (mr *MockIDeviceMockRecorder) Down() *gomock.Call + func (mr *MockIDeviceMockRecorder) Equal(dev interface{}) *gomock.Call + func (mr *MockIDeviceMockRecorder) Flag() *gomock.Call + func (mr *MockIDeviceMockRecorder) IsUp() *gomock.Call + func (mr *MockIDeviceMockRecorder) MTU() *gomock.Call + func (mr *MockIDeviceMockRecorder) Name() *gomock.Call + func (mr *MockIDeviceMockRecorder) Open() *gomock.Call + func (mr *MockIDeviceMockRecorder) Poll() *gomock.Call + func (mr *MockIDeviceMockRecorder) Priv() *gomock.Call + func (mr *MockIDeviceMockRecorder) Transmit(dst, payload, typ interface{}) *gomock.Call + func (mr *MockIDeviceMockRecorder) Type() *gomock.Call + func (mr *MockIDeviceMockRecorder) Up() *gomock.Call + type Privilege struct + FD int + Name string + type ProtocolNumber uint8 + func (v ProtocolNumber) String() string + type V4Addr [V4AddrLen]byte + func (v V4Addr) String() string v0.3.1 Jun 6, 2021