aboutsummaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-04-07 19:03:05 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-04-07 19:03:05 +0200
commit36e59a1991f075e36e117a08321d5e4c4dc00eac (patch)
tree2c89d0b9ad67eb6ebdcd5ed4b1789ebc61ce6723 /src/misc.cpp
parent84939234eb66fe7957eaf39956f18224e3108c25 (diff)
downloadwifi-triangulator-36e59a1991f075e36e117a08321d5e4c4dc00eac.tar.gz
wifi-triangulator-36e59a1991f075e36e117a08321d5e4c4dc00eac.tar.bz2
wifi-triangulator-36e59a1991f075e36e117a08321d5e4c4dc00eac.tar.xz
wifi-triangulator-36e59a1991f075e36e117a08321d5e4c4dc00eac.zip
o Splitting capture into just two, capture and send to stdout and transmit from stdin.
o Adding formatter that formats the incoming message.
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
new file mode 100644
index 0000000..ffe174f
--- /dev/null
+++ b/src/misc.cpp
@@ -0,0 +1,35 @@
+#include "wifi-triangulator/core.h"
+
+namespace std {
+string to_string(wifi_triangulator::pb::packet_type t) {
+ using wifi_triangulator::pb::packet_type;
+
+ switch (t) {
+ case packet_type::probe_request:
+ return "probe request";
+ case packet_type::beacon:
+ return "beacon";
+ case packet_type::probe_response:
+ return "probe response";
+ case packet_type::null:
+ return "null";
+ case packet_type::ack:
+ return "ack";
+ case packet_type::data:
+ return "data";
+ case packet_type::cts:
+ return "cts";
+ case packet_type::rts:
+ return "rts";
+ case packet_type::cf_end:
+ return "cf-end";
+ case packet_type::cf_end_cf_ack:
+ return "cf-end+cf-ack";
+ case packet_type::ps_poll:
+ return "ps-poll";
+ case packet_type::unknown:
+ default:
+ return "unknown";
+ }
+}
+} // namespace std