6 #include <boost/uuid/uuid_io.hpp>
15 #include <vnc_cfg_types.h>
16 #include <agent_types.h>
38 using namespace autogen;
43 :
uuid(u), drop(false), terminal(false), other(false),
44 src_match_vn(), dst_match_vn(), acl_name() {
53 std::string str =
"ACL DB Entry:";
54 str.insert(str.end(),
name_.begin(),
name_.end());
69 AclResp *resp =
static_cast<AclResp *
>(sresp);
75 if ((uuid.empty()) || (str_uuid == uuid)) {
78 std::vector<AclSandeshData> &list =
79 const_cast<std::vector<AclSandeshData>&
>(resp->get_acl_list());
90 AclEntries::const_iterator iter;
93 AclEntrySandeshData acl_entry_sdata;
95 iter->SetAclEntrySandeshData(acl_entry_sdata);
96 data.entries.push_back(acl_entry_sdata);
104 return std::unique_ptr<DBEntry>(
static_cast<DBEntry *
>(acl));
113 std::vector<AclEntrySpec>::iterator it;
115 for (it = acl_spec_ptr->begin(); it != acl_spec_ptr->end();
120 AclSandeshData sandesh_data;
128 bool changed =
false;
136 if (qos_config_data != NULL) {
154 std::vector<AclEntrySpec>::iterator it;
156 for (it = acl_spec_ptr->begin(); it != acl_spec_ptr->end();
178 if (changed ==
false) {
180 AclDBEntry::AclEntries::iterator iter;
181 iter = entries.begin();
182 while (iter != entries.end()) {
184 entries.erase(iter++);
193 AclSandeshData sandesh_data;
219 TrafficActionMap::const_iterator it;
275 acl_table_ =
new AclTable(db, name);
292 ace_sandesh.set_ace_id(ace_spec.
id.
id_);
295 ace_sandesh.set_rule_type(
"T");
297 ace_sandesh.set_rule_type(
"NT");
299 ace_sandesh.set_uuid(ace_spec.
rule_uuid);
309 src =
"UnKnown Adresss";
311 ace_sandesh.set_src(src);
321 dst =
"UnKnown Adresss";
323 ace_sandesh.set_dst(dst);
325 std::vector<SandeshRange> sr_l;
326 std::vector<RangeSpec>::iterator it;
333 ace_sandesh.set_proto_l(sr_l);
342 ace_sandesh.set_src_port_l(sr_l);
351 ace_sandesh.set_dst_port_l(sr_l);
354 std::vector<ActionStr> astr_l;
355 std::vector<ActionSpec>::iterator action_it;
356 for (action_it = ace_spec.
action_l.begin(); action_it != ace_spec.
action_l.end();
371 action.
ma.
ip.to_string() +
" " +
374 if (astr.action.size()) {
375 astr_l.push_back(astr);
378 ace_sandesh.set_action_l(astr_l);
386 if (event == AgentLogEvent::ADD || event == AgentLogEvent::CHANGE) {
387 std::vector<AclEntrySpec>::iterator it;
388 std::vector<AclEntrySandeshData> acl_entries;
391 AclEntrySandeshData ae_sandesh;
394 acl_entries.push_back(ae_sandesh);
396 acl.set_entries(acl_entries);
398 }
else if (event == AgentLogEvent::DEL) {
404 AccessControlList *cfg_acl = dynamic_cast <AccessControlList *> (node->
GetObject());
406 autogen::IdPermsType id_perms = cfg_acl->id_perms();
407 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
410 FirewallPolicy *fw_acl =
411 dynamic_cast <FirewallPolicy *> (node->
GetObject());
413 autogen::IdPermsType id_perms = fw_acl->id_perms();
414 CfgUuidSet(id_perms.uuid.uuid_mslong, id_perms.uuid.uuid_lslong, u);
421 AccessControlList *cfg_acl,
422 const MatchConditionType *match_condition,
423 const ActionListType action_list,
424 const string rule_uuid, uint32_t
id) {
427 std::stringstream stream;
428 stream << std::setfill(
'0') << std::setw(8) << id;
429 ace_spec.
id.
id_ = stream.str();
431 if (ace_spec.
Populate(match_condition) ==
false) {
436 if (cfg_acl->entries().dynamic) {
449 AclEntrySandeshData ae_spec;
460 iter != node->
end(graph); ++iter) {
462 static_cast<IFMapNode *
>(iter.operator->());
464 agent()->cfg()->cfg_service_group_table())) {
468 const ServiceGroup *service_group =
469 static_cast<const ServiceGroup*
>(service_group_node->
GetObject());
480 iter != node->
end(graph); iter++) {
482 static_cast<IFMapNode *
>(iter.operator->());
485 agent()->cfg()->cfg_firewall_rule_table())) {
489 return firewall_rule_node;
496 const FirewallRule *rule) {
497 if ((rule->direction().compare(
"<>") == 0)) {
499 implicit_forward_ace_spec.
Reverse(&ace_spec,
514 iter != node->
end(graph); ++iter) {
516 static_cast<IFMapNode *
>(iter.operator->());
518 agent()->cfg()->cfg_firewall_policy_firewall_rule_table())) {
522 const FirewallPolicyFirewallRule *fp_fr =
523 static_cast<const FirewallPolicyFirewallRule *
>(
533 const FirewallRule *fw_rule =
534 static_cast<const FirewallRule *
>(rule->
GetObject());
537 ace_spec.
id.
id_ = fp_fr->data().sequence;
544 autogen::IdPermsType id_perms = fw_rule->id_perms();
546 id_perms.uuid.uuid_lslong, rule_uuid);
551 if ((fw_rule->direction().compare(
"<") == 0)) {
558 if ((fw_rule->direction().compare(
"<>") == 0)) {
566 const autogen::SubnetType &rhs)
const {
567 if (lhs.ip_prefix.compare(rhs.ip_prefix) != 0)
569 if (lhs.ip_prefix_len != rhs.ip_prefix_len)
575 const autogen::AddressType &rhs)
const {
578 if (lhs.virtual_network.compare(rhs.virtual_network) != 0)
580 if (lhs.security_group.compare(rhs.security_group) != 0)
582 if (lhs.network_policy.compare(rhs.network_policy) != 0)
584 if (lhs.subnet_list.size() != rhs.subnet_list.size())
586 std::vector<SubnetType>::const_iterator lit = lhs.subnet_list.begin();
587 std::vector<SubnetType>::const_iterator rit = lhs.subnet_list.begin();
588 while ((lit != lhs.subnet_list.end()) &&
589 (rit != rhs.subnet_list.end())) {
599 const autogen::PortType &dst)
const {
600 if ((src.start_port == dst.start_port) &&
601 (src.end_port == dst.end_port)) {
610 AccessControlList *cfg_acl =
611 dynamic_cast <AccessControlList *> (node->
GetObject());
612 const std::vector<AclRuleType> &entrs = cfg_acl->entries().acl_rule;
618 std::vector<AclRuleType>::const_iterator ir;
620 for(ir = entrs.begin(); ir != entrs.end(); ++ir) {
621 AddAceToAcl(&acl_spec,
this, cfg_acl, &(ir->match_condition),
622 ir->action_list, ir->rule_uuid,
id++);
623 bool address_same =
false;
625 ir->match_condition.dst_address)) {
629 bool port_same =
false;
631 ir->match_condition.dst_port)) {
636 if ((ir->direction.compare(
"<>") == 0) &&
637 (!address_same || !port_same)) {
638 MatchConditionType rmatch_condition;
639 rmatch_condition = ir->match_condition;
640 rmatch_condition.src_address = ir->match_condition.dst_address;
641 rmatch_condition.dst_address = ir->match_condition.src_address;
642 rmatch_condition.src_port = ir->match_condition.dst_port;
643 rmatch_condition.dst_port = ir->match_condition.src_port;
644 AddAceToAcl(&acl_spec,
this, cfg_acl, &rmatch_condition,
645 ir->action_list, ir->rule_uuid,
id++);
659 req.
data.reset(NULL);
666 AccessControlList *cfg_acl = dynamic_cast <AccessControlList *> (node->
GetObject());
680 req.
data.reset(data);
689 AclEntries::iterator it, tmp;
690 it = entries.begin();
691 while (it != entries.end()) {
700 AclEntries::iterator it;
714 AclEntries::iterator it;
728 AclEntries::iterator iter;
730 for (iter = entries.begin();
731 iter != entries.end(); ++iter) {
732 if (acl_entry_spec.
id == iter->id()) {
736 }
else if (iter->id() > acl_entry_spec.
id) {
745 std::vector<ActionSpec>::const_iterator it;
746 for (it = acl_entry_spec.
action_l.begin(); it != acl_entry_spec.
action_l.end();
763 entries.insert(iter, *entry);
770 AclEntries::iterator iter;
774 if (ace_id == iter->id()) {
788 AclEntries::iterator iter;
801 AclEntries::const_iterator iter;
802 bool ret_val =
false;
812 packet_header.
family != iter->family()) {
816 AclEntry::ActionList::const_iterator al_it;
817 for (al_it = al.begin(); al_it != al.end(); ++al_it) {
850 if (info && ta->
IsDrop()) {
855 info->
uuid = iter->uuid();
863 if (iter->IsTerminal()) {
870 info->
uuid = iter->uuid();
879 info->
uuid = iter->uuid();
893 return it.operator->();
904 AclEntries::const_iterator new_entries_it = new_entries.begin();
906 new_entries_it != new_entries.end()) {
907 if (*it == *new_entries_it) {
915 new_entries_it == new_entries.end()) {
924 if (acl_uuid_str.empty()) {
938 AclDBEntry::AclEntries::const_iterator it =
acl_entries_.begin();
940 const AclEntry *ae = it.operator->();
941 if (ae->
uuid() == rule_uuid) {
950 const int last_count) {
951 AclFlowResp *resp =
new AclFlowResp();
961 resp->set_context(ctx);
967 const string &ace_id) {
968 AclFlowCountResp *resp =
new AclFlowCountResp();
977 resp->set_context(ctx);
981 void AclReq::HandleRequest()
const {
983 sand->DoSandesh(sand);
987 const std::string &context) {
992 void NextAclFlowReq::HandleRequest()
const {
993 string key = get_iteration_key();
995 size_t n = std::count(key.begin(), key.end(),
':');
997 AclFlowCountResp *resp =
new AclFlowCountResp();
998 resp->set_context(context());
1001 std::stringstream ss(key);
1003 if (getline(ss, item,
':')) {
1006 if (getline(ss, item,
':')) {
1007 std::istringstream(item) >> last_count;
1013 void AclFlowReq::HandleRequest()
const {
1017 void AclFlowCountReq::HandleRequest()
const {
1021 void NextAclFlowCountReq::HandleRequest()
const {
1022 string key = get_iteration_key();
1023 size_t n = std::count(key.begin(), key.end(),
':');
1025 AclFlowCountResp *resp =
new AclFlowCountResp();
1026 resp->set_context(context());
1029 std::stringstream ss(key);
1030 string uuid_str, item;
1031 std::string ace_id =
"";
1032 if (getline(ss, item,
':')) {
1035 if (getline(ss, item,
':')) {
1043 std::vector<AclAddressInfo> *list) {
1045 boost::system::error_code ec;
1046 info.
ip_addr = IpAddress::from_string(prefix.c_str(), ec);
1047 if (ec.value() != 0) {
1048 ACL_TRACE(Err,
"Invalid source ip prefix " + prefix);
1059 list->push_back(info);
1069 if (fst->protocol.compare(
"any") == 0) {
1092 if (s_group->firewall_service_list().size() == 0) {
1096 std::vector<FirewallServiceType>::const_iterator it =
1097 s_group->firewall_service_list().begin();
1098 for (; it != s_group->firewall_service_list().end(); it++) {
1126 ServiceGroupMatch::ServicePortList::const_iterator it;
1138 bool swap_address,
bool swap_port) {
1162 const std::string &name) {
1168 iter != node->
end(graph); ++iter) {
1170 static_cast<IFMapNode *
>(iter.operator->());
1176 if (ag_node->
name() == name) {
1185 const std::string &name,
1189 if (!ag_ifmap_node) {
1193 AddressGroup *ag =
static_cast<AddressGroup *
>(ag_ifmap_node->
GetObject());
1201 iter != ag_ifmap_node->
end(graph); ++iter) {
1203 static_cast<IFMapNode *
>(iter.operator->());
1211 if (strtol(tag->id().c_str(), NULL, 16) == 0) {
1216 src_tags.push_back(strtol(tag->id().c_str(), NULL, 16));
1218 dst_tags.push_back(strtol(tag->id().c_str(), NULL, 16));
1222 std::vector<AclAddressInfo> ip_list;
1223 std::vector<SubnetType>::const_iterator it = ag->prefix().begin();
1224 for (; it != ag->prefix().end(); it++) {
1238 const FirewallRule *fw_rule) {
1239 if (fw_rule->IsPropertySet(FirewallRule::SERVICE)) {
1243 if (fw_rule->match_tags().size()) {
1244 std::vector<int>::const_iterator it =
1245 fw_rule->match_tag_types().begin();
1246 for (; it != fw_rule->match_tag_types().end(); it++) {
1254 if (fw_rule->endpoint_1().subnet.ip_prefix.size()) {
1257 if (fw_rule->endpoint_1().subnet.ip_prefix.size()) {
1259 fw_rule->endpoint_1().subnet.ip_prefix_len,
1262 }
else if (fw_rule->endpoint_1().virtual_network.size()) {
1264 nt = fw_rule->endpoint_1().virtual_network;
1267 }
else if (fw_rule->endpoint_1().tags.size()) {
1269 std::vector<int>::const_iterator it =
1270 fw_rule->endpoint_1().tag_ids.begin();
1271 for (;it != fw_rule->endpoint_1().tag_ids.end(); it++) {
1276 }
else if (fw_rule->endpoint_1().address_group.size()) {
1278 fw_rule->endpoint_1().address_group,
true)) {
1285 if (fw_rule->endpoint_2().subnet.ip_prefix.size()) {
1288 if (fw_rule->endpoint_2().subnet.ip_prefix.size()) {
1290 fw_rule->endpoint_2().subnet.ip_prefix_len,
1294 }
else if (fw_rule->endpoint_2().virtual_network.size()) {
1296 nt = fw_rule->endpoint_2().virtual_network;
1299 }
else if (fw_rule->endpoint_2().tags.size()) {
1301 std::vector<int>::const_iterator it =
1302 fw_rule->endpoint_2().tag_ids.begin();
1303 for (;it != fw_rule->endpoint_2().tag_ids.end(); it++) {
1308 }
else if (fw_rule->endpoint_2().address_group.size()) {
1310 fw_rule->endpoint_2().address_group,
false)) {
1320 if (match_condition->protocol.compare(
"any") == 0) {
1324 std::stringstream ss;
1325 ss<<match_condition->protocol;
1333 if (match_condition->ethertype.compare(
"IPv6") == 0) {
1335 }
else if (match_condition->ethertype.compare(
"IPv4") == 0) {
1342 if ((match_condition->protocol.compare(
"1") != 0) &&
1343 (match_condition->protocol.compare(
"58") != 0)) {
1346 sp = match_condition->src_port;
1347 rs.
min = sp.start_port;
1348 rs.
max = sp.end_port;
1349 if ((sp.start_port == -1) && (sp.end_port == -1)) {
1356 dp = match_condition->dst_port;
1357 rs.
min = dp.start_port;
1358 rs.
max = dp.end_port;
1359 if ((dp.start_port == -1) && (dp.end_port == -1)) {
1367 const std::vector<SubnetType> &slist =
1368 match_condition->src_address.subnet_list;
1370 match_condition->src_address.subnet.ip_prefix.size()) {
1373 if (match_condition->src_address.subnet.ip_prefix.size()) {
1375 match_condition->src_address.subnet.ip_prefix_len,
1379 std::vector<SubnetType>::const_iterator it = slist.begin();
1380 while (it != slist.end()) {
1381 const SubnetType &subnet = *it;
1386 }
else if (match_condition->src_address.virtual_network.size()) {
1388 nt = match_condition->src_address.virtual_network;
1391 }
else if (match_condition->src_address.security_group.size()) {
1392 std::stringstream ss;
1393 ss<<match_condition->src_address.security_group;
1400 const std::vector<SubnetType> &dlist =
1401 match_condition->dst_address.subnet_list;
1403 match_condition->dst_address.subnet.ip_prefix.size()) {
1406 if (match_condition->dst_address.subnet.ip_prefix.size()) {
1408 match_condition->dst_address.subnet.ip_prefix_len,
1413 std::vector<SubnetType>::const_iterator it = dlist.begin();
1414 while (it != dlist.end()) {
1415 const SubnetType &subnet = *it;
1420 }
else if (match_condition->dst_address.virtual_network.size()) {
1422 nt = match_condition->dst_address.virtual_network;
1425 }
else if (match_condition->dst_address.security_group.size()) {
1426 std::stringstream ss;
1427 ss<<match_condition->dst_address.security_group;
1435 std::vector<ActionSpec>::const_iterator it;
1470 LOG(ERROR,
"Mirror nh mode not supported");
1476 const ActionListType &action_list) {
1477 if (!action_list.simple_action.empty()) {
1485 if (action_list.log) {
1490 if (action_list.alert) {
1500 if (!action_list.mirror_to.analyzer_name.empty()
1501 && action_list.mirror_to.nic_assisted_mirroring) {
1503 action_list.mirror_to.nic_assisted_mirroring;
1505 action_list.mirror_to.nic_assisted_mirroring_vlan;
1509 }
else if (!action_list.mirror_to.analyzer_name.empty()) {
1510 boost::system::error_code ec;
1514 IpAddress::from_string(action_list.mirror_to.analyzer_ip_address, ec);
1516 maction.
ma.
nh_mode = action_list.mirror_to.nh_mode;
1522 IpAddress::from_string(
1523 action_list.mirror_to.static_nh_header.vtep_dst_ip_address, ec);
1527 action_list.mirror_to.static_nh_header.vni;
1529 maction.
ma.
vrf_name = action_list.mirror_to.routing_instance;
1534 if (ec.value() == 0) {
1535 if (action_list.mirror_to.udp_port) {
1536 maction.
ma.
port = action_list.mirror_to.udp_port;
1544 ACL_TRACE(Err,
"Invalid analyzer ip address " +
1545 action_list.mirror_to.analyzer_ip_address);
1549 if (!action_list.assign_routing_instance.empty()) {
1554 action_list.assign_routing_instance);
1556 action_l.push_back(vrf_translate_spec);
1559 if (!action_list.qos_action.empty()) {
1564 action_list.qos_action);
1565 action_l.push_back(qos_translate_spec);
1568 if (action_list.host_based_service) {
virtual bool IFNodeToUuid(IFMapNode *node, boost::uuids::uuid &u)
std::string dst_policy_id_str
void ReversePort(AclEntrySpec *ace_spec)
void ReverseAddress(AclEntrySpec *ace_spec)
bool IsQosConfigResolved()
bool Changed(const AclEntries &new_acl_entries) const
IpAddress GetMirrorSourceIp(const IpAddress &dest)
void SetName(const std::string name)
boost::function< void(const AclDBEntry *acl, AclFlowResp &data, const int last_count)> FlowAclSandeshDataFn
std::string GetAnalyzerName()
VrfTranslateActionSpec vrf_translate
static Agent * GetInstance()
static boost::uuids::uuid StringToUuid(const std::string &str)
static void CfgUuidSet(uint64_t ms_long, uint64_t ls_long, boost::uuids::uuid &u)
AclEntryIDList ace_id_list
AddressMatch::AddressType dst_addr_type
DBState * GetState(DBTableBase *tbl_base, ListenerId listener) const
std::vector< AclEntrySpec > acl_entry_specs_
std::string GetString(const std::string &key) const
virtual bool OperDBOnChange(DBEntry *entry, const DBRequest *req)
virtual DBEntry * OperDBAdd(const DBRequest *req)
virtual bool OperDBDelete(DBEntry *entry, const DBRequest *req)
void set_name(const std::string &name)
std::list< TrafficAction * > ActionList
void SetDynamicAcl(bool dyn)
bool DBEntrySandesh(Sandesh *resp, std::string &name) const
void PopulateServiceType(const autogen::FirewallServiceType *fst)
ConfigManager * config_manager() const
void SetState(DBTableBase *tbl_base, ListenerId listener, DBState *state)
static AclTable * acl_table_
boost::asio::ip::address IpAddress
const AgentQosConfig * qos_config_ref() const
bool stringToInteger(const std::string &str, NumberType &num)
QosConfigActionSpec qos_config_action
const std::string & vrf_name() const
std::unique_ptr< DBRequestData > data
static DBTableBase * CreateTable(DB *db, const std::string &name)
bool ResyncQosConfigEntries()
void FirewallPolicyIFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u, AclSpec &acl_spec)
AgentDBEntry * FindActiveEntry(const DBEntry *key)
bool Enqueue(DBRequest *req)
std::vector< RangeSpec > protocol
bool nic_assisted_mirroring
std::vector< AclAddressInfo > dst_ip_list
const std::string & name() const
adjacency_iterator end(DBGraph *graph)
IFMapAgentTable * cfg_address_group_table() const
static std::string UuidToString(const boost::uuids::uuid &id)
const boost::uuids::uuid & GetUuid() const
std::vector< ActionSpec > action_l
ServiceGroupMatch::ServicePortList service_group
virtual bool IFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u)
boost::shared_ptr< TraceBuffer< SandeshTrace > > SandeshTraceBufferPtr
std::vector< RangeSpec > src_port
static Ip4Address GetIp4SubnetAddress(const Ip4Address &prefix, uint16_t plen)
std::unique_ptr< DBRequestKey > KeyPtr
SandeshTraceBufferPtr AclTraceBuf
static const std::string kActionLogStr
QosConfigActionSpec qos_config_action_
#define ACL_TRACE(obj,...)
AclTable(DB *db, const std::string &name)
bool SubnetTypeEqual(const autogen::SubnetType &lhs, const autogen::SubnetType &rhs) const
MirrorTable * mirror_table() const
static Ip6Address GetIp6SubnetAddress(const Ip6Address &prefix, uint16_t plen)
const DBGraph * GetGraph() const
std::vector< MirrorActionSpec > mirror_l
ListenerId Register(ChangeCallback callback, const std::string &name="unspecified")
void set_acl_flow_sandesh_data_cb(FlowAclSandeshDataFn fn)
KeyPtr GetDBRequestKey() const
bool IsQosConfigResolved()
const std::string & GetName() const
virtual bool OperDBResync(DBEntry *entry, const DBRequest *req)
bool IsRulePresent(const std::string &uuid) const
void DeleteAllAclEntries()
static const std::string integerToString(const NumberType &num)
void Notify(DBTablePartBase *partition, DBEntryBase *e)
VrfTranslateActionSpec vrf_translate_action_
AclEntry * AddAclEntry(const AclEntrySpec &acl_entry_spec, AclEntries &entries)
static void AclEntryObjectTrace(AclEntrySandeshData &ace_sandesh, AclEntrySpec &ace_spec)
static const uint16_t AnalyzerUdpPort()
static void AclFlowCountResponse(const std::string acl_uuid_str, const std::string ctx, const std::string &ace_id)
static void AddAceToAcl(AclSpec *acl_spec, const AclTable *acl_table, AccessControlList *cfg_acl, const MatchConditionType *match_condition, const ActionListType action_list, const string rule_uuid, uint32_t id)
void BuildAddressInfo(const std::string &prefix, int plen, std::vector< AclAddressInfo > *list)
static const std::string kActionHbsStr
virtual std::unique_ptr< DBEntry > AllocEntry(const DBRequestKey *k) const
void Reverse(AclEntrySpec *ace_spec, AclEntryID::Type type, bool swap_address, bool swap_port)
bool Populate(const autogen::MatchConditionType *match_condition)
Ip4Address router_id() const
void PopulateServicePort(AclEntrySpec &ace_spec, IFMapNode *node)
std::unique_ptr< DBRequestKey > key
IFMapAgentTable * cfg_tag_table() const
static std::string BuildIpMaskList(const std::vector< AclAddressInfo > &list)
bool BuildAddressGroup(Agent *agent, IFMapNode *node, const std::string &name, bool source)
bool AddressTypeEqual(const autogen::AddressType &lhs, const autogen::AddressType &rhs) const
static const std::string & NullString()
bool PopulateServiceGroup(const autogen::ServiceGroup *service_group)
virtual AgentSandeshPtr GetAgentSandesh(const AgentSandeshArguments *args, const std::string &context)
class boost::shared_ptr< AgentSandesh > AgentSandeshPtr
bool PortTypeEqual(const autogen::PortType &src, const autogen::PortType &dst) const
uint16_t nic_assisted_mirroring_vlan
static MirrorEntryData::MirrorEntryFlags DecodeMirrorFlag(const std::string &nh_mode, bool juniper_header)
IpAddress PrefixToIp6Netmask(uint32_t plen)
void PopulateAction(const AclTable *acl_table, const autogen::ActionListType &action_list)
StaticMirrorNhData staticnhdata
static std::string ActionToString(enum Action at)
const std::string & name() const
void ClearState(DBTableBase *tbl_base, ListenerId listener)
std::string analyzer_name
boost::asio::ip::address_v4 Ip4Address
TrafficAction::Action simple_action
void AddMirrorEntry(Agent *agent) const
bool DeleteAclEntry(const uint32_t acl_entry_id)
static void AddMirrorEntry(const std::string &analyzer_name, const std::string &vrf_name, const IpAddress &sip, uint16_t sport, const IpAddress &dip, uint16_t dport)
bool ResyncQosConfigEntries()
const AclEntry * GetAclEntryAtIndex(uint32_t) const
IFMapObject * GetObject()
void set_ignore_acl(bool ignore_acl)
FlowAclSandeshDataFn flow_acl_sandesh_data_cb_
bool GetDynamicAcl() const
IFMapNode * GetFirewallRule(IFMapNode *node)
bool IsLess(const DBEntry &rhs) const
bool PacketMatch(const PacketHeader &packet_header, MatchAclParams &m_acl, FlowPolicyInfo *info) const
void AddImplicitRule(AclSpec &acl_spec, AclEntrySpec &ace_spec, const autogen::FirewallRule *rule)
AgentQosConfigTable * qos_config_table() const
TrafficAction::Action ConvertActionString(std::string action) const
void DeleteUnresolvedEntry(AclDBEntry *entry)
void PopulateAclEntry(const AclEntrySpec &acl_entry_spec)
static void AclFlowResponse(const std::string acl_uuid_str, const std::string ctx, const int last_count)
#define LOG(_Level, _Msg)
DBTableBase::ListenerId qos_config_listener_id_
UnResolvedAclEntries unresolved_acl_entries_
static const std::string kActionAlertStr
AddressMatch::AddressType src_addr_type
const std::string & uuid() const
AgentConfig * cfg() const
void SetAclEntries(AclEntries &entries)
static void AclObjectTrace(AgentLogEvent::type event, AclSpec &acl_spec)
std::string ToString() const
bool SkipNode(IFMapNode *node)
boost::function< void(const AclDBEntry *acl, AclFlowCountResp &data, const std::string &ace_id)> FlowAceSandeshDataFn
static MacAddress FromString(const std::string &str, boost::system::error_code *error=NULL)
AclTable * acl_table() const
void AclIFNodeToReq(IFMapNode *node, DBRequest &req, const boost::uuids::uuid &u, AclSpec &acl_spec)
IFMapNode * GetAddressGroup(Agent *agent, IFMapNode *node, const std::string &name)
TrafficAction::TrafficActionType ta_type
adjacency_iterator begin(DBGraph *graph)
boost::intrusive::list< AclEntry, AclEntryNode > AclEntries
void SetAclSandeshData(AclSandeshData &data) const
IpAddress PrefixToIpNetmask(uint32_t prefix_len)
void SetKey(const DBRequestKey *key)
TrafficActionType action_type() const
FlowPolicyInfo(const std::string &u)
void set_vrf_name(const std::string &vrf_name)
std::string src_policy_id_str
std::vector< AclAddressInfo > src_ip_list
uint16_t mirror_port() const
void set_mirror_entry(MirrorEntryRef me)
void AddUnresolvedEntry(AclDBEntry *entry)
void set_ace_flow_sandesh_data_cb(FlowAceSandeshDataFn fn)
SandeshTraceBufferPtr SandeshTraceBufferCreate(const std::string &buf_name, size_t buf_size, bool trace_enable=true)
FlowAceSandeshDataFn flow_ace_sandesh_data_cb_
std::vector< RangeSpec > dst_port
static const AclDBEntry * GetAclDBEntry(const std::string uuid_str, const std::string ctx, SandeshResponse *resp)