112 lines
3.6 KiB
Diff
112 lines
3.6 KiB
Diff
From cfb86ab4e94f0d453dcc7c604a14df47ef9b5739 Mon Sep 17 00:00:00 2001
|
|
From: Eugene Syromyatnikov <evgsyr@gmail.com>
|
|
Date: Mon, 27 Aug 2018 06:22:52 +0200
|
|
Subject: [PATCH 068/293] net: add support for AX.25 protocols and socket
|
|
option names decoding
|
|
|
|
* xlat/ax25_protocols.in: New file.
|
|
* xlat/sock_ax25_options.in: Likewise.
|
|
* net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h".
|
|
* (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using
|
|
ax25_protocols xlat.
|
|
(print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name
|
|
using sock_ax25_options xlat.
|
|
---
|
|
net.c | 11 +++++++++++
|
|
xlat/ax25_protocols.in | 17 +++++++++++++++++
|
|
xlat/sock_ax25_options.in | 15 +++++++++++++++
|
|
3 files changed, 43 insertions(+)
|
|
create mode 100644 xlat/ax25_protocols.in
|
|
create mode 100644 xlat/sock_ax25_options.in
|
|
|
|
diff --git a/net.c b/net.c
|
|
index 58296b9..f791a92 100644
|
|
--- a/net.c
|
|
+++ b/net.c
|
|
@@ -88,6 +88,7 @@
|
|
# include "xlat/addrfams.h"
|
|
# include "xlat/ethernet_protocols.h"
|
|
#undef XLAT_MACROS_ONLY
|
|
+#include "xlat/ax25_protocols.h"
|
|
#include "xlat/irda_protocols.h"
|
|
#include "xlat/can_protocols.h"
|
|
#include "xlat/bt_protocols.h"
|
|
@@ -145,6 +146,12 @@ SYS_FUNC(socket)
|
|
printxval_search(inet_protocols, tcp->u_arg[2], "IPPROTO_???");
|
|
break;
|
|
|
|
+ case AF_AX25:
|
|
+ /* Those are not available in public headers. */
|
|
+ printxval_searchn_ex(ARRSZ_PAIR(ax25_protocols), tcp->u_arg[2],
|
|
+ "AX25_P_???", XLAT_STYLE_VERBOSE);
|
|
+ break;
|
|
+
|
|
case AF_NETLINK:
|
|
printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???");
|
|
break;
|
|
@@ -445,6 +452,7 @@ SYS_FUNC(socketpair)
|
|
#include "xlat/getsock_ipv6_options.h"
|
|
#include "xlat/setsock_ipv6_options.h"
|
|
#include "xlat/sock_ipx_options.h"
|
|
+#include "xlat/sock_ax25_options.h"
|
|
#include "xlat/sock_netlink_options.h"
|
|
#include "xlat/sock_packet_options.h"
|
|
#include "xlat/sock_raw_options.h"
|
|
@@ -496,6 +504,9 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level,
|
|
case SOL_IPX:
|
|
printxval(sock_ipx_options, name, "IPX_???");
|
|
break;
|
|
+ case SOL_AX25:
|
|
+ printxval_search(sock_ax25_options, name, "AX25_???");
|
|
+ break;
|
|
case SOL_PACKET:
|
|
printxval(sock_packet_options, name, "PACKET_???");
|
|
break;
|
|
diff --git a/xlat/ax25_protocols.in b/xlat/ax25_protocols.in
|
|
new file mode 100644
|
|
index 0000000..89ced43
|
|
--- /dev/null
|
|
+++ b/xlat/ax25_protocols.in
|
|
@@ -0,0 +1,17 @@
|
|
+/* sorted */
|
|
+/* Those are pulled from include/net/ax25.h, they should be part of UAPI */
|
|
+AX25_P_ROSE 0x01
|
|
+AX25_P_VJCOMP 0x06 /* Compressed TCP/IP packet */
|
|
+ /* Van Jacobsen (RFC 1144) */
|
|
+AX25_P_VJUNCOMP 0x07 /* Uncompressed TCP/IP packet */
|
|
+ /* Van Jacobsen (RFC 1144) */
|
|
+AX25_P_SEGMENT 0x08 /* Segmentation fragment */
|
|
+AX25_P_TEXNET 0xc3 /* TEXTNET datagram protocol */
|
|
+AX25_P_LQ 0xc4 /* Link Quality Protocol */
|
|
+AX25_P_ATALK 0xca /* Appletalk */
|
|
+AX25_P_ATALK_ARP 0xcb /* Appletalk ARP */
|
|
+AX25_P_IP 0xcc /* ARPA Internet Protocol */
|
|
+AX25_P_ARP 0xcd /* ARPA Address Resolution */
|
|
+AX25_P_FLEXNET 0xce /* FlexNet */
|
|
+AX25_P_NETROM 0xcf /* NET/ROM */
|
|
+AX25_P_TEXT 0xf0 /* No layer 3 protocol impl. */
|
|
diff --git a/xlat/sock_ax25_options.in b/xlat/sock_ax25_options.in
|
|
new file mode 100644
|
|
index 0000000..4b6bed5
|
|
--- /dev/null
|
|
+++ b/xlat/sock_ax25_options.in
|
|
@@ -0,0 +1,15 @@
|
|
+/* sorted */
|
|
+AX25_WINDOW 1
|
|
+AX25_T1 2
|
|
+AX25_N2 3
|
|
+AX25_T3 4
|
|
+AX25_T2 5
|
|
+AX25_BACKOFF 6
|
|
+AX25_EXTSEQ 7
|
|
+AX25_PIDINCL 8
|
|
+AX25_IDLE 9
|
|
+AX25_PACLEN 10
|
|
+AX25_IAMDIGI 12
|
|
+
|
|
+/* 13, 25, or 16409, depending on arch */
|
|
+SO_BINDTODEVICE
|
|
--
|
|
1.7.12.4
|
|
|