[Click] specify DLT in FromDevice?

Ian Rose ianrose at eecs.harvard.edu
Sun Feb 28 14:45:55 EST 2010


If you are interested, I have attached a candidate patch to add an ENCAP 
configuration parameter to the userlevel FromDevice element.

- Ian


Ian Rose wrote:
> When using libpcap, some drivers support multiple datalink-types.  I 
> believe this is why tcpdump exposes a -y flag (to set the datalink type) 
> and a -L flag (to list the available datalink types for a device).  I 
> think perhaps if you do not specify one (via pcap_set_datalink) then it 
> will default to the first that appears in the -L list.
> 
> For example, we are using the 'ath' FreeBSD 802.11 driver:
> 
>> ianrose at somehost 9$ sudo tcpdump -L -i ath1
>> Data link types (use option -y to set):
>>   EN10MB (Ethernet)
>>   IEEE802_11 (802.11)
>>   IEEE802_11_RADIO (802.11 plus BSD radio information header)
> 
> If I run tcpdump without -y, or if I use an unmodified FromDevice 
> element, I receive ethernet packets from the device which is not what I 
> want.  I just add a '-y IEEE802_11_RADIO' to make tcpdump work, but 
> FromDevice cannot be made to do this with hacking it.
> 
> - Ian
> 
> 
> Eddie Kohler wrote:
>> Hi Ian --
>>
>> I believe that user-level FromDevice detects the datalink type from 
>> pcap, so there wouldn't be a point to the argument.  Did you find this 
>> did not work?
>>
>> Eddie
>>
>>
>> Ian Rose wrote:
>>> I perhaps should also clarify that I am talking specifically about the 
>>> userlevel FromDevice element ("FromDevice.u" on the wiki).
>>>
>>>
>>> Ian Rose wrote:
>>>> Hello all -
>>>>
>>>> I am new to this list - apologies if this question has previously be 
>>>> answered.  I am looking at the FromDevice element, but I see no way 
>>>> to specify a datalinktype (i.e. the equivalent of the '-y' flag in 
>>>> tcpdump).  Is there any reason that an argument for this was left 
>>>> out?  It seems pretty easy for me to add, but I wanted to check first 
>>>> to make sure I wasn't overlooking or misunderstanding something.
>>>>
>>>> thanks,
>>>> Ian
>>>>
>>>> p.s. I am running on FreeBSD, so I am using the libpcap-based code in 
>>>> FromDevice, as opposed to the Linux-based code.
>>>>
>>> _______________________________________________
>>> click mailing list
>>> click at amsterdam.lcs.mit.edu
>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fromdevice.cc.patch
Type: text/x-diff
Size: 1737 bytes
Desc: not available
Url : http://amsterdam.lcs.mit.edu/pipermail/click/attachments/20100228/39bd92b3/attachment.patch 


More information about the click mailing list