summaryrefslogtreecommitdiffstats
path: root/src/vnet/dpo
AgeCommit message (Expand)AuthorFilesLines
2018-07-19Remove unused argument to vlib_feature_nextDamjan Marion1-6/+3
2018-07-11avoid using thread local storage for thread indexDamjan Marion1-1/+1
2018-06-26node functions cannot be always_inlineDamjan Marion1-10/+10
2018-05-26Fix interface-rx-dpo-l2 node to setup l2_len in vnet bufferJohn Lo1-4/+16
2018-05-04Harmonize vec/pool_get_aligned object sizes and alignment requestsDave Barach9-0/+53
2018-04-24memory leakKingwel Xie1-0/+3
2018-04-12Fixes for 'make UNATTENDED=yes CC=clang CXX=clang verify'Neale Ranns1-10/+1
2018-04-09DVR: save the rewrite length in packet meta-data for featuresNeale Ranns1-3/+9
2018-03-20FIB Interpose SourceNeale Ranns5-26/+114
2018-03-19Coverity found bugs in recent MPLS changesNeale Ranns2-2/+2
2018-03-19FIX: Fixed ip6_fib_dump api function response.Dmitry Vakhrushev2-0/+8
2018-03-15Add a helper function to fetch vlib node index for already stacked dposVijayabhaskar Katamreddy2-0/+40
2018-03-09MPLS Unifom modeNeale Ranns5-329/+1150
2018-03-05IP6 link-local tableNeale Ranns4-0/+245
2018-02-07Refactor vlib_buffer flagsDamjan Marion1-6/+6
2018-02-06BIER: fix support for longer bit-string lengthsNeale Ranns1-1/+2
2018-01-09DVR: run L3 output featuresNeale Ranns6-436/+661
2017-12-20L2 EmulationNeale Ranns1-1/+1
2017-12-09BIER in non-MPLS netowrksNeale Ranns2-0/+11
2017-12-06Label stack size exceeded fixNeale Ranns2-1/+19
2017-11-14NULL-terminate load_balance_nsh_nodes[]Gabriel Ganne1-0/+1
2017-11-09BIERNeale Ranns5-12/+86
2017-11-03NAT64: Input feature arc on virtual interface via interface RX DPO.Ole Troan2-2/+2
2017-10-31Refactor IP input checks for re-use at MPLS dispositionNeale Ranns1-20/+54
2017-10-25L3 proxy FIB source for container networkingAndrew Yourtchenko4-3/+270
2017-10-14change format_get_indent() to use u32 instead of uwordGabriel Ganne1-1/+1
2017-10-14Source Lookup progammable via APINeale Ranns1-2/+2
2017-10-05Distributed Virtual Router SupportNeale Ranns4-1/+436
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine5-8/+8
2017-09-11FIB table add/delete APINeale Ranns2-8/+24
2017-08-21PPPoE usses a midchain adjacency stack on an interface-tx DPONeale Ranns7-506/+670
2017-08-08L2 over MPLSNeale Ranns4-9/+96
2017-06-30VPP debug image with worker threads hit assert on adding IP route with traffi...Neale Ranns1-1/+16
2017-05-26MPLS lookup DPO does not pop the label (nor does it handle replicate)Neale Ranns1-6/+41
2017-05-25MPLS hash function improvementsNeale Ranns1-1/+1
2017-05-24Missing VLIB node for IPv6 disposition from mcast MPLS LSPNeale Ranns1-1/+23
2017-05-23Labelled attached paths via an MPLS tunnelNeale Ranns1-0/+3
2017-05-10completelly deprecate os_get_cpu_number, replace new occurencesDamjan Marion1-4/+4
2017-05-05First commit SR MPLSPablo Camarillo1-1/+1
2017-04-24Improve Load-Balance MAPsNeale Ranns2-1/+33
2017-04-18Memory leak in load-balance mapsNeale Ranns1-3/+10
2017-04-07MPLS McastNeale Ranns11-24/+1213
2017-04-06Use thread local storage for thread indexDamjan Marion2-16/+16
2017-04-01MTRIE Optimisations 2Neale Ranns2-5/+5
2017-03-29Mtrie optimisationsNeale Ranns2-12/+11
2017-03-17MPLS performance improvments.Neale Ranns2-31/+119
2017-02-28vlib: add buffer cloning supportDamjan Marion2-44/+35
2017-02-24VPP-650: handle buffer failure in vlib_buffer_copy(...)Dave Barach1-1/+31
2017-02-21dhcp: multiple additionsNeale Ranns1-0/+5
2017-02-16Add NSH load-balance and drop DPOFlorin Coras2-2/+104
self, ip): """ :param ip: IPv4 address to find host by. :return: Host object assigned to interface. """ return self._hosts_by_ip4[ip] def host_by_ip6(self, ip): """ :param ip: IPv6 address to find host by. :return: Host object assigned to interface. """ return self._hosts_by_ip6[ip] def generate_remote_hosts(self, count=1): """Generate and add remote hosts for the interface. :param int count: Number of generated remote hosts. """ self._remote_hosts = [] self._hosts_by_mac = {} self._hosts_by_ip4 = {} self._hosts_by_ip6 = {} for i in range( 2, count + 2): # 0: network address, 1: local vpp address mac = "02:%02x:00:00:ff:%02x" % (self.sw_if_index, i) ip4 = "172.16.%u.%u" % (self.sw_if_index, i) ip6 = "fd01:%x::%x" % (self.sw_if_index, i) host = Host(mac, ip4, ip6) self._remote_hosts.append(host) self._hosts_by_mac[mac] = host self._hosts_by_ip4[ip4] = host self._hosts_by_ip6[ip6] = host @abstractmethod def __init__(self, test): self._test = test self._remote_hosts = [] self._hosts_by_mac = {} self._hosts_by_ip4 = {} self._hosts_by_ip6 = {} self.generate_remote_hosts() self._local_ip4 = "172.16.%u.1" % self.sw_if_index self._local_ip4n = socket.inet_pton(socket.AF_INET, self.local_ip4) self.local_ip4_prefix_len = 24 self.has_ip4_config = False self.ip4_table_id = 0 self._local_ip6 = "fd01:%x::1" % self.sw_if_index self._local_ip6n = socket.inet_pton(socket.AF_INET6, self.local_ip6) self.local_ip6_prefix_len = 64 self.has_ip6_config = False self.ip6_table_id = 0 r = self.test.vapi.sw_interface_dump() for intf in r: if intf.sw_if_index == self.sw_if_index: self._name = intf.interface_name.split(b'\0', 1)[0] self._local_mac = \ ':'.join(intf.l2_address.encode('hex')[i:i + 2] for i in range(0, 12, 2)) self._dump = intf break else: raise Exception( "Could not find interface with sw_if_index %d " "in interface dump %s" % (self.sw_if_index, repr(r))) def config_ip4(self): """Configure IPv4 address on the VPP interface.""" self.test.vapi.sw_interface_add_del_address( self.sw_if_index, self.local_ip4n, self.local_ip4_prefix_len) self.has_ip4_config = True def unconfig_ip4(self): """Remove IPv4 address on the VPP interface.""" try: if self.has_ip4_config: self.test.vapi.sw_interface_add_del_address( self.sw_if_index, self.local_ip4n, self.local_ip4_prefix_len, is_add=0) except AttributeError: self.has_ip4_config = False self.has_ip4_config = False def configure_ipv4_neighbors(self): """For every remote host assign neighbor's MAC to IPv4 addresses. :param vrf_id: The FIB table / VRF ID. (Default value = 0) """ for host in self._remote_hosts: macn = host.mac.replace(":", "").decode('hex') ipn = host.ip4n self.test.vapi.ip_neighbor_add_del( self.sw_if_index, macn, ipn) def config_ip6(self): """Configure IPv6 address on the VPP interface.""" self.test.vapi.sw_interface_add_del_address( self.sw_if_index, self._local_ip6n, self.local_ip6_prefix_len, is_ipv6=1) self.has_ip6_config = True def unconfig_ip6(self): """Remove IPv6 address on the VPP interface.""" try: if self.has_ip6_config: self.test.vapi.sw_interface_add_del_address( self.sw_if_index, self.local_ip6n, self.local_ip6_prefix_len, is_ipv6=1, is_add=0) except AttributeError: self.has_ip6_config = False self.has_ip6_config = False def configure_ipv6_neighbors(self): """For every remote host assign neighbor's MAC to IPv6 addresses. :param vrf_id: The FIB table / VRF ID. (Default value = 0) """ for host in self._remote_hosts: macn = host.mac.replace(":", "").decode('hex') ipn = host.ip6n self.test.vapi.ip_neighbor_add_del( self.sw_if_index, macn, ipn, is_ipv6=1) def unconfig(self): """Unconfigure IPv6 and IPv4 address on the VPP interface.""" self.unconfig_ip4() self.unconfig_ip6() def set_table_ip4(self, table_id): """Set the interface in a IPv4 Table. .. note:: Must be called before configuring IP4 addresses. """ self.ip4_table_id = table_id self.test.vapi.sw_interface_set_table( self.sw_if_index, 0, self.ip4_table_id) def set_table_ip6(self, table_id): """Set the interface in a IPv6 Table. .. note:: Must be called before configuring IP6 addresses. """ self.ip6_table_id = table_id self.test.vapi.sw_interface_set_table( self.sw_if_index, 1, self.ip6_table_id) def disable_ipv6_ra(self): """Configure IPv6 RA suppress on the VPP interface.""" self.test.vapi.sw_interface_ra_suppress(self.sw_if_index) def ip6_ra_config(self, no=0, suppress=0, send_unicast=0): """Configure IPv6 RA suppress on the VPP interface.""" self.test.vapi.ip6_sw_interface_ra_config(self.sw_if_index, no, suppress, send_unicast) def ip6_ra_prefix(self, address, address_length, is_no=0, off_link=0, no_autoconfig=0, use_default=0): """Configure IPv6 RA suppress on the VPP interface.""" self.test.vapi.ip6_sw_interface_ra_prefix(self.sw_if_index, address, address_length, is_no=is_no, off_link=off_link, no_autoconfig=no_autoconfig, use_default=use_default) def admin_up(self): """Put interface ADMIN-UP.""" self.test.vapi.sw_interface_set_flags(self.sw_if_index, admin_up_down=1) def admin_down(self): """Put interface ADMIN-down.""" self.test.vapi.sw_interface_set_flags(self.sw_if_index, admin_up_down=0) def ip6_enable(self): """IPv6 Enable interface""" self.test.vapi.ip6_sw_interface_enable_disable(self.sw_if_index, enable=1) def ip6_disable(self): """Put interface ADMIN-DOWN.""" self.test.vapi.ip6_sw_interface_enable_disable(self.sw_if_index, enable=0) def add_sub_if(self, sub_if): """Register a sub-interface with this interface. :param sub_if: sub-interface """ if not hasattr(self, 'sub_if'): self.sub_if = sub_if else: if isinstance(self.sub_if, list): self.sub_if.append(sub_if) else: self.sub_if = sub_if def enable_mpls(self): """Enable MPLS on the VPP interface.""" self.test.vapi.sw_interface_enable_disable_mpls( self.sw_if_index) def disable_mpls(self): """Enable MPLS on the VPP interface.""" self.test.vapi.sw_interface_enable_disable_mpls( self.sw_if_index, 0) def is_ip4_entry_in_fib_dump(self, dump): for i in dump: if i.address == self.local_ip4n and \ i.address_length == self.local_ip4_prefix_len and \ i.table_id == self.ip4_table_id: return True return False def set_unnumbered(self, ip_sw_if_index): """ Set the interface to unnumbered via ip_sw_if_index """ self.test.vapi.sw_interface_set_unnumbered( self.sw_if_index, ip_sw_if_index) def unset_unnumbered(self, ip_sw_if_index): """ Unset the interface to unnumbered via ip_sw_if_index """ self.test.vapi.sw_interface_set_unnumbered( self.sw_if_index, ip_sw_if_index, is_add=0) def set_proxy_arp(self, enable=1): """ Set the interface to enable/disable Proxy ARP """ self.test.vapi.proxy_arp_intfc_enable_disable( self.sw_if_index, enable)