예제 #1
0
    def get_processors(self):
        """
        Processors used for each field.
        Order matters and must match the same order as defined in headerNames

        :return: array of cell processors.
        """

        processors = [
            NotNull(),  # action
            ParseLong(),  # seq
            NotNull(),  # hash
            NotNull(),  # router hash
            NotNull(),  # router_ip
            NotNull(),  # peer_hash
            NotNull(),  # peer_ip
            ParseLong(),  # peer_asn
            ParseTimestamp(),  # timestamp
            ParseNullAsEmpty(),  # origin
            ParseNullAsEmpty(),  # as_path
            ParseLong(),  # as_path_count
            ParseLong(),  # origin_as
            ParseNullAsEmpty(),  # nexthop
            ParseLong(),  # med
            ParseLong(),  # local_pref
            ParseNullAsEmpty(),  # aggregator
            ParseNullAsEmpty(),  # community_list
            ParseNullAsEmpty(),  # ext_community_list
            ParseNullAsEmpty(),  # cluster_list
            ParseLongEmptyAsZero(),  # isAtomicAgg
            ParseLongEmptyAsZero(),  # isNexthopIPv4
            ParseNullAsEmpty()  # originator_id
        ]

        return processors
    def get_processors(self):
        """
        Processors used for each field.
        Order matters and must match the same order as defined in headerNames

        :return: array of cell processors.
        """

        default_cell_processors = [
            NotNull(),  # action
            ParseLong(),  # seq
            NotNull(),  # hash
            NotNull(),  # router hash
            NotNull(),  # router_ip
            ParseNullAsEmpty(),  # base_attr_hash
            NotNull(),  # peer_hash
            NotNull(),  # peer_ip
            ParseLong(),  # peer_asn
            ParseTimestamp(),  # timestamp
            NotNull(),  # prefix
            ParseInt(),  # prefix_len
            ParseInt(),  # isIPv4
            ParseNullAsEmpty(),  # origin
            ParseNullAsEmpty(),  # as_path
            ParseLongEmptyAsZero(),  # as_path_count
            ParseLongEmptyAsZero(),  # origin_as
            ParseNullAsEmpty(),  # nexthop
            ParseLongEmptyAsZero(),  # med
            ParseLongEmptyAsZero(),  # local_pref
            ParseNullAsEmpty(),  # aggregator
            ParseNullAsEmpty(),  # community_list
            ParseNullAsEmpty(),  # ext_community_list
            ParseNullAsEmpty(),  # cluster_list
            ParseLongEmptyAsZero(),  # isAtomicAgg
            ParseLongEmptyAsZero(),  # isNexthopIPv4
            ParseNullAsEmpty(),  # originator_id
        ]

        if self.spec_version >= float(1.3):
            version_specific_processors = [
                ParseLongEmptyAsZero(),  # Path ID
                ParseNullAsEmpty(),  # Labels
                ParseLongEmptyAsZero(),  # isPrePolicy
                ParseLongEmptyAsZero()  # isAdjRibIn
            ]
        elif self.spec_version >= float(1.1):
            version_specific_processors = [
                ParseLongEmptyAsZero(),  # Path ID
                ParseNullAsEmpty(),  # Labels
            ]
        else:
            version_specific_processors = []

        return default_cell_processors + version_specific_processors
    def get_processors(self):
        """
        Processors used for each field.
        Order matters and must match the same order as defined in headerNames

        :return: array of cell processors.
        """

        default_cell_processors = [
            NotNull(),  # action
            ParseLong(),  # seq
            NotNull(),  # hash
            NotNull(),  # base_hash
            NotNull(),  # router_hash
            NotNull(),  # router_ip
            NotNull(),  # peer_hash
            NotNull(),  # peer_ip
            ParseLong(),  # peer_asn
            ParseTimestamp(),  # timestamp
            ParseNullAsEmpty(),  # igp_router_id
            ParseNullAsEmpty(),  # router_id
            ParseNullAsEmpty(),  # routing_id
            ParseLongEmptyAsZero(),  # ls_id
            ParseNullAsEmpty(),  # mt_id
            ParseNullAsEmpty(),  # ospf_area_id
            ParseNullAsEmpty(),  # isis_area_id
            ParseNullAsEmpty(),  # protocol
            ParseNullAsEmpty(),  # flags
            ParseNullAsEmpty(),  # as_path
            ParseLongEmptyAsZero(),  # local_pref
            ParseLongEmptyAsZero(),  # med
            ParseNullAsEmpty(),  # nexthop
            ParseNullAsEmpty(),  # name
        ]

        version_specific_processors = []

        if self.spec_version >= float(1.3):
            version_specific_processors += [
                ParseLongEmptyAsZero(),  # isPrePolicy
                ParseLongEmptyAsZero()  # isAdjRibIn
            ]

        if self.spec_version >= float(1.4):
            version_specific_processors += [
                ParseNullAsEmpty()  # SR Capabilities
            ]

        return default_cell_processors + version_specific_processors
