}
/* Creates local datapath numbered 'dp_idx' with the name 'dp_name'. A
- * 'dp_idx' of -1 or null 'dp_name' will have the kernel module choose
- * values. Returns 0 if successful, otherwise a positive errno value. */
+ * 'dp_idx' of -1 or null 'dp_name' will have the kernel module choose values.
+ * (At least one or the other must be provided, however, so that the caller can
+ * identify the datapath that was created.) Returns 0 if successful, otherwise
+ * a positive errno value. */
int
dpif_add_dp(struct dpif *dp, int dp_idx, const char *dp_name)
{
return send_mgmt_command(dp, dp_idx, DP_GENL_C_ADD_DP, dp_name);
}
-/* Destroys local datapath numbered 'dp_idx'. Returns 0 if successful,
- * otherwise a positive errno value. */
+/* Destroys a local datapath. If 'dp_idx' is not -1, destroys the datapath
+ * with that number; if 'dp_name' is not NULL, destroys the datapath with that
+ * name. Exactly one of 'dp_idx' and 'dp_name' should be used. Returns 0 if
+ * successful, otherwise a positive errno value. */
int
dpif_del_dp(struct dpif *dp, int dp_idx, const char *dp_name)
{
int dpif_send_openflow(struct dpif *, int dp_idx, struct ofpbuf *, bool wait);
/* Management functions. */
-int dpif_add_dp(struct dpif *, int, const char *);
-int dpif_del_dp(struct dpif *, int, const char *);
-int dpif_add_port(struct dpif *, int, const char *);
-int dpif_del_port(struct dpif *, int, const char *);
-int dpif_get_idx(const char *);
+int dpif_add_dp(struct dpif *, int dp_idx, const char *dp_name);
+int dpif_del_dp(struct dpif *, int dp_idx, const char *dp_name);
+int dpif_add_port(struct dpif *, int dp_idx, const char *netdev);
+int dpif_del_port(struct dpif *, int dp_idx, const char *netdev);
+int dpif_get_idx(const char *dp_name);
#endif /* dpif.h */