+static void load_tftp(struct load_task *task)
+{
+ const char *port = "69";
+ const char *argv[10] = {
+ pb_system_apps.tftp,
+ };
+
+ if (task->url->port)
+ port = task->url->port;
+
+ if (tftp_type == TFTP_TYPE_UNKNOWN)
+ tftp_type = check_tftp_type(task);
+
+ if (tftp_type == TFTP_TYPE_BUSYBOX) {
+ argv[1] = "-g";
+ argv[2] = "-l";
+ argv[3] = NULL; /* 3: local file */
+ argv[4] = "-r";
+ argv[5] = task->url->path;
+ argv[6] = task->url->host;
+ argv[7] = port;
+ argv[8] = NULL;
+
+ load_process_to_local_file(task, argv, 3);
+
+ } else if (tftp_type == TFTP_TYPE_HPA) {
+ argv[1] = "-m";
+ argv[2] = "binary";
+ argv[3] = task->url->host;
+ argv[4] = port;
+ argv[5] = "-c";
+ argv[6] = "get";
+ argv[7] = task->url->path;
+ argv[8] = NULL; /* 8: local file */
+ argv[9] = NULL;
+ load_process_to_local_file(task, argv, 8);
+
+ } else
+ task->result->status = LOAD_ERROR;