dpif: Rename odp_msg related functions for more consistency.
authorBen Pfaff <blp@nicira.com>
Wed, 17 Jun 2009 21:18:10 +0000 (14:18 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 6 Jul 2009 16:07:24 +0000 (09:07 -0700)
This seems like a more consistent naming scheme, since all of these
functions are related but none of them were named similarly or grouped
together.

lib/dpif.c
lib/dpif.h
secchan/ofproto.c

index b538c4c..09a47d2 100644 (file)
@@ -218,25 +218,7 @@ dpif_set_drop_frags(struct dpif *dpif, bool drop_frags)
 }
 
 int
-dpif_get_listen_mask(const struct dpif *dpif, int *listen_mask)
-{
-    int error = do_ioctl(dpif, ODP_GET_LISTEN_MASK, "ODP_GET_LISTEN_MASK",
-                         listen_mask);
-    if (error) {
-        *listen_mask = 0;
-    }
-    return error;
-}
-
-int
-dpif_set_listen_mask(struct dpif *dpif, int listen_mask)
-{
-    return do_ioctl(dpif, ODP_SET_LISTEN_MASK, "ODP_SET_LISTEN_MASK",
-                    &listen_mask);
-}
-
-int
-dpif_purge(struct dpif *dpif)
+dpif_recv_purge(struct dpif *dpif)
 {
     struct odp_stats stats;
     unsigned int i;
@@ -659,6 +641,24 @@ dpif_execute(struct dpif *dpif, uint16_t in_port,
     return error;
 }
 
+int
+dpif_recv_get_mask(const struct dpif *dpif, int *listen_mask)
+{
+    int error = do_ioctl(dpif, ODP_GET_LISTEN_MASK, "ODP_GET_LISTEN_MASK",
+                         listen_mask);
+    if (error) {
+        *listen_mask = 0;
+    }
+    return error;
+}
+
+int
+dpif_recv_set_mask(struct dpif *dpif, int listen_mask)
+{
+    return do_ioctl(dpif, ODP_SET_LISTEN_MASK, "ODP_SET_LISTEN_MASK",
+                    &listen_mask);
+}
+
 int
 dpif_recv(struct dpif *dpif, struct ofpbuf **bufp)
 {
index a767788..c4619c9 100644 (file)
@@ -42,10 +42,6 @@ int dpif_get_dp_stats(const struct dpif *, struct odp_stats *);
 int dpif_get_drop_frags(const struct dpif *, bool *drop_frags);
 int dpif_set_drop_frags(struct dpif *, bool drop_frags);
 
-int dpif_get_listen_mask(const struct dpif *, int *listen_mask);
-int dpif_set_listen_mask(struct dpif *, int listen_mask);
-int dpif_purge(struct dpif *);
-
 int dpif_port_add(struct dpif *, const char *devname, uint16_t port_no,
                   uint16_t flags);
 int dpif_port_del(struct dpif *, uint16_t port_no);
@@ -76,7 +72,10 @@ int dpif_execute(struct dpif *, uint16_t in_port,
                  const union odp_action[], size_t n_actions,
                  const struct ofpbuf *);
 
+int dpif_recv_get_mask(const struct dpif *, int *listen_mask);
+int dpif_recv_set_mask(struct dpif *, int listen_mask);
 int dpif_recv(struct dpif *, struct ofpbuf **);
+int dpif_recv_purge(struct dpif *);
 void dpif_recv_wait(struct dpif *);
 
 void dpif_get_netflow_ids(const struct dpif *,
index b82ccb3..2856846 100644 (file)
@@ -280,7 +280,7 @@ ofproto_create(const char *datapath, const struct ofhooks *ofhooks, void *aux,
         dpif_close(dpif);
         return error;
     }
-    error = dpif_set_listen_mask(dpif, ODPL_MISS | ODPL_ACTION);
+    error = dpif_recv_set_mask(dpif, ODPL_MISS | ODPL_ACTION);
     if (error) {
         VLOG_ERR("failed to listen on datapath %s: %s",
                  datapath, strerror(error));
@@ -288,7 +288,7 @@ ofproto_create(const char *datapath, const struct ofhooks *ofhooks, void *aux,
         return error;
     }
     dpif_flow_flush(dpif);
-    dpif_purge(dpif);
+    dpif_recv_purge(dpif);
 
     /* Start monitoring datapath ports for status changes. */
     error = dpifmon_create(datapath, &dpifmon);