aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ip
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2018-11-27 10:05:23 +0100
committerOle Trøan <otroan@employees.org>2018-12-06 14:05:04 +0000
commit8c8acc027871f97370ee549306876690030c3bbb (patch)
tree36e3c8b05d8112105739a5e809ed7fa7d80ab785 /src/vnet/ip
parent1f0dd7a0664bc217b7d69773574ac7eae3813bd7 (diff)
API: Change ip4_address and ip6_address to use type alias.
Change-Id: Id8669bbadd1d6b2054865a310a654e9b38d1667d Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/ip')
-rw-r--r--src/vnet/ip/ip_types.api9
-rw-r--r--src/vnet/ip/ip_types_api.c4
2 files changed, 4 insertions, 9 deletions
diff --git a/src/vnet/ip/ip_types.api b/src/vnet/ip/ip_types.api
index ad24d6e65ce..29bd8ad37f5 100644
--- a/src/vnet/ip/ip_types.api
+++ b/src/vnet/ip/ip_types.api
@@ -14,13 +14,8 @@
* limitations under the License.
*/
-typedef ip4_address {
- u8 address[4];
-};
-
-typedef ip6_address {
- u8 address[16];
-};
+typedef u8 ip4_address[4];
+typedef u8 ip6_address[16];
enum address_family {
ADDRESS_IP4 = 0,
diff --git a/src/vnet/ip/ip_types_api.c b/src/vnet/ip/ip_types_api.c
index 3d1f8065f5d..168e6150d19 100644
--- a/src/vnet/ip/ip_types_api.c
+++ b/src/vnet/ip/ip_types_api.c
@@ -67,9 +67,9 @@ ip_address_union_encode (const ip46_address_t * in,
vl_api_address_union_t * out)
{
if (ADDRESS_IP6 == clib_net_to_host_u32 (af))
- memcpy (out->ip6.address, &in->ip6, sizeof (out->ip6));
+ memcpy (out->ip6, &in->ip6, sizeof (out->ip6));
else
- memcpy (out->ip4.address, &in->ip4, sizeof (out->ip4));
+ memcpy (out->ip4, &in->ip4, sizeof (out->ip4));
}
void