[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re[lwip-users] turn value for netif
From: |
slvsrmark |
Subject: |
re[lwip-users] turn value for netif |
Date: |
Wed, 23 Apr 2008 23:52:28 -0700 (PDT) |
Hi all,
I am using lwip 1.1.0 version for my application.In my program i used
pppinit(), pppopen() to have link establishment. after establishing the link
netif init callback function is called and then sifup is reached.
sifup - Config the interface up and enable IP packets to pass.in this
function the netif_add() is called and it returns the address as zero, due
to this the ipcp_close is called and the connection is going down.Please
suggest me how to pass packets from this packets the particular part is
added below
/*
* sifup - Config the interface up and enable IP packets to pass. /*from
this function we can send udp/tcp packets*/*/
int sifup(int pd)
{
PPPControl *pc = &pppControl[pd];
int st = 1;
pcb1 = malloc(sizeof(struct udp_pcb));
if (pd < 0 || pd >= NUM_PPP || !pc->openFlag) {
st = 0;
PPPDEBUG((LOG_WARNING, "sifup[%d]: bad parms\n", pd));
} else {
if(pc->netif)
netif_remove(pc->netif);
//DOUBT subram
pc->netif = netif_add(pc->netif,&pc->addrs.our_ipaddr,
&pc->addrs.netmask, &pc->addrs.his_ipaddr, (void *)pd, pppifNetifInit,
ip_input);
if(pc->netif)
{
pc->if_up = 1;
pc->errCode = PPPERR_NONE;
PPPDEBUG((LOG_DEBUG, "sifup: unit %d:
linkStatusCB=%lx errCode=%d\n", pd, pc->linkStatusCB, pc->errCode));
if(pc->linkStatusCB)
pc->linkStatusCB(pc->linkStatusCtx,
pc->errCode, &pc->addrs);
} else {
st = 0;
PPPDEBUG((LOG_ERR, "sifup[%d]: netif_add failed\n", pd));
}
}
return st;
}
Thanks
--
View this message in context:
http://www.nabble.com/return-value-for-netif-tp16845629p16845629.html
Sent from the lwip-users mailing list archive at Nabble.com.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- re[lwip-users] turn value for netif,
slvsrmark <=