Returns configured capabilities.

def get_configured_capabilities(self):
        """Returns configured capabilities."""

        capabilities = OrderedDict()
        mbgp_caps = []
        if self.cap_mbgp_ipv4:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv4_UC.afi, RF_IPv4_UC.safi))

        if self.cap_mbgp_ipv6:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv6_UC.afi, RF_IPv6_UC.safi))

        if self.cap_mbgp_vpnv4:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv4_VPN.afi, RF_IPv4_VPN.safi))

        if self.cap_mbgp_vpnv6:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv6_VPN.afi, RF_IPv6_VPN.safi))

        if self.cap_rtc:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_RTC_UC.afi, RF_RTC_UC.safi))

        if self.cap_mbgp_evpn:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_L2_EVPN.afi, RF_L2_EVPN.safi))

        if self.cap_mbgp_ipv4fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv4_FLOWSPEC.afi, RF_IPv4_FLOWSPEC.safi))

        if self.cap_mbgp_ipv6fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_IPv6_FLOWSPEC.afi, RF_IPv6_FLOWSPEC.safi))

        if self.cap_mbgp_vpnv4fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_VPNv4_FLOWSPEC.afi, RF_VPNv4_FLOWSPEC.safi))

        if self.cap_mbgp_vpnv6fs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_VPNv6_FLOWSPEC.afi, RF_VPNv6_FLOWSPEC.safi))

        if self.cap_mbgp_l2vpnfs:
            mbgp_caps.append(
                BGPOptParamCapabilityMultiprotocol(
                    RF_L2VPN_FLOWSPEC.afi, RF_L2VPN_FLOWSPEC.safi))

        if mbgp_caps:
            capabilities[BGP_CAP_MULTIPROTOCOL] = mbgp_caps

        if self.cap_refresh:
            capabilities[BGP_CAP_ROUTE_REFRESH] = [
                BGPOptParamCapabilityRouteRefresh()]

        if self.cap_enhanced_refresh:
            capabilities[BGP_CAP_ENHANCED_ROUTE_REFRESH] = [
                BGPOptParamCapabilityEnhancedRouteRefresh()]

        if self.cap_four_octet_as_number:
            capabilities[BGP_CAP_FOUR_OCTET_AS_NUMBER] = [
                BGPOptParamCapabilityFourOctetAsNumber(self.local_as)]

        return capabilities