Documentation ¶
Index ¶
- Constants
- type Config
- type IGMP
- func (i *IGMP) LayerContents() []byte
- func (i *IGMP) LayerPayload() []byte
- func (i *IGMP) LayerType() gopacket.LayerType
- func (igmp *IGMP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
- func (igmp *IGMP) SerializeToIGMPv2(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
- func (igmp *IGMP) SerializeToIGMPv3(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
- type IGMPReporter
- type IGMPv3GroupRecord
- type IGMPv3GroupRecordType
- type MembershipItem
- type TestingOptions
Constants ¶
const ( // IN = "inside" // OUT = "outside" OUT side = 1 IN side = 2 ALTOUT side = 3 OUTSTR = "outside" ALTOUTSTR = "altOutside" INSTR = "inside" OutOrAltKey int = 1 TTL ttlType = 1 GRATUITOUS ttlType = 2 QUERY ttlType = 3 IGMPHostsQuad = "224.0.0.22" IGMPHosts destIP = 22 // 224.0.0.22 QueryHost destIP = 666 // In this case we use the query source IP )
const ( IGMPv2SizeCst = 8 IGMPv3BaseSizeCst = 24 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { InIntName string OutIntName string AltOutIntName string UnicastDst string ProxyOutToIn bool ProxyInToOut bool UnicastProxyInToOut bool QueryNotify bool MembershipReportsFromNetwork bool MembershipReportsToNetwork bool UnicastMembershipReports bool SocketReadDeadLine time.Duration ChannelSize int Gratuitous time.Duration QueryTime time.Duration HackPayloadFilename string DebugLevel int Testing TestingOptions }
type IGMP ¶
type IGMP struct { layers.BaseLayer Type layers.IGMPType MaxResponseTime time.Duration Checksum uint16 GroupAddress net.IP SupressRouterProcessing bool RobustnessValue uint8 IntervalTime time.Duration SourceAddresses []net.IP NumberOfGroupRecords uint16 NumberOfSources uint16 GroupRecords []IGMPv3GroupRecord Version uint8 // IGMP protocol version }
func (*IGMP) LayerContents ¶
func (*IGMP) LayerPayload ¶
func (*IGMP) SerializeTo ¶
func (igmp *IGMP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.
func (*IGMP) SerializeToIGMPv2 ¶
func (igmp *IGMP) SerializeToIGMPv2(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
SerializeToIGMPv2 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 | Max Resp Time | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Group Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
func (*IGMP) SerializeToIGMPv3 ¶
func (igmp *IGMP) SerializeToIGMPv3(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error
SerializeToIGMPv3 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 = 0x11 | Max Resp Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Group Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Resv |S| QRV | QQIC | Number of Sources (N) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Source Address [1] | +- -+ | Source Address [2] | +- . -+ . . . . . . +- -+ | Source Address [N] | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
type IGMPReporter ¶
type IGMPReporter struct { IntName map[side]string IntOutName *sync.Map Interfaces []side AltOutExists bool OutsideInterfaces map[side]bool TimerDuration map[ttlType]time.Duration NetIF map[side]*net.Interface NetIFIndex map[int]side NetIP map[side]net.IP NetAddr map[side]netip.Addr ContMsg map[side]*ipv4.ControlMessage QueryNotifyCh chan struct{} MembershipReportFromNetworkCh chan []MembershipItem MembershipReportToNetworkCh chan []MembershipItem OutInterfaceSelectorCh chan side WG *sync.WaitGroup // contains filtered or unexported fields }
func (IGMPReporter) Run ¶
func (r IGMPReporter) Run(ctx context.Context)
func (IGMPReporter) RunSelfQuery ¶
func (r IGMPReporter) RunSelfQuery()
type IGMPv3GroupRecord ¶
type IGMPv3GroupRecord struct { Type IGMPv3GroupRecordType AuxDataLen uint8 // this should always be 0 as per IGMPv3 spec. NumberOfSources uint16 MulticastAddress net.IP SourceAddresses []net.IP AuxData uint32 // NOT USED }
IGMPv3GroupRecord stores individual group records for a V3 Membership Report message.
type IGMPv3GroupRecordType ¶
type IGMPv3GroupRecordType uint8
const ( IGMPIsIn IGMPv3GroupRecordType = 0x01 // Type MODE_IS_INCLUDE, source addresses x IGMPIsEx IGMPv3GroupRecordType = 0x02 // Type MODE_IS_EXCLUDE, source addresses x IGMPToIn IGMPv3GroupRecordType = 0x03 // Type CHANGE_TO_INCLUDE_MODE, source addresses x IGMPToEx IGMPv3GroupRecordType = 0x04 // Type CHANGE_TO_EXCLUDE_MODE, source addresses x IGMPAllow IGMPv3GroupRecordType = 0x05 // Type ALLOW_NEW_SOURCES, source addresses x IGMPBlock IGMPv3GroupRecordType = 0x06 // Type BLOCK_OLD_SOURCES, source addresses x )
func (IGMPv3GroupRecordType) String ¶
func (i IGMPv3GroupRecordType) String() string