/***************************************************************************
- * Copyright (C) 2007-2009 by Øyvind Harboe *
+ * Copyright (C) 2007-2010 by Øyvind Harboe *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
#include <helper/types.h>
#include <jtag/jtag.h>
#include <helper/ioutil.h>
+#include <helper/util.h>
#include <helper/configuration.h>
#include <server/server.h>
char hwaddr[512];
-
-extern struct flash_driver *flash_drivers[];
-
#ifdef CYGPKG_PROFILE_GPROF
#include <cyg/profile/profile.h>
cyg_httpd_init_tcl_interpreter();
+ // Kludge! Why can't I do this from httpd.c??? I get linker errors...
+ // some of that --start/end-group stuff?
+ Jim_InitStaticExtensions(httpstate.jim_interp);
+
Jim_CreateCommand(httpstate.jim_interp, "log", zylinjtag_Jim_Command_log,
NULL, NULL);
Jim_CreateCommand(httpstate.jim_interp, "zy1000_reboot",
command_set_output_handler(cmd_ctx, configuration_output_handler, NULL);
command_context_mode(cmd_ctx, COMMAND_CONFIG);
+ if (util_init(cmd_ctx) != ERROR_OK)
+ return EXIT_FAILURE;
+
if (ioutil_init(cmd_ctx) != ERROR_OK)
return EXIT_FAILURE;
cyg_uint8 *mem;
int actual;
char *server;
+ int port;
char *file;
};
strncpy(tftp->server, name, server - name);
tftp->server[server - name] = 0;
+ tftp->port = 0; /* default port 69 */
+ char *port;
+ port = strchr(tftp->server, ':');
+ if (port != NULL)
+ {
+ tftp->port = atoi(port + 1);
+ *port = 0;
+ }
+
tftp->file = strdup(server + 1);
if (tftp->file == NULL)
{
if (!tftp->readFile)
{
int err;
- tftp->actual = tftp_client_get(tftp->file, tftp->server, 0, tftp->mem,
+ tftp->actual = tftp_client_get(tftp->file, tftp->server, tftp->port, tftp->mem,
tftpMaxSize, TFTP_OCTET, &err);
if (tftp->actual < 0)