aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/kdump
diff options
context:
space:
mode:
authorCraig Rodrigues <rodrigc@FreeBSD.org>2007-01-04 04:46:59 +0000
committerCraig Rodrigues <rodrigc@FreeBSD.org>2007-01-04 04:46:59 +0000
commit8bc31d836f87d86aa14b12a6e21fbe6f740d61dc (patch)
treed49bb3c32d244522e3596aeda077b40b326e49f6 /usr.bin/kdump
parentd18b5b8ca172782fd9bcab26d21432cff10e81d2 (diff)
downloadsrc-8bc31d836f87d86aa14b12a6e21fbe6f740d61dc.tar.gz
src-8bc31d836f87d86aa14b12a6e21fbe6f740d61dc.zip
Add sockipprotoname() function. Decode the third parameter (protocol)
of a socket() call with sockipprotoname() if the first parameter (domain) is PF_INET or PF_INET6. Old parsing behavior before this change: ping6 CALL socket(PF_INET6,SOCK_RAW,0x3a) New behavior after this change: ping6 CALL socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6)
Notes
Notes: svn path=/head/; revision=165758
Diffstat (limited to 'usr.bin/kdump')
-rw-r--r--usr.bin/kdump/kdump.c12
-rw-r--r--usr.bin/kdump/kdump_subr.h1
-rw-r--r--usr.bin/kdump/mksubr2
3 files changed, 14 insertions, 1 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index e4af82a653a5..3480997a748a 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -58,6 +58,7 @@ extern int errno;
#include <sys/ktrace.h>
#include <sys/ioctl.h>
#include <sys/ptrace.h>
+#include <sys/socket.h>
#include <err.h>
#include <locale.h>
#include <stdio.h>
@@ -528,14 +529,23 @@ ktrsyscall(struct ktr_syscall *ktr)
ip++;
narg-=2;
} else if (ktr->ktr_code == SYS_socket) {
+ int sockdomain;
(void)putchar('(');
- sockdomainname((int)*ip);
+ sockdomain=(int)*ip;
+ sockdomainname(sockdomain);
ip++;
narg--;
(void)putchar(',');
socktypename((int)*ip);
ip++;
narg--;
+ if (sockdomain == PF_INET ||
+ sockdomain == PF_INET6) {
+ (void)putchar(',');
+ sockipprotoname((int)*ip);
+ ip++;
+ narg--;
+ }
c = ',';
} else if (ktr->ktr_code == SYS_setsockopt ||
ktr->ktr_code == SYS_getsockopt) {
diff --git a/usr.bin/kdump/kdump_subr.h b/usr.bin/kdump/kdump_subr.h
index f69921d8c0de..6e336ddbc22a 100644
--- a/usr.bin/kdump/kdump_subr.h
+++ b/usr.bin/kdump/kdump_subr.h
@@ -21,6 +21,7 @@ void flockname (int);
void sockoptname (int);
void sockoptlevelname (int, int);
void sockdomainname (int);
+void sockipprotoname (int);
void socktypename (int);
void thrcreateflagsname (int);
void mlockallname (int);
diff --git a/usr.bin/kdump/mksubr b/usr.bin/kdump/mksubr
index 78cbeabc3d68..4231aab48be2 100644
--- a/usr.bin/kdump/mksubr
+++ b/usr.bin/kdump/mksubr
@@ -138,6 +138,7 @@ cat <<_EOF_
#define _KERNEL
#include <sys/socket.h>
#undef _KERNEL
+#include <netinet/in.h>
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/resource.h>
@@ -335,6 +336,7 @@ auto_switch_type "lio_listioname" "LIO_(NO)?WAIT[[:space:]]+[0-9]+" "aio.h"
auto_switch_type "minheritname" "INHERIT_[A-Z]+[[:space:]]+[0-9]+" "sys/mman.h"
auto_switch_type "quotactlname" "Q_[A-Z]+[[:space:]]+0x[0-9]+" "ufs/ufs/quota.h"
auto_if_type "sockdomainname" "PF_[[:alnum:]]+[[:space:]]+" "sys/socket.h"
+auto_if_type "sockipprotoname" "IPPROTO_[[:alnum:]]+[[:space:]]+" "netinet/in.h"
auto_switch_type "sockoptname" "SO_[A-Z]+[[:space:]]+0x[0-9]+" "sys/socket.h"
auto_switch_type "socktypename" "SOCK_[A-Z]+[[:space:]]+[1-9]+[0-9]*" "sys/socket.h"