sirroom
驱动大牛
驱动大牛
  • 注册日期2001-07-30
  • 最后登录2018-05-29
  • 粉丝0
  • 关注0
  • 积分6分
  • 威望11点
  • 贡献值1点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:1782回复:0

passthru nat(未解决,仅有思路,不过可以借鉴)(转)

楼主#
更多 发布于:2002-05-30 18:22
所有留言及回应
Message 1 in thread
寄件者:brucie (brucie@263.net)
主旨:kebugcheckex: bugcheckcode=0xD2 while NAT with NDISWAN
新闻群组:comp.os.ms-windows.programmer.nt.kernel-mode
View this article only
日期:2001-10-05 05:58:46 PST
 

I am using Passthru to implement NAT. The driver runs
well with two ethernet NICs. If I dont start NAT packet
tranlsation, The driver still runs well with one LAN adapter
and one wan adapter.
But when I start NAT packet translation,After some packets
(always 2 to 4 packets) which comes from LAN adapter are
translated and sended by wan adapter, there is a kernel
bug check occurred. I only tried to translate icmp echo request/reply
 packet.
Softice tell me:
   kebugcheckex: bugcheckcode=0xD2 p1=....p2=..,p3=..,p4=..
I could not find what 0xD2 means because it is not list in the
windbg references.
Here is the code I used to redirect the packet:
***********************************************
//translate packet from LAN and send via WAN.
  if(pAdapt->IsLocal)
  {
         if(!TranslateLocalICMPPacket(
                    pAdapt,
                    pEthHeader,
                    iphdr,
                    icmphdr)) break;
          //send packet via global adapter
         if (pAdaptList->IsLocal)
        {        
              pAdaptSend = pAdaptList->Next;
        } else
        {     pAdaptSend = pAdaptList; }
        NdisSend(&Status, pAdaptSend->BindingHandle,    Packet);
  }
//translate packet from WAN and send via LAN
if(!TranslateGlobalICMPPacket(
               pAdapt,
               pEthHeader,
               iphdr,
  icmphdr)) break;
//send packet via local adapter
if (pAdaptList->IsLocal)
{
   pAdaptSend = pAdaptList;
}
else
{
   pAdaptSend = pAdaptList->Next;
}
NdisSend(&Status,
pAdaptSend->BindingHandle,
 Packet);
*************************************************
I read DDK document about NDISWAN. Should I queue the packet
and then send it?
Please give me suggestion:)))
Thanks
yours brucie
Message 2 in thread
寄件者:Nathan Nesbit (nathann@microsoft.com)
主旨:Re: kebugcheckex: bugcheckcode=0xD2 while NAT with NDISWAN
新闻群组:comp.os.ms-windows.programmer.nt.kernel-mode
View this article only
日期:2001-10-15 10:02:16 PST
 

Are you using the latest debugger from
http://www.microsoft.com/ddk/debugging?
If so then try the command !analyzebugcheck and see what help it can give
you about the crash.


\"brucie\" <brucie@263.net> wrote in message
news:234eb7d8.0110050458.52dfc2e0@posting.google.com...
> I am using Passthru to implement NAT. The driver runs
> well with two ethernet NICs. If I dont start NAT packet
> tranlsation, The driver still runs well with one LAN adapter
> and one wan adapter.
> But when I start NAT packet translation,After some packets
> (always 2 to 4 packets) which comes from LAN adapter are
> translated and sended by wan adapter, there is a kernel
> bug check occurred. I only tried to translate icmp echo request/reply
>  packet.
> Softice tell me:
>    kebugcheckex: bugcheckcode=0xD2 p1=....p2=..,p3=..,p4=..
> I could not find what 0xD2 means because it is not list in the
> windbg references.
> Here is the code I used to redirect the packet:
> ***********************************************
> //translate packet from LAN and send via WAN.
>   if(pAdapt->IsLocal)
>   {
>          if(!TranslateLocalICMPPacket(
>                     pAdapt,
>                     pEthHeader,
>                     iphdr,
>                     icmphdr)) break;
>           //send packet via global adapter
>          if (pAdaptList->IsLocal)
>         {
>               pAdaptSend = pAdaptList->Next;
>         } else
>         {     pAdaptSend = pAdaptList; }
>         NdisSend(&Status, pAdaptSend->BindingHandle,    Packet);
>   }
> //translate packet from WAN and send via LAN
> if(!TranslateGlobalICMPPacket(
>                pAdapt,
>                pEthHeader,
>                iphdr,
>   icmphdr)) break;
> //send packet via local adapter
> if (pAdaptList->IsLocal)
> {
>    pAdaptSend = pAdaptList;
> }
> else
> {
>    pAdaptSend = pAdaptList->Next;
> }
> NdisSend(&Status,
> pAdaptSend->BindingHandle,
>  Packet);
> *************************************************
> I read DDK document about NDISWAN. Should I queue the packet
> and then send it?
> Please give me suggestion:)))
> Thanks
> yours brucie
 


?2002 Google

最新喜欢:

baoyibao99baoyib... tomoretomore
111
游客

返回顶部