6 #include <net/ethernet.h>
7 #include <boost/uuid/uuid_io.hpp>
31 #include <vnc_cfg_types.h>
34 #include "sandesh/sandesh_trace.h"
35 #include "sandesh/common/vns_types.h"
36 #include "sandesh/common/vns_constants.h"
42 using namespace boost::uuids;
71 assert(xconnect != NULL);
86 const std::string &vrf_name,
89 const std::string &xconnect,
90 const std::string vn_name,
93 plen_(plen), gw_(gw), xconnect_(xconnect), vn_name_(vn_name) {
149 const Ip4Address &gw,
const string &vn_name) {
154 if (physical_intf->
no_arp() ||
164 vn_list.insert(vn_name);
182 const VrfEntry *vrf,
const string &interface,
184 int plen,
const string &vn_name) {
188 addr, 32, vn_name,
false,
true);
193 if (physical_intf->
no_arp())
234 if (physical_intf && physical_intf->
no_arp()) {
248 boost::system::error_code ec;
276 boost::system::error_code ec;
312 if (
gw_.to_ulong()) {
335 if (
gw_.to_ulong()) {
349 sub_type_(VHOST), ip_addr_(0), plen_(0), gw_(0), xconnect_(NULL),
358 const std::string &vn_name) :
461 if (
gw_.to_ulong()) {
467 if (
gw_.to_ulong()) {
486 const std::string &xconnect,
487 const std::string &vn_name,
502 const std::string &xconnect,
503 const std::string &vn_name,
517 req.
data.reset(NULL);
524 req.data.reset(NULL);
boost::asio::ip::address_v4 Ip4Address
Ip4Address GetIp4SubnetBroadcastAddress(const Ip4Address &ip_prefix, uint16_t plen)
std::vector< int > TagList
#define IPV4_MULTICAST_BASE_ADDRESS
std::vector< int > SecurityGroupList
#define MULTICAST_BASE_ADDRESS_PLEN
std::vector< Ip4Address > AddressList
std::set< std::string > VnListType
#define IPV6_MULTICAST_BASE_ADDRESS
std::vector< std::string > CommunityList
static Ip4Address GetIp4SubnetAddress(const Ip4Address &prefix, uint16_t plen)
AgentDBEntry * FindActiveEntry(const DBEntry *key)
virtual void Process(DBRequest &req)
bool subnet_hosts_resolvable() const
const std::string & vhost_name() const
const Ip4Address & vhost_addr() const
InterfaceTable * interface_table() const
AgentParam * params() const
const std::string & fabric_policy_vrf_name() const
static const MacAddress & pkt_interface_mac()
VrfTable * vrf_table() const
const Peer * local_peer() const
VrfEntry * fabric_policy_vrf() const
const Peer * local_vm_peer() const
const std::string & fabric_vn_name() const
NextHopTable * nexthop_table() const
bool forwarding_enabled() const
const std::string & fabric_vrf_name() const
std::unique_ptr< DBRequestKey > KeyPtr
DBTableBase * get_table() const
bool Enqueue(DBRequest *req)
static void Create(InterfaceTable *table, const std::string &ifname, SubType sub_type, const std::string &vrf_name, const Ip4Address &addr, int plen, const Ip4Address &gw, const std::string &xconnect, const std::string &vn_name, Interface::Transport transport)
Interface * xconnect() const
KeyPtr GetDBRequestKey() const
static void CreateReq(InterfaceTable *table, const std::string &ifname, SubType sub_type, const std::string &vrf_name, const Ip4Address &addr, int plen, const Ip4Address &gw, const std::string &xconnect, const std::string &vn_name, Interface::Transport transport)
InetInterface(const std::string &name)
static void DeleteReq(InterfaceTable *table, const std::string &ifname)
bool OnChange(InetInterfaceData *data)
void ActivateHostInterface()
void DeActivateSimpleGateway()
void DelHostMulticastRoutes()
void ActivateSimpleGateway()
virtual bool CmpInterface(const DBEntry &rhs) const
void AddHostMulticastRoutes()
void DeActivateHostInterface()
static void AddVHostRecvRoute(const Peer *peer, const string &vrf, const InterfaceKey &interface, const IpAddress &addr, uint8_t plen, const string &vn_name, bool policy, bool native_encap, bool ipam_host_route=true)
static void AddResolveRoute(const Peer *peer, const string &vrf_name, const Ip4Address &ip, const uint8_t plen, const InterfaceKey &intf_key, const uint32_t label, bool policy, const std::string &vn_name, const SecurityGroupList &sg_list, const TagList &tag_list)
static void Delete(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen)
static void AddVHostRecvRouteReq(const Peer *peer, const string &vrf, const InterfaceKey &interface, const IpAddress &addr, uint8_t plen, const string &vn_name, bool policy, bool native_encap)
void AddInterfaceRouteReq(Agent *agent, const Peer *peer, const string &vrf_name, const Ip4Address &ip, uint8_t plen, const Interface *intrface, const std::string &vn_name)
static void AddVHostSubnetRecvRoute(const Peer *peer, const string &vrf, const InterfaceKey &interface, const Ip4Address &addr, uint8_t plen, const std::string &vn_name, bool policy)
static void DeleteReq(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen, AgentRouteData *data)
static void AddGatewayRoute(const Peer *peer, const string &vrf_name, const Ip4Address &dst_addr, uint8_t plen, const AddressList &gw_list, const VnListType &vn_name, uint32_t label, const SecurityGroupList &sg_list, const TagList &tag_list, const CommunityList &communities, bool native_encap)
static void CreateInetInterfaceNextHop(const string &ifname, const string &vrf_name, const MacAddress &mac)
static void DeleteInetInterfaceNextHop(const string &ifname, const MacAddress &mac)
NextHopConstRef flow_key_nh_
const std::string & name() const
Interface::Transport transport() const
static const uint32_t kInvalidLabel
EncapType encap_type() const
static void Create(NextHopTable *table, const Interface *intf, bool policy)
const string & GetName() const
InetUnicastAgentRouteTable * GetInet4UnicastRouteTable() const
InetUnicastAgentRouteTable * GetInet4UnicastRouteTable(const std::string &vrf_name)
static VrfTable * GetInstance()
static void DeleteDefaultRoute(Agent *agent, InetUnicastAgentRouteTable *table, const VrfEntry *vrf, const Ip4Address &addr)
static void AddDefaultRoute(Agent *agent, InetUnicastAgentRouteTable *table, const VrfEntry *vrf, const Interface *xconnect, const Ip4Address &gw, const string &vn_name)
static void AddHostRoutes(Agent *agent, InetUnicastAgentRouteTable *table, const VrfEntry *vrf, const string &interface, const Interface *xconnect, const Ip4Address &addr, int plen, const string &vn_name)
static void DeleteHostRoutes(Agent *agent, InetUnicastAgentRouteTable *table, const VrfEntry *vrf, const Interface *xconnect, const Ip4Address &addr, int plen)
std::unique_ptr< DBRequestKey > key
std::unique_ptr< DBRequestData > data
InetInterface::SubType sub_type_
InetInterfaceData(InetInterface::SubType sub_type, const std::string &vrf_name, const Ip4Address &addr, int plen, const Ip4Address &gw, const std::string &xconnect, const std::string vn_name, Interface::Transport transport)
Interface * AllocEntry(const InterfaceTable *table) const
InterfaceKey * Clone() const
InetInterfaceKey(const std::string &name)
Interface::Transport transport_
void InetInit(const std::string &vrf_name)