예제 #4
0
    def get_processors(self):
        """
        Processors used for each field.
        Order matters and must match the same order as defined in headerNames

        :return: array of cell processors.
        """

        processors = [
            NotNull(),  # action
            ParseLong(),  # seq
            NotNull(),  # hash
            NotNull(),  # router hash
            ParseNullAsEmpty(),  # name
            NotNull(),  # remote_bgp_id
            NotNull(),  # router_ip
            ParseTimestamp(),  # Timestamp
            ParseLong(),  # remote_asn
            NotNull(),  # remote_ip
            ParseNullAsEmpty(),  # peer_rd
            ParseLongEmptyAsZero(),  # remote_port
            ParseLongEmptyAsZero(),  # local_asn
            ParseNullAsEmpty(),  # local_ip
            ParseLongEmptyAsZero(),  # local_port
            ParseNullAsEmpty(),  # local_bgp_id
            ParseNullAsEmpty(),  # info_data
            ParseNullAsEmpty(),  # adv_cap
            ParseNullAsEmpty(),  # recv_cap
            ParseLongEmptyAsZero(),  # remote_holddown
            ParseLongEmptyAsZero(),  # local_holddown
            ParseLongEmptyAsZero(),  # bmp_reason
            ParseLongEmptyAsZero(),  # bgp_error_code
            ParseLongEmptyAsZero(),  # bgp_error_sub_code
            ParseNullAsEmpty(),  # error_text
            ParseLongEmptyAsZero(),  # isL3VPN
            ParseLongEmptyAsZero(),  # isPrePolicy
            ParseLongEmptyAsZero()  # isIPv4
        ]

        return processors
예제 #5
0
    def get_processors(self):
        """
        Processors used for each field.
        Order matters and must match the same order as defined in headerNames

        :return: array of cell processors.
        """

        default_cell_processors = [
            NotNull(),  # action
            ParseLong(),  # seq
            NotNull(),  # hash
            NotNull(),  # base_hash
            NotNull(),  # router_hash
            NotNull(),  # router_ip
            NotNull(),  # peer_hash
            NotNull(),  # peer_ip
            ParseLong(),  # peer_asn
            ParseTimestamp(),  # timestamp
            ParseNullAsEmpty(),  # igp_router_id
            ParseNullAsEmpty(),  # router_id
            ParseNullAsEmpty(),  # routing_id
            ParseLongEmptyAsZero(),  # ls_id
            ParseNullAsEmpty(),  # ospf_area_id
            ParseNullAsEmpty(),  # isis_area_id
            ParseNullAsEmpty(),  # protocol
            ParseNullAsEmpty(),  # as_path
            ParseLongEmptyAsZero(),  # local_pref
            ParseLongEmptyAsZero(),  # med
            ParseNullAsEmpty(),  # nexthop
            ParseNullAsEmpty(),  # mt_id
            ParseLongEmptyAsZero(),  # local_link_id
            ParseLongEmptyAsZero(),  # remote_link_id
            ParseNullAsEmpty(),  # intf_ip
            ParseNullAsEmpty(),  # nei_ip
            ParseLongEmptyAsZero(),  # igp_metric
            ParseLongEmptyAsZero(),  # admin_group
            ParseNullAsEmpty(),  # max_link_bw
            ParseNullAsEmpty(),  # max_resv_bw
            ParseNullAsEmpty(),  # unresv_bw
            ParseLongEmptyAsZero(),  # te_default_metric
            ParseNullAsEmpty(),  # link_protection
            ParseNullAsEmpty(),  # mpls_proto_mask
            ParseNullAsEmpty(),  # srlg
            ParseNullAsEmpty(),  # link_name
            ParseNullAsEmpty(),  # remote_node_hash
            ParseNullAsEmpty(),  # local_node_hash
        ]

        version_specific_processors = []

        if self.spec_version >= float(1.2):
            version_specific_processors += [
                ParseNullAsEmpty(),  # remote_igp_router_id
                ParseNullAsEmpty(),  # remote_router_id
                ParseLongEmptyAsZero(),  # local_node_asn
                ParseLongEmptyAsZero(),  # remote_node_asn
                ParseNullAsEmpty()  # Peer node SID
            ]

        if self.spec_version >= float(1.3):
            version_specific_processors += [
                ParseLongEmptyAsZero(),  # isPrePolicy
                ParseLongEmptyAsZero()  # isAdjRibIn
            ]

        if self.spec_version >= float(1.4):
            version_specific_processors += [
                ParseNullAsEmpty(),  # SR Adjacency SID list
            ]

        return default_cell_processors + version_specific_processors