+static int
+api_flowprobe_params (vat_main_t * vam)
+{
+ unformat_input_t *i = vam->input;
+ u8 record_l2 = 0, record_l3 = 0, record_l4 = 0;
+ u32 active_timer = ~0;
+ u32 passive_timer = ~0;
+ vl_api_flowprobe_params_t *mp;
+ int ret;
+
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "active %d", &active_timer))
+ ;
+ else if (unformat (i, "passive %d", &passive_timer))
+ ;
+ else if (unformat (i, "record"))
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT)
+ {
+ if (unformat (i, "l2"))
+ record_l2 = 1;
+ else if (unformat (i, "l3"))
+ record_l3 = 1;
+ else if (unformat (i, "l4"))
+ record_l4 = 1;
+ else
+ break;
+ }
+ else
+ break;
+ }
+
+ if (passive_timer > 0 && active_timer > passive_timer)
+ {
+ errmsg ("Passive timer has to be greater than active one...\n");
+ return -99;
+ }
+
+ /* Construct the API message */
+ M (FLOWPROBE_PARAMS, mp);
+ mp->record_l2 = record_l2;
+ mp->record_l3 = record_l3;
+ mp->record_l4 = record_l4;
+ mp->active_timer = ntohl (active_timer);
+ mp->passive_timer = ntohl (passive_timer);
+
+ /* send it... */
+ S (mp);
+
+ /* Wait for a reply... */
+ W (ret);
+
+ return ret;
+}
+