📄 aal2switchtablesxp.c
字号:
/* * aal2SwitchTables.c * * AAL2 Switch tables building *//* * Copyright (c) 2001, 2002 C-Port Corporation * All Rights Reserved * * The information contained in this file is confidential and proprietary. * Any reproduction, use or disclosure, in whole or in part, of this * program, including any attempt to obtain a human-readable version of this * program, without the express, prior written consent of C-Port * Corporation is strictly prohibited. */#include <dcpTypes.h>#include <dcpTableSvcs.h>#include <atm.h>#include <atmVcTable.h>#include <aal2TableDefs.h>#include <aal2XpIf.h>/* #define RX_MISC_1_2 */extern VcUnicastIngressInit atmSwitchUnicastTables1[];/* * Function: aal2CidTableSetup * * Description: Create the table to be by used AAL2 RX CPs for * switching the cells to the AAL2 TX CP. Egress VcIndex, * CID and queue ids are obtained from the lookup. * * Modifications had been done to include the changes * due to ATM table enhancements which uses HTK table. * Now all the AAL2 CPs do a lookup on the same table. * * Arguments: TsTableId * * Returns: none */#define MAX_AAL2_VC_INDEX 25void aal2CidTableSetup(TsTableId tableId){ int16u vcIndex; int16u ocid; int16u ecid; CidTabEntry etabEntry; CidTabEntry otabEntry; CidTabEntryData *edata = &(etabEntry.data); CidTabEntryData *odata = &(otabEntry.data); for (vcIndex = 1; vcIndex < MAX_AAL2_VC_INDEX; vcIndex++) { for (ecid = 1; ecid <= 7; ecid++) { edata->queueId = XP_RES_CID_QUEUE; etabEntry.index = composeCidIndex (vcIndex,ecid); edata->vcIndex = vcIndex; edata->cid = ecid; edata->atmEgressKey = atmSwitchUnicastTables1[edata->vcIndex - 1].ingressData.atmEgressKey; aal2CidTableWrite(&etabEntry, tableId); } for (ecid = 8, ocid = 9; ecid < 249; ecid+= 48, ocid += 48) { if (vcIndex <= 4) { edata->queueId = AAL2_TX5_BASE_QUEUE; odata->queueId = AAL2_TX5_BASE_QUEUE; } else if (vcIndex <= 8) { edata->queueId = AAL2_TX4_BASE_QUEUE; odata->queueId = AAL2_TX4_BASE_QUEUE; } else if (vcIndex <= 12) { edata->queueId = AAL2_TX6_BASE_QUEUE; odata->queueId = AAL2_TX6_BASE_QUEUE; } else if (vcIndex <= 16) { edata->queueId = AAL2_TX2_BASE_QUEUE; odata->queueId = AAL2_TX2_BASE_QUEUE; } else if (vcIndex <= 20) { edata->queueId = AAL2_TX1_BASE_QUEUE; odata->queueId = AAL2_TX1_BASE_QUEUE; } else if (vcIndex <= 24) { edata->queueId = AAL2_TX3_BASE_QUEUE; odata->queueId = AAL2_TX3_BASE_QUEUE; } /* Write the even CID data first */ edata->vcIndex = MAX_AAL2_VC_INDEX - vcIndex; etabEntry.index = composeCidIndex (vcIndex,ecid); edata->cid = 256 - ecid; edata->atmEgressKey = atmSwitchUnicastTables1[edata->vcIndex - 1].ingressData.atmEgressKey; aal2CidTableWrite(&etabEntry, tableId); /* Write the odd CID data next */ odata->vcIndex = MAX_AAL2_VC_INDEX - vcIndex; otabEntry.index = composeCidIndex (vcIndex,ocid); odata->cid = 258 - ocid; odata->atmEgressKey = atmSwitchUnicastTables1[odata->vcIndex - 1].ingressData.atmEgressKey; aal2CidTableWrite(&otabEntry, tableId); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -