Versions in this module Expand all Collapse all v0 v0.1.3 Sep 11, 2023 v0.1.2 Sep 9, 2023 v0.1.0 Sep 6, 2023 Changes in this version + const SizeofDUPPacket + const SizeofEthernetPacket + const SizeofIPv4Packet + const SizeofTCPPacket + type DUPPacket struct + CheckSum uint16 + DstPort uint16 + Len uint16 + SrcPort uint16 + func NewDUPPacket(b [SizeofDUPPacket]byte) (udp DUPPacket) + func (udp DUPPacket) WireFormat() []byte + type EthernetPacket struct + FrameType uint16 + HeadMAC [2]HardwareAddr + func NewEthernetPacket(b [SizeofEthernetPacket]byte) (eth EthernetPacket) + func (eth EthernetPacket) WireFormat() []byte + type IPv4Packet struct + Checksum uint16 + Dst IPv4 + Flags uint8 + FragOff uint16 + ID uint16 + IHL uint8 + Options []byte + Protocol uint8 + Src IPv4 + TOS uint8 + TTL uint8 + TotalLen uint16 + Version uint8 + func NewIPv4Packet(b []byte) (ipv4 IPv4Packet, next uint8) + func (ipv4 IPv4Packet) String() string + func (ipv4 IPv4Packet) WireFormat() []byte + type TCPPacket struct + ACK bool + AckNum uint32 + CheckSum uint16 + DataOffset uint8 + DstPort uint16 + FIN bool + Options []byte + PSH bool + RST bool + Reserved uint8 + SYN bool + Sequence uint32 + SrcPort uint16 + URG bool + UrgentPtr uint16 + Window uint16 + func NewTCPPacket(b []byte) (tcp TCPPacket, next uint8) + func (tcp TCPPacket) WireFormat() []byte v0.0.2 Jul 8, 2023 v0.0.1 Jul 8, 2023 Changes in this version + const ARP_ETHERNETTYPE + const ARP_REPLY + const ARP_REQUEST + const DHCP_BOOTREPLY + const DHCP_BOOTREQUEST + const DHCP_ClientPort + const DHCP_Ethernet_LEN + const DHCP_Ethernet_TYPE + const DHCP_ServerPort + const SizeofArpPacket + const SizeofDhcpV4Packet + const SizeofIfAddrmsg + const SizeofIfInfomsg + const SizeofNlMsgerr + const SizeofNlMsghdr + const SizeofOptionsPacket + const SizeofRtAttr + const SizeofRtMsg + var Broadcast = HardwareAddr + var MagicCookie = [4]byte + type ArpPacket struct + FrameType uint16 + HardwareLen uint8 + HardwareType uint16 + HeadMAC [2]HardwareAddr + IPLen uint8 + Operation uint16 + ProtocolType uint16 + SendHardware HardwareAddr + SendIP IPv4 + TargetHardware HardwareAddr + TargetIP IPv4 + func NewArpPacket(b [SizeofArpPacket]byte) (arp *ArpPacket) + func (arp *ArpPacket) String() string + func (arp *ArpPacket) WireFormat() []byte + type DHCP_IPv4_TYPE uint8 + const DHCP_Cookie_Server + const DHCP_Default_Finger_Server + const DHCP_Domain_Name_Server + const DHCP_IRC_Server + const DHCP_Impress_Server + const DHCP_Information_Servers + const DHCP_LPR_Server + const DHCP_Log_Server + const DHCP_Mobile_IP_Home_Agent + const DHCP_NNTP_Server + const DHCP_Name_Server + const DHCP_NetBIOS_Distribution_Server + const DHCP_NetBIOS_Name_Server + const DHCP_Network_Information_Service_Servers + const DHCP_POP3_Server + const DHCP_Protocol_Servers + const DHCP_Requested_IP_Address + const DHCP_Resource_Location_Server + const DHCP_Router + const DHCP_SMTP_Server + const DHCP_STDA_Server + const DHCP_Server_Identifier + const DHCP_StreetTalk_Server + const DHCP_Subnet_Mask + const DHCP_Time_Server + const DHCP_WWW_Server + const DHCP_Window_System_Display_Manager + const DHCP_Window_System_Server + type DHCP_Message_Type uint8 + const DHCP_ACK + const DHCP_DECLINE + const DHCP_DISCOVER + const DHCP_INFORM + const DHCP_NAK + const DHCP_OFFER + const DHCP_RELEASE + const DHCP_REQUEST + type DHCP_NetBIOS_Node_Type uint8 + const DHCP_B_node + const DHCP_H_node + const DHCP_M_node + const DHCP_P_node + type DHCP_STRING_TYPE uint8 + const DHCP_Bootfile_Name + const DHCP_Error_Message + const DHCP_NetBIOS_Scope + const DHCP_Network_Information_ServiceS_Domain + const DHCP_Network_Information_Service_Domain + const DHCP_TFTP_Server_Name + const DHCP_Vendor_Class_Identifier + type DHCP_TIME_TYPE uint8 + const DHCP_IP_Address_Lease + const DHCP_Rebinding_Time + const DHCP_Renewal_Time + type DhcpV4Packet struct + CIAddr IPv4 + ChHardware [16]byte + FileName [128]byte + Flags uint16 + GIAddr IPv4 + HardwareLen uint8 + HardwareType uint8 + Hops uint8 + HostName [64]byte + Op uint8 + Options []*OptionsPacket + SIAddr IPv4 + Secs uint16 + XID uint32 + YIAddr IPv4 + func NewDhcpV4Packet(b []byte) (dhcp *DhcpV4Packet) + func (dhcp *DhcpV4Packet) WireFormat() []byte + type HardwareAddr [6]byte + func (h *HardwareAddr) String() string + type IPv4 [4]byte + func (v4 *IPv4) String() string + type IfAddrmsg syscall.IfAddrmsg + func NewIfAddrmsg(b [SizeofIfAddrmsg]byte) (addr *IfAddrmsg) + func (addr *IfAddrmsg) WireFormat() []byte + type IfInfomsg syscall.IfInfomsg + func NewIfInfomsg(b [SizeofIfInfomsg]byte) (info *IfInfomsg) + func (info *IfInfomsg) WireFormat() []byte + type NlMsgerr struct + Error int32 + Msg NlMsghdr + func NewNlMsgerr(b [SizeofNlMsgerr]byte) (nlmsg *NlMsgerr) + func (nlmsg *NlMsgerr) WireFormat() []byte + type NlMsghdr syscall.NlMsghdr + func NewNlMsghdr(b [SizeofNlMsghdr]byte) (hdr *NlMsghdr) + func (hdr *NlMsghdr) WireFormat() []byte + func (hdr *NlMsghdr) WireFormatToByte(b *[SizeofNlMsghdr]byte) + type OptionsPacket struct + Code uint8 + Length uint8 + Value []byte + func NewOptionsPacket(b []byte) (list []*OptionsPacket) + func SetDHCPIPv4(t DHCP_IPv4_TYPE, ip ...IPv4) *OptionsPacket + func SetDHCPMaximumMessageSize(size uint16) *OptionsPacket + func SetDHCPMessage(t DHCP_Message_Type) *OptionsPacket + func SetDHCPNetBIOSNodeType(t DHCP_NetBIOS_Node_Type) *OptionsPacket + func SetDHCPOptionsRequestList(codes ...uint8) *OptionsPacket + func SetDHCPString(t DHCP_STRING_TYPE, s string) *OptionsPacket + func SetDHCPTime(t DHCP_TIME_TYPE, d time.Duration) *OptionsPacket + func (opp *OptionsPacket) WireFormat() []byte + type RtMsg syscall.RtMsg + func NewRtMsg(b [SizeofRtMsg]byte) (rtmsg *RtMsg) + func (rtmsg *RtMsg) WireFormat() []byte