Documentation ¶
Index ¶
- type Addressing
- type DHCP
- func (d *DHCP) Address() *net.IPNet
- func (d *DHCP) Discover(ctx context.Context, link *net.Interface) error
- func (d *DHCP) Family() int
- func (d *DHCP) Hostname() (hostname string)
- func (d *DHCP) Link() *net.Interface
- func (d *DHCP) MTU() uint32
- func (d *DHCP) Mask() net.IPMask
- func (d *DHCP) Name() string
- func (d *DHCP) Resolvers() []net.IP
- func (d *DHCP) Routes() (routes []*Route)
- func (d *DHCP) Scope() uint8
- func (d *DHCP) TTL() time.Duration
- func (d *DHCP) Valid() bool
- type Route
- type Static
- func (s *Static) Address() *net.IPNet
- func (s *Static) Discover(ctx context.Context, link *net.Interface) error
- func (s *Static) Family() int
- func (s *Static) Hostname() string
- func (s Static) Link() *net.Interface
- func (s *Static) MTU() uint32
- func (s *Static) Mask() net.IPMask
- func (s *Static) Name() string
- func (s *Static) Resolvers() []net.IP
- func (s *Static) Routes() (routes []*Route)
- func (s *Static) Scope() uint8
- func (s *Static) TTL() time.Duration
- func (s *Static) Valid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Addressing ¶
type Addressing interface { Address() *net.IPNet Discover(context.Context, *net.Interface) error Family() int Hostname() string Link() *net.Interface MTU() uint32 Mask() net.IPMask Name() string Resolvers() []net.IP Routes() []*Route Scope() uint8 TTL() time.Duration Valid() bool }
Addressing provides an interface for abstracting the underlying network addressing configuration. Currently dhcp(v4) and static methods are supported.
type DHCP ¶
DHCP implements the Addressing interface.
func (*DHCP) Link ¶
Link returns the underlying net.Interface that this address method is configured for.
func (*DHCP) Routes ¶
Routes aggregates all Routers and ClasslessStaticRoutes retrieved from the DHCP offer. rfc3442:
If the DHCP server returns both a Classless Static Routes option and a Router option, the DHCP client MUST ignore the Router option.
type Static ¶
type Static struct { CIDR string Mtu int FQDN string RouteList []config.Route NetIf *net.Interface NameServers []net.IP }
Static implements the Addressing interface.
func (*Static) Discover ¶
Discover doesnt do anything in the static configuration since all the necessary configuration data is supplied via config.
func (Static) Link ¶
Link returns the underlying net.Interface that this address method is configured for.
func (*Static) Routes ¶
Routes aggregates the specified routes for a given device configuration TODO: do we need to be explicit on route vs gateway?