aboutsummaryrefslogtreecommitdiff
path: root/lib/libstand
diff options
context:
space:
mode:
authorMike Barcroft <mike@FreeBSD.org>2002-02-18 20:35:27 +0000
committerMike Barcroft <mike@FreeBSD.org>2002-02-18 20:35:27 +0000
commitfd8e4ebc8c18caec3eefac6527831f9ee6a92959 (patch)
tree970c36894ee638248ec810bd7570ac8aabb5eaf5 /lib/libstand
parent3e1ce344baebe1f56863d29d656549c93a464ded (diff)
Notes
Diffstat (limited to 'lib/libstand')
-rw-r--r--lib/libstand/net.c2
-rw-r--r--lib/libstand/stand.h13
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/libstand/net.c b/lib/libstand/net.c
index 6ac0de818984d..06d9dbf56baa9 100644
--- a/lib/libstand/net.c
+++ b/lib/libstand/net.c
@@ -231,7 +231,7 @@ intoa(addr)
register int n;
static char buf[17]; /* strlen(".255.255.255.255") + 1 */
- NTOHL(addr);
+ addr = ntohl(addr);
cp = &buf[sizeof buf];
*--cp = '\0';
diff --git a/lib/libstand/stand.h b/lib/libstand/stand.h
index b9e31ad1626c1..e3570f9a9ee4d 100644
--- a/lib/libstand/stand.h
+++ b/lib/libstand/stand.h
@@ -371,6 +371,19 @@ extern void panic(const char *, ...) __dead2;
extern struct fs_ops *file_system[];
extern struct devsw *devsw[];
+/*
+ * Expose byteorder(3) functions.
+ */
+#define htonl(x) __htonl(x)
+#define htons(x) __htons(x)
+#define ntohl(x) __ntohl(x)
+#define ntohs(x) __ntohs(x)
+
+extern uint32_t htonl(uint32_t);
+extern uint16_t htons(uint16_t);
+extern uint32_t ntohl(uint32_t);
+extern uint16_t ntohs(uint16_t);
+
#if 0
static inline void *