nameserver

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxDuration = time.Duration(math.MaxInt64)
	MailboxSize = 16
)
View Source
const (
	CSendQuery = iota
	CShutdown
	CMessageReceived
)
View Source
const (
	LOCAL_DOMAIN = "weave.local."
)
View Source
const (
	RDNS_DOMAIN = "in-addr.arpa."
)

Variables

This section is empty.

Functions

func LinkLocalMulticastListener

func LinkLocalMulticastListener(ifi *net.Interface) (net.PacketConn, error)

func ListenHttp

func ListenHttp(domain string, db Zone, port int)

func StartServer

func StartServer(zone Zone, iface *net.Interface, dnsPort int, wait int) error

func StartUpdater

func StartUpdater(apiPath string, zone Zone) error

Types

type DuplicateError

type DuplicateError struct {
}

func (DuplicateError) Error

func (dup DuplicateError) Error() string

type Lookup added in v0.9.0

type Lookup interface {
	LookupName(name string) (net.IP, error)
	LookupInaddr(inaddr string) (string, error)
}

type LookupError

type LookupError string

func (LookupError) Error

func (ops LookupError) Error() string

type LookupFunc added in v0.9.0

type LookupFunc func(Lookup, *dns.Msg, *dns.Question) *dns.Msg

type MDNSClient

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

func NewMDNSClient

func NewMDNSClient() (*MDNSClient, error)

func (*MDNSClient) LookupInaddr added in v0.9.0

func (client *MDNSClient) LookupInaddr(inaddr string) (string, error)

func (*MDNSClient) LookupName added in v0.9.0

func (client *MDNSClient) LookupName(name string) (net.IP, error)

func (*MDNSClient) ResponseCallback

func (c *MDNSClient) ResponseCallback(r *dns.Msg)

Async - called from dns library multiplexer

func (*MDNSClient) SendQuery

func (c *MDNSClient) SendQuery(name string, querytype uint16, responseCh chan<- *Response)

Async

func (*MDNSClient) Shutdown

func (c *MDNSClient) Shutdown()

Async

func (*MDNSClient) Start

func (c *MDNSClient) Start(ifi *net.Interface) error

type MDNSInteraction

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

type MDNSServer

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

func NewMDNSServer

func NewMDNSServer(zone Zone) (*MDNSServer, error)

func (*MDNSServer) Start

func (s *MDNSServer) Start(ifi *net.Interface) error

type Record

type Record struct {
	Ident string
	Name  string
	IP    net.IP
}

type Response added in v0.9.0

type Response struct {
	Name string
	Addr net.IP
	Err  error
}

type Zone

type Zone interface {
	AddRecord(ident string, name string, ip net.IP) error
	DeleteRecord(ident string, ip net.IP) error
	DeleteRecordsFor(ident string) error
	Lookup
}

type ZoneDb

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

Very simple data structure for now, with linear searching. TODO: make more sophisticated to improve performance.

func (*ZoneDb) AddRecord

func (zone *ZoneDb) AddRecord(ident string, name string, ip net.IP) error

func (*ZoneDb) DeleteRecord

func (zone *ZoneDb) DeleteRecord(ident string, ip net.IP) error

func (*ZoneDb) DeleteRecordsFor

func (zone *ZoneDb) DeleteRecordsFor(ident string) error

func (*ZoneDb) LookupInaddr added in v0.9.0

func (zone *ZoneDb) LookupInaddr(inaddr string) (string, error)

func (*ZoneDb) LookupName added in v0.9.0

func (zone *ZoneDb) LookupName(name string) (net.IP, error)

Jump to

Keyboard shortcuts

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