EmbeddedRelated.com
Forums

issue : ifconfig

Started by fredolamainfroide June 24, 2008
Hi all
I have an issue concerning ifconfig. I try to wake up ethernet
interface on RCM4300.
When i run :
-------
ifconfig(IF_ETH0, IFS_UP, IFS_END);
while (ifpending(IF_DEFAULT) == IF_COMING_UP) {
tcp_tick(NULL);
}
-------

the loop never ends!
Why the status doesn't turn to IF_UP ?

Thanks

Have you set static/dynamic, IP addr, router, and nameserver before
trying to bring it up?

--- In r..., "fredolamainfroide"
wrote:
>
> Hi all
> I have an issue concerning ifconfig. I try to wake up ethernet
> interface on RCM4300.
> When i run :
> -------
> ifconfig(IF_ETH0, IFS_UP, IFS_END);
> while (ifpending(IF_DEFAULT) == IF_COMING_UP) {
> tcp_tick(NULL);
> }
> -------
>
> the loop never ends!
> Why the status doesn't turn to IF_UP ?
>
> Thanks
>

Yes, I set static ip configuration :
--------
#define TCPCONFIG 1
#define _PRIMARY_STATIC_IP "192.168.0.158"
#define _PRIMARY_NETMASK "255.255.255.0"
#define MY_GATEWAY "192.168.0.1"
#define MY_NAMESERVER "192.168.0.1"
--------
--- In r..., "joejaworski" wrote:
>
> Have you set static/dynamic, IP addr, router, and nameserver before
> trying to bring it up?
> --- In r..., "fredolamainfroide"
> wrote:
> >
> > Hi all
> > I have an issue concerning ifconfig. I try to wake up ethernet
> > interface on RCM4300.
> > When i run :
> > -------
> > ifconfig(IF_ETH0, IFS_UP, IFS_END);
> > while (ifpending(IF_DEFAULT) == IF_COMING_UP) {
> > tcp_tick(NULL);
> > }
> > -------
> >
> > the loop never ends!
> > Why the status doesn't turn to IF_UP ?
> >
> > Thanks
>
I understand that ifconfig is for change the ip address in run time.
I always use this with an IP address asociated,

For example:

ifconfig(IF_ETH0, IFS_IPADDR, aton("192.168.0.158"),
IFS_NETMASK, aton("255.255.255.0"),
IFS_ROUTER_SET, aton("192.168.0.1"),
IFS_NAMESERVER_SET, aton("192,168.0.1"),
IFS_UP,
IFS_END);

The strings can be chanded for variables, as config.wdirip,
config.wmask,....

The aton function is for convering the char to IP format address.

Omar

--- In r..., "fredolamainfroide"
wrote:
>
> Yes, I set static ip configuration :
> --------
> #define TCPCONFIG 1
> #define _PRIMARY_STATIC_IP "192.168.0.158"
> #define _PRIMARY_NETMASK "255.255.255.0"
> #define MY_GATEWAY "192.168.0.1"
> #define MY_NAMESERVER "192.168.0.1"
> --------
> --- In r..., "joejaworski" wrote:
> >
> > Have you set static/dynamic, IP addr, router, and nameserver before
> > trying to bring it up?
> >
> >
> >
> >
> > --- In r..., "fredolamainfroide"
> > wrote:
> > >
> > > Hi all
> > > I have an issue concerning ifconfig. I try to wake up ethernet
> > > interface on RCM4300.
> > > When i run :
> > > -------
> > > ifconfig(IF_ETH0, IFS_UP, IFS_END);
> > > while (ifpending(IF_DEFAULT) == IF_COMING_UP) {
> > > tcp_tick(NULL);
> > > }
> > > -------
> > >
> > > the loop never ends!
> > > Why the status doesn't turn to IF_UP ?
> > >
> > > Thanks
> > >
>