> You can probably use PacketRequest with the OID_GEN_MEDIA_CONNECT_STATUS
> OID.

> Loris


I am trying to do something similar, and I can't get anything other than zeros returned in the OID. My code is below. The MAC request works, but the link status request does not.

         unsigned char oid_storage[1024];
         PACKET_OID_DATA* oid = (PACKET_OID_DATA*)(oid_storage);

         memset(oid_storage, 0, 1024);
         oid->Oid = OID_802_3_CURRENT_ADDRESS;
         oid->Length = 1024 - (sizeof(oid->Oid) - sizeof(oid->Length));
         if (PacketRequest(np->adapter, false, oid)) {
            setMac(oid->Data);
         }
         else {
            VLOG << "ERROR:  PacketRequest for CURRENT_ADDRESS failed.\n";
         }

         memset(oid_storage, 0, 1024);
         oid->Oid = OID_GEN_MEDIA_CONNECT_STATUS;
         oid->Length = 1024 - (sizeof(oid->Oid) - sizeof(oid->Length));
         if (PacketRequest(np->adapter, false, oid)) {
            VLOG << "CONNECT_STATUS: " << (int)(oid->Data[0]) << ":"
                 << (int)(oid->Data[1]) << ":"
                 << (int)(oid->Data[2]) << ":"
                 << (int)(oid->Data[3]) << endl;
            if (oid->Data[0]) {
               cur_flags.turn_off(IF_link_OK);
            }
            else {
               cur_flags.turn_on(IF_link_OK);
            }
         }
         else {
            VLOG << "ERROR:  PacketRequest for CONNECT_STATUS failed.\n";
         }

Any idea what I'm doing wrong?

Thanks,
Ben

--
Ben Greear <[EMAIL PROTECTED]>
Candela Technologies Inc  http://www.candelatech.com



==================================================================
This is the WinPcap users list. It is archived at
http://www.mail-archive.com/[email protected]/

To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================

Reply via email to