[Winpcap-users] Is there a way to get the 'adapter' field in winpcap 4.1.2?
Ben Greear
greearb at candelatech.com
Thu Jun 20 15:33:02 PDT 2013
On 06/20/2013 01:21 PM, Guy Harris wrote:
>
> On Jun 20, 2013, at 12:52 PM, Ben Greear <greearb at candelatech.com> wrote:
>
>> I'm trying to upgrade from an older (OEM) winpcap to winpcap OME 4.1.2.
>>
>> I have been using code like this:
>>
>> oid->Oid = OID_GEN_MEDIA_CONNECT_STATUS;
>> oid->Length = 1024 - (sizeof(oid->Oid) - sizeof(oid->Length));
>> if (PacketRequest(np->adapter, false, oid)) {
>>
>> But, it seems that the 'struct pcap' is no longer defined anywhere,
>> and I cannot find anything equivalent to get the adapter.
>>
>> Anyone have any ideas?
>
> I would suggest writing a pcap_get_adapter() routine:
>
> /*
> * XXX - "struct pcap" is not guaranteed to look the same from
> * release to release, so use this only with current releases;
> * if it changes, the future release should include a pcap_get_adapter()
> * routine that will return the ADAPTER regardless of the layout of
> * the structure.
> */
> struct pcap_internal {
> ADAPTER *adapter;
> };
>
> ADAPTER *
> pcap_get_adapter(pcap_t *p)
> {
> struct pcap_internal *p_int = (struct pcap_internal *)(void *)p;
>
> return (p->adapter);
> }
Thanks, that works (after fixing the typo: return (p_int->adapter);
Can you point me to the git repo you are talking about? (Is it for winpcap?)
Thanks,
Ben
--
Ben Greear <greearb at candelatech.com>
Candela Technologies Inc http://www.candelatech.com
More information about the Winpcap-users
mailing list