Documentation
¶
Index ¶
- Constants
- Variables
- func Checksum(bytes []byte) uint16
- type AddressList
- type DRPriority
- type EncodedSourceAddressFlag
- type GenerationID
- type Group
- type HelloMessage
- type HelloOption
- type Holdtime
- type JoinPruneMessage
- type LANPruneDelay
- type MessageType
- type OptionType
- type PIMHeader
- type PIMMessage
- type PIMServer
- type RawConner
- type SourceAddress
- type StateRefreshInterval
Constants ¶
const ( Hello = 0x00 Register = 0x01 RegisterStop = 0x02 JoinPrune = 0x03 Bootstrap = 0x04 Assert = 0x05 Graft = 0x06 GraftAck = 0x07 CadidateRPAdvertisement = 0x08 )
const ( OptionTypeHoldtime = 1 OptionTypeLANPruneDelay = 2 OptionTypeDRPriority = 19 OptionTypeGenerationID = 20 OptionTypeStateRefresh = 21 OptionTypeAddressList = 24 )
const ( SparseBit = 1 << 2 WildCardBit = 1 << 1 RPTreeBit = 1 << 0 )
Variables ¶
var ( PIMMessageType = gopacket.RegisterLayerType(1666, gopacket.LayerTypeMetadata{Name: "PIM", Decoder: gopacket.DecodeFunc(decodePim)}) HelloMessageType = gopacket.RegisterLayerType(1667, gopacket.LayerTypeMetadata{Name: "PIMHelloMessage", Decoder: gopacket.DecodeFunc(decodePimHelloMessage)}) JoinPruneMessageType = gopacket.RegisterLayerType(1668, gopacket.LayerTypeMetadata{Name: "PIMJoinPruneMessage", Decoder: gopacket.DecodeFunc(decodePimJoinPruneMessage)}) )
var ( // Anycast rendezvous point address used within DoubleZero RpAddress = net.IP([]byte{10, 0, 0, 0}) )
Functions ¶
func Checksum ¶
Check on this at some point https://github.com/google/gopacket/blob/b7d9dbd15ae4c4621a62119b0c682dc23061a8bc/layers/ip4.go#L158
Types ¶
type AddressList ¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 24 | Length = <Variable> | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Secondary Address 1 (Encoded-Unicast format) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Secondary Address N (Encoded-Unicast format) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (AddressList) Bytes ¶
func (a AddressList) Bytes() []byte
func (AddressList) NewAddressList ¶
func (a AddressList) NewAddressList(addresses []net.IP) AddressList
type DRPriority ¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 19 | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | DR Priority | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func NewDRPriority ¶
func NewDRPriority(drPriority uint32) DRPriority
func (DRPriority) Bytes ¶
func (d DRPriority) Bytes() []byte
type EncodedSourceAddressFlag ¶
type EncodedSourceAddressFlag uint8
type GenerationID ¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 20 | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Generation ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func NewGenerationID ¶
func NewGenerationID(genID uint32) GenerationID
func (GenerationID) Bytes ¶
func (g GenerationID) Bytes() []byte
type Group ¶
type HelloMessage ¶
type HelloMessage struct {
layers.BaseLayer
Holdtime uint16
PropDelay uint16
OverrideeInterval uint16
DRPriority uint32
GenerationID uint32
SecondaryAddress []net.IP
StateRefreshInterval uint8
Options []HelloOption
}
func (*HelloMessage) LayerType ¶
func (p *HelloMessage) LayerType() gopacket.LayerType
func (*HelloMessage) SerializeTo ¶
func (p *HelloMessage) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
type HelloOption ¶
type HelloOption struct {
Type OptionType
Length uint16
Value []byte
}
type Holdtime ¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 1 | Length = 2 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Holdtime | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func NewHoldtime ¶
type JoinPruneMessage ¶
type JoinPruneMessage struct {
layers.BaseLayer
UpstreamNeighborAddress net.IP
Reserved uint8
NumGroups uint8
Holdtime uint16
Groups []Group
}
func (*JoinPruneMessage) LayerType ¶
func (p *JoinPruneMessage) LayerType() gopacket.LayerType
func (*JoinPruneMessage) SerializeTo ¶
func (p *JoinPruneMessage) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
type LANPruneDelay ¶
type LANPruneDelay struct {
Type uint16
Length uint16
JoinSuppressionDisabled bool
PropDelay uint16
OverrideInterval uint16
}
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 2 | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |T| Propagation_Delay | Override_Interval | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func NewLANPruneDelay ¶
func NewLANPruneDelay(propDelay, overrideInterval uint16) LANPruneDelay
func (LANPruneDelay) Bytes ¶
func (l LANPruneDelay) Bytes() []byte
type MessageType ¶
type MessageType uint8
PIM Common Header
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |PIM Ver| Type | Reserved | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
type OptionType ¶
type OptionType uint16
type PIMHeader ¶
type PIMHeader struct {
Version uint8
Type MessageType
Reserved uint8
Checksum uint16
}
type PIMMessage ¶
func (*PIMMessage) LayerType ¶
func (p *PIMMessage) LayerType() gopacket.LayerType
func (*PIMMessage) SerializeTo ¶
func (p *PIMMessage) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
type PIMServer ¶
type PIMServer struct {
// contains filtered or unexported fields
}
func NewPIMServer ¶
func NewPIMServer() *PIMServer
type SourceAddress ¶
type SourceAddress struct {
AddressFamily uint8
EncodingType uint8
Flags uint8
MaskLength uint8
Address net.IP
}
func (SourceAddress) Bytes ¶
func (s SourceAddress) Bytes() []byte
type StateRefreshInterval ¶
type StateRefreshInterval struct {
Type uint16
Length uint16
Version uint8
Interval uint8
Reserved uint16
}
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type = 21 | Length = 4 | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Version = 1 | Interval | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func NewStateRefreshInterval ¶
func NewStateRefreshInterval(interval uint8) StateRefreshInterval
func (StateRefreshInterval) Bytes ¶
func (s StateRefreshInterval) Bytes() []byte