lib/netrom_ntop.c
raw| 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | |
| 3 | #include <sys/socket.h> |
| 4 | #include <errno.h> |
| 5 | #include <linux/ax25.h> |
| 6 | |
| 7 | #include "utils.h" |
| 8 | |
| 9 | const char *ax25_ntop1(const ax25_address *src, char *dst, socklen_t size); |
| 10 | |
| 11 | const char *netrom_ntop(int af, const void *addr, char *buf, socklen_t buflen) |
| 12 | { |
| 13 | switch (af) { |
| 14 | case AF_NETROM: |
| 15 | errno = 0; |
| 16 | return ax25_ntop1((ax25_address *)addr, buf, buflen); |
| 17 | |
| 18 | default: |
| 19 | errno = EAFNOSUPPORT; |
| 20 | } |
| 21 | |
| 22 | return NULL; |
| 23 | } |