OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
flow_mgmt_key.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
3  */
4 
6 #include <oper/health_check.h>
7 
10 
11  switch (type_) {
12  case INTERFACE:
13  case ACL:
14  case VN:
15  case INET4:
16  case INET6:
17  case BRIDGE:
18  case NH:
19  case VRF:
21  break;
22 
23  case ACE_ID:
24  case VM:
25  event = FlowEvent::INVALID;
26  break;
27  case BGPASASERVICE:
28  event = FlowEvent::INVALID;
29 
30  default:
31  assert(0);
32  }
33 
34  return event;
35 }
36 
38  Agent *agent, FlowEntry *flow, const boost::uuids::uuid &hc_uuid) {
39  if (bgp_health_check_instance_ != NULL) {
41  return;
42  }
43 
45  if (bgp_health_check_service_ == NULL) {
46  LOG(DEBUG, "Unable to start BFD health check " << hc_uuid << " on flow "
47  " destination = " << flow->key().dst_addr <<
48  " source = " << flow->key().src_addr);
49  return;
50  }
51 
52  const VmInterface *vm_interface =
53  static_cast<const VmInterface *>(flow->intf_entry());
56  const_cast<VmInterface *>(vm_interface),
57  flow->key().dst_addr, flow->key().src_addr);
59 }
60 
67  }
68 }
69 
71  if (Match(flow->key().src_addr)) {
72  return true;
73  }
74 
75  if (Match(flow->key().dst_addr)) {
76  return true;
77  }
78 
79  const FlowEntry *rflow = flow->reverse_flow_entry();
80  if (rflow == NULL) {
81  return true;
82  }
83 
84  if (Match(rflow->key().src_addr)) {
85  return true;
86  }
87 
88  if (Match(rflow->key().dst_addr)) {
89  return true;
90  }
91 
92  return false;
93 }
HealthCheckService * bgp_health_check_service_
IpAddress src_addr
Definition: flow_entry.h:213
IpAddress dst_addr
Definition: flow_entry.h:214
boost::uuids::uuid uuid
void StopHealthCheckService(HealthCheckInstanceBase *instance)
const FlowKey & key() const
Definition: flow_entry.h:594
bool NeedsReCompute(const FlowEntry *flow)
void StopHealthCheck(FlowEntry *flow)
Definition: agent.h:358
void SetService(HealthCheckService *service)
virtual bool UpdateInstanceTask()
Definition: health_check.h:130
HealthCheckInstanceBase * StartHealthCheckService(VmInterface *intrface, VmInterface *paired_vmi, const IpAddress &source_ip, const IpAddress &destination_ip, const MacAddress &destination_mac, bool ignore_status_event, bool multi_hop)
const Interface * intf_entry() const
Definition: flow_entry.h:652
HealthCheckTable * health_check_table() const
Definition: agent.cc:933
HealthCheckService * Find(const boost::uuids::uuid &u)
FlowEntry * reverse_flow_entry()
Definition: flow_entry.h:602
FlowEvent::Event FreeDBEntryEvent() const
Definition: flow_mgmt_key.cc:8
#define LOG(_Level, _Msg)
Definition: logging.h:33
HealthCheckInstanceBase * bgp_health_check_instance_
void StartHealthCheck(Agent *agent, FlowEntry *flow, const boost::uuids::uuid &hc_uuid)
bool Match(const IpAddress &match_ip) const