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?

See: https://dox.ipxe.org/group__ieee80211__ie.html
Also: https://www.oreilly.com/library/view/80211-wireless-networks/0596100523/ch04.html

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:

Screenshot%20from%202019-08-08%2007-20-02