summaryrefslogtreecommitdiffstats
path: root/src/vnet/mpls
AgeCommit message (Expand)AuthorFilesLines
2018-01-18FIB Inherited SrouceNeale Ranns1-2/+2
2018-01-11api: remove transport specific code from handlersFlorin Coras1-12/+12
2018-01-09api: refactor vlibmemoryFlorin Coras1-4/+4
2017-12-20Fix MPLS local-label CLI help stringMarek Gradzki1-1/+1
2017-12-09BIER in non-MPLS netowrksNeale Ranns1-14/+0
2017-12-08Remove the unused 'create VRF if needed' API parametersNeale Ranns1-4/+0
2017-11-26FIB: store the node type not the function pointer.Neale Ranns1-2/+0
2017-11-22CLI for interface MPLS enable returns errors to callerNeale Ranns1-1/+5
2017-11-22Fix MPLS local-label CLINeale Ranns1-2/+2
2017-11-18unformat function for FIB pathsNeale Ranns2-205/+14
2017-11-10Break up vpe.apiNeale Ranns2-0/+32
2017-11-09BIERNeale Ranns2-2/+3
2017-11-07UDP Encapsulation.Neale Ranns1-1/+3
2017-10-15Revert "Enforce FIB table creation before use"Florin Coras1-0/+5
2017-10-14Source Lookup progammable via APINeale Ranns1-2/+13
2017-10-13Enforce FIB table creation before useNeale Ranns1-5/+0
2017-10-09vppapigen: support per-file (major,minor,patch) version stampsDave Barach1-0/+2
2017-10-05Distributed Virtual Router SupportNeale Ranns1-7/+1
2017-10-04[aarch64] Fixes CLI crashes on dpaa2 platform.Christophe Fontaine1-2/+2
2017-09-19Fix MPLS table create CLINeale Ranns1-7/+2
2017-09-18Fixes for issues Coverity has reported (VPP-972)Chris Luke1-1/+1
2017-09-13Add a name to the creation of an IP and MPLS tableNeale Ranns4-28/+46
2017-09-11replace uint32_t with u32Neale Ranns1-2/+2
2017-09-11FIB table add/delete APINeale Ranns4-30/+154
2017-09-06Fixes for issues raised by Coverity (VPP-972)Chris Luke1-3/+0
2017-08-14FIB table add/delete API onlyNeale Ranns2-0/+31
2017-08-10MPLS tunnel - multiple labels on the CLI - fix cut and paste robot errorsNeale Ranns1-13/+4
2017-08-09Allow multiple MPLS output labels to be passed on the CLINeale Ranns2-13/+43
2017-08-08L2 over MPLSNeale Ranns5-80/+94
2017-08-01FIB path weight incorrect in dump (VPP-922)Neale Ranns2-3/+6
2017-07-18FIB path preferenceNeale Ranns2-0/+4
2017-06-10MPLS: cannot delete a path from the CLINeale Ranns1-13/+25
2017-06-01MPLS trace the EOS bit correctlyNeale Ranns1-1/+2
2017-05-26MPLS lookup DPO does not pop the label (nor does it handle replicate)Neale Ranns2-77/+104
2017-05-25MPLS hash function improvementsNeale Ranns2-6/+63
2017-05-25MPLS interface output feature not explicitly enabledNeale Ranns1-2/+0
2017-05-24MPLS tunnels; path-list lock leak and debug CLI imrpovementsNeale Ranns1-7/+16
2017-05-24MPLS trace fixesNeale Ranns2-1/+7
2017-05-23Labelled attached paths via an MPLS tunnelNeale Ranns1-1/+3
2017-05-23ARP/ND entries for the same address on different interfaces (VPP-848)Neale Ranns2-99/+20
2017-04-26IP Flow Hash Config fixesNeale Ranns1-3/+15
2017-04-25"autoreply" flag: autogenerate standard xxx_reply_t messagesDave Barach1-23/+3
2017-04-24Improve Load-Balance MAPsNeale Ranns1-40/+78
2017-04-11MPLS Mcast coverity fixesNeale Ranns1-1/+1
2017-04-11Remove usued, redundant and deprecated code from lookup.hNeale Ranns1-2/+2
2017-04-07MPLS McastNeale Ranns8-458/+941
2017-04-06Use thread local storage for thread indexDamjan Marion3-19/+19
2017-04-03Adjacency layout change and move to vnet/adjNeale Ranns1-1/+1
2017-04-01MTRIE Optimisations 2Neale Ranns3-33/+32
2017-03-29Mtrie optimisationsNeale Ranns1-8/+0
pan>, data=None): """Send BGP peer configuration data and check the response. :param node: Honeycomb node. :param path: Additional path to append to the base BGP config path. :param data: Configuration data to be sent in PUT request. :type node: dict :type path: str :type data: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the status code in response to PUT is not 200 = OK or 201 = ACCEPTED. """ if data is None: status_code, resp = HcUtil. \ delete_honeycomb_data(node, "config_bgp_peer", path) else: status_code, resp = HcUtil.\ put_honeycomb_data(node, "config_bgp_peer", data, path) if status_code not in (HTTPCodes.OK, HTTPCodes.ACCEPTED): raise HoneycombError( "The configuration of BGP peer was not successful. " "Status code: {0}.".format(status_code)) return resp @staticmethod def _configure_bgp_route(node, path, data=None): """Send BGP route configuration data and check the response. :param node: Honeycomb node. :param path: Additional path to append to the base BGP config path. :param data: Configuration data to be sent in PUT request. :type node: dict :type path: str :type data: dict :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the status code in response to PUT is not 200 = OK or 201 = ACCEPTED. """ if data is None: status_code, resp = HcUtil. \ delete_honeycomb_data(node, "config_bgp_route", path) else: status_code, resp = HcUtil. \ put_honeycomb_data(node, "config_bgp_route", data, path) if status_code not in (HTTPCodes.OK, HTTPCodes.ACCEPTED): raise HoneycombError( "The configuration of BGP route was not successful. " "Status code: {0}.".format(status_code)) return resp @staticmethod def get_full_bgp_configuration(node): """Get BGP configuration from the node. :param node: Honeycomb node. :type node: dict :returns: BGP configuration data. :rtype: dict :raises HoneycombError: If the status code in response is not 200 = OK. """ status_code, resp = HcUtil. \ get_honeycomb_data(node, "config_bgp_peer") if status_code != HTTPCodes.OK: raise HoneycombError( "Not possible to get configuration information about BGP." " Status code: {0}.".format(status_code)) return resp @staticmethod def get_bgp_peer(node, address, datastore='config'): """Get BGP configuration of the specified peer from the node. :param node: Honeycomb node. :param address: IP address of the peer. :param datastore: Get data from config or operational datastore. :type node: dict :type address: str :type datastore; str :returns: BGP peer configuration data. :rtype: dict :raises HoneycombError: If the status code in response is not 200 = OK. """ path = "bgp-openconfig-extensions:neighbors/" \ "neighbor/{0}".format(address) if datastore != "operational": url = "config_bgp_peer" else: url = "oper_bgp" path = "peer/bgp:%2F%2F{0}".format(address) status_code, resp = HcUtil. \ get_honeycomb_data(node, url, path) if status_code != HTTPCodes.OK: raise HoneycombError( "Not possible to get configuration information about the BGP" " peer. Status code: {0}.".format(status_code)) return resp @staticmethod def add_bgp_peer(node, address, data): """Configure a BGP peer on the node. :param node: Honeycomb node. :param address: IP address of the peer. :param data: Peer configuration data. :type node: dict :type address: str :type data: dict :returns: Content of response. :rtype: bytearray """ path = "bgp-openconfig-extensions:neighbors/neighbor/{address}".format( address=address) return BGPKeywords._configure_bgp_peer(node, path, data) @staticmethod def remove_bgp_peer(node, address): """Remove a BGP peer from the configuration. :param node: Honeycomb node. :param address: IP address of the peer. :type node: dict :type address: str :returns: Content of response. :rtype: bytearray """ path = "bgp-openconfig-extensions:neighbors/neighbor/{address}".format( address=address) return BGPKeywords._configure_bgp_peer(node, path) @staticmethod def configure_bgp_route(node, peer_address, data, route_address, index, ip_version): """Configure a route for the BGP peer specified by peer IP address. :param node: Honeycomb node. :param peer_address: IP address of the BGP peer. :param data: Route configuration data. :param route_address: IP address of the route. :param index: Index number of the route within specified peer. :param ip_version: IP protocol version. ipv4 or ipv6 :type node: dict :type peer_address: str :type data: dict :type route_address: str :type index: int :type ip_version: str :returns: Content of response. :rtype: bytearray """ route_address = route_address.replace("/", "%2F") if ip_version.lower() == "ipv4": path = "{0}/tables/bgp-types:ipv4-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv4-routes/ipv4-route/{1}/{2}" \ .format(peer_address, route_address, index) else: path = "{0}/tables/bgp-types:ipv6-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv6-routes/ipv6-route/{1}/{2}" \ .format(peer_address, route_address, index) return BGPKeywords._configure_bgp_route(node, path, data) @staticmethod def get_bgp_route(node, peer_address, route_address, index, ip_version): """Get all BGP peers from operational data. :param node: Honeycomb node. :param peer_address: IP address of the BGP peer. :param route_address: IP address of the route. :param index: Index number of the route within specified peer. :param ip_version: IP protocol version. ipv4 or ipv6 :type node: dict :type peer_address: str :type route_address: str :type index: int :type ip_version: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the status code in response is not 200 = OK. """ route_address = route_address.replace("/", "%2F") if ip_version.lower() == "ipv4": path = "{0}/tables/bgp-types:ipv4-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv4-routes/ipv4-route/{1}/{2}" \ .format(peer_address, route_address, index) else: path = "{0}/tables/bgp-types:ipv6-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv6-routes/ipv6-route/{1}/{2}" \ .format(peer_address, route_address, index) status_code, resp = HcUtil. \ get_honeycomb_data(node, "config_bgp_route", path) if status_code != HTTPCodes.OK: raise HoneycombError( "Not possible to get configuration information about the BGP" " route. Status code: {0}.".format(status_code)) return resp @staticmethod def get_all_peer_routes(node, peer_address, ip_version): """Get all configured routes for the given BGP peer. :param node: Honeycomb node. :param peer_address: IP address of the peer. :param ip_version: IP protocol version. ipv4 or ipv6 :type node: dict :type peer_address: str :type ip_version: str :returns: Content of response. :rtype: bytearray :raises HoneycombError: If the status code in response is not 200 = OK. """ if ip_version.lower() == "ipv4": path = "{0}/tables/bgp-types:ipv4-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv4-routes".format(peer_address) else: path = "{0}/tables/bgp-types:ipv6-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv6-routes".format(peer_address) status_code, resp = HcUtil. \ get_honeycomb_data(node, "config_bgp_route", path) if status_code != HTTPCodes.OK: raise HoneycombError( "Not possible to get configuration information about BGP" " routes. Status code: {0}.".format(status_code)) return resp @staticmethod def remove_bgp_route(node, peer_address, route_address, index, ip_version): """Remove the specified BGP route from configuration. :param node: Honeycomb node. :param peer_address: IP address of the BGP peer. :param route_address: IP address of the route. :param index: Index number of the route within specified peer. :param ip_version: IP protocol version. ipv4 or ipv6 :type node: dict :type peer_address: str :type route_address: str :type index: int :type ip_version: str :returns: Content of response. :rtype: bytearray """ route_address = route_address.replace("/", "%2F") if ip_version.lower() == "ipv4": path = "{0}/tables/bgp-types:ipv4-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv4-routes/ipv4-route/{1}/{2}" \ .format(peer_address, route_address, index) else: path = "{0}/tables/bgp-types:ipv6-address-family/" \ "bgp-types:unicast-subsequent-address-family/" \ "bgp-inet:ipv6-routes/ipv6-route/{1}/{2}" \ .format(peer_address, route_address, index) return BGPKeywords._configure_bgp_route(node, path) @staticmethod def get_bgp_local_rib(node): """Get local RIB table from the Honeycomb node. :param node: Honeycomb node. :type node: dict :returns: RIB operational data. :rtype: dict :raises HoneycombError: If the status code in response is not 200 = OK. """ path = "loc-rib" status_code, resp = HcUtil. \ get_honeycomb_data(node, "oper_bgp", path) if status_code != HTTPCodes.OK: raise HoneycombError( "Not possible to get operational data from BGP local RIB." " Status code: {0}.".format(status_code)) return resp @staticmethod def configure_bgp_base(node, ip_address, port, as_number): """Modify BGP config file. Requires a restart of Honeycomb to take effect. :param node: Honeycomb node. :param ip_address: BGP peer identifier/binding address. :param port: BGP binding port. :param as_number: Autonomous System ID number. :type node: dict :type ip_address: str :type port: int :type as_number: int :raises HoneycombError: If modifying the configuration fails. """ from resources.libraries.python.ssh import SSH config = { '\\"bgp-binding-address\\"': '\\"{0}\\"'.format(ip_address), '\\"bgp-port\\"': port, '\\"bgp-as-number\\"': as_number} path = "{0}/config/bgp.json".format(Const.REMOTE_HC_DIR) for key, value in config.items(): find = key replace = '"{0}": "{1}",'.format(key, value) argument = '"/{0}/c\\ {1}"'.format(find, replace) command = "sed -i {0} {1}".format(argument, path) ssh = SSH() ssh.connect(node) (ret_code, _, stderr) = ssh.exec_command_sudo(command) if ret_code != 0: raise HoneycombError("Failed to modify configuration on " "node {0}, {1}".format(node, stderr)) @staticmethod def compare_rib_tables(data, ref): """Compare provided RIB table with reference. All reference entries must be present in data. Data entries not present in reference are ignored. :param data: Data from Honeycomb node. :param ref: Reference data to compare against. :type data: dict :type ref: dict :raises HoneycombError: If the tables do not match.""" # Remove runtime attributes from data for item in data: item.pop("attributes", "") for item in ref: if item not in data: raise HoneycombError( "RIB entry {0} not found in operational data.")