5 #include <boost/uuid/uuid_io.hpp>
23 LOG(DEBUG,
"Create Policy - " << ss.str());
30 AclPtrList::iterator it;
31 LOG(DEBUG,
"Policy::~Policy");
50 LOG(DEBUG,
"Init: " << ss.str() <<
" Name: " <<
name_);
51 AclPtr a = AclPtr(
new Acl(policy_data->
acl_id_));
61 AclPtrList::iterator it;
68 for (it = acls->begin(); it < acls->end(); it++) {
69 if (acl_id == (*it)->acl_id()) {
87 AclPtrList::iterator it;
94 for (it = acls->begin(); it < acls->end(); it++) {
95 if (acl_id == (*it)->acl_id()) {
106 AclPtrList::iterator it;
109 bool ret_value =
false;
116 for (it = acls->begin(); it < acls->end(); it++) {
117 if ((*it)->PMatch(packet_header, sal, terminal_rule)) {
119 if (terminal_rule ==
true) {
133 std::string str =
"Policy ";
140 LOG(DEBUG,
"Policy::GetDBRequestKey");
146 LOG(DEBUG,
"Policy::SetKey");
157 return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(p));
163 LOG(DEBUG,
"PolicyTable::Add");
173 LOG(DEBUG,
"PolicyTable::Change");
176 AclPtr a = AclPtr(
new Acl(data->
acl_id_));
183 LOG(DEBUG,
"PolicyTable::Delete");
189 LOG(DEBUG,
"CreateTable" << name);
void DeleteAcl(const bool inbound, const uuid acl_id)
KeyPtr GetDBRequestKey() const
std::list< TrafficAction * > ActionList
void SetName(const std::string str)
std::unique_ptr< DBRequestData > data
std::unique_ptr< DBRequestKey > KeyPtr
void InsertAcl(const bool inbound, const AclPtr acl)
std::string ToString() const
virtual bool OnChange(DBEntry *entry, const DBRequest *req)
bool PacketMatch(const PacketHeader &packet_header, const bool inbound, AclEntry::ActionList &sal)
std::unique_ptr< DBRequestKey > key
DBEntry * Add(const DBRequest *req)
static DBTableBase * CreateTable(DB *db, const std::string &name)
PolicyTable(DB *db, const std::string &name)
bool IsLess(const DBEntry &rhs) const
AclPtrList outbound_acls_
void Init(const PolicyData *req)
#define LOG(_Level, _Msg)
std::vector< AclPtr > AclPtrList
void SetKey(const DBRequestKey *key)
void Init(const PolicyConfigSpec &policy_cfg)
AclPtr FindAcl(const bool inbound, const uuid acl_id)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *key) const
static void RegisterFactory(const std::string &prefix, CreateFunction create_fn)
void Delete(DBEntry *entry, const DBRequest *req)