ofpbuf: Introduce access api for base, data and size.
[sliver-openvswitch.git] / tests / test-vconn.c
index 76757f4..b7b57eb 100644 (file)
@@ -356,7 +356,7 @@ test_send_plain_hello(int argc OVS_UNUSED, char *argv[])
 
     hello = ofpraw_alloc_xid(OFPRAW_OFPT_HELLO, OFP10_VERSION,
                              htonl(0x12345678), 0);
-    test_send_hello(type, hello->data, hello->size, 0);
+    test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), 0);
     ofpbuf_delete(hello);
 }
 
@@ -374,7 +374,7 @@ test_send_long_hello(int argc OVS_UNUSED, char *argv[])
                              htonl(0x12345678), EXTRA_BYTES);
     ofpbuf_put_zeros(hello, EXTRA_BYTES);
     ofpmsg_update_length(hello);
-    test_send_hello(type, hello->data, hello->size, 0);
+    test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), 0);
     ofpbuf_delete(hello);
 }
 
@@ -388,7 +388,7 @@ test_send_echo_hello(int argc OVS_UNUSED, char *argv[])
 
     echo = ofpraw_alloc_xid(OFPRAW_OFPT_ECHO_REQUEST, OFP10_VERSION,
                              htonl(0x12345678), 0);
-    test_send_hello(type, echo->data, echo->size, EPROTO);
+    test_send_hello(type, ofpbuf_data(echo), ofpbuf_size(echo), EPROTO);
     ofpbuf_delete(echo);
 }
 
@@ -414,8 +414,8 @@ test_send_invalid_version_hello(int argc OVS_UNUSED, char *argv[])
 
     hello = ofpraw_alloc_xid(OFPRAW_OFPT_HELLO, OFP10_VERSION,
                              htonl(0x12345678), 0);
-    ((struct ofp_header *) hello->data)->version = 0;
-    test_send_hello(type, hello->data, hello->size, EPROTO);
+    ((struct ofp_header *) ofpbuf_data(hello))->version = 0;
+    test_send_hello(type, ofpbuf_data(hello), ofpbuf_size(hello), EPROTO);
     ofpbuf_delete(hello);
 }