cfm: Fix GCC warning.
[openvswitch] / lib / vconn.c
index 8694305b71a7a07cbf8169671bef784ac46908d8..3804061b6195927a4e4b7c1d406433d4711cad03 100644 (file)
@@ -38,7 +38,7 @@
 #include "util.h"
 #include "vlog.h"
 
-VLOG_DEFINE_THIS_MODULE(vconn)
+VLOG_DEFINE_THIS_MODULE(vconn);
 
 /* State of an active vconn.*/
 enum vconn_state {
@@ -127,7 +127,7 @@ vconn_usage(bool active, bool passive, bool bootstrap OVS_UNUSED)
     /* Really this should be implemented via callbacks into the vconn
      * providers, but that seems too heavy-weight to bother with at the
      * moment. */
-    
+
     printf("\n");
     if (active) {
         printf("Active OpenFlow connection methods:\n");
@@ -317,39 +317,39 @@ vconn_get_name(const struct vconn *vconn)
 
 /* Returns the IP address of the peer, or 0 if the peer is not connected over
  * an IP-based protocol or if its IP address is not yet known. */
-uint32_t
-vconn_get_remote_ip(const struct vconn *vconn) 
+ovs_be32
+vconn_get_remote_ip(const struct vconn *vconn)
 {
     return vconn->remote_ip;
 }
 
-/* Returns the transport port of the peer, or 0 if the connection does not 
+/* Returns the transport port of the peer, or 0 if the connection does not
  * contain a port or if the port is not yet known. */
-uint16_t
-vconn_get_remote_port(const struct vconn *vconn) 
+ovs_be16
+vconn_get_remote_port(const struct vconn *vconn)
 {
     return vconn->remote_port;
 }
 
-/* Returns the IP address used to connect to the peer, or 0 if the 
- * connection is not an IP-based protocol or if its IP address is not 
+/* Returns the IP address used to connect to the peer, or 0 if the
+ * connection is not an IP-based protocol or if its IP address is not
  * yet known. */
-uint32_t
-vconn_get_local_ip(const struct vconn *vconn) 
+ovs_be32
+vconn_get_local_ip(const struct vconn *vconn)
 {
     return vconn->local_ip;
 }
 
-/* Returns the transport port used to connect to the peer, or 0 if the 
+/* Returns the transport port used to connect to the peer, or 0 if the
  * connection does not contain a port or if the port is not yet known. */
-uint16_t
-vconn_get_local_port(const struct vconn *vconn) 
+ovs_be16
+vconn_get_local_port(const struct vconn *vconn)
 {
     return vconn->local_port;
 }
 
 static void
-vcs_connecting(struct vconn *vconn) 
+vcs_connecting(struct vconn *vconn)
 {
     int retval = (vconn->class->connect)(vconn);
     assert(retval != EINPROGRESS);
@@ -648,10 +648,10 @@ vconn_recv_block(struct vconn *vconn, struct ofpbuf **msgp)
  *
  * 'request' is always destroyed, regardless of the return value. */
 int
-vconn_recv_xid(struct vconn *vconn, uint32_t xid, struct ofpbuf **replyp)
+vconn_recv_xid(struct vconn *vconn, ovs_be32 xid, struct ofpbuf **replyp)
 {
     for (;;) {
-        uint32_t recv_xid;
+        ovs_be32 recv_xid;
         struct ofpbuf *reply;
         int error;
 
@@ -667,7 +667,8 @@ vconn_recv_xid(struct vconn *vconn, uint32_t xid, struct ofpbuf **replyp)
         }
 
         VLOG_DBG_RL(&bad_ofmsg_rl, "%s: received reply with xid %08"PRIx32
-                    " != expected %08"PRIx32, vconn->name, recv_xid, xid);
+                    " != expected %08"PRIx32,
+                    vconn->name, ntohl(recv_xid), ntohl(xid));
         ofpbuf_delete(reply);
     }
 }
@@ -682,7 +683,7 @@ int
 vconn_transact(struct vconn *vconn, struct ofpbuf *request,
                struct ofpbuf **replyp)
 {
-    uint32_t send_xid = ((struct ofp_header *) request->data)->xid;
+    ovs_be32 send_xid = ((struct ofp_header *) request->data)->xid;
     int error;
 
     *replyp = NULL;
@@ -902,25 +903,25 @@ vconn_init(struct vconn *vconn, struct vconn_class *class, int connect_status,
 }
 
 void
-vconn_set_remote_ip(struct vconn *vconn, uint32_t ip)
+vconn_set_remote_ip(struct vconn *vconn, ovs_be32 ip)
 {
     vconn->remote_ip = ip;
 }
 
 void
-vconn_set_remote_port(struct vconn *vconn, uint16_t port)
+vconn_set_remote_port(struct vconn *vconn, ovs_be16 port)
 {
     vconn->remote_port = port;
 }
 
-void 
-vconn_set_local_ip(struct vconn *vconn, uint32_t ip)
+void
+vconn_set_local_ip(struct vconn *vconn, ovs_be32 ip)
 {
     vconn->local_ip = ip;
 }
 
-void 
-vconn_set_local_port(struct vconn *vconn, uint16_t port)
+void
+vconn_set_local_port(struct vconn *vconn, ovs_be16 port)
 {
     vconn->local_port = port;
 }