def generate_rofl_actions(fields): add_fields_properties(fields) header = fields[0]['header'] location = ROFL_DIR + '/datapath/pipeline/openflow/openflow1x/pipeline/' generate_file(location + 'of1x_action.h', generate_openflow_pipeline_action_h(fields)) generate_file(location + 'of1x_action.c', generate_openflow_pipeline_action_c(fields)) location = ROFL_DIR + '/common/openflow/experimental/actions/' generate_file(location + '%s_actions.h' % header, generate_experimental_action_h(fields)) generate_file(location + '%s_actions.cc' % header, generate_experimental_action_c(fields)) generate_file(location + 'Makefile.am', generate_experimental_makefile(fields)) generate_file(ROFL_DIR + '/datapath/pipeline/platform/packet_actions_autogenerated.h', generate_datapath_pipeline_platform_actions_h(fields)) experimental_ids = {} for field in fields: if 'field' in field: continue if 'experimental_id' in field: if field['header'] not in experimental_ids: experimental_ids[field['header']] = [] full_action_name = "%s_%s" % (field['action'], field['header']) experimental_ids[field['header']].append({'action':full_action_name, 'experimental_id':field['experimental_id']}) else: experimental_ids[field['header']].append({'action':full_action_name, 'experimental_id':4}) # TODO FIX return experimental_ids
def generate_rofl_frames(fields): fields = approve_fields_with_attribute(fields, 'field') add_fields_properties(fields) header = fields[0]['header'] location = ROFL_DIR + '/common/protocols/' generate_file(location + 'f%sframe.h' % header, generate_common_protocol_frame_h(fields)) generate_file(location + 'f%sframe.cc' % header, generate_common_protocol_frame_c(fields)) generate_file(location + 'Makefile.am', generate_common_protocol_makefile(fields))
def generate_xdpd(fields): add_fields_properties(fields) header = fields[0]['header'] location = XDPD_GNU_LINUX_DIR + '/io/packet_classifiers/' generate_file(location + 'packetclassifier.h', generate_packet_classifier_h(fields)) generate_file(location + 'static_pktclassifier.h', generate_static_pktclassifier_h(fields)) generate_file(location + 'static_pktclassifier.cc', generate_static_pktclassifier_c(fields)) location = XDPD_GNU_LINUX_DIR + '/pipeline-imp/' generate_file(location + 'packet.cc', generate_packet_c(fields)) location = XDPD_OPENFLOW + '/openflow12/' generate_file(location + 'of12_translation_utils.cc', generate_translation_utils_c(fields))