forked from sonic-net/sonic-swss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vlanmgr.h
46 lines (37 loc) · 1.4 KB
/
vlanmgr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef __VLANMGR__
#define __VLANMGR__
#include "dbconnector.h"
#include "producerstatetable.h"
#include "orch.h"
#include <set>
#include <map>
#include <string>
namespace swss {
class VlanMgr : public Orch
{
public:
VlanMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const std::vector<std::string> &tableNames);
using Orch::doTask;
private:
ProducerStateTable m_appVlanTableProducer, m_appVlanMemberTableProducer;
Table m_cfgVlanTable, m_cfgVlanMemberTable;
Table m_statePortTable, m_stateLagTable;
Table m_stateVlanTable, m_stateVlanMemberTable;
std::set<std::string> m_vlans;
void doTask(Consumer &consumer);
void doVlanTask(Consumer &consumer);
void doVlanMemberTask(Consumer &consumer);
void processUntaggedVlanMembers(std::string vlan, const std::string &members);
bool addHostVlan(int vlan_id);
bool removeHostVlan(int vlan_id);
bool setHostVlanAdminState(int vlan_id, const std::string &admin_status);
bool setHostVlanMtu(int vlan_id, uint32_t mtu);
bool addHostVlanMember(int vlan_id, const std::string &port_alias, const std::string& tagging_mode);
bool removeHostVlanMember(int vlan_id, const std::string &port_alias);
bool isMemberStateOk(const std::string &alias);
bool isVlanStateOk(const std::string &alias);
bool isVlanMacOk();
bool isVlanMemberStateOk(const std::string &vlanMemberKey);
};
}
#endif