Documentation
¶
Overview ¶
Package tzsp provides a basic TaZmen Sniffer Protocol parser.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrHeaderTooShort is returned when size of the packet is lower 4 bytes. ErrHeaderTooShort = errors.New("header too short") // ErrUnsupportedVersion is returned when the packet version is not 1. ErrUnsupportedVersion = errors.New("unsupported version") // ErrUnsupportedPacketType is returned when the packet type is not supported // by this package. ErrUnsupportedPacketType = errors.New("unsupported packet type") // ErrTruncatedTag is returned when an EOF is reached while parsing a tag. ErrTruncatedTag = errors.New("truncated tag") // ErrMissingEndTag is returned when the no END tag is provided. ErrMissingEndTag = errors.New("packet truncated (no END tag)") )
Functions ¶
This section is empty.
Types ¶
type Packet ¶
Packet is a TZSP packet content.
type Proto ¶
type Proto uint16
Proto defines TZSP encapsulated protocol.
const ( // ProtoEthernet ethernet encapsulated protocol. ProtoEthernet Proto = 0x01 // ProtoIEEE80211 IEEE 802.11 encapsulated protocol. ProtoIEEE80211 Proto = 0x12 // ProtoPrismHeader Prisma encapsulated protocol. ProtoPrismHeader Proto = 0x77 // ProtoWLANAVS WLAN AVS encapsulated protocol. ProtoWLANAVS Proto = 0x7f )
type TagType ¶
type TagType uint8
TagType defines TZSP tag type.
const ( // TagPadding is a special tagged field which has neither tag length nor any tag data. // The receiver should ignore it. It is sometimes used to pack the frame to a word boundary. TagPadding TagType = 0x00 // TagEnd is a special tagged field which has neither tag length nor any tag data. // This means that there are no more tags. Following this tag, until the end // of the UDP packet, is the encapsulated frame. This is the only tag that is // required and must be included before the encapsulated data. No variable tags // can follow this one. TagEnd TagType = 0x01 // TagRawRSSI contains the raw RSSI obtained from the sensor. // The data is either a signed byte or signed short. TagRawRSSI TagType = 0x0a // TagSNR contains the raw noise obtained from the sensor. // The data is either a signed byte or signed short. TagSNR TagType = 0x0b // TagDataRate contains the data rate the encapsulated packet was transmitted at. TagDataRate TagType = 0x0c // TagTimestamp is the time the sensor MAC received the packet. // It is a 4-byte unsigned int. TagTimestamp TagType = 0xd // TagContentionFree is used to tell if the packet was sent in a contention free period. // It is a 1-byte unsigned byte. TagContentionFree TagType = 0x0f // TagDecrypted is used to tell if the packet was decrypted. It is a 1-byte unsigned byte. TagDecrypted TagType = 0x10 // TagFCSError is used to tell if the packet had an frame check sequence (FCS) error in reception. // It is a 1-byte unsigned byte. A one (0x01) specifies that there was an FCS error // on the decoding of the packet. A zero (0x00), or the exclusion of this field means // that there was no decoding error. All other values are reserved. TagFCSError TagType = 0x11 // TagRXChannel is the channel the sensor was on when it captured the packet. // It is NOT the channel the packet was transmitted on. This is stored as an unsigned byte. TagRXChannel TagType = 0x12 // TagPacketCount is a monotonically increasing packet count. It is stored as a four byte unsigned int. TagPacketCount TagType = 0x28 // TagRXFrameLength is the received packet length. It is not necessarily the // size of the transmitted packet, which may have been truncated. // This is stored as a two byte unsigned short. TagRXFrameLength TagType = 0x29 // TagWLANRadioHDRSerial is used by some sensor vendors to specify the serial // number or other unique identifier for the sensor or AP that captured the packet. // The is a variable length field. TagWLANRadioHDRSerial TagType = 0x3c )
type Type ¶
type Type uint8
Type defines TZSP packet type.
const ( // TypeReceivedTagList is received tag list. TypeReceivedTagList Type = iota // TypePacketForTransmit is packet for transmit. TypePacketForTransmit // TypeReserved is reserved. TypeReserved // TypeConfiguration is configuration. TypeConfiguration // TypeKeepAlive is Keep alive. TypeKeepAlive // TypePortOpener is Port opener. TypePortOpener )
Click to show internal directories.
Click to hide internal directories.