+static int run_dump_radio(const char *ifname)
+{
+ int i;
+ char path[1024];
+ struct file_map m;
+ struct radio_entry *e;
+
+ check_daemon();
+ snprintf(path, sizeof(path), DB_RD_FILE, ifname);
+
+ if (mmap_file(path, sizeof(struct radio_entry), &m))
+ {
+ fprintf(stderr, "Failed to open %s: %s\n", path, strerror(errno));
+ return 1;
+ }
+
+ for (i = 0; i < m.size; i += sizeof(struct radio_entry))
+ {
+ e = (struct radio_entry *) &m.mmap[i];
+
+ if (!e->time)
+ continue;
+
+ printf("[ %u, %d, %d, %d ]%s\n",
+ ntohl(e->time),
+ e->rate, e->rssi, e->noise,
+ ((i + sizeof(struct radio_entry)) < m.size) ? "," : "");
+ }
+
+ umap_file(&m);
+
+ return 0;
+}
+