diff options
| author | Steve Dickson <steved@redhat.com> | 2009-12-22 13:51:40 -0500 |
|---|---|---|
| committer | Steve Dickson <steved@redhat.com> | 2009-12-22 13:51:40 -0500 |
| commit | 2549149b4588b19c2cbca5b38c7876febb3e0e57 (patch) | |
| tree | 9dc224442043641fe6b784fe3c45a005bd8348a3 | |
| parent | cb79a3f04253b9cbda91241abadfc59ad8af38cf (diff) | |
Added hexdump()
Signed-off-by: Steve Dickson <steved@redhat.com>
| -rw-r--r-- | sunrpc/auth.stp | 10 | ||||
| -rw-r--r-- | tapset/svc_cred.stp | 57 |
2 files changed, 62 insertions, 5 deletions
diff --git a/sunrpc/auth.stp b/sunrpc/auth.stp index e5330af..4f08f57 100644 --- a/sunrpc/auth.stp +++ b/sunrpc/auth.stp @@ -1,8 +1,7 @@ global rqstp probe module("sunrpc").function("svcauth_unix_accept") { - printf("svcauth_unix_accept: rqstp %p authp %p\n", - $rqstp, $authp); + printf("svcauth_unix_accept: rqstp %s\n", svc_rqst($rqstp)); rqstp = $rqstp; } probe module("sunrpc").function("svcauth_unix_accept").return @@ -15,8 +14,7 @@ probe module("sunrpc").function("svcauth_unix_accept").return } probe module("auth_rpcgss").function("svcauth_gss_accept") { - printf("svcauth_gss_accept: rqstp %p authp %p\n", - $rqstp, $authp); + printf("svcauth_gss_accept: rqstp %s\n", svc_rqst($rqstp)); rqstp = $rqstp; } probe module("auth_rpcgss").function("svcauth_gss_accept").return @@ -27,6 +25,10 @@ probe module("auth_rpcgss").function("svcauth_gss_accept").return printf("svcauth_gss_accept: %s\n", svcerror($return)); } } +probe module("auth_rpcgss").function("gss_verify_mic").return +{ + printf(" gss_verify_mic: %s\n", svcerror($return)); +} probe begin { log("starting sunrpc auth probe") } probe end { log("ending sunrpc auth probe") } diff --git a/tapset/svc_cred.stp b/tapset/svc_cred.stp index 35e7d4d..a9e698b 100644 --- a/tapset/svc_cred.stp +++ b/tapset/svc_cred.stp @@ -1,16 +1,50 @@ %{ +#include <linux/types.h> + #include <linux/sunrpc/svc.h> #include <linux/sunrpc/cache.h> + +static void hexdump(char *inbuf, const unsigned char *buf, unsigned short len ) +{ + static char str[80]; + char octet[10]; + int ofs, i, l, cc=0; + + for (ofs = 0; ofs < len; ofs += 16) { + sprintf( str, "%03d: ", ofs ); + + for (i = 0; i < 16; i++) { + if ((i + ofs) < len) + sprintf( octet, "%02x ", buf[ofs + i] ); + else + strcpy( octet, " " ); + + strcat( str, octet ); + } + strcat( str, " " ); + l = strlen( str ); + + for (i = 0; (i < 16) && ((i + ofs) < len); i++) + str[l++] = isprint( buf[ofs + i] ) ? buf[ofs + i] : '.'; + + str[l] = '\0'; + sprintf(inbuf+cc, "%s\n", str ); + cc = strlen(inbuf); + } +} + %} function svc_creds:string(_rqstp:long) %{ struct svc_rqst *rqstp = (struct svc_rqst *)(long) kread(&(THIS->_rqstp)); + struct kvec *rq_vec; char buf[MAXSTRINGLEN]; int cc=0; - sprintf(buf+cc, "cr_uid %d cr_gid %d", rqstp->rq_cred.cr_uid, + rq_vec = &rqstp->rq_arg.head[0]; + sprintf(buf+cc, "cr_uid %d cr_gid %d", rqstp->rq_cred.cr_uid, rqstp->rq_cred.cr_gid); cc = strlen(buf); @@ -18,4 +52,25 @@ function svc_creds:string(_rqstp:long) CATCH_DEREF_FAULT(); %} +function svc_rqst:string(_rqstp:long) +%{ + struct svc_rqst *rqstp = + (struct svc_rqst *)(long) kread(&(THIS->_rqstp)); + struct kvec *iov; + char buf[MAXSTRINGLEN]; + int cc=0; + __be32 flavor; + + iov = &rqstp->rq_arg.head[0]; + memcpy(&flavor, iov->iov_base, sizeof(flavor)); + sprintf(buf+cc, "iov_len %ld", iov->iov_len); + cc = strlen(buf); + /* + hexdump(buf+cc, iov->iov_base+sizeof(__be32), 64); + */ + + snprintf(THIS->__retvalue, MAXSTRINGLEN, "%s", buf); + + CATCH_DEREF_FAULT(); +%} |
