⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pppncplib.c

📁 这是全套的PPP协议的源码
💻 C
📖 第 1 页 / 共 2 页
字号:
/* pppNcpLib.c - Common functions for ppp ncp's (IPCP & IPV6CP) *//* Copyright 1999 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01a,22may02,vk created*//*DESCRIPTIONThis module contains the common functions for both IPCP and IPV6CPINCLUDE FILES pppNcpComponent.h*/               #include "ppp/pppIpcpComponent.h"#include "private/ppp/pppIpcpComponentP.h"#include "ppp/m2pppIpcpGroup.h"#include "inetLib.h"#include "ppp/rasamm.h"#include "private/ppp/pppNcpLibP.h"#include "private/ppp/pppNcpComponentP.h"#include "ppp/interfaces/pppHcInterfaces.h" STATUS ipcp_maxTerminationRequests     (    PFW_OBJ *                         pPfw,    PFW_PARAMETER_OPERATION_TYPE      type,    void *                            pProfileData,     char *                            pValue    );STATUS ipcp_maxConfigRequests     (    PFW_OBJ *                         pPfw,    PFW_PARAMETER_OPERATION_TYPE      type,    void *                            pProfileData,     char *                            pValue    );int ipcp_configReqSendInterval     (    PFW_OBJ *                         pPfw,    PFW_PARAMETER_OPERATION_TYPE      type,    void *                            pProfileData,     char *                            pValue    );int ipcp_TerminationReqInterval     (    PFW_OBJ *                         pPfw,    PFW_PARAMETER_OPERATION_TYPE      type,    void *                            pProfileData,     char *                            pValue    );PPP_CONTROL_PHASE ipcp_pppPhaseGet ();PPP_STATE ipcp_pppStateGet     (    PFW_PLUGIN_OBJ_STATE *            pState    );/* IPCP timer handlers */STATUS ipcp_periodic_timer     (    PFW_PLUGIN_OBJ_STATE *            pPluginState,     int                               arg    );void periodic_ipcp_configure_or_termination_request     (    PFW_PLUGIN_OBJ_STATE *            pPluginState,     UINT32                            arg    );STATUS retry_ipcp_configure_request     (    PFW_PLUGIN_OBJ_STATE *            pPluginState,    int                               backoffStarted    );STATUS retry_ipcp_termination_request     (    PFW_PLUGIN_OBJ_STATE *            pPluginState,    int                               arg    );/******************************************************************************** ipcp_maxConfigRequests - get/set the maximum number of IPCP maximum configure*                                                                      requests* This routine gets or sets the value of the ncp profile data parameter * maximum_number_of_configuration_requests.** RETURNS: OK or ERROR*/int ipcp_maxConfigRequests    (    PFW_OBJ *                        pPfwObj,      /* framework reference */    PFW_PARAMETER_OPERATION_TYPE     type,         /* operation type */    void *                           pProfileData, /* profile data */    char *                           pValue        /* value for this parameter */    )    {    int                configValue = 0;    NCP_PROFILE_DATA * pIpcp       = (NCP_PROFILE_DATA *) pProfileData;    if (PFW_PARAMETER_SET == type)        {        if (NULL == pValue)            return ERROR;        if ((configValue = atoi(pValue)) > 0)            pIpcp->maximum_number_of_configuration_requests = configValue;        return (OK);        }    if (PFW_PARAMETER_GET == type)	sprintf(pValue,"%ld",pIpcp->maximum_number_of_configuration_requests);    return (OK);    }/******************************************************************************** ipcp_maxTerminationRequests - get/set the maximum number of IPCP maximum *                                                        termination requests** This routine gets or sets the value of the ncp profile data parameter * maximum_number_of_termination_requests** RETURNS: OK or ERROR*/int ipcp_maxTerminationRequests    (    PFW_OBJ *                        pPfwObj,      /* framework reference */    PFW_PARAMETER_OPERATION_TYPE     type,         /* operation type */    void *                           pProfileData, /* profile data */    char *                           pValue        /* value for this parameter */    )    {    int                configValue  = 0;    NCP_PROFILE_DATA * pIpcp        = (NCP_PROFILE_DATA *) pProfileData;    if (PFW_PARAMETER_SET == type)        {        if (NULL == pValue)            return ERROR;        if ((configValue = atoi(pValue)) > 0)            pIpcp->maximum_number_of_termination_requests = configValue;        return (OK);        }    if (PFW_PARAMETER_GET == type)        {        sprintf(pValue,"%ld",pIpcp->maximum_number_of_termination_requests);        return OK;        }    return (ERROR);    }/******************************************************************************** ipcp_configReqSendInterval - get/set the maximum number of IPCP configure *                                                request send interval.** This routine gets or sets the value of the ncp profile data parameter * maximum_configuration_request_send_interval** RETURNS: OK or ERROR*/int ipcp_configReqSendInterval    (    PFW_OBJ *                        pPfwObj,      /* framework reference */    PFW_PARAMETER_OPERATION_TYPE     type,         /* operation type */    void *                           pProfileData, /* profile data */    char *                           pValue        /* value for this parameter */    )    {    int                   configValue = 0;    NCP_PROFILE_DATA *    pIpcp       = (NCP_PROFILE_DATA *) pProfileData;    if (PFW_PARAMETER_SET == type)        {        if (NULL == pValue)            return ERROR;        if ((configValue = atoi(pValue)) > 0)            pIpcp->maximum_configuration_request_send_interval = configValue;        return (OK);        }    if (PFW_PARAMETER_GET == type)        {        sprintf(pValue,"%ld",pIpcp->maximum_configuration_request_send_interval);        return OK;        }    return (ERROR);    }/******************************************************************************** ipcp_TerminationReqInterval - get/set the maximum number of IPCP termination*                                                     request interval** This routine gets or sets the value of the ncp profile data parameter * maximum_termination_request_send_interval** RETURNS: OK or ERROR*/int ipcp_TerminationReqInterval    (    PFW_OBJ *                        pPfwObj,      /* framework reference */    PFW_PARAMETER_OPERATION_TYPE     type,         /* operation type */    void *                           pProfileData, /* profile data */    char *                           pValue        /* value for this parameter */    )    {    int                configValue = 0;    NCP_PROFILE_DATA * pIpcp       = (NCP_PROFILE_DATA *) pProfileData;    if (PFW_PARAMETER_SET == type)        {        if (NULL == pValue)            return ERROR;        if ((configValue = atoi(pValue)) > 0)            pIpcp->maximum_termination_request_send_interval = configValue;        return (OK);        }    if (PFW_PARAMETER_GET == type)        {        sprintf(pValue,"%ld",pIpcp->maximum_termination_request_send_interval);        return OK;        }    return (ERROR);    }/******************************************************************************** ipcp_pppPhaseGet - Get the ipcp ppp phase** RETURNS: PPP_CONTROL_PHASE*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -