|
From: | VANSTAEN Laurent RD-MAPS-GRE |
Subject: | [lwip-users] LWIP, PPP and GPRS |
Date: | Wed, 21 Jul 2004 13:59:57 +0200 |
Hi,
I'm resending a mail exchange started with Michael Broughton, to continue it here if someone is interested.
To Michael, first thanks for your help !
The call to function alloc for ppp->session and ppp->statemachine are there to manage the memory on our OS (it's a home made OS).
I have modified a lot of lwip to use it with our own protocol stack, and I do not use the TCP part, so I think I do not have to call tcpip_init().
For the FSM routines, for example fsm_init : it is only called in lcp_init() and ipcp_init(), do I have to call one of these routine myself ?
___________________________________________________________________________________________________
Michael's answer :
A couple of things jump out at me:
I don't understand what you are doing with ppp->session and ppp->statemachine.
You forgot to call tcpip_init. This init is quite important to PPP.
You aren't supposed to call any of the FSM routines yourself. I'm not sure why you would want to.
It looks as if you've tried to open PPP before dialing up your GPRS modem? I don't think that will work.
One last thing, I think it would be better if you could keep the LWIP discussions on the mailing list. Thanks.
_______________________________________________________________________________________
My initial message to Michael :
Hi,
I've just read your posts on the LWIP forum and I've got a few questions if you have some time.
I'm trying to use lwip with PPP and a GPRS module I've written that takes care of AT commands. My init code looks like that :
initModem(); // This sends some AT commands to reboot the GPRS modem for example
// PPP Session initialization
ppp->session = (struct sessiondata*) CALL(ppp->allocator, alloc, sizeof(struct sessiondata));
ppp->state_machine = (fsm*) CALL(ppp->allocator, alloc, sizeof(fsm));
ppp->login = "******";
ppp->password = "*****";
stats_init();
mem_init();
memp_init();
pbuf_init();
pppInit();
fsm_init(ppp->state_machine); // FSM State = INITIAL after the init
fsm_lowerup(ppp->state_machine); // FSM State becomes CLOSED
fsm_open(ppp->state_machine); // FSM State becomes REQSENT
pppSetAuth(PPPAUTHTYPE_CHAP,ppp->login, ppp->password);
// Calls LWIP pppOpen() after some particuliar treatment
WrappedPPPopen(NULL, APN, ppp->session->proto, 0);
// Tests of the phone functionnalities
CALL(ppp->modem, phonecall, phoneNumber);
other tests ...
The initModem phase looks good, all the inits are OK, but my peer keeps sending Configure-Request packets without any answer from the other end (which should be my GPRS provider).
Do you have any idea where this could come from ?
Thank you,
Sincerely,
Laurent Vanstaen
France Telecom R&D
[Prev in Thread] | Current Thread | [Next in Thread] |