📄 pppadapterlayer.c
字号:
/* pppAdapterLayer.c - PPP Adapter Layer Source File *//* Copyright 1999 Wind River Systems, Inc. */#include "copyright_wrs.h"/*modification history--------------------01e,29nov99,sj adding DESCRIPTION for refgen01d,28oct99,sj upgrading to latest version of framework01c,23aug99,sj modified for generic framework01b,12jul99,koz included new framework header files and updated interfaces accordingly01a,07jul99,koz created*//* includes */#include "stdio.h"#include "stdlib.h"#include "string.h"#include "vxWorks.h"#include "netBufLib.h"#include "pfw/pfw.h"#include "pfw/pfwComponent.h"#include "pfw/pfwLayer.h"#include "ppp/pppAdapterLayer.h"/*DESCRIPTIONThis module implements the ADAPTER_LAYER plug-in object and it resides inthe FRAMING plane.This is a NON_OPERATIONAL layer and in any profile only onecomponent may be configured within this layer.*//* defines *//* typedefs *//* locals *//* forwards */LOCAL STATUS componentAdd (PFW_COMPONENT_OBJ *);/********************************************************************************* pppAdapterLayerCreate - initialize and add the PPP Adapter Layer** This routine adds the ADAPTER_LAYER plug-in object to the framework** RETURNS: OK or ERROR**/STATUS pppAdapterLayerCreate ( PFW_OBJ * pfw /* framework we are adding this to */ ) { PFW_LAYER_OBJ *pAdapterLayer; pAdapterLayer = (PFW_LAYER_OBJ *) calloc (1, sizeof(PFW_LAYER_OBJ)); if (pAdapterLayer == NULL) { pfwPrintError (__FILE__, "pppAdapterLayerInit", __LINE__, pfw,0, "Unable to allocate memory"); return (ERROR); } strcpy(pAdapterLayer->pluginObj.name, "ADAPTER_LAYER"); pAdapterLayer->pluginObj.pfwObj = pfw; pAdapterLayer->pluginObj.profileDataSize = 0; pAdapterLayer->pluginObj.stackDataSize = 0; pAdapterLayer->pluginObj.profileDataConstruct = NULL; pAdapterLayer->pluginObj.profileDataCopy = NULL; pAdapterLayer->pluginObj.profileDataDestruct = NULL; pAdapterLayer->pluginObj.stackDataConstruct = NULL; pAdapterLayer->pluginObj.stackDataDestruct = NULL; pAdapterLayer->planeId = FRAMING_PLANE; pAdapterLayer->position = 1; pAdapterLayer->type = NON_OPERATIONAL_LAYER; pAdapterLayer->componentAdd = componentAdd; if (pfwLayerAdd (pAdapterLayer) == ERROR) { pfwPrintError (__FILE__, "pppAdapterLayerInit", __LINE__, pfw,0, "Adapter layer could not be added to the stack"); return (ERROR); } return (OK); }/******************************************************************************** pppAdapterLayerDelete - delete the Adapter Layer from the framework** The ADAPTER_LAYER plug-in component object allocated by * pppAdapterLayerCreate() is freed if there are no references to this* object from a Stack or Profile object in the framework.** RETURNS: OK or ERROR*/STATUS pppAdapterLayerDelete ( PFW_OBJ *pfw ) { PFW_LAYER_OBJ *pAdapterLayer; pAdapterLayer = (PFW_LAYER_OBJ *)pfwLayerObjGet (pfw, "ADAPTER_LAYER"); if (pAdapterLayer == NULL) return ERROR; if (pfwLayerDelete (pAdapterLayer) == OK) { free (pAdapterLayer); return OK; } return (ERROR); }LOCAL STATUS componentAdd (PFW_COMPONENT_OBJ *obj){return (OK);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -