json parser

This commit is contained in:
/jdi/ 2015-10-17 19:43:21 +02:00
parent b1c5a3af6e
commit 3aa3cee61c
7 changed files with 114 additions and 204 deletions

View file

@ -17,44 +17,17 @@
#define DEFAULT_USER "admin"
#define DEFAULT_PASS "admin"
typedef rapidjson::Value jsonNode;
/*
template<typename T>
jsonNode to_json(const T &x) {
// TODO Throw undefined
return NULL;
}
template<> jsonNode to_json<vlan>(const vlan &x) {
jsonNode ret;
return ret;
}
template<typename T>
T from_json(const jsonNode &s) {
// TODO Throw not implemented
return NULL;
}
template<> vlan from_json<vlan>(const jsonNode &s) {
vlan ret;
return ret;
}*/
struct vlan {
int vlan_id;
std::string name;
std::vector<byte> tagged_member;
std::vector<byte> untagged_member;
};
struct port {
byte id;
byte status;
struct {
std::vector<vlan*> tagged;
std::vector<vlan*> untagged;
int pvid;
} vlan;
int pvid;
};
class Switch {