双网卡冗余容错,同IP,同MAC地址,一个工作,另一个热备份。当需要切换时,passthru获取一块网卡的MAC地址保存到 CHAR * ADAPTER->MACADDRESS 成员变量,把其设置到另一个网卡的 ADAPTER->MACADDRESS 中,具体代码怎么实现呢?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
你好?WIN2000下,以太网网络,双网卡热备份,也就是一个网卡坏了,另一个冗余网卡热切换,两个网卡同一个IP地址,实现方案是什么?使用哪些工具,技术?代码是什么?请问做双网卡热备份,是不是在ndis的例子PASSTHRU的代码基础上,修改即可?怎么修改?希望不吝赐教,谢谢!网卡型号:D-LinkDFE-530TXFastEnthernet我是研究生二年级的学生,导师让我自己做,不用现成的产品,我的QQ:270996889 E-MAIL:SDTZ_ZZ@126.COM Msn:zz123439@sohu.com,热切期待您的回复.谢谢!
热切希望深入交流 谢谢您的回复,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~```````````
我的代码PtRequestComplete():[/b]switch(NdisRequest->RequestType)
{
case NdisRequestQueryInformation:
………………
*pAdapt->BytesReadOrWritten = NdisRequest->DATA.QUERY_INFORMATION.BytesWritten;
*pAdapt->BytesNeeded = NdisRequest->DATA.QUERY_INFORMATION.BytesNeeded;
if(Oid == OID_802_3_CURRENT_ADDRESS && Status == NDIS_STATUS_SUCCESS
{
pAdapt->PrimaryMac=pAdapt->Request.DATA.QUERY_INFORMATION.InformationBuffer;
DbgPrint("PtRequestComplete:pAdapt->PrimaryMac%s\n",pAdapt->PrimaryMac);
}
NdisMQueryInformationComplete(pAdapt->MiniportHandle,
Status);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MPQueryInformation():if (Status == NDIS_STATUS_SUCCESS)
{
if(Oid == OID_802_3_CURRENT_ADDRESS
{
pAdapt->PrimaryMac=pAdapt->Request.DATA.QUERY_INFORMATION.InformationBuffer;
DbgPrint("MPQueryInformation:pAdapt->PrimaryMac%s\n",pAdapt->PrimaryMac);
}
*BytesWritten = pAdapt->Request.DATA.QUERY_INFORMATION.BytesWritten;
*BytesNeeded = pAdapt->Request.DATA.QUERY_INFORMATION.BytesNeeded;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
typedef struct _ADAPT
{CHAR * PrimaryMac;
……}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
可是DbgPrint输出的PrimaryMac值为空,请教各位大侠,怎么能实现上个 的功能呢?谢谢,