瀏覽代碼

update atftp, use sourceforge homepage

Waldemar Brodkorb 10 年之前
父節點
當前提交
c05d2e9da7

+ 1 - 1
package/atftp/Makefile

@@ -6,7 +6,7 @@ include $(ADK_TOPDIR)/rules.mk
 PKG_NAME:=		atftp
 PKG_VERSION:=		0.7.1
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		3b27365772d918050b2251d98a9c7c82
+PKG_MD5SUM:=		367bf401965fbed04585b1229c2191a8
 PKG_DESCR:=		tftp client
 PKG_SECTION:=		net/misc
 PKG_DEPENDS:=		libreadline libncurses

+ 0 - 14
package/atftp/patches/patch-stats_c

@@ -1,14 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- atftp-0.7.orig/stats.c	2002-03-27 04:02:12.000000000 +0100
-+++ atftp-0.7/stats.c	2008-10-09 12:08:47.000000000 +0200
-@@ -157,8 +157,8 @@ void stats_print(void)
- 
-      logger(LOG_INFO, "  Load measurements:");
-      logger(LOG_INFO, "   User: %8.3fs  Sys:%8.3fs",
--            (double)(s_stats.tms.tms_utime) / CLK_TCK,
--            (double)(s_stats.tms.tms_stime) / CLK_TCK);
-+            (double)(s_stats.tms.tms_utime) / CLOCKS_PER_SEC,
-+            (double)(s_stats.tms.tms_stime) / CLOCKS_PER_SEC);
-      logger(LOG_INFO, "   Total:%8.3fs  CPU:%8.3f%%", 
-             (double)(tmp.tv_sec + tmp.tv_usec * 1e-6),
-             (double)(s_stats.tms.tms_utime + s_stats.tms.tms_stime) /

+ 0 - 83
package/atftp/patches/patch-tftp_c

@@ -1,83 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- atftp-0.7.orig/tftp.c	2004-03-16 00:55:56.000000000 +0100
-+++ atftp-0.7/tftp.c	2008-10-09 11:58:48.000000000 +0200
-@@ -409,7 +409,7 @@ int process_cmd(int argc, char **argv)
- int set_peer(int argc, char **argv)
- {
-      struct hostent *host;      /* for host name lookup */
--     struct servent *sp;        /* server entry for tftp service */
-+     int port = htons(69);
- 
-      /* sanity check */
-      if ((argc < 2) || (argc > 3))
-@@ -418,13 +418,6 @@ int set_peer(int argc, char **argv)
-           return ERR;
-      }
- 
--     /* get the server entry */
--     sp = getservbyname("tftp", "udp");
--     if (sp == 0) {
--          fprintf(stderr, "tftp: udp/tftp, unknown service.\n");
--          return ERR;
--     }
--
-      /* look up the host */
-      host = gethostbyname(argv[1]);
-      /* if valid, update s_inn structure */
-@@ -437,7 +430,7 @@ int set_peer(int argc, char **argv)
-           Strncpy(data.hostname, host->h_name,
-                   sizeof(data.hostname));
-           data.hostname[sizeof(data.hostname)-1] = 0;
--          data.sa_peer.sin_port = sp->s_port;
-+          data.sa_peer.sin_port = port;
-      } 
-      else
-      {
-@@ -448,17 +441,17 @@ int set_peer(int argc, char **argv)
-      /* get the server port */
-      if (argc == 3)
-      {
--          sp->s_port = htons(atoi(argv[2]));
--          if (sp->s_port < 0)
-+          port = htons(atoi(argv[2]));
-+          if (port < 0)
-           {
-                fprintf(stderr, "%s: bad port number.\n", argv[2]);
-                data.connected = 0;
-                return ERR;
-           }
--          data.sa_peer.sin_port = sp->s_port;
-+          data.sa_peer.sin_port = port;
-      }
-      /* copy port number to data structure */
--     data.port = ntohs(sp->s_port);
-+     data.port = ntohs(port);
- 
-      data.connected = 1;
-      return OK;
-@@ -974,6 +967,7 @@ int tftp_cmd_line_options(int argc, char
-           { "tftp-timeout", 1, NULL, 'T'},
-           { "mode", 1, NULL, 'M'},
-           { "option", 1, NULL, 'O'},
-+		  { "retry", 1, NULL, 'R'},
- #if 1
-           { "timeout", 1, NULL, 't'},
-           { "blksize", 1, NULL, 'b'},
-@@ -993,11 +987,16 @@ int tftp_cmd_line_options(int argc, char
-      };
- 
-      /* Support old argument until 0.8 */
--     while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:sm",
-+     while ((c = getopt_long(argc, argv, /*"gpl:r:Vh"*/ "gpl:r:Vht:b:smR:",
-                              options, &option_index)) != EOF)
-      {
-           switch (c)
-           {
-+		  case 'R':
-+               snprintf(string, sizeof(string), "option retry %s", optarg);
-+               make_arg(string, &ac, &av);
-+               process_cmd(ac, av);
-+		       break;
-           case 'g':
-                interactive = 0;
-                if ((action == PUT) || (action == MGET))

+ 0 - 11
package/atftp/patches/patch-tftp_def_c

@@ -1,11 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- atftp-0.7.orig/tftp_def.c	2004-02-13 04:16:09.000000000 +0100
-+++ atftp-0.7/tftp_def.c	2008-10-09 11:58:48.000000000 +0200
-@@ -37,6 +37,7 @@ struct tftp_opt tftp_default_options[OPT
-      { "timeout", "5", 0, 1 },  /* 2348, 2349, 2090.  */
-      { "blksize", "512", 0, 1 }, /* This is the default option */
-      { "multicast", "", 0, 1 }, /* structure */
-+	 { "retry", "5", 0, 1 },
-      { "", "", 0, 0}
- };
- 

+ 0 - 13
package/atftp/patches/patch-tftp_def_h

@@ -1,13 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- atftp-0.7.orig/tftp_def.h	2004-02-13 04:16:09.000000000 +0100
-+++ atftp-0.7/tftp_def.h	2008-10-09 11:58:48.000000000 +0200
-@@ -40,7 +40,8 @@
- #define OPT_TIMEOUT   3
- #define OPT_BLKSIZE   4
- #define OPT_MULTICAST 5
--#define OPT_NUMBER    7
-+#define OPT_RETRY     6
-+#define OPT_NUMBER    8
- 
- #define OPT_SIZE     12
- #define VAL_SIZE     MAXLEN

+ 0 - 64
package/atftp/patches/patch-tftp_file_c

@@ -1,64 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- atftp-0.7.orig/tftp_file.c	2004-02-13 04:16:09.000000000 +0100
-+++ atftp-0.7/tftp_file.c	2008-10-09 11:58:48.000000000 +0200
-@@ -123,6 +123,7 @@ int tftp_receive_file(struct client_data
-      struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer;
-      FILE *fp = NULL;           /* the local file pointer */
-      int number_of_timeout = 0;
-+	 int num_retry = atoi(data->tftp_options[OPT_RETRY].value);
-      int convert = 0;           /* if true, do netascii convertion */
- 
-      int oacks = 0;             /* count OACK for improved error checking */
-@@ -141,7 +142,7 @@ int tftp_receive_file(struct client_data
- 
-      int prev_block_number = 0; /* needed to support netascii convertion */
-      int temp = 0;
--
-+	 
-      data->file_size = 0;
-      tftp_cancel = 0;
-      from.sin_addr.s_addr = 0;
-@@ -288,7 +289,7 @@ int tftp_receive_file(struct client_data
-                case GET_TIMEOUT:
-                     number_of_timeout++;
-                     fprintf(stderr, "timeout: retrying...\n");
--                    if (number_of_timeout > NB_OF_RETRY)
-+                    if ((num_retry > 0) && (number_of_timeout > num_retry))
-                          state = S_ABORT;
-                     else
-                          state = timeout_state;
-@@ -325,7 +326,7 @@ int tftp_receive_file(struct client_data
-                     number_of_timeout++;
-                     fprintf(stderr, "tftp: packet discard <%s:%d>.\n",
-                             inet_ntoa(from.sin_addr), ntohs(from.sin_port));
--                    if (number_of_timeout > NB_OF_RETRY)
-+                    if ((num_retry > 0) && (number_of_timeout > num_retry))
-                          state = S_ABORT;
-                     break;
-                case ERR:
-@@ -614,6 +615,7 @@ int tftp_send_file(struct client_data *d
-      struct tftphdr *tftphdr = (struct tftphdr *)data->data_buffer;
-      FILE *fp;                  /* the local file pointer */
-      int number_of_timeout = 0;
-+	 int num_retry = atoi(data->tftp_options[OPT_RETRY].value);
-      struct stat file_stat;
-      int convert = 0;           /* if true, do netascii convertion */
-      char string[MAXLEN];
-@@ -751,7 +753,7 @@ int tftp_send_file(struct client_data *d
-                case GET_TIMEOUT:
-                     number_of_timeout++;
-                     fprintf(stderr, "timeout: retrying...\n");
--                    if (number_of_timeout > NB_OF_RETRY)
-+                    if ((num_retry > 0) && (number_of_timeout > num_retry))
-                          state = S_ABORT;
-                     else
-                          state = timeout_state;
-@@ -797,7 +799,7 @@ int tftp_send_file(struct client_data *d
-                     number_of_timeout++;
-                     fprintf(stderr, "tftp: packet discard <%s:%d>.\n",
-                             inet_ntoa(from.sin_addr), ntohs(from.sin_port));
--                    if (number_of_timeout > NB_OF_RETRY)
-+                    if ((num_retry > 0) && (number_of_timeout > num_retry))
-                          state = S_ABORT;
-                     break;
-                case ERR:

+ 0 - 20
package/atftp/patches/patch-tftpd_c

@@ -1,20 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- atftp-0.7.orig/tftpd.c	2004-02-27 03:05:26.000000000 +0100
-+++ atftp-0.7/tftpd.c	2008-10-09 11:58:48.000000000 +0200
-@@ -230,14 +230,8 @@ int main(int argc, char **argv)
- 
-           /* find the port */
-           if (tftpd_port == 0)
--          {
--               if ((serv = getservbyname("tftp", "udp")) == NULL)
--               {
--                    logger(LOG_ERR, "atftpd: udp/tftp, unknown service");
--                    exit(1);
--               }
--               tftpd_port = ntohs(serv->s_port);
--          }
-+               tftpd_port = htons(69);
-+
-           /* initialise sockaddr_in structure */
-           memset(&sa, 0, sizeof(sa));
-           sa.sin_family = AF_INET;