2 * lsof.h - common header file for lsof
7 * Copyright 1994 Purdue Research Foundation, West Lafayette, Indiana
8 * 47907. All rights reserved.
10 * Written by Victor A. Abell
12 * This software is not subject to any license of the American Telephone
13 * and Telegraph Company or the Regents of the University of California.
15 * Permission is granted to anyone to use this software for any purpose on
16 * any computer system, and to alter it and redistribute it freely, subject
17 * to the following restrictions:
19 * 1. Neither the authors nor Purdue University are responsible for any
20 * consequences of the use of this software.
22 * 2. The origin of this software must not be misrepresented, either by
23 * explicit claim or by omission. Credit to the authors and Purdue
24 * University must appear in documentation and sources.
26 * 3. Altered versions must be plainly marked as such, and must not be
27 * misrepresented as being the original software.
29 * 4. This notice may not be removed or altered.
34 * $Id: lsof.h,v 1.66 2013/01/02 17:14:59 abe Exp $
43 # if !defined(FSV_DEFAULT)
45 # endif /* !defined(FSV_DEFAULT) */
47 #include "lsof_fields.h"
52 # if defined(HASSETLOCALE)
54 # endif /* defined(HASSETLOCALE) */
65 * Definitions and structures that may be needed by dlsof.h
68 # if !defined(INODETYPE)
69 #define INODETYPE unsigned long /* node number storage type */
70 #define INODEPSPEC "l" /* node number printf specification
72 # endif /* !defined(INODETYPE) */
75 dev_t rdev; /* device */
76 INODETYPE inode; /* inode number */
77 char *name; /* name */
78 int v; /* has been verified
79 * (when DCUnsafe == 1) */
84 * FILE_FLAG column names
88 #define FF_APPEND "AP"
89 #define FF_ASYNC "ASYN"
90 #define FF_BLKANDSET "BAS"
91 #define FF_BLKINUSE "BKIU"
92 #define FF_BLKSEEK "BSK"
94 #define FF_CLONE "CLON"
95 #define FF_CLREAD "CLRD"
96 #define FF_COPYAVOID "CA"
98 #define FF_DATAFLUSH "DFLU"
100 #define FF_DEFERIND "DFI"
101 #define FF_DELAY "DLY"
102 #define FF_DIRECT "DIR"
103 #define FF_DIRECTORY "DTY"
104 #define FF_DOCLONE "DOCL"
105 #define FF_DSYNC "DSYN"
106 #define FF_EVTONLY "EVO"
107 #define FF_EXCL "EXCL"
109 #define FF_EXLOCK "XL"
110 #define FF_FILE_MBLK "MBLK"
111 #define FF_FSYNC "FSYN"
112 #define FF_GCFDEFER "GCDF"
113 #define FF_GCFMARK "GCMK"
114 #define FF_GENTTY "GTTY"
115 #define FF_HASLOCK "LCK"
117 #define FF_KERNEL "KERN"
118 #define FF_KIOCTL "KIOC"
119 #define FF_LARGEFILE "LG"
121 #define FF_MOUNT "MNT"
122 #define FF_MSYNC "MSYN"
123 #define FF_NBDRM "NBDR"
124 #define FF_NBIO "NBIO"
125 #define FF_NBLOCK "NB"
126 #define FF_NBUF "NBF"
127 #define FF_NMFS "NMFS"
128 #define FF_NDELAY "ND"
130 #define FF_NOATM "NATM"
131 #define FF_NOCACHE "NC"
132 #define FF_NOCTTY "NTTY"
133 #define FF_NODSYNC "NDSY"
134 #define FF_NOFOLNK "NFLK"
135 #define FF_NOTOSTOP "NOTO"
136 #define FF_NSHARE "NSH"
137 #define FF_OLRMIRROR "OLRM"
138 #define FF_POSIX_AIO "PAIO"
139 #define FF_POSIX_PIPE "PP"
140 #define FF_RAIOSIG "RAIO"
141 #define FF_RCACH "RC"
144 #define FF_REVOKED "REV"
145 #define FF_RSHARE "RSH"
146 #define FF_RSYNC "RSYN"
147 #define FF_SETBLK "BL"
148 #define FF_SHLOCK "SL"
149 #define FF_SNAP "SNAP"
150 #define FF_SOCKET "SOCK"
151 #define FF_SQTSH1 "SQS1"
152 #define FF_SQTSH2 "SQS2"
153 #define FF_SQTREPAIR "SQR"
154 #define FF_SQTSH "SQSH"
155 #define FF_SQTSVM "SQSV"
156 #define FF_STOPIO "STPI"
157 #define FF_SYNC "SYN"
158 #define FF_SYNCRON "SWR"
159 #define FF_TCP_MDEVONLY "TCPM"
160 #define FF_TERMIO "TIO"
161 #define FF_TRUNC "TR"
162 #define FF_VHANGUP "VH"
163 #define FF_VTEXT "VTXT"
164 #define FF_WAKEUP "WKUP"
165 #define FF_WAITING "WTG"
170 * Process open file flag names
173 #define POF_ALLOCATED "ALLC"
174 #define POF_BNRD "BR"
175 #define POF_BNWR "BW"
176 #define POF_BNHUP "BHUP"
177 #define POF_CLOEXEC "CX"
178 #define POF_CLOSING "CLSG"
179 #define POF_FDLOCK "LCK"
180 #define POF_INUSE "USE"
181 #define POF_MAPPED "MP"
182 #define POF_FSHMAT "SHMT"
183 #define POF_RESERVED "OPIP"
184 #define POF_RSVWT "RSVW"
188 * Cross-over (-x) option values
191 #define XO_FILESYS 0x1 /* file system mount points */
192 #define XO_SYMLINK 0x2 /* symbolic links */
193 #define XO_ALL (XO_FILESYS | XO_SYMLINK)
197 #include <sys/types.h> /* just in case -- because utmp.h
203 # endif /* defined(EMPTY) */
205 # if defined(HASUTMPX)
207 # else /* !defined(HASUTMPX) */
209 # endif /* defined(HASUTMPX) */
215 #define ACCESSERRFMT "%s: WARNING: access %s: %s\n"
217 # if defined(HASDCACHE)
218 #define CRC_POLY 0120001 /* CRC-16 polynomial */
219 #define CRC_TBLL 256 /* crc table length for software */
220 #define CRC_BITS 8 /* number of bits contributing */
221 # endif /* defined(HASDCACHE) */
222 #define CMDL 9 /* maximum number of characters from
223 * command name to print in COMMAND
225 #define CWD " cwd" /* current working directory fd name */
226 #define FDLEN 8 /* fd printing array length */
227 #define FSV_FA 0x1 /* file struct addr status */
228 #define FSV_CT 0x2 /* file struct count status */
229 #define FSV_FG 0x4 /* file struct flags */
230 #define FSV_NI 0x8 /* file struct node ID status */
232 # if !defined(GET_MAJ_DEV)
233 #define GET_MAJ_DEV major /* if no dialect specific macro has
234 * been defined, use standard major()
236 # endif /* !defined(GET_MAJ_DEV) */
238 # if !defined(GET_MIN_DEV)
239 #define GET_MIN_DEV minor /* if no dialect specific macro has
240 * been defined, use standard minor()
242 # endif /* !defined(GET_MIN_DEV) */
244 # if defined(HASSELINUX)
245 #define HASHCNTX 128 /* security context hash bucket count
246 * -- MUST BE A POWER OF 2!!! */
247 # endif /* defined(HASSELINUX) */
249 # if defined(HASZONES)
250 #define HASHZONE 128 /* zone hash bucket count -- MUST BE
252 # endif /* defined(HASZONES) */
254 #define IDINCR 10 /* PID/PGID table malloc() increment */
256 # if !defined(INADDR_LOOPBACK)
257 #define INADDR_LOOPBACK (u_long)0x7f000001
258 # endif /* !defined(INADDR_LOOPBACK) */
260 #define IPROTOL 8 /* Internet protocol length */
262 # if !defined(KA_T_FMT_X)
263 #define KA_T_FMT_X "0x%08lx" /* format for printing kernel
264 * addresses in 0x... format */
265 # endif /* !defined(KA_T_FMT_X) */
267 # if !defined(LOGINML)
268 # if defined(HASUTMPX)
269 static struct utmpx dummy_utmp; /* to get login name length */
270 #define LOGINML sizeof(dummy_utmp.ut_user)
271 /* login name length */
272 # else /* !defined(HASUTMPX) */
273 static struct utmp dummy_utmp; /* to get login name length */
274 #define LOGINML sizeof(dummy_utmp.ut_name)
275 /* login name length */
276 # endif /* defined(HASUTMPX) */
277 # endif /* !defined(LOGINML) */
279 #define LPROCINCR 128 /* Lproc[] allocation increment */
280 #define LSOF_URL "ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/"
281 #define MIN_AF_ADDR sizeof(struct in_addr)
282 /* minimum AF_* address length */
284 # if defined(HASIPv6)
285 #define MAX_AF_ADDR sizeof(struct in6_addr)
286 /* maximum AF_* address length */
287 # else /* !defined(HASIPv6) */
288 #define MAX_AF_ADDR MIN_AF_ADDR /* maximum AF_* address length */
289 # endif /* defined(HASIPv6) */
291 #define MAXDCPATH 4 /* paths in DCpath[] */
292 #define MAXNWAD 100 /* maximum network addresses */
294 # if !defined(MEMMOVE)
295 #define MEMMOVE memmove
296 # endif /* !defined*MEMMOVE) */
298 #define N_REGLR 0 /* regular file system node */
299 #define N_AFS 1 /* AFS node */
300 #define N_AFPFS 2 /* Apple Darwin AppleShare */
301 #define N_ANON_INODE 3 /* Linux anon_inodefs node */
302 #define N_AUSX 4 /* Auspex LFS node */
303 #define N_AUTO 5 /* automount node */
304 #define N_BLK 6 /* block device node */
305 #define N_CACHE 7 /* cached file system node */
306 #define N_CDFS 8 /* CD-ROM node */
307 #define N_CFS 9 /* CFS node */
308 #define N_CHR 10 /* character device node */
309 #define N_COM 11 /* streams common device node */
310 #define N_CTFSADIR 12 /* Solaris CTFS adir node */
311 #define N_CTFSBUND 13 /* Solaris CTFS bundle node */
312 #define N_CTFSCDIR 14 /* Solaris CTFS cdir node */
313 #define N_CTFSCTL 15 /* Solaris CTFS ctl node */
314 #define N_CTFSEVT 16 /* Solaris CTFS events node */
315 #define N_CTFSLATE 17 /* Solaris CTFS latest node */
316 #define N_CTFSROOT 18 /* Solaris CTFS root node */
317 #define N_CTFSSTAT 19 /* Solaris CTFS status node */
318 #define N_CTFSSYM 20 /* Solaris CTFS symbolic node */
319 #define N_CTFSTDIR 21 /* Solaris CTFS type node */
320 #define N_CTFSTMPL 22 /* Solaris CTFS template node */
321 #define N_DEV 23 /* DEV FS node */
322 #define N_DOOR 24 /* DOOR node */
323 #define N_FD 25 /* FD node */
324 #define N_FIFO 26 /* FIFO node */
325 #define N_HSFS 27 /* High Sierra node */
326 #define N_KERN 28 /* BSD /kern node */
327 #define N_LOFS 29 /* loopback node */
328 #define N_MNT 30 /* mount file system device node */
329 #define N_MPC 31 /* multiplexed device node */
330 #define N_MVFS 32 /* multi-volume file system node (?) */
331 #define N_NFS 33 /* NFS node */
332 #define N_NFS4 34 /* NFS version 4 node */
333 #define N_NM 35 /* named file system node */
334 #define N_OBJF 36 /* objfs file system node */
335 #define N_PCFS 37 /* PC file system node */
336 #define N_PIPE 38 /* pipe device node */
337 #define N_PORT 39 /* port node */
338 #define N_PROC 40 /* /proc node */
339 #define N_PSEU 41 /* pseudofs node */
340 #define N_SAMFS 42 /* Solaris SAM-FS */
341 #define N_SANFS 43 /* AIX SANFS */
342 #define N_SDEV 44 /* Solaris sdev file system node */
343 #define N_SHARED 45 /* Solaris sharedfs */
344 #define N_SOCK 46 /* sock_vnodeops node */
345 #define N_SPEC 47 /* spec_vnodeops node */
346 #define N_STREAM 48 /* stream node */
347 #define N_TMP 49 /* tmpfs node */
348 #define N_UFS 50 /* UNIX file system node */
349 #define N_UNKN 51 /* unknown node type */
350 #define N_VXFS 52 /* Veritas file system node */
351 #define N_XFS 53 /* XFS node */
352 #define N_ZFS 54 /* ZFS node */
354 # if !defined(OFFDECDIG)
355 #define OFFDECDIG 8 /* maximum number of digits in the
356 * offset decimal form (0t...) */
357 # endif /* !defined(OFFDECDIG) */
359 # if !defined(USELOCALREADDIR)
360 #define CloseDir closedir /* use standard closedir() */
361 #define OpenDir opendir /* use standard opendir() */
362 #define ReadDir readdir /* use standard readdir() */
363 # endif /* !defined(USELOCALREADDIR) */
365 #define RPTTM 15 /* default repeat seconds */
366 #define RTD " rtd" /* root directory fd name */
367 #define TCPTPI_FLAGS 0x0001 /* report TCP/TPI socket options and
368 * state, and TCP_NODELAY state */
369 #define TCPTPI_QUEUES 0x0002 /* report TCP/TPI queue lengths */
370 #define TCPTPI_STATE 0x0004 /* report TCP/TPI state */
371 #define TCPTPI_WINDOWS 0x0008 /* report TCP/TPI window sizes */
372 #define TCPTPI_ALL (TCPTPI_QUEUES | TCPTPI_STATE | TCPTPI_WINDOWS)
373 /* report all TCP/TPI info */
374 #define TCPUDPALLOC 32 /* allocation amount for TCP and UDP
376 #define TMLIMIT 15 /* readlink() & stat() timeout sec */
377 #define TMLIMMIN 2 /* minimum timeout */
378 #define TYPEL 8 /* type character length */
379 #define UIDCACHEL 1024 /* UID cache length */
380 #define UIDINCR 10 /* UID table malloc() increment */
381 #define USERPRTL 8 /* UID/login print length limit */
383 # if !defined(SZOFFTYPE)
384 #define SZOFFTYPE unsigned long /* type for size and offset */
386 #define SZOFFPSPEC "l" /* SZOFFTYPE printf specification
388 # endif /* !defined(SZOFFTYPE) */
390 # if !defined(TIMEVAL_LSOF)
391 #define TIMEVAL_LSOF timeval
392 # endif /* !defined(TIMEVAL_LSOF) */
394 # if !defined(XDR_PMAPLIST)
395 #define XDR_PMAPLIST xdr_pmaplist
396 # endif /* !defined(XDR_PMAPLIST) */
398 # if !defined(XDR_VOID)
399 #define XDR_VOID xdr_void
400 # endif /* !defined(XDR_VOID) */
404 * Output title definitions
407 #define CMDTTL "COMMAND"
409 #define CNTXTTL "SECURITY-CONTEXT"
411 #define DEVTTL "DEVICE"
417 #define FGTTL "FILE-FLAG"
419 #define FSTTL "FILE-ADDR"
421 #define NITTL "NODE-ID"
424 #define NLTTL "NLINK"
428 #define NODETTL "NODE"
430 #define OFFTTL "OFFSET"
431 #define PGIDTTL "PGID"
435 #define PPIDTTL "PPID"
438 #define SZOFFTTL "SIZE/OFF"
439 extern int SzOffColW;
442 #define TYPETTL "TYPE"
444 #define USERTTL "USER"
446 #define ZONETTL "ZONE"
454 #define PS_PRI 1 /* primary process selection -- e.g.,
456 #define PS_SEC 2 /* secondary process selection -- e.g.,
457 * by directory or file */
458 #define SELCMD 0x0001 /* select process by command name */
459 #define SELCNTX 0x0002 /* select security context (-Z) */
460 #define SELFD 0x0004 /* select file by descriptor name */
461 #define SELNA 0x0008 /* select socket by address (-i@...) */
462 #define SELNET 0x0010 /* select Internet socket files (-i) */
463 #define SELNFS 0x0020 /* select NFS files (-N) */
464 #define SELNLINK 0x0040 /* select based on link count */
465 #define SELNM 0x0080 /* select by name */
466 #define SELPGID 0x0100 /* select process group IDs (-g) */
467 #define SELPID 0x0200 /* select PIDs (-p) */
468 #define SELUID 0x0400 /* select UIDs (-u) */
469 #define SELUNX 0x0800 /* select UNIX socket (-U) */
470 #define SELZONE 0x1000 /* select zone (-z) */
471 #define SELEXCLF 0x2000 /* file selection excluded */
472 #define SELTASK 0x4000 /* select tasks (-K) */
473 #define SELALL (SELCMD|SELCNTX|SELFD|SELNA|SELNET|SELNM|SELNFS|SELPID|SELUID|SELUNX|SELZONE|SELTASK)
474 #define SELPROC (SELCMD|SELCNTX|SELPGID|SELPID|SELUID|SELZONE|SELTASK)
475 /* process selecters */
476 #define SELFILE (SELFD|SELNFS|SELNLINK|SELNM) /* file selecters */
477 #define SELNW (SELNA|SELNET|SELUNX) /* network selecters */
480 * Structure definitions
483 # if defined(HAS_AFS)
484 struct afsnode { /* AFS pseudo-node structure */
486 unsigned char ino_st; /* 1 if inode has a value */
487 unsigned char nlink_st; /* 1 if nlink has a value */
492 # endif /* defined(HAS_AFS) */
494 # if defined(HAS_STD_CLONE)
496 int dx; /* index of device entry in Devtp[] */
497 struct clone *next; /* forward link */
499 extern struct clone *Clone;
500 # endif /* defined(HAS_STD_CLONE) */
502 # if defined(HASNLIST)
503 struct drive_Nl { /* data to drive build_Nl() */
504 char *nn; /* nickname for lookups */
505 char *knm; /* kernel variable for name list */
507 extern struct drive_Nl Drive_Nl[]; /* defined in dstore.c */
508 # endif /* defined(HASNLIST) */
512 * Global storage definitions (including their structure definitions)
515 typedef struct efsys_list {
516 char *path; /* path to file system for which kernel
517 * blocks are to be eliminated */
518 int pathl; /* path length */
519 int rdlnk; /* avoid readlink(2) if non-zero */
520 struct mounts *mp; /* local mount table entry pointer */
521 struct efsys_list *next; /* next efsys_list entry pointer */
523 extern efsys_list_t *Efsysl; /* file systems for which kernel blocks
524 * are to be eliminated */
527 int i; /* integer argument */
528 int f; /* find state -- meaningful only if
530 int x; /* excluded state */
533 typedef struct lsof_rx { /* regular expression table entry */
534 char *exp; /* original regular expression */
535 regex_t cx; /* compiled expression */
536 int mc; /* match count */
538 extern lsof_rx_t *CmdRx;
541 # if defined(HASFSTRUCT)
542 struct pff_tab { /* print file flags table structure */
543 long val; /* flag value */
544 char *nm; /* name to print for flag */
546 # endif /* defined(HASFSTRUCT) */
549 uid_t uid; /* User ID */
550 char *lnm; /* specified login name (NULL = none) */
551 unsigned char excl; /* excluded state */
552 unsigned char f; /* selected User ID find state
553 * (meaningful only if excl == 0) */
556 # if defined(HASBLKDEV)
557 extern struct l_dev *BDevtp, **BSdev;
559 # endif /* defined(HASBLKDEV) */
564 char *str; /* string */
565 int len; /* string length */
566 short f; /* selected string find state */
567 short x; /* exclusion (if non-zero) */
568 struct str_lst *next; /* next list entry */
570 extern struct str_lst *Cmdl;
575 # if defined(HASSELINUX)
576 typedef struct cntxlist {
577 char *cntx; /* zone name */
578 int f; /* "find" flag (used only in CntxArg) */
579 struct cntxlist *next; /* next zone hash entry */
581 extern cntxlist_t *CntxArg;
582 extern int CntxStatus;
583 # endif /* defined(HASSELINUX) */
585 # if defined(HASDCACHE)
586 extern unsigned DCcksum;
589 extern char *DCpathArg;
590 extern char *DCpath[];
592 extern int DCrebuilt;
595 # endif /* defined(HASDCACHE) */
599 extern struct l_dev *Devtp;
613 # if defined(HASNCACHE)
615 extern int NcacheReload;
616 # endif /* defined(HASNCACHE) */
626 # if !defined(HASNORPC_H)
628 # endif /* !defined(HASNORPC_H) */
644 # if defined(HASXOPT_VALUE)
646 # endif /* defined(HASXOPT_VALUE) */
652 char *nm; /* file descriptor name -- range if
654 int lo; /* range start (if nm NULL) */
655 int hi; /* range end (if nm NULL) */
658 extern struct fd_lst *Fdl;
659 extern int FdlTy; /* Fdl[] type: -1 == none
664 char id; /* field ID character */
665 unsigned char st; /* field status */
666 char *nm; /* field name */
667 int *opt; /* option variable address */
668 int ov; /* value to OR with option variable */
670 extern struct fieldsel FieldSel[];
674 enum IDType {PGID, PID};
675 extern char *InodeFmt_d;
676 extern char *InodeFmt_x;
682 unsigned char dev_def; /* device number definition status */
683 unsigned char inp_ty; /* inode/iproto type
684 * 0: neither inode nor iproto
685 * 1: print inode in decimal
686 * 2: iproto contains string
687 * 3: print inode in hex
689 unsigned char is_com; /* common stream status */
690 unsigned char is_nfs; /* NFS file status */
691 unsigned char is_stream; /* stream device status */
693 # if defined(HASVXFS) && defined(HASVXFSDNLC)
694 unsigned char is_vxfs; /* VxFS file status */
695 # endif /* defined(HASVXFS) && defined(HASVXFSDNLC) */
697 unsigned char lmi_srch; /* local mount info search status:
698 * 1 = printname() search required */
700 # if defined(HASMNTSTAT)
701 unsigned char mnt_stat; /* mount point stat(2) status */
702 # endif /* defined(HASMNTSTAT) */
704 unsigned char nlink_def; /* link count definition status */
705 unsigned char off_def; /* offset definition status */
706 unsigned char rdev_def; /* rdev definition status */
707 unsigned char sz_def; /* size definition status */
709 # if defined(HASFSTRUCT)
710 unsigned char fsv; /* file struct value status */
711 # endif /* defined(HASFSTRUCT) */
714 char iproto[IPROTOL];
716 short sf; /* select flags -- SEL* symbols */
717 int ch; /* VMPC channel: -1 = none */
718 int ntype; /* node type -- N_* value */
724 long nlink; /* link count */
726 char *fsdir; /* file system directory */
727 char *fsdev; /* file system device */
729 # if defined(HASFSINO)
730 INODETYPE fs_ino; /* file system inode number */
731 # endif /* defined HASFSINO) */
733 struct linaddr { /* local Internet address information */
734 int af; /* address family: 0 for none; AF_INET;
738 struct in_addr a4; /* AF_INET Internet address */
740 # if defined(HASIPv6)
741 struct in6_addr a6; /* AF_INET6 Internet address */
742 # endif /* defined(HASIPv6) */
745 } li[2]; /* li[0]: local
747 struct ltstate { /* local TCP/TPI state */
748 int type; /* state type:
751 * 1 == TPI or socket (SS_*) */
753 int i; /* integer state */
754 unsigned int ui; /* unsigned integer state */
757 # if defined(HASSOOPT)
758 unsigned char pqlens; /* pqlen status: 0 = none */
759 unsigned char qlens; /* qlen status: 0 = none */
760 unsigned char qlims; /* qlim status: 0 = none */
761 unsigned char rbszs; /* rbsz status: 0 = none */
762 unsigned char sbszs; /* sbsz status: 0 = none */
763 int kai; /* TCP keep-alive interval */
764 int ltm; /* TCP linger time */
765 unsigned int opt; /* socket options */
766 unsigned int pqlen; /* partial connection queue length */
767 unsigned int qlen; /* connection queue length */
768 unsigned int qlim; /* connection queue limit */
769 unsigned long rbsz; /* receive buffer size */
770 unsigned long sbsz; /* send buffer size */
771 # endif /* defined(HASSOOPT) */
773 # if defined(HASSOSTATE)
774 unsigned int ss; /* socket state */
775 # if defined(HASSBSTATE)
776 unsigned int sbs_rcv; /* receive socket buffer state */
777 unsigned int sbs_snd; /* send socket buffer state */
778 # endif /* defined(HASSBSTATE) */
779 # endif /* defined(HASSOSTATE) */
781 # if defined(HASTCPOPT)
782 unsigned int topt; /* TCP options */
783 unsigned char msss; /* mss status: 0 = none */
784 unsigned long mss; /* TCP maximum segment size */
785 # endif /* defined(HASTCPOPT) */
787 # if defined(HASTCPTPIQ)
788 unsigned long rq; /* receive queue length */
789 unsigned long sq; /* send queue length */
790 unsigned char rqs; /* rq status: 0 = none */
791 unsigned char sqs; /* sq status: 0 = none */
792 # endif /* defined(HASTCPTPIQ) */
794 # if defined(HASTCPTPIW)
795 unsigned char rws; /* rw status: 0 = none */
796 unsigned char wws; /* ww status: 0 = none */
797 unsigned long rw; /* read window size */
798 unsigned long ww; /* write window size */
799 # endif /* defined(HASTCPTPIW) */
803 char *nma; /* NAME column addition */
805 # if defined(HASNCACHE) && HASNCACHE<2
806 KA_T na; /* file structure's node address */
807 # endif /* defined(HASNCACHE) && HASNCACHE<2 */
809 # if defined(HASNCACHE) && defined(HASNCVPID)
810 unsigned long id; /* capability ID */
811 # endif /* defined(HASNCACHE) && defined(HASNCVPID) */
813 # if defined(HASLFILEADD)
815 # endif /* defined(HASLFILEADD) */
817 # if defined(HASFSTRUCT)
818 KA_T fsa; /* file structure address */
819 long fct; /* file structure's f_count */
820 long ffg; /* file structure's f_flag */
821 long pof; /* process open-file flags */
822 KA_T fna; /* file structure node address */
823 # endif /* defined(HASFSTRUCT) */
827 extern struct lfile *Lf, *Plf;
831 char *cmd; /* command name */
833 # if defined(HASSELINUX)
834 char *cntx; /* security context */
835 # endif /* defined(HASSELINUX) */
837 short sf; /* select flags -- SEL* symbols */
838 short pss; /* state: 0 = not selected
839 * 1 = wholly selected
840 * 2 = partially selected */
841 int pid; /* process ID */
843 # if defined(HASTASKS)
844 int tid; /* task ID */
845 # endif /* HASTASKS */
847 int pgid; /* process group ID */
848 int ppid; /* parent process ID */
849 uid_t uid; /* user ID */
851 # if defined(HASZONES)
852 char *zn; /* zone name */
853 # endif /* defined(HASZONES) */
855 struct lfile *file; /* open files of process */
857 extern struct lproc *Lp, *Lproc;
861 extern char *MntSupP;
863 # if defined(HASPROCFS)
864 extern struct mounts *Mtprocfs;
874 extern size_t Namechl;
877 # if defined(HASNLIST)
878 # if !defined(NLIST_TYPE)
879 #define NLIST_TYPE nlist
880 # endif /* !defined(NLIST_TYPE) */
881 extern struct NLIST_TYPE *Nl;
883 # endif /* defined(HASNLIST) */
900 char *arg; /* argument */
901 char *proto; /* protocol */
902 int af; /* address family -- e.g.,
903 * AF_INET, AF_INET6 */
904 unsigned char a[MAX_AF_ADDR]; /* address */
905 int sport; /* starting port */
906 int eport; /* ending port */
907 int f; /* find state */
908 struct nwad *next; /* forward link */
910 extern struct nwad *Nwad;
912 extern int OffDecDig;
915 # if defined(HASFSTRUCT)
916 extern struct pff_tab Pff_tab[]; /* file flags table */
917 extern struct pff_tab Pof_tab[]; /* process open file flags table */
918 # endif /* defined(HASFSTRUCT) */
920 # if defined(HASPROCFS)
922 pid_t pid; /* search PID */
923 char *nm; /* search name */
924 unsigned char f; /* match found if == 1 */
926 # if defined(HASPINODEN)
927 INODETYPE inode; /* search inode number */
928 # endif /* defined(HASPINODEN) */
930 struct procfsid *next; /* forward link */
934 extern struct procfsid *Procfsid;
936 # endif /* defined(HASPROCFS) */
940 extern struct l_dev **Sdev;
945 extern int Setuidroot;
946 extern struct sfile *Sfile;
947 extern struct int_lst *Spgid;
948 extern struct int_lst *Spid;
949 extern struct seluid *Suid;
950 extern char *SzOffFmt_0t;
951 extern char *SzOffFmt_d;
952 extern char *SzOffFmt_dv;
953 extern char *SzOffFmt_x;
954 extern int TaskPrtFl;
955 extern int TcpStAlloc;
956 extern unsigned char *TcpStI;
959 extern unsigned char *TcpStX;
961 extern int TcpNstates;
963 extern char Terminator;
965 extern int UdpStAlloc;
966 extern unsigned char *UdpStI;
969 extern unsigned char *UdpStX;
971 extern int UdpNstates;
974 # if defined(HASZONES)
975 typedef struct znhash {
976 char *zn; /* zone name */
977 int f; /* "find" flag (used only in ZoneArg) */
978 struct znhash *next; /* next zone hash entry */
980 extern znhash_t **ZoneArg;
981 # endif /* defined(HASZONES) */