[Click] [RFC] Adding channel to wifi extra struct

Roberto Riggio roberto.riggio at create-net.org
Fri Oct 29 03:26:45 EDT 2010


Hi,

that could be an option, however the radiotap field for the channel
is 16 bits long in that it contains the channel center frequency in MHz :)

R.

Il 28/10/2010 20:22, Robert Sombrutzki ha scritto:
> Hi,
> oh sorry i overlook, that you change the size of the flags.
> Maybe it is possible to use only 1 byte (uint8_t) for the channel (0-255
> should be enough) and to use the unused byte for antenna information or
> something else.
> Robert
> On Donnerstag, 28. Oktober 2010, Roberto Riggio wrote:
>> Hi,
>>
>> actually the struct has the same size after the patch because
>> i've reduced the flag field from 32bit to 16bits. As far as I known
>> not all the 32 bits were used bu the flags (right?).
>>
>> R.
>>
>> Il 28/10/2010 17:37, Robert Sombrutzki ha scritto:
>>> Hi Roberto,
>>> it would be nice to have the channel in the struct click_wifi_extra, but
>>> please check include/click/packet_anno.hh.
>>> There are 24 bytes reserved for click_wifi_extra. Using your patch, the
>>> paint annos will be overwritten, because the size of struct
>>> click_wifi_extra will be 25 bytes. That's not a good idea.
>>> I think it's better to implement some channel annos without using struct
>>> click_wifi_extra, so that you can decide which annos you will overwrite.
>>> I did the following to implement an anns for the channel:
>>>
>>> #define CHANNEL_ANNO_OFFSET    46
>>> #define CHANNEL_ANNO_SIZE         1
>>> #define CHANNEL_ANNO(p)               ((p)->anno_u8(CHANNEL_ANNO_OFFSET))
>>> #define SET_CHANNEL_ANNO(p, v)
>>> ((p)->set_anno_u8(CHANNEL_ANNO_OFFSET(v)))
>>>
>>> This will overwrite  PERFCTR_ANNO and IPSEC_SA_DATA_REFERENCE_ANNO. I
>>> don't use this annos. Just check include/click/packet_anno.hh and choose
>>> some annos, that are unused in your click elements/configuration.
>>>
>>> Robert
>>>
>>> On Donnerstag, 28. Oktober 2010, Roberto Riggio wrote:
>>>> Is the patch attached suitable for merging with click? If not, which
>>>> would be a more "clicky"
>>>> way of having a packet marked with the channel over which it was
>>>> received?
>>>>
>>>> R.
>>>>
>>>> --
>>>> diff -urN click/elements/wifi/radiotapdecap.cc
>>>> click-wing/elements/wifi/radiotapdecap.cc
>>>> --- click/elements/wifi/radiotapdecap.cc    2010-10-15
>>>> 12:22:57.548443142 +0200
>>>> +++ click-wing/elements/wifi/radiotapdecap.cc    2010-10-15
>>>> 12:47:05.604443142 +0200
>>>> @@ -142,6 +142,9 @@
>>>>             if (rt_el_present(th, IEEE80211_RADIOTAP_DBM_ANTSIGNAL))
>>>>                 ceh->rssi = *((u_int8_t *) rt_el_offset(th,
>>>> IEEE80211_RADIOTAP_DBM_ANTSIGNAL));
>>>>
>>>> +        if (rt_el_present(th, IEEE80211_RADIOTAP_CHANNEL))
>>>> +            ceh->channel = le16_to_cpu(*((u_int16_t *) rt_el_offset(th,
>>>> IEEE80211_RADIOTAP_CHANNEL)));
>>>> +
>>>>             if (rt_el_present(th, IEEE80211_RADIOTAP_DBM_ANTNOISE))
>>>>                 ceh->silence = *((u_int8_t *) rt_el_offset(th,
>>>> IEEE80211_RADIOTAP_DBM_ANTNOISE));
>>>> diff -urN click/include/clicknet/wifi.h
>>>> click-wing/include/clicknet/wifi.h --- click/include/clicknet/wifi.h
>>>> 2010-10-15 12:22:57.588443142 +0200 +++
>>>> click-wing/include/clicknet/wifi.h    2010-10-15 12:47:05.652443142
>>>> +0200
>>>> @@ -29,7 +29,9 @@
>>>>
>>>>     struct click_wifi_extra {
>>>>       uint32_t magic;
>>>> -  uint32_t flags;
>>>> +
>>>> +  uint16_t flags;
>>>> +  uint16_t channel;
>>>>
>>>>       uint8_t rssi;
>>>>       uint8_t silence;
>>>> _______________________________________________
>>>> click mailing list
>>>> click at amsterdam.lcs.mit.edu
>>>> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>



More information about the click mailing list