type lookup tabel

This commit is contained in:
/jdi/ 2015-10-08 17:26:39 +02:00
parent f11f281a2c
commit 7f3e5fc0d9
7 changed files with 122 additions and 75 deletions

View file

@ -9,6 +9,7 @@
#define SWITCH_H_
#include <string>
#include <map>
#include "Types.h"
#include "Types/bytes.h"
#include "Types/datasets.h"
@ -16,19 +17,37 @@
#define DEFAULT_USER "admin"
#define DEFAULT_PASS "admin"
/*
*
static bitable lookup = {
{1, "type"},
{2, "hostname"},
{3, "mac"},
{4, "ip_addr"},
{5, "ip_mask"},
{6, "gateway"},
{7, "firmware_version"},
{8, "hardware_version"},
{9, "dhcp"}};
*/
static std::map<int,std::string> rcv_lookup= {
{ 1, "type"},//string
{ 2, "hostname"},//string
{ 3, "mac"},//byte[6]
{ 4, "ip_addr"},//byte[4]
{ 5, "ip_mask"},//byte[4]
{ 6, "gateway"},//byte[4]
{ 7, "firmware_version"},//string
{ 8, "hardware_version"},//string
{ 9, "dhcp"}};//bool byte
static std::map<int,std::string> snd_lookup= {
{10,"???"},//after login
{2,"???"},//after login
{512,"login_user"},//string
{513,"new_user"},//string
{514,"login_password"},//string
{515,"new_passwoord"},//string
{2200,"vlan"},
{2305,"???"},//sent before login and before change hostname
{4608,"port_trunk"},//byte[5] last byte bitmask??
{8192,"mtu_vlan"},//byte[2] first byte bool, second byte port id
{8449,"port_vlan"},//???
{8705,"802.1q vlan"},//???
{8706,"802.1q vlan pvid"},//????
{12288,"QoS Basic"},//bool = QoS Mod
{16640,"port_mirror"},//byte[10] second byte port id??
{17152,"loop_prevention"},//bool byte
//{0000," "},
};
struct vlan {
int vlan_id;