2 * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
3 * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
4 * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
5 * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
43 tprintf("%ld, ", tcp->u_arg[0]);
46 tprintf("%#lx", tcp->u_arg[1]);
48 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
49 tprintf(", %lu", tcp->u_arg[2]);
59 tprintf("%ld, ", tcp->u_arg[0]);
60 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
61 tprintf(", %lu", tcp->u_arg[2]);
67 tprint_iov(tcp, len, addr)
81 if ((iov = (struct iovec *) malloc(len * sizeof *iov)) == NULL) {
82 fprintf(stderr, "No memory");
85 if (umoven(tcp, (int) addr,
86 len * sizeof *iov, (char *) iov) < 0) {
87 tprintf("%#lx", tcp->u_arg[1]);
90 for (i = 0; i < len; i++) {
94 printstr(tcp, (long) iov[i].iov_base,
96 tprintf(", %lu}", (unsigned long)iov[i].iov_len);
108 tprintf("%ld, ", tcp->u_arg[0]);
112 tcp->u_arg[1], tcp->u_arg[2]);
115 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
116 tprintf(", %lu", tcp->u_arg[2]);
126 tprintf("%ld, ", tcp->u_arg[0]);
127 tprint_iov(tcp, tcp->u_arg[2], tcp->u_arg[1]);
128 tprintf(", %lu", tcp->u_arg[2]);
133 #if defined(SVR4) || defined(FREEBSD)
140 tprintf("%ld, ", tcp->u_arg[0]);
143 tprintf("%#lx", tcp->u_arg[1]);
145 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
147 /* off_t is signed int */
148 tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
151 tprintf(", %lu, %llu", tcp->u_arg[2],
152 (((unsigned long long) tcp->u_arg[4]) << 32
155 tprintf(", %lu, %llu", tcp->u_arg[2],
156 (((off_t) tcp->u_arg[3]) << 32) + tcp->u_arg[4]);
168 tprintf("%ld, ", tcp->u_arg[0]);
169 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
171 /* off_t is signed int */
172 tprintf(", %lu, %ld", tcp->u_arg[2], tcp->u_arg[3]);
175 tprintf(", %lu, %llu", tcp->u_arg[2],
176 (((unsigned long long) tcp->u_arg[4]) << 32
179 tprintf(", %lu, %llu", tcp->u_arg[2],
180 (((off_t) tcp->u_arg[3]) << 32) + tcp->u_arg[4]);
186 #endif /* SVR4 || FREEBSD */
189 #include <sys/types.h>
190 #include <sys/socket.h>
197 tprintf("%ld, %ld, %llu, %lu", tcp->u_arg[0], tcp->u_arg[1],
198 (((unsigned long long) tcp->u_arg[3]) << 32 |
199 tcp->u_arg[2]), tcp->u_arg[4]);
208 if (umove(tcp, tcp->u_arg[5], &hdtr) < 0)
209 tprintf(", %#lx", tcp->u_arg[5]);
212 tprint_iov(tcp, hdtr.hdr_cnt, hdtr.headers);
213 tprintf(", %u, ", hdtr.hdr_cnt);
214 tprint_iov(tcp, hdtr.trl_cnt, hdtr.trailers);
215 tprintf(", %u }", hdtr.hdr_cnt);
220 else if (umove(tcp, tcp->u_arg[6], &offset) < 0)
221 tprintf(", %#lx", tcp->u_arg[6]);
223 tprintf(", [%llu]", offset);
224 tprintf(", %lu", tcp->u_arg[7]);
236 tprintf("%ld, ", tcp->u_arg[0]);
239 tprintf("%#lx", tcp->u_arg[1]);
241 printstr(tcp, tcp->u_arg[1], tcp->u_rval);
242 tprintf(", %lu, %llu", tcp->u_arg[2],
243 *(unsigned long long *)&tcp->u_arg[3]);
253 tprintf("%ld, ", tcp->u_arg[0]);
254 printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
255 tprintf(", %lu, %llu", tcp->u_arg[2],
256 *(unsigned long long *)&tcp->u_arg[3]);
268 tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
271 else if (umove(tcp, tcp->u_arg[2], &offset) < 0)
272 tprintf("%#lx", tcp->u_arg[2]);
274 tprintf("[%lu]", offset);
275 tprintf(", %lu", tcp->u_arg[3]);
289 tprintf("%ld, ", tcp->u_arg[0]);
290 symbol = ioctl_lookup(tcp->u_arg[1]);
292 tprintf("%s", symbol);
294 tprintf("%#lx", tcp->u_arg[1]);
295 ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
298 if (ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]) == 0)
299 tprintf(", %#lx", tcp->u_arg[2]);