From: Ben Pfaff Date: Tue, 30 Dec 2008 19:32:23 +0000 (-0800) Subject: Update dpif comments and prototypes. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=366ada0a9b063fb34d4f89e02ee339cbf832ea76;p=openvswitch Update dpif comments and prototypes. Some of the comments weren't up-to-date, and the prototypes are easier to understand if parameter names are included. --- diff --git a/lib/dpif.c b/lib/dpif.c index 0f995225..90856b5f 100644 --- a/lib/dpif.c +++ b/lib/dpif.c @@ -242,16 +242,20 @@ dpif_send_openflow(struct dpif *dp, int dp_idx, struct ofpbuf *buffer, } /* 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) { diff --git a/lib/dpif.h b/lib/dpif.h index 519ba923..313621b7 100644 --- a/lib/dpif.h +++ b/lib/dpif.h @@ -59,10 +59,10 @@ int dpif_recv_openflow(struct dpif *, struct ofpbuf **, bool wait); 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 */