summaryrefslogtreecommitdiffstats
path: root/cpukit/libnetworking
diff options
context:
space:
mode:
authorRalf Corsepius <ralf.corsepius@rtems.org>2005-05-09 13:12:45 +0000
committerRalf Corsepius <ralf.corsepius@rtems.org>2005-05-09 13:12:45 +0000
commit9e7678d2afca1621e470e0474bf237ff6117c7a1 (patch)
tree5a8ee8134a575b0987f7dbb6b8765dda95adb2da /cpukit/libnetworking
parentsocklen_t. (diff)
downloadrtems-9e7678d2afca1621e470e0474bf237ff6117c7a1.tar.bz2
Partial update from FreeBSD.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r--cpukit/libnetworking/arpa/inet.h63
-rw-r--r--cpukit/libnetworking/netinet/in.h3
-rw-r--r--cpukit/libnetworking/sys/socket.h6
3 files changed, 49 insertions, 23 deletions
diff --git a/cpukit/libnetworking/arpa/inet.h b/cpukit/libnetworking/arpa/inet.h
index c4f2372dcc..d1032cf0be 100644
--- a/cpukit/libnetworking/arpa/inet.h
+++ b/cpukit/libnetworking/arpa/inet.h
@@ -62,8 +62,11 @@
/* External definitions for functions in inet(3), addr2ascii(3) */
-#include <sys/types.h>
#include <sys/cdefs.h>
+#include <rtems/bsdnet/_types.h>
+
+#define INET_ADDRSTRLEN 16
+#define INET6_ADDRSTRLEN 46
#ifndef _IN_ADDR_T_DECLARED
typedef uint32_t in_addr_t;
@@ -75,8 +78,25 @@ typedef uint16_t in_port_t;
#define _IN_PORT_T_DECLARED
#endif
-#if 0 /* RTEMS -- Why rename these? */
+/*
+ * XXX socklen_t is used by a POSIX.1-2001 interface, but not required by
+ * POSIX.1-2001.
+ */
+#ifndef _SOCKLEN_T_DECLARED
+typedef __socklen_t socklen_t;
+#define _SOCKLEN_T_DECLARED
+#endif
+
+#ifndef _STRUCT_IN_ADDR_DECLARED
+struct in_addr {
+ in_addr_t s_addr;
+};
+#define _STRUCT_IN_ADDR_DECLARED
+#endif
+
+#if !defined(__rtems__) /* RTEMS -- Why rename these? */
/* XXX all new diversions!! argh!! */
+#if __BSD_VISIBLE
#define inet_addr __inet_addr
#define inet_aton __inet_aton
#define inet_lnaof __inet_lnaof
@@ -91,25 +111,30 @@ typedef uint16_t in_port_t;
#define inet_ntop __inet_ntop
#define inet_nsap_addr __inet_nsap_addr
#define inet_nsap_ntoa __inet_nsap_ntoa
-#endif
+#endif /* __BSD_VISIBLE */
+#endif /* __rtems__ */
__BEGIN_DECLS
-int ascii2addr __P((int, const char *, void *));
-char *addr2ascii __P((int, const void *, int, char *));
-unsigned long inet_addr __P((const char *));
-int inet_aton __P((const char *, struct in_addr *));
-unsigned long inet_lnaof __P((struct in_addr));
-struct in_addr inet_makeaddr __P((u_long , u_long));
-char * inet_neta __P((u_long, char *, size_t));
-unsigned long inet_netof __P((struct in_addr));
-unsigned long inet_network __P((const char *));
-char *inet_net_ntop __P((int, const void *, int, char *, size_t));
-int inet_net_pton __P((int, const char *, void *, size_t));
-char *inet_ntoa __P((struct in_addr));
-int inet_pton __P((int, const char *, void *));
-const char *inet_ntop __P((int, const void *, char *, size_t));
-u_int inet_nsap_addr __P((const char *, u_char *, int));
-char *inet_nsap_ntoa __P((int, const u_char *, char *));
+in_addr_t inet_addr(const char *);
+char *inet_ntoa(struct in_addr);
+const char *inet_ntop(int, const void * __restrict, char * __restrict,
+ socklen_t);
+int inet_pton(int, const char * __restrict, void * __restrict);
+
+#if __BSD_VISIBLE
+int ascii2addr(int, const char *, void *);
+char *addr2ascii(int, const void *, int, char *);
+int inet_aton(const char *, struct in_addr *);
+in_addr_t inet_lnaof(struct in_addr);
+struct in_addr inet_makeaddr(in_addr_t, in_addr_t);
+char * inet_neta(in_addr_t, char *, size_t);
+in_addr_t inet_netof(struct in_addr);
+in_addr_t inet_network(const char *);
+char *inet_net_ntop(int, const void *, int, char *, size_t);
+int inet_net_pton(int, const char *, void *, size_t);
+unsigned inet_nsap_addr(const char *, unsigned char *, int);
+char *inet_nsap_ntoa(int, const unsigned char *, char *);
+#endif /* __BSD_VISIBLE */
__END_DECLS
#endif /* !_ARPA_INET_H_ */
diff --git a/cpukit/libnetworking/netinet/in.h b/cpukit/libnetworking/netinet/in.h
index f75f4c0bb1..1c7786b4b9 100644
--- a/cpukit/libnetworking/netinet/in.h
+++ b/cpukit/libnetworking/netinet/in.h
@@ -37,6 +37,7 @@
#ifndef _NETINET_IN_H_
#define _NETINET_IN_H_
+#include <rtems/bsdnet/_types.h>
#include <machine/endian.h>
/* Protocols common to RFC 1700, POSIX, and X/Open. */
@@ -54,7 +55,7 @@ typedef uint16_t in_port_t;
#endif
#ifndef _SA_FAMILY_T_DECLARED
-typedef unsigned char sa_family_t;
+typedef __sa_family_t sa_family_t;
#define _SA_FAMILY_T_DECLARED
#endif
diff --git a/cpukit/libnetworking/sys/socket.h b/cpukit/libnetworking/sys/socket.h
index e0bc0d7162..31213eda51 100644
--- a/cpukit/libnetworking/sys/socket.h
+++ b/cpukit/libnetworking/sys/socket.h
@@ -38,7 +38,7 @@
#define _SYS_SOCKET_H_
#include <sys/cdefs.h>
-#include <sys/types.h>
+#include <rtems/bsdnet/_types.h>
/*
* Definitions related to sockets: types, address families, options.
@@ -49,12 +49,12 @@
*/
#ifndef _SA_FAMILY_T_DECLARED
-typedef unsigned char sa_family_t;
+typedef __sa_family_t sa_family_t;
#define _SA_FAMILY_T_DECLARED
#endif
#ifndef _SOCKLEN_T_DECLARED
-typedef int socklen_t;
+typedef __socklen_t socklen_t;
#define _SOCKLEN_T_DECLARED
#endif