Commit graph

8 commits

Author SHA1 Message Date
Craig Rodrigues 8bc31d836f 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)
2007-01-04 04:46:59 +00:00
Craig Rodrigues d18b5b8ca1 Generate sockdomainname() function with auto_if_type() instead
of auto_or_type.

The old parsing code would incorrectly decode a socket() call in the
ping6 program as:
  CALL  socket(PF_PUP|PF_ECMA|PF_APPLETALK|PF_COIP|PF_SIP,SOCK_DGRAM,0)

The new parsing code decodes the same socket() call as:
  CALL  socket(PF_INET6,SOCK_DGRAM,0)
2007-01-04 04:28:17 +00:00
Craig Rodrigues 4c8dc49a4a Add auto_if_type() function, which is similar to auto_switch_type().
However, auto_if_type() uses if/else statements in C instead
of a single switch statement, when mapping an integer value to
a #define.  For certain cases where multiple #define constants
alias to a single integer value, auto_if_type() makes things easier
to parse than auto_switch_type().
2007-01-04 04:18:03 +00:00
Craig Rodrigues 7e3d8842da The second argument (type) to socket(2) is an enum, not a bitmask, so parse
it as an enum.

If an SCTP SOCK_SEQPACKET socket was opened, kdump would display this
wrong output:
 socket(PF_INET,SOCK_STREAM|SOCK_RDM|SOCK_SEQPACKET,0x84)

instead of this correct output:
 socket(PF_INET,SOCK_SEQPACKET,0x84)

MFC after:	2 weeks
2006-12-22 05:07:21 +00:00
Maxim Konovalov f45b405f7a o optname, the third {set,get}sockopt(2) argument, is an enum, not a bitmap.
Treat it accordingly.

PR:		bin/101642
MFC after:	3 weeks
2006-09-18 13:49:57 +00:00
Konstantin Belousov 09e7364ee9 Remove slipped in spaces.
Pointed out by:	maxim
Approved by:	pjd (mentor)
2006-07-12 12:42:47 +00:00
Konstantin Belousov 1a8b0c1571 Check that the signal number is in range.
Submitted by:	Michiel Boland <michiel boland org>
MFC after:	1 week
Approved by:	pjd (mentor)
2006-07-12 09:13:33 +00:00
Alexander Leidinger 98a68a586f Change kdump to print more useful information, i.e. it changes from
32229 telnet   CALL  mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0)
 32229 telnet   CALL  open(0x2807bc28,0,0x1b6)
 32229 telnet   CALL  socket(0x2,0x2,0)
to
 32229 telnet   CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0)
 32229 telnet   CALL  open(0x2807bc28,O_RDONLY,<unused>0x1b6)
 32229 telnet   CALL  socket(PF_INET,SOCK_DGRAM,0)

David wanted to implement the suggestions which came up at the review from
arch@ too, but real life rejected this proposal. So I commit what we already
got and let another volunteer pick the remaining work from the ideas list.

Submitted by:	"David Kirchner" <dpk@dpk.net>
Suggested by:	FreeBSD ideas list page
Reviewed by:	arch
2006-05-20 14:27:22 +00:00