This is the part that's totally non-disclosed, closed-source, proprietary, etc.
On the ESP8266 you could replace the standard LWIP library by one modified by yourself, but only if the LWIP version wasn't any newer than some six years, because the interface changed after that and the interface, of course, would be binary, not source.
On the ESP32, using IDF, I think it's possible to replace LWIP altogether and process raw ethernet-like frames. They're still nog 802.11 frames though, they're rewritten to match ethernet format frames. That's nice for LWIP, but it also you can't access any specific 802.11 metadata from the frames.
So that's the status. Access on ethernet-like frames and not anything beyond that. Just hope and pray Espressif will "do the right thing"...