Documentation
¶
Index ¶
- func ComputeTCPHash(password, salt string) string
- func GetQueryParam(q map[string][]string, names ...string) string
- func ParseReqc(raw string) (int, error)
- func ResolveRequestIP(reqc int, providedIP, remote string) (string, error)
- func SetDebugMode(enabled bool)
- func VerifyPassword(storedPassword, inputPassword string) bool
- type DynMode
- type EasyDNSMode
- type GnuHTTPMode
- type GnuTCPMode
- type Mode
- type Outcome
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeTCPHash ¶
ComputeTCPHash returns md5( md5(password) + "." + salt ) used by GnuDIP TCP clients.
func SetDebugMode ¶
func SetDebugMode(enabled bool)
SetDebugMode toggles debug behaviours across modes.
func VerifyPassword ¶
Types ¶
type DynMode ¶
type DynMode struct {
// contains filtered or unexported fields
}
DynMode holds shared DynDNS-like behaviour (DynDNS, DtDNS, EasyDNS, Oray).
func NewDynMode ¶
type EasyDNSMode ¶
type EasyDNSMode struct {
*DynMode
}
EasyDNSMode is intentionally kept as a distinct type even though it embeds DynMode. This preserves a clear separation between the EasyDNS protocol surface and the generic DynDNS behavior, and allows EasyDNS-specific behavior or response mapping to evolve independently of DynMode.
func (*EasyDNSMode) Respond ¶
func (m *EasyDNSMode) Respond(w http.ResponseWriter, req *Request, outcome Outcome)
Respond writes EasyDNS dynamic DNS result codes as plain-text responses. It implements the EasyDNS API contract by mapping internal outcomes to EasyDNS result strings (each terminated with a newline):
- OutcomeSuccess -> "NOERROR\n"
- OutcomeAuthFailure -> "NOACCESS\n"
- OutcomeInvalidDomain -> "ILLEGAL INPUT\n"
- OutcomeSystemError -> "NOSERVICE\n"
- any other outcome -> "NOSERVICE\n"
For protocol details, see the EasyDNS dynamic DNS API documentation. The "NOERROR\n" response is required by many easyDNS clients (e.g., inadyn).
type GnuHTTPMode ¶
type GnuHTTPMode struct {
// contains filtered or unexported fields
}
GnuHTTPMode implements the two-step GnuDIP HTTP challenge flow. Step 1: client requests without pass/sign -> server returns meta tags with retc/time/sign/addr. Step 2: client requests with pass/sign (md5(user:time:secret)) -> server validates and updates.
func (*GnuHTTPMode) Process ¶
func (m *GnuHTTPMode) Process(req *Request) Outcome
func (*GnuHTTPMode) Respond ¶
func (m *GnuHTTPMode) Respond(w http.ResponseWriter, req *Request, outcome Outcome)
type GnuTCPMode ¶
type GnuTCPMode struct {
// contains filtered or unexported fields
}
GnuTCPMode handles GnuDIP TCP protocol.
func NewGnuTCPMode ¶
func NewGnuTCPMode(debug func(format string, args ...interface{})) *GnuTCPMode
func (*GnuTCPMode) Handle ¶
func (m *GnuTCPMode) Handle(conn net.Conn)
type Mode ¶
type Mode interface {
Prepare(*http.Request) (*Request, Outcome)
Process(*Request) Outcome
Respond(http.ResponseWriter, *Request, Outcome)
}
Mode defines a protocol handler that can prepare, process, and respond to a DDNS HTTP request.
func NewEasyDNSMode ¶
func NewGnuHTTPMode ¶
type Request ¶
type Request struct {
Username string
Password string
Domain string
IP string
Reqc int
RemoteAddr string
Time string
// Salt is the cryptographic salt for GnuDIP authentication.
Salt string
// Sign is the MD5 signature for challenge-response authentication.
Sign string
}
Request holds normalized DDNS parameters.