<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def flowspec_prefix_add(self, flowspec_family, rules, route_dist=None, actions=None):
 """ This method adds a new Flow Specification prefix to be advertised. ``flowspec_family`` specifies one of the flowspec family name. This parameter must be one of the following. - FLOWSPEC_FAMILY_IPV4 = 'ipv4fs' - FLOWSPEC_FAMILY_IPV6 = 'ipv6fs' - FLOWSPEC_FAMILY_VPNV4 = 'vpnv4fs' - FLOWSPEC_FAMILY_VPNV6 = 'vpnv6fs' - FLOWSPEC_FAMILY_L2VPN = 'l2vpnfs' ``rules`` specifies NLRIs of Flow Specification as a dictionary type value. For the supported NLRI types and arguments, see `from_user()` method of the following classes. - :py:mod:`ryu.lib.packet.bgp.FlowSpecIPv4NLRI` - :py:mod:`ryu.lib.packet.bgp.FlowSpecIPv6NLRI` - :py:mod:`ryu.lib.packet.bgp.FlowSpecVPNv4NLRI` - :py:mod:`ryu.lib.packet.bgp.FlowSpecVPNv6NLRI` - :py:mod:`ryu.lib.packet.bgp.FlowSpecL2VPNNLRI` ``route_dist`` specifies a route distinguisher value. This parameter is required only if flowspec_family is one of the following address family. - FLOWSPEC_FAMILY_VPNV4 = 'vpnv4fs' - FLOWSPEC_FAMILY_VPNV6 = 'vpnv6fs' - FLOWSPEC_FAMILY_L2VPN = 'l2vpnfs' ``actions`` specifies Traffic Filtering Actions of Flow Specification as a dictionary type value. The keys are "ACTION_NAME" for each action class and values are used for the arguments to that class. For the supported "ACTION_NAME" and arguments, see the following table. =============== =============================================================== ACTION_NAME Action Class =============== =============================================================== traffic_rate :py:mod:`ryu.lib.packet.bgp.BGPFlowSpecTrafficRateCommunity` traffic_action :py:mod:`ryu.lib.packet.bgp.BGPFlowSpecTrafficActionCommunity` redirect :py:mod:`ryu.lib.packet.bgp.BGPFlowSpecRedirectCommunity` traffic_marking :py:mod:`ryu.lib.packet.bgp.BGPFlowSpecTrafficMarkingCommunity` vlan_action :py:mod:`ryu.lib.packet.bgp.BGPFlowSpecVlanActionCommunity` tpid_action :py:mod:`ryu.lib.packet.bgp.BGPFlowSpecTPIDActionCommunity` =============== =============================================================== Example(IPv4):
: Example(VPNv4):
: """

        func_name = 'flowspec.add'

        # Set required arguments
        kwargs = {
            FLOWSPEC_FAMILY: flowspec_family,
            FLOWSPEC_RULES: rules,
            FLOWSPEC_ACTIONS: actions or {},
        }

        if flowspec_family in [FLOWSPEC_FAMILY_VPNV4, FLOWSPEC_FAMILY_VPNV6,
                               FLOWSPEC_FAMILY_L2VPN]:
            func_name = 'flowspec.add_local'
            kwargs.update({ROUTE_DISTINGUISHER: route_dist})

        call(func_name, **kwargs)