| 100 | } // anonymous |
| 101 | |
| 102 | ByteBuf format_pslist_json(const Engine& eng) { |
| 103 | json arr = json::array(); |
| 104 | for (const auto& p : eng.processes()) { |
| 105 | json o; |
| 106 | o["pid"] = p.pid; |
| 107 | o["ppid"] = p.ppid; |
| 108 | o["tgid"] = p.tgid; |
| 109 | o["uid"] = p.uid; |
| 110 | o["comm"] = p.comm; |
| 111 | o["cmdline"] = read_cmdline_oneline(eng, p); |
| 112 | arr.push_back(std::move(o)); |
| 113 | } |
| 114 | return dump_json(arr); |
| 115 | } |
| 116 | |
| 117 | ByteBuf format_tcp_json(const Engine& eng) { return format_sockets_json(eng, SocketInfo::P_TCP, "TCP"); } |
| 118 | ByteBuf format_udp_json(const Engine& eng) { return format_sockets_json(eng, SocketInfo::P_UDP, "UDP"); } |
no test coverage detected