aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-12-17 12:02:26 +0100
committerNeale Ranns <nranns@cisco.com>2018-12-18 11:54:24 +0000
commit8006c6aa425126529b4017768a9201e4f03964ad (patch)
tree7b7342e6fb4964a5c8ca65c3d13d8dcc980f120d /src/vnet/ethernet
parent02782d6ebd13ce02f2d3facebb54fec3c2137c88 (diff)
PAPI: Add MACAddress object wrapper for vl_api_mac_address_t
Change the definition of vl_api_mac_address_t to an aliased type. Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134 Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/ethernet')
-rw-r--r--src/vnet/ethernet/ethernet_types.api4
-rw-r--r--src/vnet/ethernet/ethernet_types_api.c8
-rw-r--r--src/vnet/ethernet/ethernet_types_api.h11
3 files changed, 7 insertions, 16 deletions
diff --git a/src/vnet/ethernet/ethernet_types.api b/src/vnet/ethernet/ethernet_types.api
index c33a02c377a..f945f20910f 100644
--- a/src/vnet/ethernet/ethernet_types.api
+++ b/src/vnet/ethernet/ethernet_types.api
@@ -14,6 +14,4 @@
* limitations under the License.
*/
-typedef mac_address {
- u8 bytes[6];
-};
+typedef u8 mac_address[6];
diff --git a/src/vnet/ethernet/ethernet_types_api.c b/src/vnet/ethernet/ethernet_types_api.c
index 4b84d386e4e..90b630d46be 100644
--- a/src/vnet/ethernet/ethernet_types_api.c
+++ b/src/vnet/ethernet/ethernet_types_api.c
@@ -30,15 +30,15 @@
#undef vl_printfun
void
-mac_address_decode (const vl_api_mac_address_t * in, mac_address_t * out)
+mac_address_decode (const u8 * in, mac_address_t * out)
{
- mac_address_from_bytes (out, in->bytes);
+ mac_address_from_bytes (out, in);
}
void
-mac_address_encode (const mac_address_t * in, vl_api_mac_address_t * out)
+mac_address_encode (const mac_address_t * in, u8 * out)
{
- clib_memcpy_fast (out->bytes, in->bytes, 6);
+ clib_memcpy_fast (out, in->bytes, 6);
}
/*
diff --git a/src/vnet/ethernet/ethernet_types_api.h b/src/vnet/ethernet/ethernet_types_api.h
index b65d9d46c86..e2c638d1fec 100644
--- a/src/vnet/ethernet/ethernet_types_api.h
+++ b/src/vnet/ethernet/ethernet_types_api.h
@@ -22,15 +22,8 @@
#include <vnet/ethernet/mac_address.h>
-/**
- * Forward declarations so we need not #include the API definitions here
- */
-struct _vl_api_mac_address;
-
-extern void mac_address_decode (const struct _vl_api_mac_address *in,
- mac_address_t * out);
-extern void mac_address_encode (const mac_address_t * in,
- struct _vl_api_mac_address *out);
+extern void mac_address_decode (const u8 * in, mac_address_t * out);
+extern void mac_address_encode (const mac_address_t * in, u8 * out);
#endif