Imported Upstream version 4.89
[platform/upstream/lsof.git] / lsof_fields.h
1 /*
2  * lsof_field.sh - field ID characters for lsof output that can be parsed
3  *                 (selected with -f or -F)
4  */
5
6
7 /*
8  * Copyright 1994 Purdue Research Foundation, West Lafayette, Indiana
9  * 47907.  All rights reserved.
10  *
11  * Written by Victor A. Abell
12  *
13  * This software is not subject to any license of the American Telephone
14  * and Telegraph Company or the Regents of the University of California.
15  *
16  * Permission is granted to anyone to use this software for any purpose on
17  * any computer system, and to alter it and redistribute it freely, subject
18  * to the following restrictions:
19  *
20  * 1. Neither the authors nor Purdue University are responsible for any
21  *    consequences of the use of this software.
22  *
23  * 2. The origin of this software must not be misrepresented, either by
24  *    explicit claim or by omission.  Credit to the authors and Purdue
25  *    University must appear in documentation and sources.
26  *
27  * 3. Altered versions must be plainly marked as such, and must not be
28  *    misrepresented as being the original software.
29  *
30  * 4. This notice may not be removed or altered.
31  */
32
33
34 /*
35  * $Id: lsof_fields.h,v 1.13 2014/10/13 22:36:20 abe Exp $
36  */
37
38
39 #if     !defined(LSOF_FORMAT_H)
40 #define LSOF_FORMAT_H   1
41
42 /*
43  * Codes for output fields:
44  *
45  *      LSOF_FID_*      ID character
46  *      LSOF_FIX_*      ID index
47  *      LSOF_FNM_*      name
48  *
49  * A field is displayed in the form:
50  *              <ID_character><data><field_terminator>
51  *      
52  * Output fields are normally terminated with a NL ('\n'), but the field
53  * terminator can be set to NUL with the -0 (zero) option to lsof.
54  *
55  * Field sets -- process-specific information or information specific
56  * to a single file descriptor -- are terminated with NL when the field
57  * terminator is NUL.
58  */
59
60 #define LSOF_FID_ACCESS         'a'
61 #define LSOF_FIX_ACCESS         0
62 #define LSOF_FNM_ACCESS         "access: r = read; w = write; u = read/write"
63
64 #define LSOF_FID_CMD            'c'
65 #define LSOF_FIX_CMD            1
66 #define LSOF_FNM_CMD            "command name"
67
68 #define LSOF_FID_CT             'C'
69 #define LSOF_FIX_CT             2
70 #define LSOF_FNM_CT             "file struct share count"
71
72 #define LSOF_FID_DEVCH          'd'
73 #define LSOF_FIX_DEVCH          3
74 #define LSOF_FNM_DEVCH          "device character code"
75
76 #define LSOF_FID_DEVN           'D'
77 #define LSOF_FIX_DEVN           4
78 #define LSOF_FNM_DEVN           "major/minor device number as 0x<hex>"
79
80 #define LSOF_FID_FD             'f'
81 #define LSOF_FIX_FD             5
82 #define LSOF_FNM_FD             "file descriptor (always selected)"
83
84 #define LSOF_FID_FA             'F'
85 #define LSOF_FIX_FA             6
86 #define LSOF_FNM_FA             "file struct address as 0x<hex>"
87
88 #define LSOF_FID_FG             'G'
89 #define LSOF_FIX_FG             7
90 #define LSOF_FNM_FG             "file flaGs"
91
92 #define LSOF_FID_INODE          'i'
93 #define LSOF_FIX_INODE          8
94 #define LSOF_FNM_INODE          "inode number"
95
96 #define LSOF_FID_NLINK          'k'
97 #define LSOF_FIX_NLINK          9
98 #define LSOF_FNM_NLINK          "link count"
99
100 #define LSOF_FID_TID            'K'
101 #define LSOF_FIX_TID            10
102 #define LSOF_FNM_TID            "task ID (TID)"
103
104 #define LSOF_FID_LOCK           'l'
105 #define LSOF_FIX_LOCK           11
106 #define LSOF_FNM_LOCK           "lock: r/R = read; w/W = write; u = read/write"
107
108 #define LSOF_FID_LOGIN          'L'
109 #define LSOF_FIX_LOGIN          12
110 #define LSOF_FNM_LOGIN          "login name"
111
112 #define LSOF_FID_MARK           'm'
113 #define LSOF_FIX_MARK           13
114 #define LSOF_FNM_MARK           "marker between repeated output"
115
116 #define LSOF_FID_NAME           'n'
117 #define LSOF_FIX_NAME           14
118 #define LSOF_FNM_NAME           "comment, name, Internet addresses"
119
120 #define LSOF_FID_NI             'N'
121 #define LSOF_FIX_NI             15
122 #define LSOF_FNM_NI             "file struct node ID as 0x<hex>"
123
124 #define LSOF_FID_OFFSET         'o'
125 #define LSOF_FIX_OFFSET         16
126 #define LSOF_FNM_OFFSET         "file offset as 0t<dec> or 0x<hex>"
127
128 #define LSOF_FID_PID            'p'
129 #define LSOF_FIX_PID            17
130 #define LSOF_FNM_PID            "process ID (PID)"
131
132 #define LSOF_FID_PGID           'g'
133 #define LSOF_FIX_PGID           18
134 #define LSOF_FNM_PGID           "process group ID (PGID)"
135
136 #define LSOF_FID_PROTO          'P'
137 #define LSOF_FIX_PROTO          19
138 #define LSOF_FNM_PROTO          "protocol name"
139
140 #define LSOF_FID_RDEV           'r'
141 #define LSOF_FIX_RDEV           20
142 #define LSOF_FNM_RDEV           "raw device number as 0x<hex>"
143
144 #define LSOF_FID_PPID           'R'
145 #define LSOF_FIX_PPID           21
146 #define LSOF_FNM_PPID           "paRent PID"
147
148 #define LSOF_FID_SIZE           's'
149 #define LSOF_FIX_SIZE           22
150 #define LSOF_FNM_SIZE           "file size"
151
152 #define LSOF_FID_STREAM         'S'
153 #define LSOF_FIX_STREAM         23
154 #define LSOF_FNM_STREAM         "stream module and device names"
155
156 #define LSOF_FID_TYPE           't'
157 #define LSOF_FIX_TYPE           24
158 #define LSOF_FNM_TYPE           "file type"
159
160 #define LSOF_FID_TCPTPI         'T'
161 #define LSOF_FIX_TCPTPI         25
162 #define LSOF_FNM_TCPTPI         "TCP/TPI info"
163
164 #define LSOF_FID_UID            'u'
165 #define LSOF_FIX_UID            26
166 #define LSOF_FNM_UID            "user ID (UID)"
167
168 #define LSOF_FID_ZONE           'z'
169 #define LSOF_FIX_ZONE           27
170 #define LSOF_FNM_ZONE           "zone name"
171
172 #define LSOF_FID_CNTX           'Z'
173 #define LSOF_FIX_CNTX           28
174 #define LSOF_FNM_CNTX           "security context"
175
176 #define LSOF_FID_TERM           '0'
177 #define LSOF_FIX_TERM           29
178 #define LSOF_FNM_TERM           "(zero) use NUL field terminator instead of NL"
179
180 #endif  /* !defined(LSOF_FORMAT_H) */