aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/interface.h
AgeCommit message (Expand)AuthorFilesLines
2019-09-26misc: add vnet classify filter set supportDave Barach1-1/+5
2019-09-23misc: unify pcap rx / tx / drop traceDave Barach1-7/+9
2019-09-20misc: classifier-based packet trace filterDave Barach1-0/+1
2019-09-10misc: clean up "pcap [rx|tx] trace" debug CLIDave Barach1-0/+12
2019-08-27interface: Remove residual dpdk bonding codeSteven Luong1-1/+1
2019-07-31vppinfra: refactor test_and_set spinlocks to use clib_spinlock_tjaszha031-4/+4
2019-07-05sctp: move to plugins, disabled by defaultFlorin Coras1-0/+13
2019-06-28interface: fixes for buliding for 32bit targetsVijayabhaskar Katamreddy1-1/+1
2019-06-18ipsec: ipsec-tun protectNeale Ranns1-1/+11
2019-06-03ARP: add feature arcNeale Ranns1-1/+1
2019-05-31bonding: add support for numa awarenessZhiyong Yang1-0/+4
2019-04-11Stats: Spelling mistake: s/tx-unicast-miss/tx-unicast/Ole Troan1-1/+1
2019-03-13deprecate VLIB_DEVICE_TX_FUNCTION_MULTIARCHFilip Tehlar1-3/+0
2019-02-22Callback functions must have the correct signatureNeale Ranns1-2/+2
2019-02-19tap gso: experimental supportAndrew Yourtchenko1-0/+15
2019-02-02Deprecate old mutliarch code, phase 1Damjan Marion1-23/+5
2019-01-21VPP-1549 Add missing counter name.Paul Vinciguerra1-1/+2
2018-11-17pcap-based dispatch tracerDave Barach1-1/+2
2018-11-08vnet: remove unused fieldDamjan Marion1-2/+0
2018-11-08vnet: store hw interface speed in kbps instead of using flagsDamjan Marion1-27/+4
2018-10-29interface-flags; fix coverity error found in conversionNeale Ranns1-1/+2
2018-10-27Enumify interface flagsNeale Ranns1-30/+37
2018-10-19vppinfra: add atomic macros for __sync builtinsSirshak Das1-2/+2
2018-09-24Trivial: Clean up some typos.Paul Vinciguerra1-3/+3
2018-09-08L2 BVI/FIB: Update L2 FIB table when BVI's MAC changesNeale Ranns1-1/+2
2018-08-13Multiarch handling in different constructor macrosDamjan Marion1-0/+14
2018-08-11Multiversioning: Device (tx) function constructorMohsin Kazmi1-0/+21
2018-07-20IP directed broadcastNeale Ranns1-14/+22
2018-07-07PipesNeale Ranns1-0/+1
2018-06-15STATS: Add more hierarchy to counters.Ole Troan1-0/+20
2018-06-11MTU: Software interface / Per-protocol MTU supportOle Troan1-9/+18
2018-05-11Fix issue with xconnect not working on the main interfaceDamjan Marion1-9/+6
2018-05-10vnet: device flow offload infraDamjan Marion1-0/+20
2018-04-25Adjacency walk more scalableNeale Ranns1-0/+5
2018-04-13Revert "MTU: Setting of MTU on software interface (instead of hardware interf...Damjan Marion1-3/+8
2018-04-13MTU: Setting of MTU on software interface (instead of hardware interface)Ole Troan1-8/+3
2018-04-13bond: ping fails between l2 BD [VPP-1238]Steven1-0/+8
2018-04-09L2: no-flood interface type in the Bridge-DomainNeale Ranns1-1/+5
2018-04-09plugins: unload plugin if early init failsDamjan Marion1-0/+41
2018-04-04Detailed stats collection featureNeale Ranns1-15/+15
2018-03-19Use x(void) not x() in new interface stats codeNeale Ranns1-3/+3
2018-03-19Interface Unicast, Multicast and Broadcast stats on the APINeale Ranns1-1/+35
2018-03-09Coordinate known Ethernet speeds with Linux kernel and DPDKLee Roberts1-6/+16
2018-02-26vnet: add 25G interface speed flagDamjan Marion1-2/+4
2018-02-13vnet:remove duplicate interface function macroEyal Bari1-15/+3
2018-01-24Improve tunnel interface creation performanceJohn Lo1-0/+4
2017-08-01P2P EthernetPavel Kotucek1-0/+15
2017-07-18TCP/UDP checksum offload APIDave Barach1-0/+3
2017-07-13Fix crash with worker threads on 4K VXLAN/BD setup (VPP-907)John Lo1-6/+2
2017-07-12Deprecate support for flattened output nodesDamjan Marion1-3/+0
self.dst_prefix, self._proto, self._ports, self.sport_from, self.sport_to, self.dport_from, self.dport_to, ) return new_rule def update_ports(self): if self._ports == self.PORTS_ALL: self.sport_from = 0 self.dport_from = 0 self.sport_to = 65535 if self._proto == 1 or self._proto == 58: self.sport_to = 255 self.dport_to = self.sport_to elif self._ports == self.PORTS_RANGE: if self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_ICMP: self.sport_from = self.icmp4_type self.sport_to = self.icmp4_type self.dport_from = self.icmp4_code self.dport_to = self.icmp4_code elif self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_ICMP6: self.sport_from = self.icmp6_type self.sport_to = self.icmp6_type self.dport_from = self.icmp6_code self.dport_to = self.icmp6_code elif self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_TCP: self.sport_from = self.tcp_sport_from self.sport_to = self.tcp_sport_to self.dport_from = self.tcp_dport_from self.dport_to = self.tcp_dport_to elif self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP: self.sport_from = self.udp_sport_from self.sport_to = self.udp_sport_to self.dport_from = self.udp_dport_from self.dport_to = self.udp_dport_to elif self._ports == self.PORTS_RANGE_2: if self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_ICMP: self.sport_from = self.icmp4_type_2 self.sport_to = self.icmp4_type_2 self.dport_from = self.icmp4_code_from_2 self.dport_to = self.icmp4_code_to_2 elif self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_ICMP6: self.sport_from = self.icmp6_type_2 self.sport_to = self.icmp6_type_2 self.dport_from = self.icmp6_code_from_2 self.dport_to = self.icmp6_code_to_2 elif self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_TCP: self.sport_from = self.tcp_sport_from_2 self.sport_to = self.tcp_sport_to_2 self.dport_from = self.tcp_dport_from_2 self.dport_to = self.tcp_dport_to_2 elif self._proto == VppEnum.vl_api_ip_proto_t.IP_API_PROTO_UDP: self.sport_from = self.udp_sport_from_2 self.sport_to = self.udp_sport_to_2 self.dport_from = self.udp_dport_from_2 self.dport_to = self.udp_dport_to_2 else: self.sport_from = self._ports self.sport_to = self._ports self.dport_from = self._ports self.dport_to = self._ports @property def proto(self): return self._proto @proto.setter def proto(self, proto): self._proto = proto self.update_ports() @property def ports(self): return self._ports @ports.setter def ports(self, ports): self._ports = ports self.update_ports() def encode(self): return { "is_permit": self.is_permit, "proto": self.proto, "srcport_or_icmptype_first": self.sport_from, "srcport_or_icmptype_last": self.sport_to, "src_prefix": self.src_prefix, "dstport_or_icmpcode_first": self.dport_from, "dstport_or_icmpcode_last": self.dport_to, "dst_prefix": self.dst_prefix, } class VppAcl(VppObject): """VPP ACL""" def __init__(self, test, rules, acl_index=INVALID_INDEX, tag=None): self._test = test self._acl_index = acl_index self.tag = tag self._rules = rules @property def rules(self): return self._rules @property def acl_index(self): return self._acl_index @property def count(self): return len(self._rules) def encode_rules(self): rules = [] for rule in self._rules: rules.append(rule.encode()) return rules def add_vpp_config(self, expect_error=False): try: reply = self._test.vapi.acl_add_replace( acl_index=self._acl_index, tag=self.tag, count=self.count, r=self.encode_rules(), ) self._acl_index = reply.acl_index self._test.registry.register(self, self._test.logger) if expect_error: self._test.fail("Unexpected api reply") return self except UnexpectedApiReturnValueError: if not expect_error: self._test.fail("Unexpected api reply") return None def modify_vpp_config(self, rules): self._rules = rules self.add_vpp_config() def remove_vpp_config(self, expect_error=False): try: self._test.vapi.acl_del(acl_index=self._acl_index) if expect_error: self._test.fail("Unexpected api reply") except UnexpectedApiReturnValueError: if not expect_error: self._test.fail("Unexpected api reply") def dump(self): return self._test.vapi.acl_dump(acl_index=self._acl_index) def query_vpp_config(self): dump = self.dump() for rule in dump: if rule.acl_index == self._acl_index: return True return False def object_id(self): return "acl-%s-%d" % (self.tag, self._acl_index) class VppEtypeWhitelist(VppObject): """VPP Etype Whitelist""" def __init__(self, test, sw_if_index, whitelist, n_input=0): self._test = test self.whitelist = whitelist self.n_input = n_input self._sw_if_index = sw_if_index @property def sw_if_index(self): return self._sw_if_index @property def count(self): return len(self.whitelist) def add_vpp_config(self): self._test.vapi.acl_interface_set_etype_whitelist( sw_if_index=self._sw_if_index, count=self.count, n_input=self.n_input, whitelist=self.whitelist, ) self._test.registry.register(self, self._test.logger) return self def remove_vpp_config(self): self._test.vapi.acl_interface_set_etype_whitelist( sw_if_index=self._sw_if_index, count=0, n_input=0, whitelist=[] ) def query_vpp_config(self): self._test.vapi.acl_interface_etype_whitelist_dump( sw_if_index=self._sw_if_index ) return False def object_id(self): return "acl-etype_wl-%d" % (self._sw_if_index) class VppAclInterface(VppObject): """VPP ACL Interface""" def __init__(self, test, sw_if_index, acls, n_input=0): self._test = test self._sw_if_index = sw_if_index self.n_input = n_input self.acls = acls @property def sw_if_index(self): return self._sw_if_index @property def count(self): return len(self.acls) def encode_acls(self): acls = [] for acl in self.acls: acls.append(acl.acl_index) return acls def add_vpp_config(self, expect_error=False): try: reply = self._test.vapi.acl_interface_set_acl_list( sw_if_index=self._sw_if_index, n_input=self.n_input, count=self.count, acls=self.encode_acls(), ) self._test.registry.register(self, self._test.logger) if expect_error: self._test.fail("Unexpected api reply") return self except UnexpectedApiReturnValueError: if not expect_error: self._test.fail("Unexpected api reply") return None def remove_vpp_config(self, expect_error=False): try: reply = self._test.vapi.acl_interface_set_acl_list( sw_if_index=self._sw_if_index, n_input=0, count=0, acls=[] ) if expect_error: self._test.fail("Unexpected api reply") except UnexpectedApiReturnValueError: if not expect_error: self._test.fail("Unexpected api reply") def query_vpp_config(self): dump = self._test.vapi.acl_interface_list_dump(sw_if_index=self._sw_if_index) for acl_list in dump: if acl_list.count > 0: return True return False def object_id(self): return "acl-if-list-%d" % (self._sw_if_index) class MacipRule: """Mac Ip rule""" def __init__( self, is_permit, src_mac=0, src_mac_mask=0, src_prefix=IPv4Network("0.0.0.0/0") ): self.is_permit = is_permit self.src_mac = src_mac self.src_mac_mask = src_mac_mask self.src_prefix = src_prefix def encode(self): return { "is_permit": self.is_permit, "src_mac": self.src_mac, "src_mac_mask": self.src_mac_mask, "src_prefix": self.src_prefix, } class VppMacipAcl(VppObject): """Vpp Mac Ip ACL""" def __init__(self, test, rules, acl_index=INVALID_INDEX, tag=None): self._test = test self._acl_index = acl_index self.tag = tag self._rules = rules @property def acl_index(self): return self._acl_index @property def rules(self): return self._rules @property def count(self): return len(self._rules) def encode_rules(self): rules = [] for rule in self._rules: rules.append(rule.encode()) return rules def add_vpp_config(self, expect_error=False): try: reply = self._test.vapi.macip_acl_add_replace( acl_index=self._acl_index, tag=self.tag, count=self.count, r=self.encode_rules(), ) self._acl_index = reply.acl_index self._test.registry.register(self, self._test.logger) if expect_error: self._test.fail("Unexpected api reply") return self except UnexpectedApiReturnValueError: if not expect_error: self._test.fail("Unexpected api reply") return None def modify_vpp_config(self, rules): self._rules = rules self.add_vpp_config() def remove_vpp_config(self, expect_error=False): try: self._test.vapi.macip_acl_del(acl_index=self._acl_index) if expect_error: self._test.fail("Unexpected api reply") except UnexpectedApiReturnValueError: if not expect_error: self._test.fail("Unexpected api reply") def dump(self): return self._test.vapi.macip_acl_dump(acl_index=self._acl_index) def query_vpp_config(self): dump = self.dump() for rule in dump: if rule.acl_index == self._acl_index: return True return False def object_id(self): return "macip-acl-%s-%d" % (self.tag, self._acl_index) class VppMacipAclInterface(VppObject): """VPP Mac Ip ACL Interface""" def __init__(self, test, sw_if_index, acls): self._test = test self._sw_if_index = sw_if_index self.acls = acls @property def sw_if_index(self): return self._sw_if_index @property def count(self): return len(self.acls) def add_vpp_config(self): for acl in self.acls: self._test.vapi.macip_acl_interface_add_del( is_add=True, sw_if_index=self._sw_if_index, acl_index=acl.acl_index ) self._test.registry.register(self, self._test.logger) def remove_vpp_config(self): for acl in self.acls: self._test.vapi.macip_acl_interface_add_del( is_add=False, sw_if_index=self._sw_if_index, acl_index=acl.acl_index ) def dump(self): return self._test.vapi.macip_acl_interface_list_dump( sw_if_index=self._sw_if_index ) def query_vpp_config(self): dump = self.dump() for acl_list in dump: for acl_index in acl_list.acls: if acl_index != INVALID_INDEX: return True return False def object_id(self): return "macip-acl-if-list-%d" % (self._sw_if_index)