AX.25 patches for strace
Subsystems (2)
PATCH 1/1 AX.25 patches for strace
So far strace is lacking support for AX.25 making debugging of AX.25 software harder for no good reason. Below the first cut of a patch to add AX.25 support. The patch is against Sourceforge CVS. Please test.
73 de DL5RB op Ralf
--
Loc. JN47BS / CQ 14 / ITU 28 / DOK A21
Index: configure.ac
===================================================================
RCS file: /cvsroot/strace/strace/configure.ac,v
retrieving revision 1.41
configure.ac +1 -2
@@ -193,8 +193,7 @@ AC_CHECK_FUNCS(sigaction strerror strsignal pread sys_siglist _sys_siglist getdents mctl prctl sendmsg inet_ntop if_indextoname) AC_CHECK_HEADERS([sys/reg.h sys/filio.h sys/acl.h sys/asynch.h sys/door.h stropts.h sys/conf.h sys/stream.h sys/tihdr.h sys/tiuser.h sys/sysconfig.h ioctls.h sys/ioctl.h sys/ptrace.h termio.h linux/ptrace.h asm/reg.h sys/uio.h sys/aio.h poll.h sys/poll.h sys/vfs.h asm/sysmips.h linux/utsname.h sys/nscsys.h mqueue.h sys/epoll.h], [], []) -AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h], - [], [], [#include <linux/socket.h>]) +AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h netax25/ax25.h], [], [], [#include <linux/socket.h>]) AC_CHECK_HEADERS([asm/sigcontext.h], [], [], [#include <signal.h>]) AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include <netinet/in.h>])
Index: defs.h
===================================================================
RCS file: /cvsroot/strace/strace/defs.h,v
retrieving revision 1.55
defs.h +1 -0
@@ -459,6 +459,7 @@ extern void call_summary P((FILE *)); extern void printtv32 P((struct tcb*, long)); extern void tprint_iov P((struct tcb *, int, long)); +extern void tprint_ax25_address P((char *ax));#ifdef LINUX extern int internal_clone P((struct tcb *));
Index: net.c
===================================================================
RCS file: /cvsroot/strace/strace/net.c,v
retrieving revision 1.46
net.c +113 -4
189 lines not on this page · raw message
Index: sock.c
===================================================================
RCS file: /cvsroot/strace/strace/sock.c,v
retrieving revision 1.10
sock.c +12 -6
@@ -184,12 +184,18 @@tprintf ("}" );break ;case SIOCGIFHWADDR : -/* XXX Are there other hardware addresses -than 6-byte MACs? */ - bytes = (unsigned char *) &ifr.ifr_hwaddr.sa_data; -tprintf ("ifr_hwaddr=%02x:%02x:%02x:%02x:%02x:%02x" , - bytes[0 ], bytes[1 ], bytes[2 ], - bytes[3 ], bytes[4 ], bytes[5 ]); +switch (ifr.ifr_hwaddr.sa_family) { +case AF_AX25 : +tprintf ("ifr_hwaddr=" ); +tprint_ax25_address ((char *) &ifr.ifr_hwaddr.sa_data); +break ; +default : + bytes = (unsigned char *) &ifr.ifr_hwaddr.sa_data; +tprintf ("ifr_hwaddr=%02x:%02x:%02x:%02x:%02x:%02x" , + bytes[0 ], bytes[1 ], bytes[2 ], + bytes[3 ], bytes[4 ], bytes[5 ]); +break ; + }break ;case SIOCGIFFLAGS :tprintf ("ifr_flags=" );