From ed87648312e96adc760bb4c4d6b9a8918ff183d2 Mon Sep 17 00:00:00 2001 From: /jedi/ Date: Sun, 1 Nov 2015 23:03:51 +0100 Subject: [PATCH] so more results of packet reverse engeneering --- src/Lookup.h | 17 +++++++++++++++-- src/Packet.cpp | 2 +- src/Program.cpp | 8 ++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/src/Lookup.h b/src/Lookup.h index c1fc08a..28cc61a 100644 --- a/src/Lookup.h +++ b/src/Lookup.h @@ -17,23 +17,35 @@ static table rcv_lookup = { { 1, table::STRING, "type" }, //string { 8, table::STRING, "hardware_version" }, { 9, table::DEC, "dhcp" }, //bool byte { 19, table::DEC, "ports" }, //byte, maybe number of ports + { 4352, table::HEX, "igmp_snooping" }, //switching + { 4096, table::HEX, "port_settings" }, //switching + { 4608, table::HEX, "port_trunk" }, //byte[5] last byte bitmask?? { 8704, table::HEX, "802.1q vlan" }, //??? { 12288, table::HEX, "QoS Basic 1" }, //bool = QoS Mod { 12289, table::HEX, "QoS Basic 2" }, //QoS + { 16640, table::HEX, "port_mirror" }, //byte[10] second byte port id?? + { 16384, table::HEX, "port_statistics" }, //??? + { 17152, table::HEX, "loop_prevention" }, //bool byte //{0000," "}, }; static table snd_lookup = { // TODO find out if id is unique in response - { 10, table::HEX, "??? - 10" }, //after login { 2, table::HEX, "system_info" }, //page sysinfo + { 9, table::HEX, "ip_config" }, //page sysinfo + { 10, table::HEX, "??? - 10" }, //after login { 512, table::STRING, "login_user" }, //string { 513, table::STRING, "new_user" }, //string { 514, table::STRING, "login_password" }, //string { 515, table::STRING, "new_passwoord" }, //string - { 2200, table::HEX, "vlan" }, { 2305, table::HEX, "???" }, //sent before login and before change hostname + { 2200, table::HEX, "vlan" }, //vlan + + { 2305, table::HEX, "??? - 2305" }, //sent before login and before change hostname + + { 4352, table::HEX, "igmp_snooping" }, //switching + { 4096, table::HEX, "port_settings" }, //switching { 4608, table::HEX, "port_trunk" }, //byte[5] last byte bitmask?? { 8192, table::HEX, "mtu_vlan" }, //byte[2] first byte bool, second byte port id { 8449, table::HEX, "port_vlan1" }, //??? @@ -45,6 +57,7 @@ static table snd_lookup = { { 12288, table::HEX, "QoS Basic 1" }, //bool = QoS Mod { 12289, table::HEX, "QoS Basic 2" }, //QoS { 16640, table::HEX, "port_mirror" }, //byte[10] second byte port id?? + { 16384, table::HEX, "port_statistics" }, //??? { 17152, table::HEX, "loop_prevention" }, //bool byte //{0000," "}, }; diff --git a/src/Packet.cpp b/src/Packet.cpp index 6f2fbff..a9dc63d 100644 --- a/src/Packet.cpp +++ b/src/Packet.cpp @@ -79,7 +79,7 @@ void Packet::parse(bytes data) { pull(body, i, d.type); pull(body, i, d.len); pull(body, i, d.value, d.len); - payload[d.type] = d; + payload = d; } } diff --git a/src/Program.cpp b/src/Program.cpp index 9b2ea33..849cdc0 100644 --- a/src/Program.cpp +++ b/src/Program.cpp @@ -41,19 +41,19 @@ int printPacket(Packet p) { if (d.len > 0) { switch (s->format) { case table::STRING: - std::cout << std::dec << "+\t" << s->name << " = " + std::cout << "+\t" << s->name << " = " << &d.value[0] << std::dec << "\n"; break; case table::HEX: - std::cout << std::dec << "+\t" << s->name << " = " + std::cout << "+\t" << s->name << " = " << std::hex << d.value << std::dec << "\n"; break; case table::DEC: - std::cout << std::dec << "+\t" << s->name << " = " + std::cout << "+\t" << s->name << " = " << std::dec << d.value << std::dec << "\n"; break; default: - std::cout << std::dec << "+\t" << s->name << " = " + std::cout << "+\t" << s->name << " = " << std::hex << d.value << std::dec << "\n"; } } else { //empty