v6

package
v0.0.0-...-d485828 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DHCPv6ClientPort = 546
View Source
const DHCPv6ServerPort = 547
View Source
const MinPackSizeDHCPv6 = 10*4 +
	2*4 +

	2*4 // minimal DHCPv6 header size

This is the aprox. minimal size of a DHCP packet

View Source
const MinPackSizeMLDv6 = 48

Variables

This section is empty.

Functions

func CheckIANA

func CheckIANA(iana IANontemporaryAddress, clientInfo ClientInfoV6) bool

checkIANAs returns true if all addresses of the given IANA option are also in the clientInfo

func EncodeOptions

func EncodeOptions(iaid IAID, info ClientInfoV6) ([]byte, error)

EncodeOptions encodes the IP

Types

type ClientInfoV6

type ClientInfoV6 struct {
	Temporary bool
	IPAddrs   []net.IP
	//NextServer   net.IP
	//BootFileName string
	Timeouts struct {
		ValidLifetime     time.Duration
		PreferredLifetime time.Duration
		T1RenewalTime     time.Duration
		T2RebindingTime   time.Duration
	}
	Options struct {
		HostName          string
		DomainName        string
		DomainNameServers []net.IP
		NTPServers        []net.IP
	}
}

type DHCPV6Conn

type DHCPV6Conn struct {
	// contains filtered or unexported fields
}

func ListenDHCPv6

func ListenDHCPv6(iface net.Interface, daddrs []net.IP, laddr net.IP) (*DHCPV6Conn, error)

ListenDHCPv6 creates a connection that listens on the given interface for dhcpv6 traffic destined to the given address daddr, and sends replies from the given address laddr.

daddr may be a multicast address (or any other valid IPv6 address). If daddr is ::0, then we'll listen to all DHCPv6 message on the interface.

laddr must not be a multicast address, but may be any other valid IPv6 address (e.g. unicast or link-local address).

func (*DHCPV6Conn) Close

func (c *DHCPV6Conn) Close() error

func (*DHCPV6Conn) ReadFrom

func (c *DHCPV6Conn) ReadFrom() (layers.DHCPv6, net.IP, net.HardwareAddr, error)

ReadFrom returns the parsed packet, source IP, source MAC, error

func (*DHCPV6Conn) WriteTo

func (c *DHCPV6Conn) WriteTo(pack layers.DHCPv6, dstIP net.IP, dstMAC net.HardwareAddr) error

type IAID

type IAID [4]byte

func NewIAID

func NewIAID(iaid string) (IAID, error)

func (IAID) String

func (iaid IAID) String() string

type IANontemporaryAddress

type IANontemporaryAddress struct {
	IAID             IAID
	T1               uint32
	T2               uint32
	AddressOptions   iaAddresses
	StatusCodeOption statusCodeOption
	OtherOptions     iaOptions
}

func ParseIANAOption

func ParseIANAOption(ianaOpt layers.DHCPv6Option) IANontemporaryAddress

parseIANAOptions parses an IA Non-Temporary Address DHCPv6 Option

type MLDv2Filter

type MLDv2Filter uint8
const (
	MLDv2Include MLDv2Filter = 0
	MLDv2Exclude MLDv2Filter = 1
)

func (MLDv2Filter) String

func (m MLDv2Filter) String() string

type MulticastV6Conn

type MulticastV6Conn struct {
	// contains filtered or unexported fields
}

func (*MulticastV6Conn) JoinMulticast

func (c *MulticastV6Conn) JoinMulticast(multicastAddr net.IP)

join a multicast group

func (*MulticastV6Conn) LeaveMulticast

func (c *MulticastV6Conn) LeaveMulticast(multicastAddr net.IP)

leave a multicast group

func (*MulticastV6Conn) ReadFrom

func (c *MulticastV6Conn) ReadFrom() (l int, pack gopacket.Packet, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL