dhcpd

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package dhcpd contains snippets from MIT-licensed coredhcp project at https://github.com/coredhcp/coredhcp

Package dhcpd contains snippets from MIT-licensed coredhcp project at https://github.com/coredhcp/coredhcp

Index

Constants

View Source
const (
	// completed entry (ha valid)
	ATF_COM = 0x02
	// permanent entry
	ATF_PERM = 0x04
	// publish entry
	ATF_PUBL = 0x08
	// has requested trailers
	ATF_USETRAILERS = 0x10
	// want to use a netmask (only for proxy entries)
	ATF_NETMASK = 0x20
	// don't answer this addresses
	ATF_DONTPUB = 0x40
)

ARP Flag values these are not in golang.org/x/sys/unix

View Source
const MaxDatagram = 1 << 16

MaxDatagram is the maximum length of message that can be received.

Variables

This section is empty.

Functions

func InjectArp

func InjectArp(ip net.IP, mac net.HardwareAddr, flags int32, dev string) (err error)

syscalls roughly based on https://www.unix.com/302447674-post3.html see:

https://github.com/torvalds/linux/blob/8cf8821e15cd553339a5b48ee555a0439c2b2742/net/ipv4/arp.c#L1179
https://github.com/torvalds/linux/blob/8cf8821e15cd553339a5b48ee555a0439c2b2742/net/ipv4/arp.c#L1024

func InjectArpFd

func InjectArpFd(fd uintptr, ip net.IP, mac net.HardwareAddr, flags int32, dev string) (err error)

Types

type Server

type Server struct {
	UdpConn *net.UDPConn
	*ipv4.PacketConn
	net.Interface
	// contains filtered or unexported fields
}

func NewServer

func NewServer(addr, ifname string, store *store.Store) (server *Server, err error)

func (*Server) HandleMsg4

func (server *Server) HandleMsg4(buf []byte, oob *ipv4.ControlMessage, peer net.Addr)

func (*Server) Serve

func (server *Server) Serve()

type Uint8

type Uint8 uint8

Uint8 mirrors dhcpv4.Uint16

func (*Uint8) FromBytes

func (o *Uint8) FromBytes(data []byte) error

FromBytes decodes data into o as per RFC 2132, Section 9.10.

func (Uint8) String

func (o Uint8) String() string

String returns a human-readable string for this option.

func (Uint8) ToBytes

func (o Uint8) ToBytes() []byte

ToBytes returns a serialized stream of bytes for this option.

Jump to

Keyboard shortcuts

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