6 #include <boost/uuid/uuid_io.hpp>
24 LOG(DEBUG,
"Create Policy - " << ss.str());
31 AclPtrList::iterator it;
32 LOG(DEBUG,
"Policy::~Policy");
51 LOG(DEBUG,
"Init: " << ss.str() <<
" Name: " <<
name_);
52 AclPtr a = AclPtr(
new Acl(policy_data->
acl_id_));
62 AclPtrList::iterator it;
69 for (it = acls->begin(); it < acls->end(); it++) {
70 if (acl_id == (*it)->acl_id()) {
88 AclPtrList::iterator it;
95 for (it = acls->begin(); it < acls->end(); it++) {
96 if (acl_id == (*it)->acl_id()) {
107 AclPtrList::iterator it;
110 bool ret_value =
false;
117 for (it = acls->begin(); it < acls->end(); it++) {
118 if ((*it)->PMatch(packet_header, sal, terminal_rule)) {
120 if (terminal_rule ==
true) {
134 std::string str =
"Policy ";
141 LOG(DEBUG,
"Policy::GetDBRequestKey");
147 LOG(DEBUG,
"Policy::SetKey");
158 return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(p));
164 LOG(DEBUG,
"PolicyTable::Add");
174 LOG(DEBUG,
"PolicyTable::Change");
177 AclPtr a = AclPtr(
new Acl(data->
acl_id_));
184 LOG(DEBUG,
"PolicyTable::Delete");
190 LOG(DEBUG,
"CreateTable" <<
name);
std::list< TrafficAction * > ActionList
std::unique_ptr< DBRequestKey > KeyPtr
const std::string & name() const
static void RegisterFactory(const std::string &prefix, CreateFunction create_fn)
DBEntry * Add(const DBRequest *req)
void Delete(DBEntry *entry, const DBRequest *req)
virtual bool OnChange(DBEntry *entry, const DBRequest *req)
static DBTableBase * CreateTable(DB *db, const std::string &name)
PolicyTable(DB *db, const std::string &name)
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *key) const
AclPtrList outbound_acls_
AclPtr FindAcl(const bool inbound, const uuid acl_id)
std::vector< AclPtr > AclPtrList
void DeleteAcl(const bool inbound, const uuid acl_id)
void SetName(const std::string str)
KeyPtr GetDBRequestKey() const
bool IsLess(const DBEntry &rhs) const
void Init(const PolicyData *req)
void InsertAcl(const bool inbound, const AclPtr acl)
bool PacketMatch(const PacketHeader &packet_header, const bool inbound, AclEntry::ActionList &sal)
std::string ToString() const
void SetKey(const DBRequestKey *key)
#define LOG(_Level, _Msg)
std::unique_ptr< DBRequestKey > key
std::unique_ptr< DBRequestData > data
void Init(const PolicyConfigSpec &policy_cfg)