Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jedi
smrtlink
Commits
4c166113
Commit
4c166113
authored
Sep 30, 2015
by
/jdi/
Browse files
switch Class
parent
aca82979
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Switch.cpp
0 → 100644
View file @
4c166113
/*
* Switch.cpp
*
* Created on: 29.09.2015
* Author: jdi
*/
#include
"Switch.h"
Switch
::
Switch
()
{
// TODO Auto-generated constructor stub
}
src/Switch.h
0 → 100644
View file @
4c166113
/*
* Switch.h
*
* Created on: 29.09.2015
* Author: jdi
*/
#ifndef SWITCH_H_
#define SWITCH_H_
#include
<string>
#include
"Types.h"
#define DEFAULT_USER "admin"
#define DEFAULT_PASS "admin"
struct
vlan
{
int
vlan_id
;
std
::
string
name
;
};
struct
port
{
int
id
;
struct
{
std
::
vector
<
vlan
*>
tagged
;
std
::
vector
<
vlan
*>
untagged
;
int
pvid
;
}
vlan
;
};
class
Switch
{
public:
Switch
();
void
parse
(
datasets
);
private:
struct
{
std
::
string
type
;
std
::
string
hardware_version
;
std
::
string
firmware_version
;
byteArray
<
6
>
mac
;
}
device
;
struct
{
std
::
string
password
=
DEFAULT_PASS
;
std
::
string
username
=
DEFAULT_USER
;
struct
{
std
::
string
hostname
;
byteArray
<
4
>
ip_addr
;
byteArray
<
4
>
ip_mask
;
byteArray
<
4
>
gateway
;
byte
dhcp
;
}
network
;
}
settings
;
std
::
vector
<
vlan
>
vlans
;
std
::
vector
<
port
>
ports
;
};
#endif
/* SWITCH_H_ */
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment