Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

SRC/DYNIP.C File Reference


Detailed Description

Simple dynamic IP/hostname update client. Only updating using the DynDNS2 protocol is supported.

This code is based on the ddclient Perl-script by Paul Burry: http://members.rogers.com/ddclient/pub/ddclient.tar.gz

Definition in file DYNIP.C.

Go to the source code of this file.

Data Structures

struct  URL

Functions

int get_url (const char *host, int port, const char *path, const char *user_pass)
 Fetch a single URL optionally with authentication.
const char * parse_myip_address (const char *buf)
 Parse response buffer and find the first IP-address.
int parse_dyndns_response (const char *buf)
 Parse the status response from DynDNS.
int chkip_method (const char *value)
 Select method of getting your public IP (WAN-side) address.
int dyndns_params (const char *value)
 Extracts the host, port and request from the value.
void url_free (struct URL *url)
 Free the URL.
BOOL url_parse (struct URL *res, const char *url)
 Simple URL parser; accepts only "http://" prefixes (optional).
void dynip_config (const char *name, const char *value)
 Parser for DYNIP configuration.
void dynip_exit (void)
 Free allocated memory.
void dynip_init (void)
int dynip_exec (void)
int base64encode (const char *in, char *out, size_t out_len)
BOOL get_header (void *sock, long *cont_len_ptr)
 Receive and parse the HYTTP header.

Variables

char dyndns_user [MAX_VALUELEN+1] = ""
char dyndns_passwd [MAX_VALUELEN+1] = ""
char dyn_myhostname [MAX_VALUELEN+1] = ""
char dyn_myip [20] = ""
BOOL dynip_enable = FALSE
int dyndns_refresh = 3600
int trace_level = 0
char config_file [MAX_PATHLEN+1] = "$(TEMP)\\W32DYNIP.TMP"
URL dyndns
URL chkip = { NULL, NULL, 0, FALSE }
char resp_buf [2048]
void(* prev_hook )(const char *, const char *)


Function Documentation

int chkip_method const char *  value  )  [static]
 

Select method of getting your public IP (WAN-side) address.

Either a dotted IPv4 address or an URL to return your address. Definition at line 366 of file DYNIP.C.

References isaddr(), StrLcpy(), url_free(), and url_parse().

int dyndns_params const char *  value  )  [static]
 

Extracts the host, port and request from the value.

Used for sending the DynDNS IP/host update. Definition at line 382 of file DYNIP.C.

References url_free(), and url_parse().

void dynip_config const char *  name,
const char *  value
[static]
 

Parser for DYNIP configuration.

Matches all "\c DYNIP.xx" values from WATTCP.CFG file and make appropriate actions. Definition at line 91 of file DYNIP.C.

References ARG_ATOI, ARG_FUNC, ARG_STRCPY, chkip_method(), dyndns_params(), and parse_config_table().

BOOL get_header void *  sock,
long *  cont_len_ptr
[static]
 

Receive and parse the HYTTP header.

Return FALSE if header isn't correct. Return TRUE and extract "Content-Length" field. Definition at line 475 of file DYNIP.C.

References BYTE.

const char * parse_myip_address const char *  orig  )  [static]
 

Parse response buffer and find the first IP-address.

'buf' must be 0-terminated. Definition at line 213 of file DYNIP.C.

References aton(), and StrLcpy().

BOOL url_parse struct URL *  res,
const char *  url
[static]
 

Simple URL parser; accepts only "http://" prefixes (optional).

Extracts host, port and request parts ("/" if not present). Definition at line 297 of file DYNIP.C.

References StrLcpy().


Variable Documentation

struct URL dyndns [static]
 

Initial value:

{ (char*) "members.dyndns.com", (char*) "/nic/update?system=dyndns&hostname=%s", 80, FALSE }
Definition at line 66 of file DYNIP.C.


Generated on Wed Aug 4 08:55:56 2010 for Watt-32 tcp/ip by doxygen 1.3.8