6 #include <boost/uuid/uuid_io.hpp> 
   10 #include <vnc_cfg_types.h> 
   33     std::stringstream uuidstring;
 
   34     uuidstring << sg_uuid_;
 
   35     return uuidstring.str();
 
   44     const SgKey *k = 
static_cast<const SgKey *
>(key);
 
   49     const SgKey *key = 
static_cast<const SgKey *
>(k);
 
   51     return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(sg));
 
   57     ChangeHandler(sg, req);
 
   63     bool ret = ChangeHandler(entry, req);
 
   65     sg->
SendObjectLog(GetOperDBTraceBuf(), AgentLogEvent::CHANGE);
 
   86     acl = 
static_cast<AclDBEntry *
>(agent()->acl_table()->FindActiveEntry(&key));
 
  101     sg_table_ = 
new SgTable(db, name);
 
  109     autogen::IdPermsType id_perms = cfg->id_perms();
 
  110     CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
 
  124         agent()->sg_table()->Enqueue(&req);
 
  128     agent()->config_manager()->AddSgNode(node);
 
  142     uint32_t sg_id = cfg->id();
 
  158         if (agent()->config_manager()->SkipNode(adj_node)) {
 
  162         if (adj_node->
table() == agent()->cfg()->cfg_acl_table()) {
 
  163             AccessControlList *acl_cfg = 
static_cast<AccessControlList *
> 
  166             autogen::IdPermsType id_perms = acl_cfg->id_perms();
 
  167             if (adj_node->
name().find(
"egress-access-control-list") != std::string::npos) {
 
  168                 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
 
  171             if (adj_node->
name().find(
"ingress-access-control-list") != std::string::npos) {
 
  172                 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
 
  177     data = 
new SgData(agent(), node, sg_id, egress_acl_uuid, ingress_acl_uuid);
 
  179     req.
data.reset(data);
 
  180     agent()->sg_table()->Enqueue(&req);
 
  185     SgListResp *resp = 
static_cast<SgListResp *
>(sresp);
 
  188         (str_uuid == name) ||
 
  191         data.set_ref_count(GetRefCount());
 
  192         data.set_sg_uuid(str_uuid);
 
  193         data.set_sg_id(GetSgId());
 
  194         if (GetEgressAcl()) {
 
  195             data.set_egress_acl_uuid(
UuidToString(GetEgressAcl()->GetUuid()));
 
  197         if (GetIngressAcl()) {
 
  198             data.set_ingress_acl_uuid(
UuidToString(GetIngressAcl()->GetUuid()));
 
  200         std::vector<SgSandeshData> &list =
 
  201                 const_cast<std::vector<SgSandeshData>&
>(resp->get_sg_list());
 
  202         list.push_back(data);
 
  210     SgObjectLogInfo info;
 
  214         case AgentLogEvent::ADD:
 
  215             str.assign(
"Addition");
 
  217         case AgentLogEvent::DEL:
 
  218             str.assign(
"Deletion");
 
  220         case AgentLogEvent::CHANGE:
 
  221             str.assign(
"Modification");
 
  230     info.set_uuid(sg_uuid);
 
  231     info.set_id(GetSgId());
 
  232     if (GetEgressAcl()) {
 
  233         info.set_egress_acl_uuid(
UuidToString(GetEgressAcl()->GetUuid()));
 
  235     if (GetIngressAcl()) {
 
  236         info.set_ingress_acl_uuid(
UuidToString(GetIngressAcl()->GetUuid()));
 
  238     info.set_ref_count(GetRefCount());
 
  239     SG_OBJECT_LOG_LOG(
"AgentSg", SandeshLevel::SYS_INFO, info);
 
  240     SG_OBJECT_TRACE_TRACE(buf, info);
 
  243 void SgListReq::HandleRequest()
 const {
 
  245     sand->DoSandesh(sand);
 
  249                                          const std::string &context) {
 
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
#define OPER_TRACE(obj,...)
std::string GetString(const std::string &key) const
std::unique_ptr< DBRequestKey > KeyPtr
adjacency_iterator end(DBGraph *graph)
adjacency_iterator begin(DBGraph *graph)
const DBGraph * GetGraph() const
const std::string & name() const
IFMapObject * GetObject()
bool DBEntrySandesh(Sandesh *sresp, std::string &name) const
AclDBEntryRef ingress_acl_
AclDBEntryRef egress_acl_
void SendObjectLog(SandeshTraceBufferPtr ptr, AgentLogEvent::type event) const
virtual void SetKey(const DBRequestKey *key)
virtual bool IsLess(const DBEntry &rhs) const
virtual string ToString() const
boost::uuids::uuid sg_uuid_
virtual KeyPtr GetDBRequestKey() const
bool ChangeHandler(DBEntry *entry, const DBRequest *req)
static DBTableBase * CreateTable(DB *db, const std::string &name)
virtual DBEntry * OperDBAdd(const DBRequest *req)
virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req)
static SgTable * sg_table_
static const uint32_t kInvalidSgId
bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
static std::string UuidToString(const boost::uuids::uuid &id)
static const std::string integerToString(const NumberType &num)
std::unique_ptr< DBRequestKey > key
std::unique_ptr< DBRequestData > data
boost::uuids::uuid egress_acl_id_
boost::uuids::uuid ingress_acl_id_
boost::uuids::uuid sg_uuid_