An upcoming commit will want to pass a different command.
* 'stream' and the command is always OFPFC_ADD. Returns false if end-of-file
* is reached before reading a flow, otherwise true. */
bool
-parse_ofp_add_flow_file(struct list *packets, enum nx_flow_format *cur,
- FILE *stream)
+parse_ofp_flow_mod_file(struct list *packets, enum nx_flow_format *cur,
+ FILE *stream, uint16_t command)
{
struct ds s;
bool ok;
ds_init(&s);
ok = ds_get_preprocessed_line(&s, stream) == 0;
if (ok) {
- parse_ofp_flow_mod_str(packets, cur, ds_cstr(&s), OFPFC_ADD);
+ parse_ofp_flow_mod_str(packets, cur, ds_cstr(&s), command);
}
ds_destroy(&s);
void parse_ofp_flow_mod_str(struct list *packets, enum nx_flow_format *cur,
char *string, uint16_t command);
-bool parse_ofp_add_flow_file(struct list *packets, enum nx_flow_format *cur,
- FILE *);
+bool parse_ofp_flow_mod_file(struct list *packets, enum nx_flow_format *cur,
+ FILE *, uint16_t command);
void parse_ofp_flow_stats_request_str(struct flow_stats_request *,
bool aggregate, char *string);
}
flow_format = NXFF_OPENFLOW10;
- while (parse_ofp_add_flow_file(&default_flows, &flow_format, stream)) {
+ while (parse_ofp_flow_mod_file(&default_flows, &flow_format, stream,
+ OFPFC_ADD)) {
continue;
}
flow_format = set_initial_format_for_flow_mod(&requests);
open_vconn(argv[1], &vconn);
- while (parse_ofp_add_flow_file(&requests, &flow_format, file)) {
+ while (parse_ofp_flow_mod_file(&requests, &flow_format, file, OFPFC_ADD)) {
check_final_format_for_flow_mod(flow_format);
transact_multiple_noreply(vconn, &requests);
}
}
list_init(&packets);
- while (parse_ofp_add_flow_file(&packets, &flow_format, file)) {
+ while (parse_ofp_flow_mod_file(&packets, &flow_format, file, OFPFC_ADD)) {
print_packet_list(&packets);
}
fclose(file);