Documentation
¶
Index ¶
- Constants
- Variables
- func NewRTP(raw []byte) string
- func ParseDNS(d *layers.DNS) []byte
- func ParseRTCP(data []byte) ([]byte, []byte, string)
- func WSPayload(data []byte) (b []byte, err error)
- type DHCP
- type DNS
- type DNSQuestion
- type DNSResourceRecord
- type IPv4
- type IPv6
- type RTCP_Packet
- type RTCP_header
- type RTCP_report_block
- type RTCP_report_block_xr
- type TCP
- type UDP
- type WSHeader
- type WSOpCode
Constants ¶
View Source
const ( TYPE_RTCP_SR = 200 TYPE_RTCP_RR = 201 TYPE_RTCP_SDES = 202 TYPE_RTCP_BYE = 203 TYPE_RTCP_APP = 204 TYPE_RTCP_XR = 207 )
Variables ¶
View Source
var ( ErrHeaderLengthMSB = fmt.Errorf("ws header most significant bit must be 0") ErrHeaderLengthUnexpected = fmt.Errorf("ws header unexpected payload length bits") )
Errors used by ReadWSHeader.
Functions ¶
Types ¶
type DHCP ¶
type DHCP struct { Operation layers.DHCPOp HardwareType layers.LinkType HardwareLen uint8 HardwareOpts uint8 Xid uint32 Secs uint16 Flags uint16 ClientIP net.IP YourClientIP net.IP NextServerIP net.IP RelayAgentIP net.IP ClientHWAddr net.HardwareAddr ServerName []byte File []byte Options layers.DHCPOptions }
type DNS ¶
type DNS struct { ID uint16 `json:"id"` QR bool `json:"qr"` OpCode layers.DNSOpCode `json:"opcode"` AA bool `json:"aa"` // Authoritative answer TC bool `json:"tc"` // Truncated RD bool `json:"rd"` // Recursion desired RA bool `json:"ra"` // Recursion available Z uint8 `json:"z"` // For future use ResponseCode layers.DNSResponseCode `json:"rescode"` QDCount uint16 `json:"qdc"` // Expected questions ANCount uint16 `json:"anc"` // Expected answers NSCount uint16 `json:"nsc"` // Expected authorities ARCount uint16 `json:"arc"` // Expected additional records Questions []DNSQuestion `json:"questions,omitempty"` Answers []DNSResourceRecord `json:"answers,omitempty"` }
func (*DNS) MarshalJSON ¶
type DNSQuestion ¶
type DNSResourceRecord ¶
type IPv4 ¶
type IPv4 struct { Version uint8 `json:"version"` IHL uint8 `json:"ihl"` TOS uint8 `json:"tos"` Length uint16 `json:"len"` Id uint16 `json:"id"` Flags layers.IPv4Flag `json:"flags"` FragOffset uint16 `json:"offset"` TTL uint8 `json:"ttl"` Protocol layers.IPProtocol `json:"proto"` Checksum uint16 `json:"checksum"` SrcIP net.IP `json:"srcip"` DstIP net.IP `json:"dstip"` Options []layers.IPv4Option `json:"-"` Padding []byte `json:"padding,omitempty"` }
type IPv6 ¶
type IPv6 struct { Version uint8 `json:"version"` TrafficClass uint8 `json:"tc"` FlowLabel uint32 `json:"flow"` Length uint16 `json:"len"` NextHeader layers.IPProtocol `json:"proto"` HopLimit uint8 `json:"hoplimit"` SrcIP net.IP `json:"srcip"` DstIP net.IP `json:"dstip"` HopByHop *layers.IPv6HopByHop `json:"-"` }
type RTCP_Packet ¶
type RTCP_Packet struct { SenderInformation struct { Ntp_timestamp_MSW uint32 `json:"ntp_timestamp_sec"` Ntp_timestamp_LSW uint32 `json:"ntp_timestamp_usec"` Rtp_timestamp uint32 `json:"rtp_timestamp"` Pkt_count uint32 `json:"packets"` Octet_count uint32 `json:"octets"` } `json:"sender_information"` Ssrc uint32 `json:"ssrc"` Type uint8 `json:"type"` ReportCount uint8 `json:"report_count"` ReportBlocks []RTCP_report_block `json:"report_blocks"` ReportBlocksXr RTCP_report_block_xr `json:"report_blocks_xr"` Sdes_ssrc uint32 `json:"sdes_ssrc"` }
func (*RTCP_Packet) AddReportBlock ¶
func (rp *RTCP_Packet) AddReportBlock(rb RTCP_report_block) []RTCP_report_block
func (*RTCP_Packet) MarshalJSON ¶
func (rp *RTCP_Packet) MarshalJSON() ([]byte, error)
type RTCP_header ¶
type RTCP_report_block ¶
type RTCP_report_block struct { SourceSsrc uint32 `json:"source_ssrc"` Fraction_lost uint8 `json:"fraction_lost"` Cumulative_lost uint32 `json:"packets_lost"` // 24 bit Highest_seq_no uint32 `json:"highest_seq_no"` Jitter uint32 `json:"ia_jitter"` LastSR uint32 `json:"lsr"` Delay_last_SR uint32 `json:"dlsr"` }
type RTCP_report_block_xr ¶
type RTCP_report_block_xr struct { Type uint8 `json:"type"` ID uint32 `json:"id"` Fraction_lost uint8 `json:"fraction_lost"` Fraction_discard uint8 `json:"fraction_discard"` Burst_density uint8 `json:"burst_density"` Gap_density uint8 `json:"gap_density"` Burst_duration uint16 `json:"burst_duration"` Gap_duration uint16 `json:"gap_duration"` Round_trip_delay uint16 `json:"round_trip_delay"` End_system_delay uint16 `json:"end_system_delay"` }
type TCP ¶
type UDP ¶
Click to show internal directories.
Click to hide internal directories.