summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/util.c
diff options
context:
space:
mode:
authorHakan Olsson <ho@cvs.openbsd.org>2001-10-26 12:03:08 +0000
committerHakan Olsson <ho@cvs.openbsd.org>2001-10-26 12:03:08 +0000
commit96e33d6c47856cf7acbdc90d97358149b738e2d1 (patch)
treefc433851c2116eb993c2aae3a4213335a7855f3d /sbin/isakmpd/util.c
parentc324b6d8c25b296f0b3ba5e5e386dbc0bb9c96b4 (diff)
Just rename sockaddr_data/len functions to sockaddr_addrdata/addrlen.
Diffstat (limited to 'sbin/isakmpd/util.c')
-rw-r--r--sbin/isakmpd/util.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sbin/isakmpd/util.c b/sbin/isakmpd/util.c
index 9e773835544..27d1d8491c2 100644
--- a/sbin/isakmpd/util.c
+++ b/sbin/isakmpd/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.21 2001/07/03 23:39:01 angelos Exp $ */
+/* $OpenBSD: util.c,v 1.22 2001/10/26 12:03:07 ho Exp $ */
/* $EOM: util.c,v 1.23 2000/11/23 12:22:08 niklas Exp $ */
/*
@@ -284,7 +284,7 @@ text2sockaddr (char *address, char *port, struct sockaddr **sa)
(*sa)->sa_len = sz;
(*sa)->sa_family = af;
- if (inet_pton (af, address, sockaddr_data (*sa)) != 1)
+ if (inet_pton (af, address, sockaddr_addrdata (*sa)) != 1)
{
free (*sa);
return -1;
@@ -410,11 +410,11 @@ sockaddr2text (struct sockaddr *sa, char **address, int zflag)
}
/*
- * sockaddr_len and sockaddr_data return the relevant sockaddr info depending
- * on address family. Useful to keep other code shorter(/clearer?).
+ * sockaddr_addrlen and sockaddr_addrdata return the relevant sockaddr info
+ * depending on address family. Useful to keep other code shorter(/clearer?).
*/
int
-sockaddr_len (struct sockaddr *sa)
+sockaddr_addrlen (struct sockaddr *sa)
{
switch (sa->sa_family)
{
@@ -423,14 +423,14 @@ sockaddr_len (struct sockaddr *sa)
case AF_INET:
return sizeof ((struct sockaddr_in *)sa)->sin_addr.s_addr;
default:
- log_print ("sockaddr_len: unsupported protocol family %d",
+ log_print ("sockaddr_addrlen: unsupported protocol family %d",
sa->sa_family);
return 0;
}
}
u_int8_t *
-sockaddr_data (struct sockaddr *sa)
+sockaddr_addrdata (struct sockaddr *sa)
{
switch (sa->sa_family)
{
@@ -439,6 +439,8 @@ sockaddr_data (struct sockaddr *sa)
case AF_INET:
return (u_int8_t *)&((struct sockaddr_in *)sa)->sin_addr.s_addr;
default:
+ log_print ("sockaddr_addrdata: unsupported protocol family %d",
+ sa->sa_family);
return 0;
}
}
@@ -467,7 +469,7 @@ util_ntoa (char **buf, int af, u_int8_t *addr)
case AF_INET6:
sfrom->sa_len = sizeof (struct sockaddr_in6);
- memcpy (sockaddr_data (sfrom), addr, sizeof (struct in6_addr));
+ memcpy (sockaddr_addrdata (sfrom), addr, sizeof (struct in6_addr));
break;
}