Page 1 of 1

EthernetIP not declared

Posted: Wed Mar 09, 2022 3:35 pm
by RebootExpert
I installed v3.3.7, and create an empty project. When I try to build the project, there are errors show that EthernetIP was not declared in tcp.cpp

Code: Select all

#include <predef.h>
#include <stdio.h>
#include <nbrtos.h>
#include <http.h>
#include <init.h>
#include <netinterface.h>


const char * AppName="project1";

void EnableOSStackProtector();

void UserMain(void * pd)
{
    EnableOSStackProtector(); // TODO: Uncomment #define NBRTOS_STACKOVERFLOW and/or NBRTOS_UNDEROVERFLOWin predef.h, rebuild libraries
    init();
    GetInterfaceBlock()->discovery_server = "discover.netburner.com";
    WaitForActiveNetwork(TICKS_PER_SECOND * 5);   // Wait up to 5 seconds for active network activity 
    StartHttp();

    iprintf("Application %s started\n",AppName );
    while (1)
    {
        OSTimeDly(TICKS_PER_SECOND);
    }
}

Re: EthernetIP not declared

Posted: Thu Mar 10, 2022 10:47 am
by SeeCwriter
I don't think EthernetIP is used in the v3.x tools. Looking through my 3.3.7 app, I replaced EthernetIP with either ifBlock->ip4.cur_addr or InterfaceIP(GetFirstInterface()).

Re: EthernetIP not declared

Posted: Thu Mar 10, 2022 11:46 am
by TomNB
SeeCwriter is correct. The ShowInterfaces example is a good one to see how you can handle IP address information.

Re: EthernetIP not declared

Posted: Thu Mar 10, 2022 4:23 pm
by RebootExpert
since the EtherneIP are wrap inside of a SNMP macro, I reinstall the v3.3.7 without snmp feature to fix the problem. I suggest future release replace the EthernetIP if not used

Re: EthernetIP not declared

Posted: Fri May 13, 2022 4:49 am
by NicholasAttwood
This is a great idea. That's what I would do