Line No. | Rev | Author | Line |
---|---|---|---|
1 | 32 | kaklik | /********************************************************************* |
2 | * |
||
3 | * DynDNS Headers for Microchip TCP/IP Stack |
||
4 | * |
||
5 | ********************************************************************* |
||
6 | * FileName: DynDNS.h |
||
7 | * Dependencies: None |
||
8 | * Processor: PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32 |
||
9 | * Compiler: Microchip C32 v1.05 or higher |
||
10 | * Microchip C30 v3.12 or higher |
||
11 | * Microchip C18 v3.30 or higher |
||
12 | * HI-TECH PICC-18 PRO 9.63PL2 or higher |
||
13 | * Company: Microchip Technology, Inc. |
||
14 | * |
||
15 | * Software License Agreement |
||
16 | * |
||
17 | * Copyright (C) 2002-2009 Microchip Technology Inc. All rights |
||
18 | * reserved. |
||
19 | * |
||
20 | * Microchip licenses to you the right to use, modify, copy, and |
||
21 | * distribute: |
||
22 | * (i) the Software when embedded on a Microchip microcontroller or |
||
23 | * digital signal controller product ("Device") which is |
||
24 | * integrated into Licensee's product; or |
||
25 | * (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h, |
||
26 | * ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device |
||
27 | * used in conjunction with a Microchip ethernet controller for |
||
28 | * the sole purpose of interfacing with the ethernet controller. |
||
29 | * |
||
30 | * You should refer to the license agreement accompanying this |
||
31 | * Software for additional information regarding your rights and |
||
32 | * obligations. |
||
33 | * |
||
34 | * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT |
||
35 | * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT |
||
36 | * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A |
||
37 | * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL |
||
38 | * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR |
||
39 | * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF |
||
40 | * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS |
||
41 | * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE |
||
42 | * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER |
||
43 | * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT |
||
44 | * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE. |
||
45 | * |
||
46 | * |
||
47 | * Author Date Comment |
||
48 | *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
||
49 | * A. Shirbhate 1/30/08 Original |
||
50 | **********************************************************************/ |
||
51 | #ifndef __DYNDNSCLIENT_H |
||
52 | #define __DYNDNSCLIENT_H |
||
53 | |||
54 | /**************************************************************************** |
||
55 | Section: |
||
56 | Dynamic DNS Client Configuration Parameters |
||
57 | ***************************************************************************/ |
||
58 | #define DDNS_CHECKIP_SERVER (ROM BYTE*)"checkip.dyndns.com" // Default CheckIP server for determining current IP address |
||
59 | #define DDNS_DEFAULT_PORT (80u) // Default port for CheckIP server |
||
60 | |||
61 | /**************************************************************************** |
||
62 | Section: |
||
63 | Dynamic DNS Enumerations |
||
64 | ***************************************************************************/ |
||
65 | |||
66 | // Dynamic DNS Services. |
||
67 | // Must support the DynDNS API (Auxlang) and correspond |
||
68 | // to ddnsServiceHosts and ddnsServicePorts in DynDNS.c. |
||
69 | typedef enum |
||
70 | { |
||
71 | DYNDNS_ORG = 0u, // www.dyndns.org |
||
72 | NO_IP_COM, // www.no-ip.com |
||
73 | DNSOMATIC_COM // www.dnsomatic.com |
||
74 | } DDNS_SERVICES; |
||
75 | |||
76 | // Status message for DynDNS client. GOOD and NOCHG are ok, but |
||
77 | // ABUSE through 911 are fatal. UNCHANGED through INVALID are locally |
||
78 | // defined. |
||
79 | typedef enum |
||
80 | { |
||
81 | DDNS_STATUS_GOOD = 0u, // Update successful, hostname is now updated |
||
82 | DDNS_STATUS_NOCHG, // Update changed no setting and is considered abusive. Additional 'nochg' updates will cause hostname to be blocked. |
||
83 | |||
84 | DDNS_STATUS_ABUSE, // The hostname specified is blocked for update abuse. |
||
85 | DDNS_STATUS_BADSYS, // System parameter not valid. Should be dyndns, statdns or custom. |
||
86 | DDNS_STATUS_BADAGENT, // The user agent was blocked or not sent. |
||
87 | DDNS_STATUS_BADAUTH, // The username and password pair do not match a real user. |
||
88 | DDNS_STATUS_NOT_DONATOR, // An option available only to credited users (such as offline URL) was specified, but the user is not a credited user. If multiple hosts were specified, only a single !donator will be returned. |
||
89 | DDNS_STATUS_NOT_FQDN, // The hostname specified is not a fully-qualified domain name (not in the form hostname.dyndns.org or domain.com). |
||
90 | DDNS_STATUS_NOHOST, // The hostname specified does not exist in this user account (or is not in the service specified in the system parameter). |
||
91 | DDNS_STATUS_NOT_YOURS, // The hostname specified does not belong to this user account. |
||
92 | DDNS_STATUS_NUMHOST, // Too many hosts specified in an update. |
||
93 | DDNS_STATUS_DNSERR, // Unspecified DNS error encountered by the DDNS service. |
||
94 | DDNS_STATUS_911, // There is a problem or scheduled maintenance with the DDNS service. |
||
95 | |||
96 | DDNS_STATUS_UPDATE_ERROR, // Error communicating with Update service. |
||
97 | DDNS_STATUS_UNCHANGED, // The IP Check indicated that no update was necessary. |
||
98 | DDNS_STATUS_CHECKIP_ERROR, // Error communicating with CheckIP service. |
||
99 | DDNS_STATUS_INVALID, // DDNS Client data is not valid. |
||
100 | DDNS_STATUS_UNKNOWN // DDNS client has not yet been executed with this configuration. |
||
101 | } DDNS_STATUS; |
||
102 | |||
103 | /**************************************************************************** |
||
104 | Summary: |
||
105 | Configuration parameters for the Dynamic DNS Client |
||
106 | |||
107 | Description: |
||
108 | This structure of pointers configures the Dynamic DNS Client. Initially, |
||
109 | all pointers will be null and the client will be disabled. <c>Set |
||
110 | DDNSClient.[field name].szRAM</c> to use a string stored in RAM, or |
||
111 | <c>DDNSClient.[field name].szROM</c> to use a string stored in ROM. |
||
112 | (Where <c>[field name]</c> is one of the parameters below.) |
||
113 | |||
114 | If a ROM string is specified, <c>DDNSClient.ROMPointers.[field name]</c> |
||
115 | must also be set to 1 to indicate that this field should be retrieved |
||
116 | from ROM instead of RAM. |
||
117 | |||
118 | Parameters: |
||
119 | CheckIPServer - The server used to determine the external IP address |
||
120 | CheckIPPort - Port on the above server to connect to |
||
121 | UpdateServer - The server where updates should be posted |
||
122 | UpdatePort - Port on the above server to connect to |
||
123 | Username - The user name for the dynamic DNS server |
||
124 | Password - The password to supply when making updates |
||
125 | Host - The host name you wish to update |
||
126 | ROMPointers - Indicates which parameters to read from ROM instead of RAM. |
||
127 | ***************************************************************************/ |
||
128 | typedef struct |
||
129 | { |
||
130 | union |
||
131 | { |
||
132 | BYTE *szRAM; |
||
133 | ROM BYTE *szROM; |
||
134 | } CheckIPServer; |
||
135 | |||
136 | WORD CheckIPPort; |
||
137 | |||
138 | union |
||
139 | { |
||
140 | BYTE *szRAM; |
||
141 | ROM BYTE *szROM; |
||
142 | } UpdateServer; |
||
143 | |||
144 | WORD UpdatePort; |
||
145 | |||
146 | union |
||
147 | { |
||
148 | BYTE *szRAM; |
||
149 | ROM BYTE *szROM; |
||
150 | } Username; |
||
151 | |||
152 | union |
||
153 | { |
||
154 | BYTE *szRAM; |
||
155 | ROM BYTE *szROM; |
||
156 | } Password; |
||
157 | |||
158 | union |
||
159 | { |
||
160 | BYTE *szRAM; |
||
161 | ROM BYTE *szROM; |
||
162 | } Host; |
||
163 | |||
164 | struct |
||
165 | { |
||
166 | unsigned char CheckIPServer:1; |
||
167 | unsigned char UpdateServer:1; |
||
168 | unsigned char Username:1; |
||
169 | unsigned char Password:1; |
||
170 | unsigned char Host:1; |
||
171 | |||
172 | } ROMPointers; |
||
173 | |||
174 | } DDNS_POINTERS; |
||
175 | |||
176 | // Global DDNS Configuration parameters |
||
177 | extern DDNS_POINTERS DDNSClient; |
||
178 | |||
179 | /**************************************************************************** |
||
180 | Section: |
||
181 | Function Prototypes |
||
182 | ***************************************************************************/ |
||
183 | void DDNSTask(void); |
||
184 | void DDNSInit(void); |
||
185 | void DDNSForceUpdate(void); |
||
186 | void DDNSSetService(DDNS_SERVICES svc); |
||
187 | DDNS_STATUS DDNSGetLastStatus(void); |
||
188 | IP_ADDR DDNSGetLastIP(void); |
||
189 | |||
190 | #endif |
||
191 |
Powered by WebSVN v2.8.3