星期一, 十一月 05, 2007

Lwip's ppp

It's designed very greate.
PPP is used for dialing to Internet by low-level Link, including three steps on this process.

Initppp():
Just make Ppp_Ctrl[i].OpenFlag = 0;

OpenPpp():
1, this function will return a 'pd' which identifies a current requested Dials. this pd is set being used by set ppp_Ctrl[pd].OpenFlag = 1, and then it will do fsm_up().
2, fsm is status machine. Perfect design to use fsm to control lcp->pap->ipcp dialing in each step.

ClosePpp():
closing a ppp connection.

Using callback machnism:
if there is any error or expection happened, the connection will report it to a 'cb' which set at OpenPpp(CallBack_LinkStatus linkStatus, ...)

Output and Input Data interface:
Lwip use mailBox for dealing message. When the Incoming interface receives datas, it will make a message and pass it(including data) to message queue, then the TCPIP_thread treats the message queue, it just pass sth to the core of tcpip.

0 条评论:

发表评论

订阅 博文评论 [Atom]

<< 主页