예제 #1
0
 def generate_model_inputs(self, stffile):
     # To override
     """ Parses the stf file and creates a .pcap file with input packets.
         It also adds the expected output packets per interface to a global
         dictionary.
         After parsing the necessary information, it creates a control
         header for the runtime, which contains the extracted control
          plane commands """
     with open(stffile) as raw_stf:
         iface_pkts, cmds, self.expected, self.expectedAny = parse_stf_file(
             raw_stf)
         create_table_file(cmds, self.tmpdir, "control.h")
         self._write_pcap_files(iface_pkts)
     return SUCCESS
예제 #2
0
파일: target.py 프로젝트: ederollora/p4c
 def generate_model_inputs(self, stffile):
     # To override
     """ Parses the stf file and creates a .pcap file with input packets.
         It also adds the expected output packets per interface to a global
         dictionary.
         After parsing the necessary information, it creates a control
         header for the runtime, which contains the extracted control
          plane commands """
     with open(stffile) as raw_stf:
         input_pkts, cmds, self.expected = parse_stf_file(
             raw_stf)
         result, err = create_table_file(cmds, self.tmpdir, "control.h")
         if result != SUCCESS:
             return result
         result = self._write_pcap_files(input_pkts)
         if result != SUCCESS:
             return result
     return SUCCESS