Пример #1
0
    def buildDigestConfig(self, digest_name):
        digest_entry = p4runtime_pb2.DigestEntry()
        digest_entry.digest_id = self.get_digests_id(digest_name)
        digest_entry.config.max_timeout_ns = 0
        digest_entry.config.max_list_size = 1
        digest_entry.config.ack_timeout_ns = 1000000

        return digest_entry
Пример #2
0
 def build_digest_entry(self, digest_name):
     digest_entry = p4runtime_pb2.DigestEntry()
     # using name
     digest_entry.digest_id = self.get_digests_id(digest_name)
     # using id directly
     digest_entry.config.max_timeout_ns = 0
     digest_entry.config.max_list_size = 1
     digest_entry.config.ack_timeout_ns = 0
     return digest_entry, digest_entry.digest_id
Пример #3
0
 def buildDigestEntry(self, digest_name, max_timeout_ns, max_list_size,
                      ack_timeout_ns):
     digest_entry = p4runtime_pb2.DigestEntry()
     digest_entry.digest_id = self.get_digests_id(digest_name)
     config = p4runtime_pb2.DigestEntry.Config()
     config.max_timeout_ns = max_timeout_ns
     config.max_list_size = max_list_size
     config.ack_timeout_ns = ack_timeout_ns
     digest_entry.config.CopyFrom(config)
     return digest_entry
Пример #4
0
 def buildDigestEntry(self, digest_name=None):
     digest_entry = p4runtime_pb2.DigestEntry()
     # using name
     digest_entry.digest_id = self.get_digests_id(digest_name)
     # using id directly
     #digest_entry.digest_id = int(digest_id)
     # FIXME: set config
     digest_entry.config.max_timeout_ns = 0
     digest_entry.config.max_list_size = 1
     digest_entry.config.ack_timeout_ns = 0
     return digest_entry
Пример #5
0
    def buildDigestConfig(self, digest_name):
        """
        See documentation at beginning of document.
        """
        digest_entry = p4runtime_pb2.DigestEntry()
        digest_entry.digest_id = self.get_digests_id(digest_name)
        digest_entry.config.max_timeout_ns = 0
        digest_entry.config.max_list_size = 1
        digest_entry.config.ack_timeout_ns = 1000000

        return {'name': digest_name, 'entry': digest_entry}
Пример #6
0
 def build_digest_entry(self, digest_name):
     digest_info = {}
     logger.info("Building digest entry for %s", digest_name)
     digest_entry = p4runtime_pb2.DigestEntry()
     # using name
     # TODO/FIXME - This appears to be broken on Tofino see issue #175
     logger.debug('Before getting digest ID')
     digest_entry.digest_id = self.get_digests_id(digest_name)
     logger.debug('After getting digest ID')
     # using id directly
     digest_entry.config.max_timeout_ns = 0
     digest_entry.config.max_list_size = 1
     digest_entry.config.ack_timeout_ns = 0
     digest_info[digest_name] = digest_entry.digest_id
     logger.info("Digest Entry Information %s", digest_info)
     return digest_entry, digest_info