Esempio n. 1
0
    def code_gen_handle_header(self):
        """
		Input: final_header_list
		Output: P4 code
		"""
        hp = header.header_parser(self.header_list, self.metadata_dict)
        if self.p4_version == 'p414':
            hp.generate_p414_code()
        elif self.p4_version == 'p416':
            hp.generate_p4_code()
        return hp.p4_code
Esempio n. 2
0
 def lib_parser_handle_metadata(self):
     hp = header.header_parser([], collections.OrderedDict())
     hp.read_metadata(self.lib_filename)
     self.nf_node.nf_node_store_metadata(hp.metadata)
     return
Esempio n. 3
0
def lemur_p4lib_parser_handle_metadata(p4lib_filename, nf_node):
    hp = header.header_parser([], collections.OrderedDict())
    hp.read_metadata(p4lib_filename)
    nf_node.nf_node_store_metadata(hp.metadata)
    return