unix.c (78309) | unix.c (78314) |
---|---|
1/*- 2 * Copyright (c) 1983, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)unix.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = | 1/*- 2 * Copyright (c) 1983, 1988, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)unix.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/usr.bin/netstat/unix.c 78309 2001-06-15 23:07:59Z assar $"; | 39 "$FreeBSD: head/usr.bin/netstat/unix.c 78314 2001-06-15 23:35:13Z assar $"; |
40#endif /* not lint */ 41 42/* 43 * Display protocol blocks in the unix domain. 44 */ 45#include <sys/param.h> 46#include <sys/queue.h> 47#include <sys/protosw.h> --- 9 unchanged lines hidden (view full) --- 57#include <errno.h> 58#include <err.h> 59#include <stddef.h> 60#include <stdio.h> 61#include <stdlib.h> 62#include <kvm.h> 63#include "netstat.h" 64 | 40#endif /* not lint */ 41 42/* 43 * Display protocol blocks in the unix domain. 44 */ 45#include <sys/param.h> 46#include <sys/queue.h> 47#include <sys/protosw.h> --- 9 unchanged lines hidden (view full) --- 57#include <errno.h> 58#include <err.h> 59#include <stddef.h> 60#include <stdio.h> 61#include <stdlib.h> 62#include <kvm.h> 63#include "netstat.h" 64 |
65static void unixdomainpr __P((struct xunpcb *, struct xsocket *)); | 65static void unixdomainpr (struct xunpcb *, struct xsocket *); |
66 67static const char *const socktype[] = 68 { "#0", "stream", "dgram", "raw", "rdm", "seqpacket" }; 69 70void | 66 67static const char *const socktype[] = 68 { "#0", "stream", "dgram", "raw", "rdm", "seqpacket" }; 69 70void |
71unixpr() | 71unixpr(void) |
72{ 73 char *buf; 74 int type; 75 size_t len; 76 struct xsocket *so; 77 struct xunpgen *xug, *oxug; 78 struct xunpcb *xunp; 79 char mibvar[sizeof "net.local.seqpacket.pcblist"]; --- 41 unchanged lines hidden (view full) --- 121 socktype[type]); 122 } 123 } 124 free(buf); 125 } 126} 127 128static void | 72{ 73 char *buf; 74 int type; 75 size_t len; 76 struct xsocket *so; 77 struct xunpgen *xug, *oxug; 78 struct xunpcb *xunp; 79 char mibvar[sizeof "net.local.seqpacket.pcblist"]; --- 41 unchanged lines hidden (view full) --- 121 socktype[type]); 122 } 123 } 124 free(buf); 125 } 126} 127 128static void |
129unixdomainpr(xunp, so) 130 struct xunpcb *xunp; 131 struct xsocket *so; | 129unixdomainpr(struct xunpcb *xunp, struct xsocket *so) |
132{ 133 struct unpcb *unp; 134 struct sockaddr_un *sa; 135 static int first = 1; 136 137 unp = &xunp->xu_unp; 138 if (unp->unp_addr) 139 sa = &xunp->xu_addr; --- 22 unchanged lines hidden --- | 130{ 131 struct unpcb *unp; 132 struct sockaddr_un *sa; 133 static int first = 1; 134 135 unp = &xunp->xu_unp; 136 if (unp->unp_addr) 137 sa = &xunp->xu_addr; --- 22 unchanged lines hidden --- |