📄 ncp.c
字号:
/****************************************Copyright (c)**************************************************
** 广州周立功单片机发展有限公司
** 研 究 所
** 产品一部
**
** http://www.zlgmcu.com
**
**--------------文件信息--------------------------------------------------------------------------------
**文 件 名: HardDriverCtr.h
**创 建 人: 陈明计
**最后修改日期: 2004年4月23日
**描 述: 网络控制协议(ncp)簇管理程序
**
**--------------历史版本信息----------------------------------------------------------------------------
** 创建人: 陈明计
** 版 本: 0.10b
** 日 期: 2004年4月23日
** 描 述: 原始版本
**
**--------------当前版本修订------------------------------------------------------------------------------
** 修改人:
** 日 期:
** 描 述:
**
**------------------------------------------------------------------------------------------------------
********************************************************************************************************/
#define IN_NCP
#include "config.h"
uint8 NCPFlag;
void NCPOpen(PppData *ThisPPP)
{
ThisPPP = ThisPPP;
NCPFlag = NCP_AT_PAP;
PAPSendPassword(ThisPPP);
}
void NCPClose(PppData *ThisPPP)
{
ThisPPP = ThisPPP;
NCPFlag = NCP_AT_PAP;
PPPClose();
}
void NCPGetFrame(PppData *ThisPPP, uint8 *DataBuf, uint8 Q)
{
uint16 Protocol;
DataBuf = DataBuf;
if (NCPFlag == NCP_AT_PAP)
{
switch (Q)
{
case PPP_EVENT_TO_R:
PAPSendPassword(ThisPPP);
break;
case PPP_EVENT_TO_E:
NCPClose(ThisPPP);
break;
case PPP_EVENT_UP_LAYER:
if (PAPGetFram(ThisPPP, DataBuf) == PASS_WORD_PASS)
{
NCPFlag = NCP_AT_NETWORK;
PPP_irc(DataBuf, Q);
IPCPOpen(ThisPPP);
// NCPOpenHook();
}
break;
default :
break;
}
}
else
{
Protocol = DataBuf[0] * 256 | DataBuf[1];
if (Protocol == PPP_FRAM_TYPE__IPCP || Protocol == PPP_FRAM_TYPE__IP)
{
IPCPGetFrame(ThisPPP, DataBuf, Q);
// NCPGetFrameHook(ThisPPP, DataBuf, Q);
}
}
}
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -