📄 mpapi.c
字号:
*/MP_BUNDLE_STATE mpGetBundleState ( PFW_STACK_OBJ *pManagerStackObj /* member stack object */ ) { PFW_OBJ * pfwFrameworkObj = NULL; PFW_PLUGIN_OBJ * pluginObj = NULL; PFW_PLUGIN_OBJ_STATE * mpFramingLayerPluginObjState = NULL; MP_FRAMING_LAYER_STACK_DATA * pFramingLayerStackData = NULL; MP_BUNDLE_STATE mpBundleState; if (pManagerStackObj == NULL) return ERROR; pfwFrameworkObj = pfwStackObjPfwGet (pManagerStackObj); pluginObj = pfwPluginObjGet (pfwFrameworkObj, "MP_FRAMING_LAYER"); if ((mpFramingLayerPluginObjState = pfwPluginObjStateGet (pManagerStackObj, pluginObj)) == NULL) return MP_BUNDLE_INVALID_STATE; if (pfwPluginObjStateLock (mpFramingLayerPluginObjState) == ERROR) return MP_BUNDLE_INVALID_STATE; pFramingLayerStackData = mpFramingLayerPluginObjState->stackData; mpBundleState = pFramingLayerStackData->bundle_state; if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return MP_BUNDLE_INVALID_STATE; return mpBundleState; }/******************************************************************************** mpGetNoOfLinksInTheBundle - Returns the number of links in the bundle* * This function returns the number of links in the bundle.** RETURNS: Number of bundles*/int mpGetNoOfLinksInTheBundle ( PFW_STACK_OBJ *pManagerStackObj /* manager stack object */ ) { PFW_OBJ * pfwFrameworkObj = NULL; PFW_PLUGIN_OBJ * pluginObj = NULL; PFW_PLUGIN_OBJ_STATE * mpFramingLayerPluginObjState = NULL; MP_FRAMING_LAYER_STACK_DATA * pFramingLayerStackData = NULL; int noOfBundles = 0; if (pManagerStackObj == NULL) return ERROR; pfwFrameworkObj = pfwStackObjPfwGet (pManagerStackObj); pluginObj = pfwPluginObjGet (pfwFrameworkObj, "MP_FRAMING_LAYER"); if ((mpFramingLayerPluginObjState = pfwPluginObjStateGet (pManagerStackObj, pluginObj)) == NULL) return ERROR; if (pfwPluginObjStateLock (mpFramingLayerPluginObjState) == ERROR) return ERROR; pFramingLayerStackData = mpFramingLayerPluginObjState->stackData; noOfBundles = pFramingLayerStackData->bundle.no_of_links; if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return noOfBundles; }/******************************************************************************** mpGetNoOfLinksInTheSendingEndOfTheBundle - returns the number of links in * the sending end of the bundle* * This function returns the number of links in the sending end of the bundle.** RETURNS: Number of links*/int mpGetNoOfLinksInTheSendingEndOfTheBundle ( PFW_STACK_OBJ *pManagerStackObj /* manager stack object */ ) { PFW_OBJ * pfwFrameworkObj = NULL; PFW_PLUGIN_OBJ * pluginObj = NULL; PFW_PLUGIN_OBJ_STATE * mpFramingLayerPluginObjState = NULL; MP_FRAMING_LAYER_STACK_DATA * pFramingLayerStackData = NULL; int noOfLinks = 0; if (pManagerStackObj == NULL) return ERROR; pfwFrameworkObj = pfwStackObjPfwGet (pManagerStackObj); pluginObj = pfwPluginObjGet (pfwFrameworkObj, "MP_FRAMING_LAYER"); if ((mpFramingLayerPluginObjState = pfwPluginObjStateGet (pManagerStackObj, pluginObj)) == NULL) return ERROR; if (pfwPluginObjStateLock (mpFramingLayerPluginObjState) == ERROR) return ERROR; pFramingLayerStackData = mpFramingLayerPluginObjState->stackData; noOfLinks = pFramingLayerStackData->bundle.sending_end.no_of_links; if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return noOfLinks; }/******************************************************************************** mpGetNoOfLinksInTheReceivingEndOfTheBundle - returns the number of links * in the receiving end of the bundle* * This function returns the number of links in the receving end of the bundle.** RETURNS: Number of links*/int mpGetNoOfLinksInTheReceivingEndOfTheBundle ( PFW_STACK_OBJ *pManagerStackObj /* manager stack object */ ) { PFW_OBJ * pfwFrameworkObj = NULL; PFW_PLUGIN_OBJ * pluginObj = NULL; PFW_PLUGIN_OBJ_STATE * mpFramingLayerPluginObjState = NULL; MP_FRAMING_LAYER_STACK_DATA * pFramingLayerStackData = NULL; int noOfLinks = 0; if (pManagerStackObj == NULL) return ERROR; pfwFrameworkObj = pfwStackObjPfwGet (pManagerStackObj); pluginObj = pfwPluginObjGet (pfwFrameworkObj, "MP_FRAMING_LAYER"); if ((mpFramingLayerPluginObjState = pfwPluginObjStateGet (pManagerStackObj, pluginObj)) == NULL) return ERROR; if (pfwPluginObjStateLock (mpFramingLayerPluginObjState) == ERROR) return ERROR; pFramingLayerStackData = mpFramingLayerPluginObjState->stackData; noOfLinks = pFramingLayerStackData->bundle.receiving_end.no_of_links; if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return noOfLinks; }/******************************************************************************** mpGetNoOfBundles - returns the number of bundles in the framework* * This function returns the number of bundles in the framework.** RETURNS: Number of bundles*/USHORT mpGetNoOfBundles ( PFW_OBJ *pfwObj /* framework object */ ) { PFW_PLUGIN_OBJ * pluginObj = NULL; MP_FRAMING_LAYER * mpFramingComponent = NULL; if (pfwObj == NULL) return ERROR; pluginObj = pfwPluginObjGet (pfwObj, "MP_FRAMING_LAYER"); /* Get MP FRAMING LAYER COMPONENT structure address */ mpFramingComponent = (MP_FRAMING_LAYER *) pluginObj; return mpFramingComponent->no_of_bundles; }/******************************************************************************** mpIsLinkInSendingEnd - Checks whether given link in sending_end in any * of the bundle and returns the manager Stack Obj.* * Checks whether the given link is there in any of the bundle. If so, checks * whether it is in the sending end of the bundle. If so, it gets the bundle * number and returns TRUE. Otherwise, it returns FALSE.** RETURNS: OK/ERROR*/STATUS mpIsLinkInSendingEnd ( PFW_STACK_OBJ *pMemberStackObj, /* member stack object */ PFW_STACK_OBJ **pManagerStackObj /* manager stack object */ ) { PFW_OBJ * pfwFrameworkObj = NULL; PFW_PLUGIN_OBJ * pluginObj = NULL; PFW_PLUGIN_OBJ_STATE * mpFramingLayerPluginObjState = NULL; MP_FRAMING_LAYER_STACK_DATA * pFramingLayerStackData =NULL; MP_BUNDLE_SENDING_END_LINK_CLASS sendingEndLinkClass[MAX_NO_OF_PPP_PORTS]; USHORT linkIndex = 0; if ((pMemberStackObj == NULL) || (pManagerStackObj == NULL)) return ERROR; if (mpFindAPortToBundleMapping (pMemberStackObj, pManagerStackObj) == FAIL) return ERROR; pfwFrameworkObj = pfwStackObjPfwGet ((PFW_STACK_OBJ *)*pManagerStackObj); pluginObj = pfwPluginObjGet (pfwFrameworkObj, "MP_FRAMING_LAYER"); if ((mpFramingLayerPluginObjState = pfwPluginObjStateGet ((PFW_STACK_OBJ *)*pManagerStackObj, pluginObj)) == NULL) return ERROR; if (pfwPluginObjStateLock (mpFramingLayerPluginObjState) == ERROR) return ERROR; pFramingLayerStackData = mpFramingLayerPluginObjState->stackData; for (linkIndex = 0; linkIndex < pFramingLayerStackData->bundle.sending_end.no_of_links; linkIndex ++) { sendingEndLinkClass[linkIndex] = pFramingLayerStackData->bundle.sending_end.links[linkIndex]; if (sendingEndLinkClass[linkIndex].pMemberStackObj == pMemberStackObj) { if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return OK; } } if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return ERROR; }/******************************************************************************** mpIsLinkInReceivingEnd - Checks whether given link in receiving_end in * any of the bundle and returns the manager Stack Obj* * Checks whether the given link is there in any of the bundle. If so, checks * whether it is in the receiving end of the bundle. If so, it gets the bundle * number and returns OK. Otherwise, it returns ERROR.** RETURNS: OK/ERROR*/STATUS mpIsLinkInReceivingEnd ( PFW_STACK_OBJ *pMemberStackObj, /* member stack object */ PFW_STACK_OBJ **pManagerStackObj /* manager stack object */ ) { PFW_OBJ * pfwFrameworkObj = NULL; PFW_PLUGIN_OBJ * pluginObj = NULL; PFW_PLUGIN_OBJ_STATE * mpFramingLayerPluginObjState = NULL; MP_FRAMING_LAYER_STACK_DATA * pFramingLayerStackData = NULL; MP_BUNDLE_RECEIVING_END_LINK_CLASS recvingingEndLinkClass[MAX_NO_OF_PPP_PORTS]; USHORT linkIndex = 0; if ((pMemberStackObj == NULL) || (pManagerStackObj == NULL)) return ERROR; if (mpFindAPortToBundleMapping (pMemberStackObj, pManagerStackObj) == FAIL) return ERROR; pfwFrameworkObj = pfwStackObjPfwGet ((PFW_STACK_OBJ *)*pManagerStackObj); pluginObj = pfwPluginObjGet (pfwFrameworkObj, "MP_FRAMING_LAYER"); if ((mpFramingLayerPluginObjState = pfwPluginObjStateGet ((PFW_STACK_OBJ *)*pManagerStackObj, pluginObj)) == NULL) return ERROR; if (pfwPluginObjStateLock (mpFramingLayerPluginObjState) == ERROR) return ERROR; pFramingLayerStackData = mpFramingLayerPluginObjState->stackData; for (linkIndex = 0; linkIndex < pFramingLayerStackData->bundle.receiving_end.no_of_links; linkIndex ++) { recvingingEndLinkClass[linkIndex] = pFramingLayerStackData->bundle.receiving_end.links[linkIndex]; if (recvingingEndLinkClass[linkIndex].pMemberStackObj == pMemberStackObj) { if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return OK; } } if (pfwPluginObjStateRelease (mpFramingLayerPluginObjState) == ERROR) return ERROR; return ERROR; }/******************************************************************************** mpGetManagerStackObj - Get the manager stack object** This function gets the Manager Stack obj of the given bundle number.* * RETURNS: PFW_STACK_OBJ **/PFW_STACK_OBJ * mpGetManagerStackObj ( UINT bundleNumber, PFW_OBJ *pfwObj ) { MP_FRAMING_LAYER *pComponentData = NULL; if (pfwObj == NULL) return NULL; pComponentData = (MP_FRAMING_LAYER *) pfwPluginObjGet (pfwObj, "MP_FRAMING_LAYER"); return (pComponentData-> bundle_count_to_manager_stackObj_lookup[bundleNumber].pManagerStackObj); }/******************************************************************************** mpManagerStackObjForBundleIdGet - Get the manager stack object** This function gets the Manager Stack obj of bundle with the given bundle * identifier* * RETURNS: PFW_STACK_OBJ **/PFW_STACK_OBJ *mpManagerStackObjForBundleIdGet ( PFW_OBJ *pfwObj, MP_BUNDLE_IDENTIFIER *id ) { PFW_PLUGIN_OBJ_STATE *pState = NULL; if (pfwObj == NULL) return NULL; if (is_bundle_exist (pfwObj, &pState, id)) { if (pState != NULL) return pState->stackObj; } return NULL; }/******************************************************************************** isNoEidNoAuthCase - Check for RFC 1990 5.1.3 no EID no authentication case** This function checks whether the given bundle identifer has no eid values as* well as no authentication parameters. This function can be used in dynamic* assignment of member stack to a manager stack to check whether mannual * configuration is required for the link.* * RETURNS: PFW_STACK_OBJ **/BOOL isNoEidNoAuthCase ( MP_BUNDLE_IDENTIFIER *id ) { return (is_RFC_1990_5_1_3_CASE_1(id)); }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -