summaryrefslogtreecommitdiffstats
path: root/lib/netrom_ntop.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 14:18:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 14:18:53 +0000
commita0e0018c9a7ef5ce7f6d2c3ae16aecbbd16a8f67 (patch)
tree8feaf1a1932871b139b3b30be4c09c66489918be /lib/netrom_ntop.c
parentInitial commit. (diff)
downloadiproute2-upstream/6.1.0.tar.xz
iproute2-upstream/6.1.0.zip
Adding upstream version 6.1.0.upstream/6.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--lib/netrom_ntop.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/netrom_ntop.c b/lib/netrom_ntop.c
new file mode 100644
index 0000000..3dd6cb0
--- /dev/null
+++ b/lib/netrom_ntop.c
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <sys/socket.h>
+#include <errno.h>
+#include <linux/ax25.h>
+
+#include "utils.h"
+
+const char *ax25_ntop1(const ax25_address *src, char *dst, socklen_t size);
+
+const char *netrom_ntop(int af, const void *addr, char *buf, socklen_t buflen)
+{
+ switch (af) {
+ case AF_NETROM:
+ errno = 0;
+ return ax25_ntop1((ax25_address *)addr, buf, buflen);
+
+ default:
+ errno = EAFNOSUPPORT;
+ }
+
+ return NULL;
+}