5 #include <boost/uuid/uuid_io.hpp>
6 #include <vnc_cfg_types.h>
7 #include <agent_types.h>
18 uuid_(uuid), global_(false) {
31 std::string str =
"Policy set ";
33 str.append(
" Uuid :");
50 bool resync_intf =
false;
60 acl_table()->FindActiveEntry(&key));
93 ApplicationPolicySetResp *resp =
static_cast<ApplicationPolicySetResp*
>(sresp);
95 ApplicationPolicySetSandeshData apsd;
99 std::vector<PolicyLinkData> acl_list;
103 pld.set_firewall_policy(
UuidToString((*it)->GetUuid()));
104 acl_list.push_back(pld);
107 apsd.set_firewall_policy_list(acl_list);
108 apsd.set_all_applications(
global_);
110 std::vector<ApplicationPolicySetSandeshData> &list =
111 const_cast<std::vector<ApplicationPolicySetSandeshData>&
>(
112 resp->get_application_policy_set_list());
113 list.push_back(apsd);
117 std::unique_ptr<DBEntry>
121 return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(ps));
143 autogen::FirewallPolicy *fp =
144 static_cast<autogen::FirewallPolicy *
>(adj_node->
GetObject());
145 autogen::IdPermsType id_perms = fp->id_perms();
146 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong,
155 const autogen::ApplicationPolicySet *ps) {
160 bool global = ps->all_applications();
172 autogen::ApplicationPolicySetFirewallPolicy *aps_fp =
173 static_cast<autogen::ApplicationPolicySetFirewallPolicy *
>
192 autogen::ApplicationPolicySet *ps =
193 static_cast<autogen::ApplicationPolicySet *
>(node->
GetObject());
210 autogen::ApplicationPolicySet *ps =
211 static_cast <autogen::ApplicationPolicySet *>(node->
GetObject());
225 autogen::ApplicationPolicySet *ps =
226 static_cast<autogen::ApplicationPolicySet *
>(node->
GetObject());
227 autogen::IdPermsType id_perms = ps->id_perms();
228 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
244 return ps->
Change(
this, data);
268 void ApplicationPolicySetReq::HandleRequest()
const {
271 sand->DoSandesh(sand);
275 const std::string &context) {
bool Change(PolicySetTable *table, const PolicySetData *data)
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
std::string GetString(const std::string &key) const
FirewallPolicyList fw_policy_list_
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
std::pair< std::string, boost::uuids::uuid > FirewallPolicyPair
virtual DBEntry * OperDBAdd(const DBRequest *req)
ConfigManager * config_manager() const
PolicySet(const boost::uuids::uuid &uuid)
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
std::unique_ptr< DBRequestData > data
PolicySetTable(DB *db, const std::string &name)
adjacency_iterator end(DBGraph *graph)
static std::string UuidToString(const boost::uuids::uuid &id)
std::map< std::string, boost::uuids::uuid > FirewallPolicyUuidList
std::unique_ptr< DBRequestKey > KeyPtr
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *key) const
virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req)
static PolicySetData * BuildData(Agent *agent, IFMapNode *node, const autogen::ApplicationPolicySet *ps)
const DBGraph * GetGraph() const
static PolicySetKey * BuildKey(const boost::uuids::uuid &u)
IFMapAgentTable * cfg_vm_interface_table() const
std::unique_ptr< DBRequestKey > key
static const std::string & NullString()
bool DBEntrySandesh(Sandesh *resp, std::string &name) const
virtual bool IsLess(const DBEntry &rhs) const
static bool BuildFirewallPolicy(Agent *agent, IFMapNode *node, boost::uuids::uuid &fp_uuid)
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
const std::string & name() const
FirewallPolicyUuidList fw_policy_uuid_list_
static DBTableBase * CreateTable(DB *db, const std::string &name)
IFMapAgentTable * cfg_firewall_policy_table() const
IFMapObject * GetObject()
virtual std::string ToString() const
PolicySet * global_policy_set() const
virtual void SetKey(const DBRequestKey *key)
bool ProcessConfig(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req)
AgentConfig * cfg() const
IFMapAgentTable * cfg_policy_set_firewall_policy_table() const
bool SkipNode(IFMapNode *node)
virtual bool OperDBResync(DBEntry *entry, const DBRequest *req)
adjacency_iterator begin(DBGraph *graph)
void AddPolicySetNode(IFMapNode *node)
void set_global_policy_set(PolicySet *ps)
virtual KeyPtr GetDBRequestKey() const
FirewallPolicyUuidList fw_policy_uuid_list_