1 diff -Naur ez-ipupdate-3.0.11b7/ez-ipupdate.c ez-ipupdate-3.0.11b7-sr1/ez-ipupdate.c
2 --- ez-ipupdate-3.0.11b7/ez-ipupdate.c 2002-03-12 01:31:47.000000000 +0200
3 +++ ez-ipupdate-3.0.11b7-sr1/ez-ipupdate.c 2006-10-08 17:51:40.000000000 +0200
5 #define HEIPV6TB_DEFAULT_PORT "80"
6 #define HEIPV6TB_REQUEST "/index.cgi"
8 +#define EVERYDNS_DEFAULT_SERVER "dyn.everydns.net"
9 +#define EVERYDNS_DEFAULT_PORT "80"
10 +#define EVERYDNS_REQUEST "/index.php"
11 +#define EVERYDNS_VERSION "0.1"
13 #define DEFAULT_TIMEOUT 120
14 #define DEFAULT_UPDATE_PERIOD 120
15 #define DEFAULT_RESOLV_PERIOD 30
17 int HEIPV6TB_check_info(void);
18 static char *HEIPV6TB_fields_used[] = { "server", "user", NULL };
20 +int EVERYDNS_update_entry(void);
21 +int EVERYDNS_check_info(void);
22 +static char *EVERYDNS_fields_used[] = { "server", "user", "host", "address", NULL };
24 struct service_t services[] = {
26 { "null", "NULL", 0, },
28 HEIPV6TB_DEFAULT_PORT,
32 + { "everydns", 0, 0, },
34 + EVERYDNS_update_entry,
35 + EVERYDNS_check_info,
36 + EVERYDNS_fields_used,
37 + EVERYDNS_DEFAULT_SERVER,
38 + EVERYDNS_DEFAULT_PORT,
43 static struct service_t *service = NULL;
44 @@ -4246,6 +4265,165 @@
48 +int EVERYDNS_check_info(void)
50 + warn_fields(service->fields_used);
55 +int EVERYDNS_update_entry(void)
57 + char buf[BUFFER_SIZE+1];
63 + buf[BUFFER_SIZE] = '\0';
65 + if(do_connect((int*)&client_sockfd, server, port) != 0)
67 + if(!(options & OPT_QUIET))
69 + show_message("error connecting to %s:%s\n", server, port);
71 + return(UPDATERES_ERROR);
74 + snprintf(buf, BUFFER_SIZE, "GET %s?ver=%s&", request, EVERYDNS_VERSION);
78 + snprintf(buf, BUFFER_SIZE, "%s=%s&", "ip", address);
81 + if((host != NULL) && (*host == '\0'))
83 + snprintf(buf, BUFFER_SIZE, "%s=%s&", "domain", host);
86 + snprintf(buf, BUFFER_SIZE, " HTTP/1.0\015\012");
88 + snprintf(buf, BUFFER_SIZE, "Authorization: Basic %s\015\012", auth);
90 + snprintf(buf, BUFFER_SIZE, "User-Agent: %s-%s %s [%s] (%s)\015\012",
91 + "ez-update", VERSION, OS, (options & OPT_DAEMON) ? "daemon" : "", "by Angus Mackay");
93 + snprintf(buf, BUFFER_SIZE, "Host: %s\015\012", server);
95 + snprintf(buf, BUFFER_SIZE, "\015\012");
101 + while((bytes=read_input(bp, BUFFER_SIZE-btot)) > 0)
105 + dprintf((stderr, "btot: %d\n", btot));
107 + close(client_sockfd);
110 + dprintf((stderr, "server output: %s\n", buf));
112 + if(sscanf(buf, " HTTP/1.%*c %3d", &ret) != 1)
122 + if(!(options & OPT_QUIET))
124 + show_message("strange server response, are you connecting to the right server?\n");
126 + return(UPDATERES_ERROR);
131 + if((p=strstr(buf, "Exit code: ")) != NULL)
133 + sscanf(p, "Exit code: %d", &ret);
137 + * 0 - Successfully Updated
142 + if(!(options & OPT_QUIET))
144 + show_message("strange server response, are you connecting to the right server?\n");
146 + return(UPDATERES_ERROR);
150 + if(!(options & OPT_QUIET))
152 + printf("request successful\n");
157 + if(!(options & OPT_QUIET))
159 + show_message("Bad Username/password\n");
161 + return(UPDATERES_SHUTDOWN);
165 + if(!(options & OPT_QUIET))
167 + show_message("Last update too recent, please wait...\n");
169 + return(UPDATERES_ERROR);
173 + if(!(options & OPT_QUIET))
175 + show_message("unknown return code: %d\n", ret);
176 + fprintf(stderr, "server response: %s\n", buf);
178 + return(UPDATERES_ERROR);
184 + if(!(options & OPT_QUIET))
186 + show_message("authentication failure\n");
188 + return(UPDATERES_SHUTDOWN);
192 + if(!(options & OPT_QUIET))
194 + // reuse the auth buffer
196 + sscanf(buf, " HTTP/1.%*c %*3d %255[^\r\n]", auth);
197 + show_message("unknown return code: %d\n", ret);
198 + fprintf(stderr, "server response: %s\n", auth);
200 + return(UPDATERES_ERROR);
204 + return(UPDATERES_OK);
207 static int is_in_list(char *needle, char **haystack)