7 #include <sys/socket.h>
9 #include <linux/netlink.h>
10 #include <linux/rtnetlink.h>
11 #include <linux/neighbour.h>
12 #include <linux/if_addr.h>
13 #include <arpa/inet.h>
27 if (vhost_name != std::string(
"")) {
28 int intf_idx = if_nametoindex(vhost_name.c_str());
37 if (vm_intf == NULL || intf_vrf == NULL) {
45 if (intf_inet_table == NULL)
51 if (rt_entry != NULL &&
67 intf_vrf->
GetName(), ll_ip, 128));
82 Ip6Address ll_ip = Ip6Address::from_string(std::string(
"::"));
88 vrf_table()->FindVrfFromName(vm_intf->
vrf_name());
108 GetInet6UnicastRouteTable();
115 vn_list.insert(vm_intf->
vn()->
GetName());
145 if (vhost0 == NULL ||
150 LOG(ERROR,
"An error has occured during retrieving IPv6 ll"
151 " address from vhost0 in"
152 " MetadataProxy::InitializeHttp6Server");
187 Ip6Address(), ecmp_load_balance,
false,
false,
false,
204 if (vrf_entry && !vrf_entry->
IsDeleted()) {
209 if (fabric_inet6_table) {
235 const NextHop *active_nh = active_path ? active_path->
nexthop() : NULL;
238 if (interface_nh == NULL) {
242 const VmInterface *
interface = dynamic_cast<const VmInterface*>(
244 if (interface == NULL) {
254 this->NetlinkAddVhostNb(mip6, interface->vm_mac());
257 this->NetlinkAddInterfaceRoute(mip6);
311 GetInet6UnicastRouteTable()->
uint8_t prefix_length() const
!
const Interface * GetInterface() const
void AddLocalVmRouteReq(const Peer *peer, const string &vm_vrf, const IpAddress &addr, uint8_t plen, LocalVmRoute *data)
VrfEntry * fabric_vrf() const
const boost::uuids::uuid & GetUuid() const
DBTableBase * get_table() const
const Interface * vhost_interface() const
std::vector< int > SecurityGroupList
const std::string & vhost_interface_name() const
InterfaceTable * interface_table() const
static TypeBmap MplsType()
InetUnicastRouteEntry * FindRoute(const IpAddress &ip)
InetUnicastAgentRouteTable * GetInet6UnicastRouteTable() const
const string & GetName() const
const Peer * peer() const
std::unique_ptr< DBRequestKey > KeyPtr
ListenerId Register(ChangeCallback callback, const std::string &name="unspecified")
const std::string & fabric_vrf_name() const
const AgentPath * GetActivePath() const
NextHop * nexthop() const
const Peer * link_local_peer() const
static void Delete(const Peer *peer, const string &vrf_name, const IpAddress &addr, uint8_t plen)
KeyPtr GetDBRequestKey() const
boost::asio::ip::address_v6 Ip6Address
uint64_t sequence_number() const
const VnEntry * vn() const
std::vector< std::string > CommunityList
Ip6Address mdata_ip6_addr() const
std::set< std::string > VnListType
virtual const PrefixType & prefix_address() const
Returns the value of a stored prefix address (IPv4, IPv6 or MAC address)
VrfTable * vrf_table() const
const std::string & vrf_name() const
#define HTTP_WILDCARD_ENTRY
#define LOG(_Level, _Msg)
virtual bool Initialize(unsigned short port)
void Process(DBRequest &req)
const std::string & name() const
const string & GetName() const
uint16_t metadata_server_port() const
const std::string & fabric_vn_name() const
InetUnicastRouteEntry * GetUcRoute(const IpAddress &addr) const
void RegisterHandler(const std::string &path, HttpHandlerFn handler)
InetUnicastAgentRouteTable * GetInet6UnicastRouteTable(const std::string &vrf_name)
void insert(const Path *path)
const Peer * evpn_routing_peer() const
std::vector< int > TagList