Documentation
¶
Index ¶
- type DDNS
- func (d *DDNS) CheckZoneSection(z dnsutils.ZoneInterface, msg *dns.Msg) int
- func (d *DDNS) PrerequisiteProessing(z dnsutils.ZoneInterface, msg *dns.Msg) int
- func (d *DDNS) ServeUpdate(zone dnsutils.ZoneInterface, r *dns.Msg) (int, error)
- func (d *DDNS) UpdateAdd(z dnsutils.ZoneInterface, rr dns.RR) error
- func (d *DDNS) UpdatePrescan(z dnsutils.ZoneInterface, msg *dns.Msg) int
- func (d *DDNS) UpdateProcessing(z dnsutils.ZoneInterface, m *dns.Msg) error
- func (d *DDNS) UpdateRemoveRDATA(z dnsutils.ZoneInterface, rr dns.RR) error
- func (d *DDNS) UpdateRemoveRR(z dnsutils.ZoneInterface, rr dns.RR) error
- type UpdateInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DDNS ¶
type DDNS struct {
// contains filtered or unexported fields
}
DDNS is dynamic update struct It can process update message and It updates zone data using UpdateInterface.
func (*DDNS) CheckZoneSection ¶
3.1.2 - Pseudocode For Zone Section Processing
if (zcount != 1 || ztype != SOA)
return (FORMERR)
if (zone_type(zname, zclass) == SLAVE)
return forward()
if (zone_type(zname, zclass) == MASTER)
return update()
return (NOTAUTH)
func (*DDNS) PrerequisiteProessing ¶
3.2.5 - Pseudocode for Prerequisite Section Processing
for rr in prerequisites
if (rr.ttl != 0)
return (FORMERR)
if (zone_of(rr.name) != ZNAME)
return (NOTZONE);
if (rr.class == ANY)
if (rr.rdlength != 0)
return (FORMERR)
if (rr.type == ANY)
if (!zone_name<rr.name>)
return (NXDOMAIN)
else
if (!zone_rrset<rr.name, rr.type>)
return (NXRRSET)
if (rr.class == NONE)
if (rr.rdlength != 0)
return (FORMERR)
if (rr.type == ANY)
if (zone_name<rr.name>)
return (YXDOMAIN)
else
if (zone_rrset<rr.name, rr.type>)
return (YXRRSET)
if (rr.class == zclass)
temp<rr.name, rr.type> += rr
else
return (FORMERR)
for rrset in temp
if (zone_rrset<rrset.name, rrset.type> != rrset)
return (NXRRSET)
func (*DDNS) ServeUpdate ¶
DDNS.ServeUpdate is process update message
func (*DDNS) UpdateAdd ¶
if (rr.type == CNAME)
if (zone_rrset<rr.name, ~CNAME>)
next [rr]
elsif (zone_rrset<rr.name, CNAME>)
next [rr]
if (rr.type == SOA)
if (!zone_rrset<rr.name, SOA> ||
zone_rr<rr.name, SOA>.serial > rr.soa.serial)
next [rr]
for zrr in zone_rrset<rr.name, rr.type>
if (rr.type == CNAME || rr.type == SOA ||
(rr.type == WKS && rr.proto == zrr.proto &&
rr.address == zrr.address) ||
rr.rdata == zrr.rdata)
zrr = rr
next [rr]
zone_rrset<rr.name, rr.type> += rr
func (*DDNS) UpdatePrescan ¶
func (*DDNS) UpdateProcessing ¶
func (*DDNS) UpdateRemoveRDATA ¶ added in v0.3.0
process remove RR
func (*DDNS) UpdateRemoveRR ¶
process Remove name and rrset
type UpdateInterface ¶
type UpdateInterface interface {
// add or create RR
AddRR(rr dns.RR) error
// replace rrset
ReplaceRRSet(dnsutils.RRSetInterface) error
// remove zone apex name rr other than SOA,NS
RemoveNameApex(name string) error
// remove name rr ignore SOA, NS
RemoveName(name string) error
// remove name rr ignore SOA, NS
RemoveRRSet(name string, rtype uint16) error
// remove name rr ignore SOA, NS
RemoveRR(rr dns.RR) error
// it can rollback zone records when UpdateProcessing returns error
UpdateFailedPostProcess(error)
// it can apply zone records when UpdateProcessing is successful
UpdatePostProcess() error
IsPrecheckSupportedRtype(uint16) bool
IsUpdateSupportedRtype(uint16) bool
}
UpdateInterface is update zone interface
Click to show internal directories.
Click to hide internal directories.