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

Robert Sombrutzki sombrutz at informatik.hu-berlin.de
Thu Oct 28 11:37:05 EDT 2010


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