return (gu - gbp_rule_pool);
}
+void
+gbp_rule_free (index_t gui)
+{
+ pool_put_index (gbp_rule_pool, gui);
+}
+
index_t
gbp_next_hop_alloc (const ip46_address_t * ip,
index_t grd, const mac_address_t * mac, index_t gbd)
adj_unlock (gnh->gnh_ai[fproto]);
}
}
+
+ gbp_rule_free (*gui);
}
vec_free (rules);
}
return (s);
}
-static u8 *
+u8 *
format_gbp_rule_action (u8 * s, va_list * args)
{
gbp_rule_action_t action = va_arg (*args, gbp_rule_action_t);
gbp_contract_t *gc;
/* *INDENT-OFF* */
- pool_foreach(gc, gbp_contract_pool,
- ({
+ pool_foreach (gc, gbp_contract_pool)
+ {
if (!cb(gc, ctx))
break;
- }));
+ }
/* *INDENT-ON* */
}
vlib_cli_output (vm, "Contracts:");
/* *INDENT-OFF* */
- pool_foreach (gc, gbp_contract_pool,
- ({
+ pool_foreach (gc, gbp_contract_pool)
+ {
gci = gc - gbp_contract_pool;
if (SCLASS_INVALID != src && SCLASS_INVALID != dst)
}
else
vlib_cli_output (vm, " %U", format_gbp_contract, gci);
- }));
+ }
/* *INDENT-ON* */
return (NULL);