/* flaneth - flash and ethernet
   Copyright (C) 2007-2012 Stefan Schuermans <stefan@schuermans.info>
   Copyleft: GNU public license V2 - http://www.gnu.org/copyleft/gpl.html
   a BlinkenArea project - http://www.blinkenarea.org/ */

#include "apps_tools.h"
#include "app_cfg.h"
#include "config.h"
#include "debug.h"
#include "dosfs.h"
#include "rtl8019.h"

/**
 * @brief update configuration
 * @param[in] sectorBuf scratch buffer to store a sector
 * @param[in] vi volume information structure
 */
void AppCfgRun(uint8_t sectorBuf[SECTOR_SIZE], VOLINFO *vi) // (extern)
{
  // load config
  debug_app_cfg_printf("reading config");
  if (AppsToolsReadMac(sectorBuf, vi, "cfg/mac", ConfigMac) == 0)
    RtlInit();
  AppsToolsReadIp(sectorBuf, vi, "cfg/ip", ConfigIp);
  AppsToolsReadIp(sectorBuf, vi, "cfg/mask", ConfigMask);
  AppsToolsReadIp(sectorBuf, vi, "cfg/gw", ConfigGw);
}

