forked from sonic-net/sonic-swss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathportmgr.h
42 lines (33 loc) · 1.2 KB
/
portmgr.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
#pragma once
#include "dbconnector.h"
#include "orch.h"
#include "producerstatetable.h"
#include <map>
#include <set>
#include <string>
namespace swss {
/* Port default admin status is down */
#define DEFAULT_ADMIN_STATUS_STR "down"
#define DEFAULT_MTU_STR "9100"
class PortMgr : public Orch
{
public:
PortMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const std::vector<std::string> &tableNames);
using Orch::doTask;
private:
Table m_cfgPortTable;
Table m_cfgSendToIngressPortTable;
Table m_cfgLagMemberTable;
Table m_statePortTable;
ProducerStateTable m_appPortTable;
ProducerStateTable m_appSendToIngressPortTable;
std::set<std::string> m_portList;
void doTask(Consumer &consumer);
void doSendToIngressPortTask(Consumer &consumer);
bool writeConfigToAppDb(const std::string &alias, const std::string &field, const std::string &value);
bool writeConfigToAppDb(const std::string &alias, std::vector<FieldValueTuple> &field_values);
bool setPortMtu(const std::string &alias, const std::string &mtu);
bool setPortAdminStatus(const std::string &alias, const bool up);
bool isPortStateOk(const std::string &alias);
};
}