forked from sonic-net/sonic-swss
/
nbrmgr.h
46 lines (35 loc) · 1.25 KB
/
nbrmgr.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 __NBRMGR__
#define __NBRMGR__
#include <string>
#include <map>
#include <set>
#include "dbconnector.h"
#include "producerstatetable.h"
#include "orch.h"
#include "netmsg.h"
using namespace std;
namespace swss {
class NbrMgr : public Orch
{
public:
NbrMgr(DBConnector *cfgDb, DBConnector *appDb, DBConnector *stateDb, const std::vector<std::string> &tableNames);
using Orch::doTask;
bool isNeighRestoreDone();
private:
bool isIntfStateOk(const std::string &alias);
bool setNeighbor(const std::string& alias, const IpAddress& ip, const MacAddress& mac);
void doResolveNeighTask(Consumer &consumer);
void doSetNeighTask(Consumer &consumer);
void doTask(Consumer &consumer);
void doStateSystemNeighTask(Consumer &consumer);
bool getVoqInbandInterfaceName(string &nbr_odev);
bool addKernelRoute(string odev, IpAddress ip_addr);
bool delKernelRoute(IpAddress ip_addr);
bool addKernelNeigh(string odev, IpAddress ip_addr, MacAddress mac_addr);
bool delKernelNeigh(string odev, IpAddress ip_addr);
unique_ptr<Table> m_cfgVoqInbandInterfaceTable;
Table m_statePortTable, m_stateLagTable, m_stateVlanTable, m_stateIntfTable, m_stateNeighRestoreTable;
struct nl_sock *m_nl_sock;
};
}
#endif // __NBRMGR__