+ struct ofpbuf *buffer;
+ struct ofp_flow_mod *ofm;
+ size_t size;
+ int n_actions = MAX_ADD_ACTS;
+
+ /* Parse and send. */
+ size = sizeof *ofm + (sizeof ofm->actions[0] * MAX_ADD_ACTS);
+ ofm = make_openflow(size, OFPT_FLOW_MOD, &buffer);
+ str_to_flow(argv[2], &ofm->match, &ofm->actions[0], &n_actions,
+ NULL, NULL, &idle_timeout, &hard_timeout);
+ ofm->command = htons(OFPFC_MODIFY);
+ ofm->idle_timeout = htons(idle_timeout);
+ ofm->hard_timeout = htons(hard_timeout);
+ ofm->buffer_id = htonl(UINT32_MAX);
+ ofm->priority = htons(0);
+ ofm->reserved = htonl(0);
+
+ /* xxx Should we use the buffer library? */
+ buffer->size -= (MAX_ADD_ACTS - n_actions) * sizeof ofm->actions[0];