Versions in this module Expand all Collapse all v0 v0.0.1 Feb 29, 2024 Changes in this version + var ICMPHeaderLen = 8 + var ICMPv6HeaderLen = 8 + var IPv6HeaderLen = 40 + var UDPHeaderLen = 8 + var Version6 = 6 + func Checksum(b []byte) uint16 + func GetLocalAddr(network string, ip net.IP) (net.Addr, error) + func IPv4HeaderToPseudoHeader(hdr *ipv4.Header, udplen int) ([]byte, error) + func IPv6HeaderToPseudoHeader(hdr *ipv6.Header) ([]byte, error) + type ICMP struct + Checksum uint16 + Code ICMPCode + Payload []byte + Type ICMPType + Unused uint32 + func NewICMP(b []byte) (*ICMP, error) + func (i *ICMP) UnmarshalBinary(b []byte) error + func (i ICMP) ComputeChecksum() (uint16, error) + func (i ICMP) MarshalBinary() ([]byte, error) + type ICMPCode uint8 + type ICMPType uint8 + var ICMPAddrMaskReply ICMPType = 18 + var ICMPAddrMaskReq ICMPType = 17 + var ICMPAlternateHostAddr ICMPType = 6 + var ICMPConversionErr ICMPType = 31 + var ICMPDestUnreachable ICMPType = 3 + var ICMPDomainNameReply ICMPType = 38 + var ICMPDomainNameReq ICMPType = 37 + var ICMPEchoReply ICMPType + var ICMPEchoRequest ICMPType = 8 + var ICMPExperimentalMobilityProtocols ICMPType = 41 + var ICMPIPv6IAmHere ICMPType = 34 + var ICMPIPv6WhereAreYou ICMPType = 33 + var ICMPMobileHostRedirect ICMPType = 32 + var ICMPMobileRegistrationReply ICMPType = 36 + var ICMPMobileRegistrationReq ICMPType = 35 + var ICMPParamProblem ICMPType = 12 + var ICMPPhoturis ICMPType = 40 + var ICMPRedirect ICMPType = 5 + var ICMPRouterAdv ICMPType = 9 + var ICMPRouterSol ICMPType = 10 + var ICMPSkipAlgoDiscoveryProtocol ICMPType = 39 + var ICMPSourceQuench ICMPType = 4 + var ICMPTimeExceeded ICMPType = 11 + var ICMPTimestampReply ICMPType = 14 + var ICMPTimestampReq ICMPType = 13 + var ICMPTraceroute ICMPType = 30 + type ICMPv6 struct + Checksum uint16 + Code ICMPv6Code + Type ICMPv6Type + Unused uint32 + func NewICMPv6(b []byte) (*ICMPv6, error) + func (i *ICMPv6) SetNext(l Layer) + func (i *ICMPv6) UnmarshalBinary(b []byte) error + func (i ICMPv6) MarshalBinary() ([]byte, error) + func (i ICMPv6) Next() Layer + type ICMPv6Code uint8 + var ICMPv6CodeAddressUnreachable ICMPv6Code = 2 + var ICMPv6CodeAdministrativelyProhibited ICMPv6Code = 1 + var ICMPv6CodeFragmentReassemblyTimeout ICMPv6Code = 1 + var ICMPv6CodeHopLimitExceeded ICMPv6Code + var ICMPv6CodeNoRouteToDestination ICMPv6Code + var ICMPv6CodePortUnreachable ICMPv6Code = 4 + type ICMPv6Type uint8 + var ICMPv6TypeCertificationPathAdvertisement ICMPv6Type = 149 + var ICMPv6TypeCertificationPathSolicitation ICMPv6Type = 148 + var ICMPv6TypeDestUnreachable ICMPv6Type = 1 + var ICMPv6TypeEchoReply ICMPv6Type = 129 + var ICMPv6TypeEchoRequest ICMPv6Type = 128 + var ICMPv6TypeExperimentalMobilityProtocols ICMPv6Type = 150 + var ICMPv6TypeFMIPv6Messages ICMPv6Type = 154 + var ICMPv6TypeGroupMembershipQuery ICMPv6Type = 130 + var ICMPv6TypeGroupMembershipReduction ICMPv6Type = 132 + var ICMPv6TypeGroupMembershipReport ICMPv6Type = 131 + var ICMPv6TypeHomeAgentAddressDiscoveryReplyMessage ICMPv6Type = 145 + var ICMPv6TypeHomeAgentAddressDiscoveryRequestMessage ICMPv6Type = 144 + var ICMPv6TypeICMPNodeInformationQuery ICMPv6Type = 139 + var ICMPv6TypeICMPNodeInformationResponse ICMPv6Type = 140 + var ICMPv6TypeInverseNeighborDiscoveryAdvertisementMessage ICMPv6Type = 142 + var ICMPv6TypeInverseNeighborDiscoverySolicitationMessage ICMPv6Type = 141 + var ICMPv6TypeMLDv2MulticastListenerReport ICMPv6Type = 143 + var ICMPv6TypeMobilePrefixAdvertisement ICMPv6Type = 147 + var ICMPv6TypeMobilePrefixSolicitation ICMPv6Type = 146 + var ICMPv6TypeMulticastRouterAdvertisement ICMPv6Type = 151 + var ICMPv6TypeMulticastRouterSolicitation ICMPv6Type = 152 + var ICMPv6TypeMulticastRouterTermination ICMPv6Type = 153 + var ICMPv6TypeNeighborAdvertisement ICMPv6Type = 135 + var ICMPv6TypeNeighborSolicitation ICMPv6Type = 136 + var ICMPv6TypePacketTooBig ICMPv6Type = 2 + var ICMPv6TypeParameterProblem ICMPv6Type = 4 + var ICMPv6TypeRedirect ICMPv6Type = 137 + var ICMPv6TypeRouterAdvertisement ICMPv6Type = 134 + var ICMPv6TypeRouterRenumbering ICMPv6Type = 138 + var ICMPv6TypeRouterSolicitation ICMPv6Type = 133 + var ICMPv6TypeTimeExceeded ICMPv6Type = 3 + type IPProto int + var ProtoICMP IPProto = 1 + var ProtoICMPv6 IPProto = 58 + var ProtoTCP IPProto = 6 + var ProtoUDP IPProto = 17 + type IPv6 struct + Dst net.IP + FlowLabel int + HopLimit int + IPinICMP bool + NextHeader IPProto + PayloadLen int + Src net.IP + TrafficClass int + Version int + func NewIPv6(b []byte) (*IPv6, error) + func (h *IPv6) SetNext(l Layer) + func (h *IPv6) UnmarshalBinary(b []byte) error + func (h IPv6) MarshalBinary() ([]byte, error) + func (h IPv6) Next() Layer + type Layer interface + MarshalBinary func() ([]byte, error) + Next func() Layer + SetNext func(Layer) + UnmarshalBinary func(data []byte) error + type Raw struct + Data []byte + func NewRaw(b []byte) (*Raw, error) + func (r *Raw) UnmarshalBinary(b []byte) error + func (r Raw) MarshalBinary() ([]byte, error) + func (r Raw) Next() Layer + func (r Raw) SetNext(Layer) + type UDP struct + Csum uint16 + Dst uint16 + Len uint16 + Payload []byte + PseudoHeader []byte + Src uint16 + func NewUDP(b []byte) (*UDP, error) + func (h *UDP) MarshalBinary() ([]byte, error) + func (h *UDP) UnmarshalBinary(b []byte) error