Documentation
¶
Index ¶
- type ArchitectureType
- type DUID
- type DUIDEN
- type DUIDLL
- type DUIDLLT
- type DUIDType
- type DUIDUUID
- type InterfaceType
- type Message
- type MessageType
- type Option
- type OptionBootFileParameters
- type OptionBootFileURL
- type OptionClientID
- type OptionClientNetworkInterfaceIdentifier
- type OptionClientSystemArchitectureType
- type OptionDNSServer
- type OptionElapsedTime
- type OptionIAAddress
- func (o *OptionIAAddress) AddOption(opt Option)
- func (o OptionIAAddress) HasOption(t OptionType) Option
- func (o OptionIAAddress) Len() uint16
- func (o OptionIAAddress) Marshal() ([]byte, error)
- func (o *OptionIAAddress) SetOption(newopt Option)
- func (o OptionIAAddress) String() string
- func (o OptionIAAddress) Type() OptionType
- type OptionIANA
- type OptionNextHop
- func (o *OptionNextHop) AddOption(opt Option)
- func (o OptionNextHop) HasOption(t OptionType) Option
- func (o OptionNextHop) Len() uint16
- func (o OptionNextHop) Marshal() ([]byte, error)
- func (o *OptionNextHop) SetOption(newopt Option)
- func (o OptionNextHop) String() string
- func (o OptionNextHop) Type() OptionType
- type OptionOptionRequest
- type OptionRapidCommit
- type OptionRoutePrefix
- func (o *OptionRoutePrefix) AddOption(opt Option)
- func (o OptionRoutePrefix) HasOption(t OptionType) Option
- func (o OptionRoutePrefix) Len() uint16
- func (o OptionRoutePrefix) Marshal() ([]byte, error)
- func (o *OptionRoutePrefix) SetOption(newopt Option)
- func (o OptionRoutePrefix) String() string
- func (o OptionRoutePrefix) Type() OptionType
- type OptionServerID
- type OptionStatusCode
- type OptionType
- type OptionUserClass
- type OptionVendorClass
- type Options
- type RoutePreference
- type StatusCode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArchitectureType ¶
type ArchitectureType uint16
const ( ArchitectureTypeIntelx86PC ArchitectureType = iota ArchitectureTypeNECPC98 ArchitectureTypeEFIItanium ArchitectureTypeDECAlpha ArchitectureTypeArcx86 ArchitectureTypeIntelLeanClient ArchitectureTypeEFIIA32 ArchitectureTypeEFIBC ArchitectureTypeEFIXscale ArchitectureTypeEFIx8664 )
Architecture types as described at https://tools.ietf.org/html/rfc4578#section-2.1
func (ArchitectureType) String ¶
func (s ArchitectureType) String() string
type DUID ¶
DUID acts as an interface of other DUIDs
func DecodeDUID ¶
DecodeDUID tries to decode given byte slice to one of the defined DUIDTypes
type DUIDEN ¶
DUIDEN - as described in https://tools.ietf.org/html/rfc3315#section-9.3 NOTE: currently not implemented
type DUIDLL ¶
type DUIDLL struct {
HardwareType uint16
LinkLayerAddress net.HardwareAddr
}
DUIDLL - as described in https://tools.ietf.org/html/rfc3315#section-9.4
type DUIDLLT ¶
type DUIDLLT struct {
HardwareType uint16
Time time.Time
LinkLayerAddress net.HardwareAddr
}
DUIDLLT - as described in https://tools.ietf.org/html/rfc3315#section-9.2
type DUIDType ¶
type DUIDType uint8
DUIDType represents the type of DUID
const ( // RFC3315 DUIDTypeLLT DUIDType DUIDTypeEN DUIDTypeLL // RFC6355 DUIDTypeUUID )
DUID types as described in https://tools.ietf.org/html/rfc3315#section-9.1 and https://tools.ietf.org/html/rfc6355#section-4
type DUIDUUID ¶
DUIDUUID as described in https://tools.ietf.org/html/rfc6355#section-4
type InterfaceType ¶
type InterfaceType uint8
const (
InterfaceTypeUNDI InterfaceType
)
Interface types as described at https://tools.ietf.org/html/rfc4578#section-2.2
func (InterfaceType) String ¶
func (s InterfaceType) String() string
type Message ¶
type Message struct {
MessageType MessageType
Xid uint32
Options Options
}
Message represents a DHCPv6 message
func DecodeMessage ¶
DecodeMessage takes DHCPv6 message bytes and tries to decode the message and optionally its options and returns decoded Message or error if any occurs
func (Message) HasOption ¶
func (m Message) HasOption(t OptionType) Option
HasOption returns Option if this Message has OptionType t as option or nil otherwise
type MessageType ¶
type MessageType uint8
MessageType describes DHCPv6 message types
const ( MessageTypeSolicit MessageType MessageTypeAdvertise MessageTypeRequest MessageTypeConfirm MessageTypeRenew MessageTypeRebind MessageTypeReply MessageTypeRelease MessageTypeDecline MessageTypeReconfigure MessageTypeInformationRequest MessageTypeRelayForward MessageTypeRelayReply )
add constants for all DHCPv6 message types from RFC3315
func (MessageType) String ¶
func (t MessageType) String() string
type Option ¶
type Option interface {
String() string
Len() uint16
Type() OptionType
Marshal() ([]byte, error)
}
Option -- interface to build various DHCPv6 options on
type OptionBootFileParameters ¶
type OptionBootFileParameters struct {
Parameters []string
}
OptionBootFileParameters implements the Boot File URL option described in https://tools.ietf.org/html/rfc5970#section-3.2
func (OptionBootFileParameters) Len ¶
func (o OptionBootFileParameters) Len() uint16
Len returns the length in bytes of OptionBootFileParameters's body
func (OptionBootFileParameters) Marshal ¶
func (o OptionBootFileParameters) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionBootFileParameters
func (OptionBootFileParameters) String ¶
func (o OptionBootFileParameters) String() string
func (OptionBootFileParameters) Type ¶
func (o OptionBootFileParameters) Type() OptionType
Type returns OptionTypeBootFileParameters
type OptionBootFileURL ¶
type OptionBootFileURL struct {
URL string
}
OptionBootFileURL implements the Boot File URL option described in https://tools.ietf.org/html/rfc5970#section-3.1
func (OptionBootFileURL) Len ¶
func (o OptionBootFileURL) Len() uint16
Len returns the length in bytes of OptionBootFileURL's body
func (OptionBootFileURL) Marshal ¶
func (o OptionBootFileURL) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionBootFileURL
func (OptionBootFileURL) String ¶
func (o OptionBootFileURL) String() string
func (OptionBootFileURL) Type ¶
func (o OptionBootFileURL) Type() OptionType
Type returns OptionTypeBootFileURL
type OptionClientID ¶
type OptionClientID struct {
DUID DUID
}
OptionClientID implements the Client Identifier option as described at https://tools.ietf.org/html/rfc3315#section-22.2
func (OptionClientID) Len ¶
func (o OptionClientID) Len() uint16
Len returns the length in bytes of OptionClientID's body
func (OptionClientID) Marshal ¶
func (o OptionClientID) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionClientID
func (OptionClientID) String ¶
func (o OptionClientID) String() string
func (OptionClientID) Type ¶
func (o OptionClientID) Type() OptionType
Type returns OptionTypeClientID
type OptionClientNetworkInterfaceIdentifier ¶
type OptionClientNetworkInterfaceIdentifier struct {
InterfaceType InterfaceType
RevisionMajor uint8
RevisionMinor uint8
}
OptionClientNetworkInterfaceIdentifier implements the Client Network Interface Identifier option as described in https://tools.ietf.org/html/rfc5970#section-3.4
func (OptionClientNetworkInterfaceIdentifier) Len ¶
func (o OptionClientNetworkInterfaceIdentifier) Len() uint16
Len returns the length in bytes of OptionClientNetworkInterfaceIdentifier's body
func (OptionClientNetworkInterfaceIdentifier) Marshal ¶
func (o OptionClientNetworkInterfaceIdentifier) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionTypeClientNetworkInterfaceIdentifier
func (OptionClientNetworkInterfaceIdentifier) String ¶
func (o OptionClientNetworkInterfaceIdentifier) String() string
func (OptionClientNetworkInterfaceIdentifier) Type ¶
func (o OptionClientNetworkInterfaceIdentifier) Type() OptionType
Type returns OptionTypeClientNetworkInterfaceIdentifier
type OptionClientSystemArchitectureType ¶
type OptionClientSystemArchitectureType struct {
Types []ArchitectureType
}
OptionClientSystemArchitectureType implements the Client System Architecture Type option as described in https://tools.ietf.org/html/rfc5970#section-3.3
func (OptionClientSystemArchitectureType) Len ¶
func (o OptionClientSystemArchitectureType) Len() uint16
Len returns the length in bytes of OptionClientSystemArchitectureType's body
func (OptionClientSystemArchitectureType) Marshal ¶
func (o OptionClientSystemArchitectureType) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionClientSystemArchitectureType
func (OptionClientSystemArchitectureType) String ¶
func (o OptionClientSystemArchitectureType) String() string
func (OptionClientSystemArchitectureType) Type ¶
func (o OptionClientSystemArchitectureType) Type() OptionType
Type returns OptionTypeClientSystemArchitectureType
type OptionDNSServer ¶
OptionDNSServer implements the DNS Server option described in https://tools.ietf.org/html/rfc3646#section-3
func (OptionDNSServer) Len ¶
func (o OptionDNSServer) Len() uint16
Len returns the length in bytes of OptionDNSServer's body
func (OptionDNSServer) Marshal ¶
func (o OptionDNSServer) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionDNSServer
func (OptionDNSServer) String ¶
func (o OptionDNSServer) String() string
func (OptionDNSServer) Type ¶
func (o OptionDNSServer) Type() OptionType
Type returns OptionTypeDNSServer
type OptionElapsedTime ¶
OptionElapsedTime implements the Elapsed Time option as described at https://tools.ietf.org/html/rfc3315#section-22.9
func (OptionElapsedTime) Len ¶
func (o OptionElapsedTime) Len() uint16
Len returns the length in bytes of OptionElapsedTime's body
func (OptionElapsedTime) Marshal ¶
func (o OptionElapsedTime) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionElapsedTime
func (OptionElapsedTime) String ¶
func (o OptionElapsedTime) String() string
func (OptionElapsedTime) Type ¶
func (o OptionElapsedTime) Type() OptionType
Type returns OptionTypeElapsedTime
type OptionIAAddress ¶
type OptionIAAddress struct {
Address net.IP
PreferredLifetime time.Duration
ValidLifetime time.Duration
// contains filtered or unexported fields
}
OptionIAAddress implements the IA Address option as described at https://tools.ietf.org/html/rfc3315#section-22.6
func (*OptionIAAddress) AddOption ¶
func (o *OptionIAAddress) AddOption(opt Option)
AddOption adds given Option to slice of Options, even if this type occurs in the list already. To prevent duplicate option types in the list, you will probably want to use SetOption instead
func (OptionIAAddress) HasOption ¶
func (o OptionIAAddress) HasOption(t OptionType) Option
HasOption returns first occurance of option with type t or nil if no options with that type are in Options
func (OptionIAAddress) Len ¶
func (o OptionIAAddress) Len() uint16
Len returns the length in bytes of OptionIAAddress's body
func (OptionIAAddress) Marshal ¶
func (o OptionIAAddress) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionIAAddress
func (*OptionIAAddress) SetOption ¶
func (o *OptionIAAddress) SetOption(newopt Option)
SetOption sets given Option to slice of Options, replacing first potential duplicate option of the same type
func (OptionIAAddress) String ¶
func (o OptionIAAddress) String() string
func (OptionIAAddress) Type ¶
func (o OptionIAAddress) Type() OptionType
Type returns OptionTypeIAAddress
type OptionIANA ¶
type OptionIANA struct {
IAID uint32
T1 time.Duration // delay before Renew
T2 time.Duration // delay before Rebind
// contains filtered or unexported fields
}
OptionIANA implements the Identity Association for Non-temporary Addresses option as described at https://tools.ietf.org/html/rfc3315#section-22.4
func (*OptionIANA) AddOption ¶
func (o *OptionIANA) AddOption(opt Option)
AddOption adds given Option to slice of Options, even if this type occurs in the list already. To prevent duplicate option types in the list, you will probably want to use SetOption instead
func (OptionIANA) HasOption ¶
func (o OptionIANA) HasOption(t OptionType) Option
HasOption returns first occurance of option with type t or nil if no options with that type are in Options
func (OptionIANA) Len ¶
func (o OptionIANA) Len() uint16
Len returns the length in bytes of OptionIANA's body
func (*OptionIANA) Marshal ¶
func (o *OptionIANA) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionIANA
func (*OptionIANA) SetOption ¶
func (o *OptionIANA) SetOption(newopt Option)
SetOption sets given Option to slice of Options, replacing first potential duplicate option of the same type
func (OptionIANA) String ¶
func (o OptionIANA) String() string
type OptionNextHop ¶
OptionNextHop implements the Next Hop option proposed in https://tools.ietf.org/html/draft-ietf-mif-dhcpv6-route-option-05#section-5.1
func (*OptionNextHop) AddOption ¶
func (o *OptionNextHop) AddOption(opt Option)
AddOption adds given Option to slice of Options, even if this type occurs in the list already. To prevent duplicate option types in the list, you will probably want to use SetOption instead
func (OptionNextHop) HasOption ¶
func (o OptionNextHop) HasOption(t OptionType) Option
HasOption returns first occurance of option with type t or nil if no options with that type are in Options
func (OptionNextHop) Len ¶
func (o OptionNextHop) Len() uint16
Len returns the length in bytes of OptionNextHop's body
func (OptionNextHop) Marshal ¶
func (o OptionNextHop) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionNextHop
func (*OptionNextHop) SetOption ¶
func (o *OptionNextHop) SetOption(newopt Option)
SetOption sets given Option to slice of Options, replacing first potential duplicate option of the same type
func (OptionNextHop) String ¶
func (o OptionNextHop) String() string
type OptionOptionRequest ¶
type OptionOptionRequest struct {
Options []OptionType
}
OptionOptionRequest implements the Option Request option as described at https://tools.ietf.org/html/rfc3315#section-22.7
func (OptionOptionRequest) HasOption ¶
func (o OptionOptionRequest) HasOption(t OptionType) bool
HasOption returns Option if this IA_NA option has OptionType t as option or nil otherwise
func (OptionOptionRequest) Len ¶
func (o OptionOptionRequest) Len() uint16
Len returns the length in bytes of OptionOptionRequest's body
func (OptionOptionRequest) Marshal ¶
func (o OptionOptionRequest) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionOptionRequest
func (OptionOptionRequest) String ¶
func (o OptionOptionRequest) String() string
func (OptionOptionRequest) Type ¶
func (o OptionOptionRequest) Type() OptionType
Type returns OptionTypeOptionRequest
type OptionRapidCommit ¶
type OptionRapidCommit struct{}
OptionRapidCommit implements the Rapid Commit option as described at https://tools.ietf.org/html/rfc3315#section-22.14 this option acts basically as a flag for the message carrying it and has no further contents
func (OptionRapidCommit) Len ¶
func (o OptionRapidCommit) Len() uint16
Len returns the length in bytes of OptionRapidCommit's body
func (OptionRapidCommit) Marshal ¶
func (o OptionRapidCommit) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionRapidCommit
func (OptionRapidCommit) String ¶
func (o OptionRapidCommit) String() string
func (OptionRapidCommit) Type ¶
func (o OptionRapidCommit) Type() OptionType
Type returns OptionTypeRapidCommit
type OptionRoutePrefix ¶
type OptionRoutePrefix struct {
RouteLifetime uint32
PrefixLength uint8
Preference RoutePreference
Metric uint8
Prefix net.IP
// contains filtered or unexported fields
}
OptionRoutePrefix implements the Next Hop option proposed in https://tools.ietf.org/html/draft-ietf-mif-dhcpv6-route-option-05#section-5.2
func (*OptionRoutePrefix) AddOption ¶
func (o *OptionRoutePrefix) AddOption(opt Option)
AddOption adds given Option to slice of Options, even if this type occurs in the list already. To prevent duplicate option types in the list, you will probably want to use SetOption instead
func (OptionRoutePrefix) HasOption ¶
func (o OptionRoutePrefix) HasOption(t OptionType) Option
HasOption returns first occurance of option with type t or nil if no options with that type are in Options
func (OptionRoutePrefix) Len ¶
func (o OptionRoutePrefix) Len() uint16
Len returns the length in bytes of OptionNextHop's body
func (OptionRoutePrefix) Marshal ¶
func (o OptionRoutePrefix) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionRoutePrefix
func (*OptionRoutePrefix) SetOption ¶
func (o *OptionRoutePrefix) SetOption(newopt Option)
SetOption sets given Option to slice of Options, replacing first potential duplicate option of the same type
func (OptionRoutePrefix) String ¶
func (o OptionRoutePrefix) String() string
func (OptionRoutePrefix) Type ¶
func (o OptionRoutePrefix) Type() OptionType
Type returns OptionTypeNextHop
type OptionServerID ¶
type OptionServerID struct {
DUID DUID
}
OptionServerID implements the Server Identifier option as described at https://tools.ietf.org/html/rfc3315#section-22.3
func (OptionServerID) Equal ¶
func (o OptionServerID) Equal(opt Option) bool
Equal returns true if given ServerID option is byte-wise identical or false otherwise
func (OptionServerID) Len ¶
func (o OptionServerID) Len() uint16
Len returns the length in bytes of OptionServerID's body
func (OptionServerID) Marshal ¶
func (o OptionServerID) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionServerID
func (OptionServerID) String ¶
func (o OptionServerID) String() string
func (OptionServerID) Type ¶
func (o OptionServerID) Type() OptionType
Type returns OptionTypeServerID
type OptionStatusCode ¶
type OptionStatusCode struct {
Code StatusCode
Message string
}
OptionStatusCode implements the Status Code option as described at https://tools.ietf.org/html/rfc3315#section-22.13
func (OptionStatusCode) Len ¶
func (o OptionStatusCode) Len() uint16
Len returns the length in bytes of OptionStatusCode's body
func (OptionStatusCode) Marshal ¶
func (o OptionStatusCode) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionStatusCode
func (OptionStatusCode) String ¶
func (o OptionStatusCode) String() string
func (OptionStatusCode) Type ¶
func (o OptionStatusCode) Type() OptionType
Type returns OptionTypeStatusCode
type OptionType ¶
type OptionType uint8
OptionType describes DHCPv6 option types
const ( // RFC3315 OptionTypeClientID OptionType OptionTypeServerID OptionTypeIANA OptionTypeIATA OptionTypeIAAddress OptionTypeOptionRequest OptionTypePreference OptionTypeElapsedTime OptionTypeRelayMessage OptionTypeAuthentication OptionTypeServerUnicast OptionTypeStatusCode OptionTypeRapidCommit OptionTypeUserClass OptionTypeVendorClass OptionTypeVendorOption OptionTypeInterfaceID OptionTypeReconfigureMessage OptionTypeReconfigureAccept // RFC3646 OptionTypeDNSServer OptionTypeDNSSearchList // RFC5970 OptionTypeBootFileURL OptionType = 59 OptionTypeBootFileParameters OptionType = 60 OptionTypeClientSystemArchitectureType OptionType = 61 OptionTypeClientNetworkInterfaceIdentifier OptionType = 62 // draft-ietf-mif-dhcpv6-route-option OptionTypeNextHop OptionType = 242 OptionTypeRoutePrefix OptionType = 243 )
DHCPv6 option types as described in RFC's 3315, 3646, 5970 and a draft for Route Options
func (OptionType) String ¶
func (t OptionType) String() string
type OptionUserClass ¶
type OptionUserClass struct {
// contains filtered or unexported fields
}
OptionUserClass implements the User Class option described in https://tools.ietf.org/html/rfc3315#section-22.15
func (OptionUserClass) Len ¶
func (o OptionUserClass) Len() uint16
Len returns the length in bytes of OptionUserClass's body
func (OptionUserClass) Marshal ¶
func (o OptionUserClass) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionUserClass
func (OptionUserClass) String ¶
func (o OptionUserClass) String() string
func (OptionUserClass) Type ¶
func (o OptionUserClass) Type() OptionType
Type returns OptionTypeUserClass
type OptionVendorClass ¶
type OptionVendorClass struct {
EnterpriseNumber uint32
// contains filtered or unexported fields
}
OptionVendorClass implements the Vendor Class option described in https://tools.ietf.org/html/rfc3315#section-22.16
func (OptionVendorClass) Len ¶
func (o OptionVendorClass) Len() uint16
Len returns the length in bytes of OptionVendorClass's body
func (OptionVendorClass) Marshal ¶
func (o OptionVendorClass) Marshal() ([]byte, error)
Marshal returns byte slice representing this OptionVendorClass
func (OptionVendorClass) String ¶
func (o OptionVendorClass) String() string
func (OptionVendorClass) Type ¶
func (o OptionVendorClass) Type() OptionType
Type returns OptionTypeVendorClass
type Options ¶
type Options []Option
Options is a type wrapper for a slice of Options
func DecodeOptions ¶
DecodeOptions takes DHCPv6 option bytes and tries to decode every handled option, looking at its type and the given length, and returns a slice containing all decoded structs
type RoutePreference ¶
type RoutePreference uint8
const ( RoutePreferenceMedium RoutePreference = iota RoutePreferenceHigh RoutePreferenceLow )
Route preferences as described at https://tools.ietf.org/html/draft-ietf-mif-dhcpv6-route-option-05#section-5.2
func (RoutePreference) String ¶
func (s RoutePreference) String() string
type StatusCode ¶
type StatusCode uint16
const ( StatusCodeSuccess StatusCode = iota StatusCodeUnspecFail StatusCodeNoAddrsAvail StatusCodeNoBinding StatusCodeNotOnLink StatusCodeUseMulticast )
Status codes as described at https://tools.ietf.org/html/rfc3315#section-24.4
func (StatusCode) String ¶
func (s StatusCode) String() string