21 #ifndef __ETHMAINTAINER_H__
22 #define __ETHMAINTAINER_H__
25 #include "EoUpdaterProtocol.h"
36 bool string2ipv4(
const string &ipv4string, eOipv4addr_t &ipv4);
39 eOipv4addr_t
acetoipv4(ACE_UINT32 address);
49 enum { hostIPaddress = EO_COMMON_IPV4ADDR(10, 0, 1, 104),
51 ipv4OfAllSelected = EO_COMMON_IPV4ADDR(0, 0, 0, 0),
52 ipv4Broadcast = EO_COMMON_IPV4ADDR(255, 255, 255, 255)
69 bool open(eOipv4addr_t ipv4 = hostIPaddress, eOipv4port_t port = mainIPport);
74 void verbose(
bool on);
77 void debugprint(
bool on);
87 bool boards_useinternal(
bool on);
97 bool boards_clr(
void);
100 bool boards_select(eOipv4addr_t ipv4,
bool on);
104 int boards_add(eOipv4addr_t ipv4,
boardInfo2_t &info2,
bool force);
107 int boards_rem(eOipv4addr_t ipv4);
120 EthBoardList discover(
bool clearbeforediscovery =
true,
int numberofdiscoveries = 1,
double waittimeout = 1.0);
129 EthBoardList information(eOipv4addr_t ipv4,
bool ask2board =
true,
bool forcemaintenance =
true,
int numberofrequests = 1,
double waittimeout = 1.0);
133 std::string moreinformation(eOipv4addr_t ipv4,
bool forcemaintenance =
false);
139 bool go2maintenance(eOipv4addr_t ipv4,
bool verify =
true,
int retries = 6,
double timegap = 1.0);
149 bool go2application(eOipv4addr_t ipv4,
bool checkdef2runapplication =
true,
double bootstraptime = 10.0,
bool verify =
true);
161 bool program(eOipv4addr_t ipv4, eObrd_ethtype_t type, eOuprot_process_t process, eOversion_t targetversion, FILE *
fp,
bool forcemaintenance =
true,
void progress(
float) = NULL,
bool restart2application =
true);
166 bool command_supported(eOipv4addr_t ipv4, eOuprot_proc_capabilities_t capability,
bool ask2board =
false);
168 bool command_def2run(eOipv4addr_t ipv4, eOuprot_process_t process,
bool forcemaintenance =
true,
bool verify =
true);
170 bool command_restart(eOipv4addr_t ipv4);
172 bool command_changeaddress(eOipv4addr_t ipv4, eOipv4addr_t ipv4new,
bool checkifnewispresent =
true,
bool forcemaintenance =
true,
bool restart =
false,
bool verify =
false);
174 bool command_info32_clr(eOipv4addr_t ipv4);
175 bool command_info32_set(eOipv4addr_t ipv4,
const string &info32);
176 vector<string> command_info32_get(eOipv4addr_t ipv4);
178 bool command_jump2updater(eOipv4addr_t ipv4);
180 bool command_jump2address(eOipv4addr_t ipv4, uint32_t romaddress);
182 bool command_blink(eOipv4addr_t ipv4);
184 bool command_eeprom_erase(eOipv4addr_t ipv4);
186 bool command_eeprom_read(eOipv4addr_t ipv4, uint16_t from, uint16_t size, uint8_t **value);
193 bool command_program(eOipv4addr_t ipv4, FILE *programFile, eOuprot_partition2prog_t partition,
void (*updateProgressBar)(
float),
EthBoardList *pboardlist,
string &stringresult);
213 bool sendCommand(eOipv4addr_t ipv4,
void *
cmd, uint16_t len,
EthBoardList *boardlist = NULL);
215 int sendPROG2(
const uint8_t opc,
progData_t &progdata);
217 bool isInMaintenance(eOipv4addr_t ipv4,
EthBoardList &boardlist);
218 bool isInApplication(eOipv4addr_t ipv4,
EthBoardList &boardlist);
220 string processDiscoveryReplies2(
EthBoardList &boardlist,
double waittimeout = 1.0);
222 std::string processMoreInfoReplies(
EthBoardList &boardlist);
226 std::string prepareMoreInfoText(eOuprot_cmd_DISCOVER_REPLY_t * disc,
const char *ipv4string);
227 std::string prepareMoreInfoText(eOuprot_cmd_DISCOVER_REPLY2_t * disc,
const char *ipv4string);
231 std::string getMoreInfoText(eOuprot_cmd_MOREINFO_REPLY_t *moreinfo,
char *ipv4string);
264 unsigned char mRxBuffer[uprot_UDPmaxsize];
265 unsigned char mTxBuffer[uprot_UDPmaxsize];
string ipv4tostring(eOipv4addr_t ipv4)
eOipv4addr_t acetoipv4(ACE_UINT32 address)
bool string2ipv4(const string &ipv4string, eOipv4addr_t &ipv4)
ACE_UINT32 ipv4toace(eOipv4addr_t ipv4)
static const eOipv4addr_t ipv4Broadcast
static const eOipv4addr_t ipv4OfAllSelected
static const eOipv4port_t mainIPport
EthBoardList _internalboardlist
static const eOipv4addr_t hostIPaddress
bool _useofinternalboardlist
static struct bpf_program fp
vector< EthBoard * > selected