//函数指针数组
FN_IOCTL IoctlFuncs[] = {
DoVrgEndptInit,
DoVrgEndptDeinit,
DoVrgEndptCreate,
DoVrgEndptDestroy,
DoVrgEndptCapabilities,
DoVrgEndptSignal,
DoVrgEndptPlayTone,
DoVrgEndptCreateConnection,
DoVrgEndptModifyConnection,
DoVrgEndptDeleteConnection,
DoVrgEndptMuteConnection,
DoVrgEndptLinkInternal,
DoEndptPacket,
DoEndptGetPacket,
DoEndptGetEvent,
DoEndptGetCodecMap,
DoEndptGetStats,
DoEndptIsInitialized,
DoEndptConsoleCmd,
DoTest,
DoVrgEndptCount,
DoVrgFxsEndptCount,
DoVrgFxoEndptCount,
DoVrgDectEndptCount,
#ifdef PSTN_LIFE_LINE_SUPPORT
DoVrgEndptIsPstnLifeLineSupported,
#endif
#if defined( NTR_SUPPORT )
DoVrgEndptNtrCmd,
#endif /* NTR_SUPPORT */
DoVrgEndptGetHookStatus,
DoVrgEndptSendCasEvt,
DoVrgEndptSetRelayStat,
DoVrgEndptPrintf,
DoVrgEndptProvSet,
DoVrgEndptProvGet,
DoVrgEndptProbeSet,
DoVrgEndptProbeGet,
DoVrgEndptGetRtpStats,
};
unsigned int cmdnr = _IOC_NR(command); //提取函数索引
//校验函数合法性,并执行
if ( cmdnr >= 0 && cmdnr < MAX_ENDPOINTDRV_IOCTL_COMMANDS )
{
ret = (*IoctlFuncs[cmdnr]) (arg);
}