summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKinsey Moore <kinsey.moore@oarcorp.com>2022-07-27 11:24:54 -0500
committerKinsey Moore <kinsey.moore@oarcorp.com>2022-09-06 13:46:39 -0500
commit175fdbf7e8e5f493116785bde0c6845df0d1cbff (patch)
tree024a3dfcd1b27c7af6e27467c412d1ec8da640f9
parentsebhbsd: Import NTP sources (diff)
downloadrtems-net-services-175fdbf7e8e5f493116785bde0c6845df0d1cbff.tar.bz2
sebhbsd: Adapt source
Add the tweaks necessary for this to compile on lwIP.
-rw-r--r--sebhbsd/freebsd/contrib/ntp/include/config.h11
-rw-r--r--sebhbsd/freebsd/contrib/ntp/include/ntp_net.h3
-rw-r--r--sebhbsd/freebsd/contrib/ntp/ntpd/ntp_io.c8
3 files changed, 22 insertions, 0 deletions
diff --git a/sebhbsd/freebsd/contrib/ntp/include/config.h b/sebhbsd/freebsd/contrib/ntp/include/config.h
index 0cd7aba..d0251a1 100644
--- a/sebhbsd/freebsd/contrib/ntp/include/config.h
+++ b/sebhbsd/freebsd/contrib/ntp/include/config.h
@@ -339,7 +339,9 @@
#define GETSOCKNAME_SOCKLEN_TYPE socklen_t
/* Do we have a routing socket (rt_msghdr or rtattr)? */
+#ifndef __rtems__
#define HAS_ROUTING_SOCKET 1
+#endif
/* via __adjtimex */
/* #undef HAVE_ADJTIMEX */
@@ -1153,8 +1155,10 @@
/* Do we have the TIO serial stuff? */
/* #undef HAVE_TIO_SERIAL_STUFF */
+#ifndef __rtems__
/* Are TrustedBSD MAC policy privileges available? */
#define HAVE_TRUSTEDBSD_MAC 1
+#endif
/* Define to 1 if the system has the type `uint16_t'. */
#define HAVE_UINT16_T 1
@@ -1468,6 +1472,9 @@
/* wildcard socket needs REUSEADDR to bind interface addresses */
/* #undef OS_NEEDS_REUSEADDR_FOR_IFADDRBIND */
+#ifdef __rtems__
+#define OS_NEEDS_REUSEADDR_FOR_IFADDRBIND
+#endif
/* Do we need to override the system's idea of HZ? */
#define OVERRIDE_HZ 1
@@ -1680,7 +1687,11 @@ typedef unsigned int uintptr_t;
/* configure --enable-ipv6 */
#define WANT_IPV6 1
+#ifdef __rtems__
+#include <machine/endian.h>
+#else
#include <machine/_endian.h>
+#endif
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/sebhbsd/freebsd/contrib/ntp/include/ntp_net.h b/sebhbsd/freebsd/contrib/ntp/include/ntp_net.h
index 0577402..3a7a9a1 100644
--- a/sebhbsd/freebsd/contrib/ntp/include/ntp_net.h
+++ b/sebhbsd/freebsd/contrib/ntp/include/ntp_net.h
@@ -29,6 +29,9 @@ typedef union {
struct sockaddr sa;
struct sockaddr_in sa4;
struct sockaddr_in6 sa6;
+#ifdef __rtems__
+ struct sockaddr_storage storage;
+#endif
} sockaddr_u;
/*
diff --git a/sebhbsd/freebsd/contrib/ntp/ntpd/ntp_io.c b/sebhbsd/freebsd/contrib/ntp/ntpd/ntp_io.c
index f572255..eea40ed 100644
--- a/sebhbsd/freebsd/contrib/ntp/ntpd/ntp_io.c
+++ b/sebhbsd/freebsd/contrib/ntp/ntpd/ntp_io.c
@@ -1115,7 +1115,11 @@ create_wildcards(
wildif->flags = INT_UP | INT_WILDCARD;
wildif->ignore_packets = (ACTION_DROP == action);
+#ifdef __rtems__
+ wildif->fd = open_socket(&wildif->sin, 0, 0, wildif);
+#else
wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);
+#endif
if (wildif->fd != INVALID_SOCKET) {
wildipv6 = wildif;
@@ -1166,7 +1170,11 @@ create_wildcards(
SET_ADDR4N(&wildif->bcast, INADDR_ANY);
SET_PORT(&wildif->bcast, port);
#endif /* MCAST */
+#ifdef __rtems__
+ wildif->fd = open_socket(&wildif->sin, 0, 0, wildif);
+#else
wildif->fd = open_socket(&wildif->sin, 0, 1, wildif);
+#endif
if (wildif->fd != INVALID_SOCKET) {
wildipv4 = wildif;