summaryrefslogtreecommitdiffstats
path: root/src/tools
AgeCommit message (Expand)AuthorFilesLines
2018-12-19session: add cli option to dump session elogFlorin Coras2-2/+3
2018-12-13API: Use string type instead of u8.Ole Troan2-10/+17
2018-12-03API: C generator improve symbol protection.Ole Troan1-2/+2
2018-11-29vppapigen: Fix python3 compatibilityOle Troan1-24/+40
2018-11-29API: Add support for type aliasesOle Troan3-3/+40
2018-10-23c11 safe string handling supportDave Barach3-6/+6
2018-09-26perftool: fix c2cpelFlorin Coras1-0/+2
2018-09-13Fix: vppapigen make build fails on fresh installPaul Vinciguerra4-3/+3
2018-09-07cmake: set packaging component for different filesDamjan Marion1-1/+2
2018-08-30cmake: fix vppapigen install permissonsDamjan Marion1-1/+9
2018-08-28cmake: Add perftool to cmake buildMohsin Kazmi1-0/+35
2018-08-28cmake: add g2 and elftool toolsDamjan Marion2-0/+53
2018-08-28cmake: install vppapigenDamjan Marion1-0/+15
2018-06-29VPPAPIGEN: use SOURCE_DATE_EPOCH for datestringNirmoy Das1-1/+2
2018-06-29CSIT-1148: VPPAPIGEN 2nd level import of .api ignoredOle Troan1-4/+5
2018-05-23VPPAPIGEN: Add union and enum support and IP4/IP6 address type.Ole Troan3-85/+123
2018-04-17ACL based forwardingAndrew Yourtchenko1-1/+1
2018-04-11VPPAPIGEN: Consistent CRC32 on complete file.Ole Troan1-17/+25
2018-03-08vppapigen: require reply/details messages for requests/dumpsMarek Gradzki1-6/+6
2018-03-07VPPAPIGEN: Run tool directly from source tree.Ole Troan1-1/+4
2018-03-06vppapigen: require service definition for singleton messagesMarek Gradzki1-7/+2
2018-03-06vppapigen: do not allow to define message as both request and replyMarek Gradzki1-0/+4
2018-03-06vppapigen: require reply ID different than caller IDMarek Gradzki1-0/+4
2018-03-06API: Add service definitions for events and singleton messages (second attempt)Marek Gradzki1-17/+30
2018-03-05Revert "API: Add service definitions for events and singleton messages."Ole Trøan1-30/+17
2018-03-05API: Add service definitions for events and singleton messages.Ole Troan1-17/+30
2018-03-03VPPAPIGEN: Improve output module finding for out-of-tree builds.Ole Troan1-2/+12
2018-02-09vppapigen: simplify JSON format for servicesMarek Gradzki1-2/+2
2018-01-23VPPAPIGEN: vppapigen replacement in Python PLY.Ole Troan10-2980/+1171
2017-12-14Fix display of single-event event-logsDave Barach2-1/+8
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach4-4/+79
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine1-1/+1
2017-05-10Allow to override the build dateBernhard M. Wiedemann1-1/+6
2017-05-09Fix remaining 32-bit compile issuesDamjan Marion2-5/+5
2017-04-25"autoreply" flag: autogenerate standard xxx_reply_t messagesDave Barach5-3/+65
2017-04-04Clear pid-vector, to avoid spurious track selectionDave Barach2-4/+4
2017-04-03g2: add multi-track time-slew controlsDave Barach3-15/+357
2017-04-01Clean up event log merge codeDave Barach1-2/+5
2017-03-25g2, c2cpel, and cpeldump: scale to 8M event log filesDave Barach3-0/+9
2017-03-02VPP-608: fix coverity warning in vppapigenDave Barach1-2/+2
2017-02-28Fix warning in generated codeDave Barach1-4/+14
2017-01-01Move java,lua api and remaining plugins to src/Damjan Marion3-38/+0
2016-12-28Reorganize source tree to use single autotools instanceDamjan Marion36-0/+14621
ass="n">append({'next_hop': p.nh_addr, 'weight': 1, 'afi': p.proto, 'sw_if_index': 0xffffffff, 'preference': 0, 'table_id': p.nh_table_id, 'next_hop_id': p.next_hop_id, 'is_udp_encap': p.is_udp_encap, 'n_labels': n_labels, 'label_stack': lstack}) return br_paths def add_vpp_config(self): self._test.vapi.abf_policy_add_del( 1, {'policy_id': self.policy_id, 'acl_index': self.acl.acl_index, 'n_paths': len(self.paths), 'paths': self.encode_paths()}) self._test.registry.register(self, self._test.logger) def remove_vpp_config(self): self._test.vapi.abf_policy_add_del( 0, {'policy_id': self.policy_id, 'acl_index': self.acl.acl_index, 'n_paths': len(self.paths), 'paths': self.encode_paths()}) def query_vpp_config(self): return find_abf_policy(self._test, self.policy_id) def __str__(self): return self.object_id() def object_id(self): return ("abf-policy-%d" % self.policy_id) class VppAbfAttach(VppObject): def __init__(self, test, policy_id, sw_if_index, priority, is_ipv6=0): self._test = test self.policy_id = policy_id self.sw_if_index = sw_if_index self.priority = priority self.is_ipv6 = is_ipv6 def add_vpp_config(self): self._test.vapi.abf_itf_attach_add_del( 1, {'policy_id': self.policy_id, 'sw_if_index': self.sw_if_index, 'priority': self.priority, 'is_ipv6': self.is_ipv6}) self._test.registry.register(self, self._test.logger) def remove_vpp_config(self): self._test.vapi.abf_itf_attach_add_del( 0, {'policy_id': self.policy_id, 'sw_if_index': self.sw_if_index, 'priority': self.priority, 'is_ipv6': self.is_ipv6}) def query_vpp_config(self): return find_abf_itf_attach(self._test, self.policy_id, self.sw_if_index) def __str__(self): return self.object_id() def object_id(self): return ("abf-attach-%d-%d" % (self.policy_id, self.sw_if_index)) class TestAbf(VppTestCase): """ ABF Test Case """ def setUp(self): super(TestAbf, self).setUp() self.create_pg_interfaces(range(4)) for i in self.pg_interfaces: i.admin_up() i.config_ip4() i.resolve_arp() i.config_ip6() i.resolve_ndp() def tearDown(self): for i in self.pg_interfaces: i.unconfig_ip4() i.unconfig_ip6() i.ip6_disable() i.admin_down() super(TestAbf, self).tearDown() def test_abf4(self): """ IPv4 ACL Based Forwarding """ # # We are not testing the various matching capabilities # of ACLs, that's done elsewhere. Here ware are testing # the application of ACLs to a forwarding path to achieve # ABF # So we construct just a few ACLs to ensure the ABF policies # are correclty constructed and used. And a few path types # to test the API path decoding. # # # Rule 1 # rule_1 = ({'is_permit': 1, 'is_ipv6': 0, 'proto': 17, 'srcport_or_icmptype_first': 1234, 'srcport_or_icmptype_last': 1234, 'src_ip_prefix_len': 32, 'src_ip_addr': inet_pton(AF_INET, "1.1.1.1"), 'dstport_or_icmpcode_first': 1234, 'dstport_or_icmpcode_last': 1234, 'dst_ip_prefix_len': 32, 'dst_ip_addr': inet_pton(AF_INET, "1.1.1.2")}) acl_1 = self.vapi.acl_add_replace(acl_index=4294967295, r=[rule_1]) # # ABF policy for ACL 1 - path via interface 1 # abf_1 = VppAbfPolicy(self, 10, acl_1, [VppRoutePath(self.pg1.remote_ip4, self.pg1.sw_if_index)]) abf_1.add_vpp_config() # # Attach the policy to input interface Pg0 # attach_1 = VppAbfAttach(self, 10, self.pg0.sw_if_index, 50) attach_1.add_vpp_config() # # fire in packet matching the ACL src,dst. If it's forwarded # then the ABF was successful, since default routing will drop it # p_1 = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IP(src="1.1.1.1", dst="1.1.1.2") / UDP(sport=1234, dport=1234) / Raw('\xa5' * 100)) self.send_and_expect(self.pg0, p_1*65, self.pg1) # # Attach a 'better' priority policy to the same interface # abf_2 = VppAbfPolicy(self, 11, acl_1, [VppRoutePath(self.pg2.remote_ip4, self.pg2.sw_if_index)]) abf_2.add_vpp_config() attach_2 = VppAbfAttach(self, 11, self.pg0.sw_if_index, 40) attach_2.add_vpp_config() self.send_and_expect(self.pg0, p_1*65, self.pg2) # # Attach a policy with priority in the middle # abf_3 = VppAbfPolicy(self, 12, acl_1, [VppRoutePath(self.pg3.remote_ip4, self.pg3.sw_if_index)]) abf_3.add_vpp_config() attach_3 = VppAbfAttach(self, 12, self.pg0.sw_if_index, 45) attach_3.add_vpp_config() self.send_and_expect(self.pg0, p_1*65, self.pg2) # # remove the best priority # attach_2.remove_vpp_config() self.send_and_expect(self.pg0, p_1*65, self.pg3) # # Attach one of the same policies to Pg1 # attach_4 = VppAbfAttach(self, 12, self.pg1.sw_if_index, 45) attach_4.add_vpp_config() p_2 = (Ether(src=self.pg1.remote_mac, dst=self.pg1.local_mac) / IP(src="1.1.1.1", dst="1.1.1.2") / UDP(sport=1234, dport=1234) / Raw('\xa5' * 100)) self.send_and_expect(self.pg1, p_2 * 65, self.pg3) # # detach the policy from PG1, now expect traffic to be dropped # attach_4.remove_vpp_config() self.send_and_assert_no_replies(self.pg1, p_2 * 65, "Detached") def test_abf6(self): """ IPv6 ACL Based Forwarding """ # # Simple test for matching IPv6 packets # # # Rule 1 # rule_1 = ({'is_permit': 1, 'is_ipv6': 1, 'proto': 17, 'srcport_or_icmptype_first': 1234, 'srcport_or_icmptype_last': 1234, 'src_ip_prefix_len': 128, 'src_ip_addr': inet_pton(AF_INET6, "2001::2"), 'dstport_or_icmpcode_first': 1234, 'dstport_or_icmpcode_last': 1234, 'dst_ip_prefix_len': 128, 'dst_ip_addr': inet_pton(AF_INET6, "2001::1")}) acl_1 = self.vapi.acl_add_replace(acl_index=4294967295, r=[rule_1]) # # ABF policy for ACL 1 - path via interface 1 # abf_1 = VppAbfPolicy(self, 10, acl_1, [VppRoutePath("3001::1", 0xffffffff, proto=DpoProto.DPO_PROTO_IP6)]) abf_1.add_vpp_config() attach_1 = VppAbfAttach(self, 10, self.pg0.sw_if_index, 45, is_ipv6=True) attach_1.add_vpp_config() # # a packet matching the rule # p = (Ether(src=self.pg0.remote_mac, dst=self.pg0.local_mac) / IPv6(src="2001::2", dst="2001::1") / UDP(sport=1234, dport=1234) / Raw('\xa5' * 100)) # # packets are dropped because there is no route to the policy's # next hop # self.send_and_assert_no_replies(self.pg1, p * 65, "no route") # # add a route resolving the next-hop # route = VppIpRoute(self, "3001::1", 32, [VppRoutePath(self.pg1.remote_ip6, self.pg1.sw_if_index, proto=DpoProto.DPO_PROTO_IP6)], is_ip6=1) route.add_vpp_config() # # now expect packets forwarded. # self.send_and_expect(self.pg0, p * 65, self.pg1) if __name__ == '__main__': unittest.main(testRunner=VppTestRunner)