Programmatic (ubus?) access to "iw dev station dump" including mesh points?

With the dire warnings from iw about not screen-scraping the output, I looked into ubus for accessing similar data from both "normal" APs, as well as mesh.

The documentation on ubus isn't very complete, but as I poke around on it, it doesn't look like the information is there, either in much detail, or at all for mesh points.

What is the preferred way for user-space applications to get

  • List of all configured APs and mesh nodes
  • For each of those
    • List of all "active" stations
      • For each of those, at least
        • MAC address
        • Signal levels
        • Modulation type/rate for RX & TX
        • Client status; authorized, authenticated, associated, or mesh status (plink, PS modes,...), as appropriate

In travelmate I use a mix of ubus -S call network.wireless status, ubus -S call network.interface dump and iwinfo, of course.