Need to extract 802.11 Information Element of an access point?

I need to extract 802.11 Information Element which are sent from an Access Point which I am using it?

If possible then need to set them?

What all ways are possible to set them or at least one working way?

I tied using iw dev scan command but it doesn't work with access points IE's.

Please can anyone help me in this?

Thanks in advance.

Sure, the easiest way is to place the WiFi chip in promiscuous mode to record the frames.

Sure; but I guess it depends on which element. Do you mean things like the rates, country, bandwidth and SSID?


Thanks a lot for reply lleachii.

Is there any way to get this information by using some commands like iw or uci in linux?

It will be a great help if have any example(you can take any element) how to implement them so that I will get an idea how to extract this information and how to set them because I am new to this domain.

OK, I'll use ieee80211_ie_country (since it's common):

How to extract:

root@OpenWrt:~# iw reg get | grep country
country US: DFS-FCC

How to set: