Line data Source code
1 : /* 2 : * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : 5 : #ifndef vnsw_agent_bridge_route_audit_ksync_h 6 : #define vnsw_agent_bridge_route_audit_ksync_h 7 : 8 : #include <string> 9 : #include <net/mac_address.h> 10 : #include <boost/asio.hpp> 11 : #include <boost/bind/bind.hpp> 12 : 13 : #include <ksync/ksync_entry.h> 14 : #include <ksync/ksync_object.h> 15 : #include <ksync/ksync_netlink.h> 16 : #include <vrouter/ksync/agent_ksync_types.h> 17 : #include <vrouter/ksync/ksync_flow_memory.h> 18 : 19 : using namespace boost::placeholders; 20 : 21 : class BridgeRouteAuditKSyncObject; 22 : class KSync; 23 : 24 : class BridgeRouteAuditKSyncEntry : public KSyncNetlinkEntry { 25 : public: 26 : BridgeRouteAuditKSyncEntry(BridgeRouteAuditKSyncObject *obj, 27 : uint32_t vrf_id, const MacAddress &mac); 28 : BridgeRouteAuditKSyncEntry(BridgeRouteAuditKSyncObject* obj, 29 : const BridgeRouteAuditKSyncEntry *entry); 30 : virtual ~BridgeRouteAuditKSyncEntry(); 31 : 32 : int EncodeDelete(char *buf, int buf_len); 33 : KSyncObject *GetObject() const; 34 : virtual bool Sync(); 35 : virtual KSyncEntry *UnresolvedReference(); 36 : void FillObjectLog(sandesh_op::type type, KSyncRouteInfo &info) const; 37 : 38 : std::string ToString() const; 39 : bool IsLess(const KSyncEntry &rhs) const; 40 : int AddMsg(char *buf, int buf_len); 41 : int ChangeMsg(char *buf, int buf_len); 42 : int DeleteMsg(char *buf, int buf_len); 43 : 44 : private: 45 : BridgeRouteAuditKSyncObject *ksync_obj_; 46 : uint32_t vrf_id_; 47 : MacAddress mac_; 48 : DISALLOW_COPY_AND_ASSIGN(BridgeRouteAuditKSyncEntry); 49 : }; 50 : 51 : class BridgeRouteAuditKSyncObject : public KSyncObject { 52 : public: 53 : BridgeRouteAuditKSyncObject(KSync *ksync); 54 : virtual ~BridgeRouteAuditKSyncObject(); 55 : 56 : KSyncEntry *Alloc(const KSyncEntry *key, uint32_t index); 57 0 : KSync *ksync() const { return ksync_; } 58 : 59 : private: 60 : KSync *ksync_; 61 : DISALLOW_COPY_AND_ASSIGN(BridgeRouteAuditKSyncObject); 62 : }; 63 : 64 : #endif // vnsw_agent_bridge_route_audit_ksync_h