Esempio n. 1
0
 def do_table_tcam_add_entry(self, line):
     # defined in p4_px_tables.py
     (table_name, address, keys, masks, action_name,
      action_data) = parse_table_tcam_add_entry(line)
     p4_tables_api.table_tcam_write_entry(table_name, address, keys, masks,
                                          action_name, action_data)
Esempio n. 2
0
def table_lpm_load_dataset(table_name, lpm_dict):
    p4_tables_api.table_tcam_clean(table_name)
    map(lambda e: p4_tables_api.table_tcam_write_entry(table_name, \
            e.addr, [e.key], [e.mask], e.action_name, \
            DATA_TO_NUMERIC[table_name](e.action_data)),
            lpm_to_tcam(lpm_dict))