📄 mplcpinterfaces.c
字号:
{#ifdef PPP_DEBUG printf ("MP:lcpMpOptionsGet(): No AUTH_INFO_INTERFACE in framework 0x%x\n", (int) pfwObj); #endif /* PPP_DEBUG */ if (pfwPluginObjStateRelease(pLcpState) == ERROR) return ERROR; return ERROR; } pAuthMpInterfaceObj = (AUTH_INFO_INTERFACE *) pfwInterfaceObjGetViaPluginObj (pPluginObj, authMpInterfaceId); if (pAuthMpInterfaceObj == NULL) {#ifdef PPP_DEBUG printf ("MP:lcpMpOptionsGet(): No AUTH_INFO_INTERFACE for proto 0x%x\n", pLcpBundleOptions->remoteAuthProtocol);#endif /* PPP_DEBUG */ if (pfwPluginObjStateRelease(pLcpState) == ERROR) return ERROR; return ERROR; } pAuthMpInterfaceObj->remoteUserNameGet (pState, pLcpBundleOptions->bundle_identifier.remote_user_name); if (pfwInterfaceReferenceDelete (&pAuthMpInterfaceObj->interfaceObj) == ERROR) {#ifdef PPP_DEBUG printf ("MP:lcpMpOptionsGet(): Can't delete reference to AUTH_INFO_INTERFACE\n");#endif /* PPP_DEBUG */ if (pfwPluginObjStateRelease(pLcpState) == ERROR) return ERROR; return ERROR; } } /* Local Link Discriminator */ pOptionEntry = find_matching_option(&tx_accepted_list, LCP_LINK_DISCRIMINATOR); if (pOptionEntry != NULL) { pLcpBundleOptions->local_link_discriminator = ntohs (pOptionEntry->uptr_data->_ushort); } else pLcpBundleOptions->local_link_discriminator = 0; /* Remote Link Discriminator */ pOptionEntry = find_matching_option(&rx_accepted_list, LCP_LINK_DISCRIMINATOR); if (pOptionEntry != NULL) pLcpBundleOptions->remote_link_discriminator = ntohs (pOptionEntry->uptr_data->_ushort); else pLcpBundleOptions->remote_link_discriminator = 0; if (pfwPluginObjStateRelease(pLcpState) == ERROR) return ERROR; return OK; }/******************************************************************************** lcpProxyLcpDo - * Does Proxy Lcp for the Manager Stack with the option values negotiated on * the Member Stack * * This function copies the configure lists and accepted lists of the local end * and remote end from the Member LCP to Manager LCP and sends CONFIGURE_ACK and * CONFIGURE_REQUEST_ACK events to LCP state machine so that it brings the PPP * state to PPP_OPENED state* * RETURNS: OK or ERROR*/STATUS lcpProxyLcpDo ( PFW_PLUGIN_OBJ_STATE *pLcpManagerState, /* Manager Stack's LCP state */ PFW_PLUGIN_OBJ_STATE *pLcpMemberState /* Member Stack's LCP state */ ) { OPTION_LISTS *sptr_manager_option_lists = NULL; OPTION_LISTS *sptr_member_option_lists = NULL; LCP_STACK_DATA *pManagerStackData = NULL; LCP_STACK_DATA *pMemberStackData = NULL; PFW_OBJ *pfw = pLcpManagerState->pluginObj->pfwObj; char profileString[MAX_VALUE_STRING_LENGTH]; UINT param = 0; OPTION_LIST_ENTRY *pOptionEntry = NULL; OPTION_LIST_ENTRY *pOptionEntryMRU = NULL; if (pfwPluginObjStateLock (pLcpManagerState) == ERROR) { return ERROR; } if (pfwPluginObjStateLock (pLcpMemberState) == ERROR) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; return ERROR; } bzero (profileString, MAX_VALUE_STRING_LENGTH); pManagerStackData = (LCP_STACK_DATA *)pLcpManagerState->stackData; pMemberStackData = (LCP_STACK_DATA *)pLcpMemberState->stackData; sptr_manager_option_lists = &pManagerStackData->option_lists; sptr_member_option_lists = &pMemberStackData->option_lists; free_ppp_option_lists (sptr_manager_option_lists); /* Copy member option list of tx to manager tx */ copy_configuration_options_list (pfw, &sptr_member_option_lists->tx_accepted, &sptr_manager_option_lists->tx_accepted); /* Copy member option list of rx to manager rx */ copy_configuration_options_list (pfw, &sptr_member_option_lists->rx_accepted, &sptr_manager_option_lists->rx_accepted); /* Copy member's configured option list to manager's list */ copy_configuration_options_list (pfw, &sptr_member_option_lists->configured, &sptr_manager_option_lists->configured); /* Copy member's remote configured option list to manager's remote list */ copy_configuration_options_list (pfw, &sptr_member_option_lists->remote_configured, &sptr_manager_option_lists->remote_configured); /* Disabling authentication on bundle */ param = pfwParameterIdGet (pfw, "mpFraming_disableAuthOnBundle"); if (param == 0) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } if (pfwStackParamGet (pLcpManagerState->stackObj, param, profileString) == ERROR) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } if (strcmp (profileString, "TRUE") == 0) { /* Disable authentication on the Local End */ pOptionEntry = find_matching_option(&sptr_manager_option_lists->rx_accepted, LCP_AUTHENTICATION_PROTOCOL); if (pOptionEntry != NULL) { delete_entry_from_option_list (&sptr_manager_option_lists-> rx_accepted, pOptionEntry); } /* Disable authentication on the Remote End */ pOptionEntry = find_matching_option(&sptr_manager_option_lists->tx_accepted, LCP_AUTHENTICATION_PROTOCOL); if (pOptionEntry != NULL) { delete_entry_from_option_list (&sptr_manager_option_lists-> tx_accepted, pOptionEntry); } } /* Remove Magic Number From Manager Stack */ pOptionEntry = find_matching_option(&sptr_manager_option_lists->rx_accepted, LCP_MAGIC_NUMBER); if (pOptionEntry != NULL) { delete_entry_from_option_list (&sptr_manager_option_lists-> rx_accepted, pOptionEntry); } pOptionEntry = find_matching_option(&sptr_manager_option_lists->tx_accepted, LCP_MAGIC_NUMBER); if (pOptionEntry != NULL) { delete_entry_from_option_list (&sptr_manager_option_lists-> tx_accepted, pOptionEntry); } /* Bundle MRRU should be the Manager Stack's MRU. Copy the MRRU negotiated on the local end and remote end to the MRU option list entry in the tx_accepted_list and rx_accepted_list respectively */ pOptionEntry = find_matching_option(&sptr_manager_option_lists->rx_accepted, LCP_MULTILINK_MAXIMUM_RECEIVED_RECONSTRUCTED_UNIT); pOptionEntryMRU = find_matching_option(&sptr_manager_option_lists->rx_accepted, LCP_MAXIMUM_RECEIVE_UNIT); if (pOptionEntry == NULL) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } if (pOptionEntryMRU != NULL) { pOptionEntryMRU->length = pOptionEntry->length; memcpy (pOptionEntryMRU->uptr_data, pOptionEntry->uptr_data, pOptionEntry->length); } else { BYTE mrruLen = LCP_MRRU_OPTION_LENGTH; if (add_new_ppp_option_to_list (pfw,&sptr_manager_option_lists->rx_accepted, OPTION_ACKED_STATE, LCP_MAXIMUM_RECEIVE_UNIT, NULL, htons (mrruLen), (UINT8 *)pOptionEntry->uptr_data,FALSE,TRUE, TRUE) == FAIL) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } } pOptionEntry = find_matching_option(&sptr_manager_option_lists->tx_accepted, LCP_MULTILINK_MAXIMUM_RECEIVED_RECONSTRUCTED_UNIT); pOptionEntryMRU = find_matching_option(&sptr_manager_option_lists->tx_accepted, LCP_MAXIMUM_RECEIVE_UNIT); if (pOptionEntry == NULL) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } if (pOptionEntryMRU != NULL) { pOptionEntryMRU->length = pOptionEntry->length; memcpy (pOptionEntryMRU->uptr_data, pOptionEntry->uptr_data, pOptionEntry->length); } else { BYTE mrruLen = LCP_MRRU_OPTION_LENGTH; if (add_new_ppp_option_to_list (pfw,&sptr_manager_option_lists->tx_accepted, OPTION_ACKED_STATE, LCP_MAXIMUM_RECEIVE_UNIT, NULL, htons (mrruLen), (UINT8 *)pOptionEntry->uptr_data,FALSE,TRUE, TRUE) == FAIL) { if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) return ERROR; if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } } pManagerStackData->isMpManagerStack = TRUE; pppConnectionOpen (pLcpManagerState->stackObj, NULL, NULL); if (pManagerStackData->last_txed_lcp_configuration_request_packet != NULL) { netMblkClChainFree ( pManagerStackData->last_txed_lcp_configuration_request_packet); pManagerStackData->last_txed_lcp_configuration_request_packet = NULL; } /* * SPR# 85936: In passive mode, server is in STOPPED state. * PPP_RECEIVE_CONFIGURE_REQUEST_GOOD_EVENT needs to happen before * PPP_RECEIVE_CONFIGURE_ACK_EVENT. In non-passive mode, the order * of these event does not matter. */ execute_ppp_state_machine (pLcpManagerState, PPP_RECEIVE_CONFIGURE_REQUEST_GOOD_EVENT, NULL); execute_ppp_state_machine (pLcpManagerState, PPP_RECEIVE_CONFIGURE_ACK_EVENT, NULL); if (pfwPluginObjStateRelease (pLcpManagerState) == ERROR) { if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) return ERROR; return ERROR; } if (pfwPluginObjStateRelease (pLcpMemberState) == ERROR) { return ERROR; } return OK; }#if 0/******************************************************************************** lcpMpLinkTime - Set the link in MP Timing Mode* * This function sets is_mp_timing_link variable in the LCP stack data to TRUE so * that when LCP echo reply is received, LCP raise LCP_ECHO_REPLY_RECEIVED. On * this event handler, MP times the link.* * RETURNS: N/A*/STATUS lcpMpLinkTime ( PFW_PLUGIN_OBJ_STATE *pLcpState /* member stack's LCP state */ ) { LCP_STACK_DATA *pStackData = NULL; pStackData = pLcpState->stackData; if (pfwPluginObjStateLock (pLcpState) == ERROR) return ERROR; /* Set the link in the timing mode */ pStackData->is_mp_timing_the_link = TRUE; if (pfwPluginObjStateRelease (pLcpState) == ERROR) return ERROR; return OK; }#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -