Imported Upstream version 0.63
Willi Mann
11 years ago
0 | --Bugs | |
1 | ||
2 | I said: | |
3 | ||
4 | > On my system the program can segfault when a report is being | |
5 | > generated under certain conditions. This happens when the c++ | |
6 | > STL sort function is called too often. Sorting is used to | |
7 | > speed up access to the tables and reduce the time you have | |
8 | > to wait for a report to complete. | |
9 | ||
10 | The problem has been found and fixed by Mike Reid (a fellow New | |
11 | Zealander.) I was dereferencing a null pointer in one function | |
12 | and writing to a string that had been c_str() in another - pretty | |
13 | big coding mistakes if you ask me. Naughty boy etc. | |
14 | ||
15 | So the sorting should be fine now (provided I haven't coded other | |
16 | errors) so please use the STL sort (for faster results too) and let | |
17 | me know if it breaks for you: set "bRepMySort" to "no" and as I | |
18 | previously explained: | |
19 | ||
20 | > There are two variables in squidview.conf which direct | |
21 | > sorting operations. "bRepMySort" can be set to "yes" to use | |
22 | > my sort routines, or "no" otherwise. "iRepFast" is an integer. | |
23 | > After this many lines of processing a sort is made. Therefore | |
24 | > the smaller this number the more often sorts are made. I've | |
25 | > settled on a 10000 value for this; your mileage may vary. | |
26 | > Making "iRepFast" 0 disables sorting completely. | |
27 | ||
28 | > Squidview catches segfaults and will tell you if it happened during | |
29 | > the STL sort. |
0 | GNU GENERAL PUBLIC LICENSE | |
1 | Version 2, June 1991 | |
2 | ||
3 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. | |
4 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
5 | Everyone is permitted to copy and distribute verbatim copies | |
6 | of this license document, but changing it is not allowed. | |
7 | ||
8 | Preamble | |
9 | ||
10 | The licenses for most software are designed to take away your | |
11 | freedom to share and change it. By contrast, the GNU General Public | |
12 | License is intended to guarantee your freedom to share and change free | |
13 | software--to make sure the software is free for all its users. This | |
14 | General Public License applies to most of the Free Software | |
15 | Foundation's software and to any other program whose authors commit to | |
16 | using it. (Some other Free Software Foundation software is covered by | |
17 | the GNU Library General Public License instead.) You can apply it to | |
18 | your programs, too. | |
19 | ||
20 | When we speak of free software, we are referring to freedom, not | |
21 | price. Our General Public Licenses are designed to make sure that you | |
22 | have the freedom to distribute copies of free software (and charge for | |
23 | this service if you wish), that you receive source code or can get it | |
24 | if you want it, that you can change the software or use pieces of it | |
25 | in new free programs; and that you know you can do these things. | |
26 | ||
27 | To protect your rights, we need to make restrictions that forbid | |
28 | anyone to deny you these rights or to ask you to surrender the rights. | |
29 | These restrictions translate to certain responsibilities for you if you | |
30 | distribute copies of the software, or if you modify it. | |
31 | ||
32 | For example, if you distribute copies of such a program, whether | |
33 | gratis or for a fee, you must give the recipients all the rights that | |
34 | you have. You must make sure that they, too, receive or can get the | |
35 | source code. And you must show them these terms so they know their | |
36 | rights. | |
37 | ||
38 | We protect your rights with two steps: (1) copyright the software, and | |
39 | (2) offer you this license which gives you legal permission to copy, | |
40 | distribute and/or modify the software. | |
41 | ||
42 | Also, for each author's protection and ours, we want to make certain | |
43 | that everyone understands that there is no warranty for this free | |
44 | software. If the software is modified by someone else and passed on, we | |
45 | want its recipients to know that what they have is not the original, so | |
46 | that any problems introduced by others will not reflect on the original | |
47 | authors' reputations. | |
48 | ||
49 | Finally, any free program is threatened constantly by software | |
50 | patents. We wish to avoid the danger that redistributors of a free | |
51 | program will individually obtain patent licenses, in effect making the | |
52 | program proprietary. To prevent this, we have made it clear that any | |
53 | patent must be licensed for everyone's free use or not licensed at all. | |
54 | ||
55 | The precise terms and conditions for copying, distribution and | |
56 | modification follow. | |
57 | ||
58 | GNU GENERAL PUBLIC LICENSE | |
59 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
60 | ||
61 | 0. This License applies to any program or other work which contains | |
62 | a notice placed by the copyright holder saying it may be distributed | |
63 | under the terms of this General Public License. The "Program", below, | |
64 | refers to any such program or work, and a "work based on the Program" | |
65 | means either the Program or any derivative work under copyright law: | |
66 | that is to say, a work containing the Program or a portion of it, | |
67 | either verbatim or with modifications and/or translated into another | |
68 | language. (Hereinafter, translation is included without limitation in | |
69 | the term "modification".) Each licensee is addressed as "you". | |
70 | ||
71 | Activities other than copying, distribution and modification are not | |
72 | covered by this License; they are outside its scope. The act of | |
73 | running the Program is not restricted, and the output from the Program | |
74 | is covered only if its contents constitute a work based on the | |
75 | Program (independent of having been made by running the Program). | |
76 | Whether that is true depends on what the Program does. | |
77 | ||
78 | 1. You may copy and distribute verbatim copies of the Program's | |
79 | source code as you receive it, in any medium, provided that you | |
80 | conspicuously and appropriately publish on each copy an appropriate | |
81 | copyright notice and disclaimer of warranty; keep intact all the | |
82 | notices that refer to this License and to the absence of any warranty; | |
83 | and give any other recipients of the Program a copy of this License | |
84 | along with the Program. | |
85 | ||
86 | You may charge a fee for the physical act of transferring a copy, and | |
87 | you may at your option offer warranty protection in exchange for a fee. | |
88 | ||
89 | 2. You may modify your copy or copies of the Program or any portion | |
90 | of it, thus forming a work based on the Program, and copy and | |
91 | distribute such modifications or work under the terms of Section 1 | |
92 | above, provided that you also meet all of these conditions: | |
93 | ||
94 | a) You must cause the modified files to carry prominent notices | |
95 | stating that you changed the files and the date of any change. | |
96 | ||
97 | b) You must cause any work that you distribute or publish, that in | |
98 | whole or in part contains or is derived from the Program or any | |
99 | part thereof, to be licensed as a whole at no charge to all third | |
100 | parties under the terms of this License. | |
101 | ||
102 | c) If the modified program normally reads commands interactively | |
103 | when run, you must cause it, when started running for such | |
104 | interactive use in the most ordinary way, to print or display an | |
105 | announcement including an appropriate copyright notice and a | |
106 | notice that there is no warranty (or else, saying that you provide | |
107 | a warranty) and that users may redistribute the program under | |
108 | these conditions, and telling the user how to view a copy of this | |
109 | License. (Exception: if the Program itself is interactive but | |
110 | does not normally print such an announcement, your work based on | |
111 | the Program is not required to print an announcement.) | |
112 | ||
113 | These requirements apply to the modified work as a whole. If | |
114 | identifiable sections of that work are not derived from the Program, | |
115 | and can be reasonably considered independent and separate works in | |
116 | themselves, then this License, and its terms, do not apply to those | |
117 | sections when you distribute them as separate works. But when you | |
118 | distribute the same sections as part of a whole which is a work based | |
119 | on the Program, the distribution of the whole must be on the terms of | |
120 | this License, whose permissions for other licensees extend to the | |
121 | entire whole, and thus to each and every part regardless of who wrote it. | |
122 | ||
123 | Thus, it is not the intent of this section to claim rights or contest | |
124 | your rights to work written entirely by you; rather, the intent is to | |
125 | exercise the right to control the distribution of derivative or | |
126 | collective works based on the Program. | |
127 | ||
128 | In addition, mere aggregation of another work not based on the Program | |
129 | with the Program (or with a work based on the Program) on a volume of | |
130 | a storage or distribution medium does not bring the other work under | |
131 | the scope of this License. | |
132 | ||
133 | 3. You may copy and distribute the Program (or a work based on it, | |
134 | under Section 2) in object code or executable form under the terms of | |
135 | Sections 1 and 2 above provided that you also do one of the following: | |
136 | ||
137 | a) Accompany it with the complete corresponding machine-readable | |
138 | source code, which must be distributed under the terms of Sections | |
139 | 1 and 2 above on a medium customarily used for software interchange; or, | |
140 | ||
141 | b) Accompany it with a written offer, valid for at least three | |
142 | years, to give any third party, for a charge no more than your | |
143 | cost of physically performing source distribution, a complete | |
144 | machine-readable copy of the corresponding source code, to be | |
145 | distributed under the terms of Sections 1 and 2 above on a medium | |
146 | customarily used for software interchange; or, | |
147 | ||
148 | c) Accompany it with the information you received as to the offer | |
149 | to distribute corresponding source code. (This alternative is | |
150 | allowed only for noncommercial distribution and only if you | |
151 | received the program in object code or executable form with such | |
152 | an offer, in accord with Subsection b above.) | |
153 | ||
154 | The source code for a work means the preferred form of the work for | |
155 | making modifications to it. For an executable work, complete source | |
156 | code means all the source code for all modules it contains, plus any | |
157 | associated interface definition files, plus the scripts used to | |
158 | control compilation and installation of the executable. However, as a | |
159 | special exception, the source code distributed need not include | |
160 | anything that is normally distributed (in either source or binary | |
161 | form) with the major components (compiler, kernel, and so on) of the | |
162 | operating system on which the executable runs, unless that component | |
163 | itself accompanies the executable. | |
164 | ||
165 | If distribution of executable or object code is made by offering | |
166 | access to copy from a designated place, then offering equivalent | |
167 | access to copy the source code from the same place counts as | |
168 | distribution of the source code, even though third parties are not | |
169 | compelled to copy the source along with the object code. | |
170 | ||
171 | 4. You may not copy, modify, sublicense, or distribute the Program | |
172 | except as expressly provided under this License. Any attempt | |
173 | otherwise to copy, modify, sublicense or distribute the Program is | |
174 | void, and will automatically terminate your rights under this License. | |
175 | However, parties who have received copies, or rights, from you under | |
176 | this License will not have their licenses terminated so long as such | |
177 | parties remain in full compliance. | |
178 | ||
179 | 5. You are not required to accept this License, since you have not | |
180 | signed it. However, nothing else grants you permission to modify or | |
181 | distribute the Program or its derivative works. These actions are | |
182 | prohibited by law if you do not accept this License. Therefore, by | |
183 | modifying or distributing the Program (or any work based on the | |
184 | Program), you indicate your acceptance of this License to do so, and | |
185 | all its terms and conditions for copying, distributing or modifying | |
186 | the Program or works based on it. | |
187 | ||
188 | 6. Each time you redistribute the Program (or any work based on the | |
189 | Program), the recipient automatically receives a license from the | |
190 | original licensor to copy, distribute or modify the Program subject to | |
191 | these terms and conditions. You may not impose any further | |
192 | restrictions on the recipients' exercise of the rights granted herein. | |
193 | You are not responsible for enforcing compliance by third parties to | |
194 | this License. | |
195 | ||
196 | 7. If, as a consequence of a court judgment or allegation of patent | |
197 | infringement or for any other reason (not limited to patent issues), | |
198 | conditions are imposed on you (whether by court order, agreement or | |
199 | otherwise) that contradict the conditions of this License, they do not | |
200 | excuse you from the conditions of this License. If you cannot | |
201 | distribute so as to satisfy simultaneously your obligations under this | |
202 | License and any other pertinent obligations, then as a consequence you | |
203 | may not distribute the Program at all. For example, if a patent | |
204 | license would not permit royalty-free redistribution of the Program by | |
205 | all those who receive copies directly or indirectly through you, then | |
206 | the only way you could satisfy both it and this License would be to | |
207 | refrain entirely from distribution of the Program. | |
208 | ||
209 | If any portion of this section is held invalid or unenforceable under | |
210 | any particular circumstance, the balance of the section is intended to | |
211 | apply and the section as a whole is intended to apply in other | |
212 | circumstances. | |
213 | ||
214 | It is not the purpose of this section to induce you to infringe any | |
215 | patents or other property right claims or to contest validity of any | |
216 | such claims; this section has the sole purpose of protecting the | |
217 | integrity of the free software distribution system, which is | |
218 | implemented by public license practices. Many people have made | |
219 | generous contributions to the wide range of software distributed | |
220 | through that system in reliance on consistent application of that | |
221 | system; it is up to the author/donor to decide if he or she is willing | |
222 | to distribute software through any other system and a licensee cannot | |
223 | impose that choice. | |
224 | ||
225 | This section is intended to make thoroughly clear what is believed to | |
226 | be a consequence of the rest of this License. | |
227 | ||
228 | 8. If the distribution and/or use of the Program is restricted in | |
229 | certain countries either by patents or by copyrighted interfaces, the | |
230 | original copyright holder who places the Program under this License | |
231 | may add an explicit geographical distribution limitation excluding | |
232 | those countries, so that distribution is permitted only in or among | |
233 | countries not thus excluded. In such case, this License incorporates | |
234 | the limitation as if written in the body of this License. | |
235 | ||
236 | 9. The Free Software Foundation may publish revised and/or new versions | |
237 | of the General Public License from time to time. Such new versions will | |
238 | be similar in spirit to the present version, but may differ in detail to | |
239 | address new problems or concerns. | |
240 | ||
241 | Each version is given a distinguishing version number. If the Program | |
242 | specifies a version number of this License which applies to it and "any | |
243 | later version", you have the option of following the terms and conditions | |
244 | either of that version or of any later version published by the Free | |
245 | Software Foundation. If the Program does not specify a version number of | |
246 | this License, you may choose any version ever published by the Free Software | |
247 | Foundation. | |
248 | ||
249 | 10. If you wish to incorporate parts of the Program into other free | |
250 | programs whose distribution conditions are different, write to the author | |
251 | to ask for permission. For software which is copyrighted by the Free | |
252 | Software Foundation, write to the Free Software Foundation; we sometimes | |
253 | make exceptions for this. Our decision will be guided by the two goals | |
254 | of preserving the free status of all derivatives of our free software and | |
255 | of promoting the sharing and reuse of software generally. | |
256 | ||
257 | NO WARRANTY | |
258 | ||
259 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | |
260 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | |
261 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | |
262 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED | |
263 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | |
264 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS | |
265 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE | |
266 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, | |
267 | REPAIR OR CORRECTION. | |
268 | ||
269 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | |
270 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | |
271 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, | |
272 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING | |
273 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED | |
274 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY | |
275 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER | |
276 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE | |
277 | POSSIBILITY OF SUCH DAMAGES. | |
278 | ||
279 | END OF TERMS AND CONDITIONS | |
280 | ||
281 | How to Apply These Terms to Your New Programs | |
282 | ||
283 | If you develop a new program, and you want it to be of the greatest | |
284 | possible use to the public, the best way to achieve this is to make it | |
285 | free software which everyone can redistribute and change under these terms. | |
286 | ||
287 | To do so, attach the following notices to the program. It is safest | |
288 | to attach them to the start of each source file to most effectively | |
289 | convey the exclusion of warranty; and each file should have at least | |
290 | the "copyright" line and a pointer to where the full notice is found. | |
291 | ||
292 | <one line to give the program's name and a brief idea of what it does.> | |
293 | Copyright (C) <year> <name of author> | |
294 | ||
295 | This program is free software; you can redistribute it and/or modify | |
296 | it under the terms of the GNU General Public License as published by | |
297 | the Free Software Foundation; either version 2 of the License, or | |
298 | (at your option) any later version. | |
299 | ||
300 | This program is distributed in the hope that it will be useful, | |
301 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
302 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
303 | GNU General Public License for more details. | |
304 | ||
305 | You should have received a copy of the GNU General Public License | |
306 | along with this program; if not, write to the Free Software | |
307 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
308 | ||
309 | ||
310 | Also add information on how to contact you by electronic and paper mail. | |
311 | ||
312 | If the program is interactive, make it output a short notice like this | |
313 | when it starts in an interactive mode: | |
314 | ||
315 | Gnomovision version 69, Copyright (C) year name of author | |
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. | |
317 | This is free software, and you are welcome to redistribute it | |
318 | under certain conditions; type `show c' for details. | |
319 | ||
320 | The hypothetical commands `show w' and `show c' should show the appropriate | |
321 | parts of the General Public License. Of course, the commands you use may | |
322 | be called something other than `show w' and `show c'; they could even be | |
323 | mouse-clicks or menu items--whatever suits your program. | |
324 | ||
325 | You should also get your employer (if you work as a programmer) or your | |
326 | school, if any, to sign a "copyright disclaimer" for the program, if | |
327 | necessary. Here is a sample; alter the names: | |
328 | ||
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program | |
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. | |
331 | ||
332 | <signature of Ty Coon>, 1 April 1989 | |
333 | Ty Coon, President of Vice | |
334 | ||
335 | This General Public License does not permit incorporating your program into | |
336 | proprietary programs. If your program is a subroutine library, you may | |
337 | consider it more useful to permit linking proprietary applications with the | |
338 | library. If this is what you want to do, use the GNU Library General | |
339 | Public License instead of this License. |
0 | >> Squidview history: | |
1 | ||
2 | v0.63: 17 December 2003: | |
3 | - fixes to allow compiling in some environments | |
4 | ||
5 | v0.62: 16 December 2003 | |
6 | - bugs found and fixed by Mike Reid - thanks: | |
7 | - dereference of null pointer in NullText() | |
8 | - using c_str() to write to a string in StrLwr() | |
9 | - above bug fixes allow fast STL sort to run, so it is now default. | |
10 | but requires an edit of conf file if upgrading - see BUGS | |
11 | - more bugs fixed: | |
12 | - false positive in CheckEmail() | |
13 | - better shown progress in report generation | |
14 | ||
15 | v0.61: 9 December 2003 | |
16 | - example.log included | |
17 | ||
18 | v0.60: 17 November 2003 | |
19 | - repackaged to use GNU make | |
20 | - better at determining location of shared data | |
21 | ||
22 | v0.51: 18 September 2003 | |
23 | - remembers some tally preferences | |
24 | - minor bug fixed | |
25 | ||
26 | v0.50: 16 September 2003 | |
27 | - took in the 0.4 beta series: | |
28 | -- tally mode | |
29 | -- one user history mode | |
30 | - and added documentation | |
31 | ||
32 | v0.36: 1 March 2003 | |
33 | - aliases of IP client numbers | |
34 | - option changes to support that | |
35 | ||
36 | v0.35: 13 January 2003 | |
37 | - documentation improvements | |
38 | - minor bug (non fatal) fixes | |
39 | ||
40 | v0.30 patch3: 3 January 2003 | |
41 | - IP addresses replace null names | |
42 | - a few other minor improvements | |
43 | ||
44 | v0.30 patch 2: 30 December 2002 | |
45 | - distribution includes sample access.log | |
46 | ||
47 | v0.30 patch 1: 22 August 2002 | |
48 | - compiles with g++ 3 and not just 2.9x | |
49 | ||
50 | v0.30: 17 August 2002 | |
51 | - documentation improvements | |
52 | - misc. improvements | |
53 | - Makefile amended for package distributors | |
54 | - self contained sort routine implemented and used by | |
55 | default as a work around to external segfault - refer | |
56 | to readme about this(*) | |
57 | ||
58 | v0.20: 11 July 2002 | |
59 | - initial public release | |
60 | ||
61 | >> Future plans: | |
62 | ||
63 | - compile smoothly on other platforms, eg Solaris (please help | |
64 | with this one) | |
65 | - fix the above segfault problem * (advice sought also) | |
66 | - non-interactive reports (maybe, according to demand) | |
67 | ||
68 | The squidview home page is: | |
69 | http://www.rillion.net/squidview |
0 | squidview 0.6 (c) 2001 - 2003 Graeme Sheppard - GPL software | |
1 | www.rillion.net/squidview | |
2 | ||
3 | --Overview | |
4 | ||
5 | Squidview is a program meant to display the squid proxy server log | |
6 | file in a nice fashion, providing the log file is in squid's | |
7 | native reporting fashion. It has features such as search, report | |
8 | generation, monitor mode and supports three log files. | |
9 | ||
10 | Thus, the program can be used to monitor Internet usage on a | |
11 | networked site. But please note squid has to be running first and | |
12 | this program is not a proactive resource controller. What it can | |
13 | do is tell you who and which sites are consuming the most bandwidth. | |
14 | ||
15 | --Using squidview | |
16 | ||
17 | Squidview shows each proxy request on one line starting with the | |
18 | user's name (ie the name of the user on the client machine as | |
19 | reported by identd or similar), flags and then the target (ie | |
20 | destination) of the request. | |
21 | ||
22 | Should an identd process not be running on the client, squidview | |
23 | can display the client IP address instead of "-", or if you are | |
24 | using an aliases file it can get a name from that. See Reports | |
25 | about this. | |
26 | ||
27 | The target bit is truncated if necessary so as to fit the | |
28 | information on one line. There are two methods of truncation | |
29 | (discussed in Reports.) | |
30 | ||
31 | Change the selected line with the cursor control keys or the number | |
32 | keypad. Down the bottom, on the status bar, is the time the selected | |
33 | request was made as well how far through the log it is (as a | |
34 | percentage: 0% top, 100% end). Press 'h' to get some help or 'r' | |
35 | for this readme file. | |
36 | ||
37 | Also on the status bar will be "Mon Pri". "Mon" means the program | |
38 | will update the screen if new proxy requests are made. Toggle this | |
39 | off by pressing 'm' if you want to remain on a selected line. | |
40 | "Pri" is the primary log file, to switch to another log file press | |
41 | the appropriate key (press 'h' for keys.) | |
42 | ||
43 | --Flags | |
44 | ||
45 | Between the user and URL columns is the flags field. For example | |
46 | it may be "w2Rf": | |
47 | ||
48 | 'w': a word match on the URL (see Searches below) | |
49 | '2': bytes transferred was between 0.25MB and 1MB | |
50 | 'R': the request was a cache refresh hit | |
51 | 'f': part of the current focus | |
52 | ||
53 | For a bit of help about these flags select the relevant line and | |
54 | press 'v'. | |
55 | ||
56 | --Searching | |
57 | ||
58 | A search forward is made by the right arrow key, backwards is | |
59 | handled by the left arrow key. But first you need something to | |
60 | search for. Press 'f' to find a piece of text. Both user names and | |
61 | http/ftp addresses can cause a match. Request lines which match | |
62 | are noted by a 'w' in the flags column. | |
63 | ||
64 | Multiple search strings are possible, and are necessary when you | |
65 | use skips. Skips tell squidview not to match some requests, such | |
66 | as when the word "sex" is searched for but not when the target is | |
67 | on doubleclick.net (that advertisement server likes to use the word | |
68 | "sex" in URLs.) The following will accomplish that: | |
69 | ||
70 | !doubleclick.net | |
71 | sex | |
72 | ||
73 | The requests with "doubleclick.net" in them will be skipped | |
74 | because that piece of text is first and it is preceded with an | |
75 | "!". In doubleclick.net cases the flags column will have a | |
76 | '-' where the word match would have been. | |
77 | ||
78 | Note that text you enter with 'f' is placed at the top of the | |
79 | search list so it has priority. Using 'F' (capital F) will add | |
80 | search text to the bottom. | |
81 | ||
82 | Your search words can be saved from the search options menu, and | |
83 | you can do some other things there: pick up large requests and | |
84 | focus on a particular user. These two can be turned off when not | |
85 | needed. | |
86 | ||
87 | --Navigating the log file | |
88 | ||
89 | As well as jumping to the beginning or end of the log file, you | |
90 | can go to a certain percentage through with 'g', or to the | |
91 | beginning of a certain day with 'j' or 'J'. Of course 'home' and | |
92 | 'end' work too, if you are using a remote shell and they don't, | |
93 | press '7' or '1' respectfully (look at your number keypad.) | |
94 | ||
95 | --User lookup | |
96 | ||
97 | On a selected line you can press 'v' to get a verbose description | |
98 | of it - this is actually a dump of the line to the screen. | |
99 | Squidview will try to match the user to those known in a file | |
100 | called "users", displaying that line in the file. For example | |
101 | the "users" file could have in it:- | |
102 | ||
103 | root system administrator | |
104 | ||
105 | The first word on each line must be the login name with no spaces | |
106 | between it and the real name. | |
107 | ||
108 | --Common options | |
109 | ||
110 | By default if no login name is available the client's IP number is | |
111 | displayed instead. Change this with "ip instead of null user" to | |
112 | get, instead, reports of bandwidth attributed to "-". The aliases | |
113 | file is another option here. You might specify that 192.168.0.15 | |
114 | be displayed as "server4". You need to enable this one because | |
115 | it's off by default. | |
116 | ||
117 | Keeping the filename of target also affects the main window. When | |
118 | on, the target URL is shifted left - but not over the domain - so that | |
119 | the type of file can be seen on one line. Otherwise the line is | |
120 | simply truncated to be displayed. | |
121 | ||
122 | --Log a report | |
123 | ||
124 | Make a text or CSV report of search hits. A few options are there. | |
125 | You will need to specify a report file name to view the details. | |
126 | Otherwise you will just get a summary. Reports are placed in ~/.squidview. | |
127 | ||
128 | To start or finish the report at a particular point in the log file | |
129 | highlight the line in the main window, press 'l' and then either | |
130 | 'a' or 'b'. Press 'a' or 'b' again to toggle it. | |
131 | ||
132 | User bandwidth totals can be calculated. The options are search hits | |
133 | or "not veto" (which is mostly everything excluding skips mentioned | |
134 | above.) These are sorted so you can find the heavy internet users. | |
135 | ||
136 | Bandwidth totals will find the most popular sites for you. This can | |
137 | be done for one user specifically or for all users as a whole. | |
138 | ||
139 | When a word hit is detected it can be written in the report (eg | |
140 | "word hit action: normal text"). | |
141 | Text reports are good for viewing with "less"; CSV ones are intended | |
142 | for spreadsheets. | |
143 | ||
144 | In the case of normal text reports you may or may not want to see | |
145 | the request size. This information takes up a column. Splitting long | |
146 | lines will show the details on more than one line if need be. Then | |
147 | again, you may only want all "hits" to be shown on just one line. | |
148 | ||
149 | The other options are straight forward. Be a bit picky about the CSV | |
150 | field separator - they put just about any characters in URLs. Try a | |
151 | tab (yes, just press 'tab', 'enter') or "*". | |
152 | ||
153 | To get a summary report about a particular user, say "graeme", do | |
154 | this: | |
155 | - in search options focus on "graeme" | |
156 | - go to log a report | |
157 | - select "domain bandwidth totals" | |
158 | - select "only focus user graeme" | |
159 | - and press enter on the previous screen where it says go | |
160 | ||
161 | You will need to unset the above options for reports to come | |
162 | out normally again, and for searches (cursor <-, ->) too. | |
163 | ||
164 | --Filtered reports | |
165 | ||
166 | After making a general report it is possible to filter it for | |
167 | just one user. That way you don't have to rescan the log file | |
168 | with a focus. The downside of this is the target totals the | |
169 | user surfed to can't be calculated. | |
170 | ||
171 | --Tally Mode | |
172 | ||
173 | This mode tells you some statistics about each user's usage of the Web. | |
174 | Given any given starting point, it doesn't have to be at the begining of the | |
175 | log, squidview will gather the data, display it, and then keep it up to | |
176 | date. | |
177 | ||
178 | So from the main screen press T (capital) and let it work. Then you should | |
179 | get the tally screen that has the list of users down the left hand side and | |
180 | their statistics to the right. Most numbers are self explanatory. "Points" | |
181 | indicate who has used the Web a lot recently. Every web byte is counted and | |
182 | added to that user's number of points. Then after a certain period of time | |
183 | the points list is aged, eg multiplied by 0.75. This means big users will | |
184 | rise to the top quickly and then slowly progress further down the list if | |
185 | they stop surfing. | |
186 | ||
187 | Tally mode can be set to go in monitor mode. Turn that off if you need to | |
188 | stay selected on one user. There are other views and options mentioned in | |
189 | help (h). One of these toggles what to do about requests that have been | |
190 | denied. You may not want to see attempts by computers (often by themselves) | |
191 | "phoning home" regularly. If the status line shows "-d" you won't get | |
192 | these cluttering up your view. | |
193 | ||
194 | --One User History | |
195 | ||
196 | This mode is like the main view of the request log, just that it contains | |
197 | entries only by the specified user. It is useful to discover that user's | |
198 | recent activity, warranted for example by a spike in his/her tally points. | |
199 | ||
200 | Pressing O (capital) will bring you into this mode using as the user the | |
201 | one currently selected. u will switch to another user. | |
202 | ||
203 | The numbers on the status line deserve explanation. If they say: | |
204 | ||
205 | (98.32% to 100.00%) 90.90% | |
206 | ||
207 | it means that request entries have been found and stored in memory for that | |
208 | user from 98.32% of the way through the log to the end of it (100%.) By | |
209 | scrolling up you can progress further and further backward through the log | |
210 | file. | |
211 | ||
212 | The 90.90% indicates the selected line is that far down the request entries | |
213 | in memory. For your information the request lines aren't actually in | |
214 | memory - just their positions in the log file are. |
0 | --Compiling squidview | |
1 | ||
2 | $ ./configure | |
3 | $ make | |
4 | ||
5 | The program is c/c++ and uses the ncurses library for obtaining | |
6 | some keystrokes. Old gcc compilers can fail compiling this | |
7 | program; if so start afresh and: | |
8 | ||
9 | $ cp Makefile.old Makefile | |
10 | $ make oldgcc | |
11 | ||
12 | ... and install manually. | |
13 | ||
14 | If you are compiling on Solaris I have heard of one instance where | |
15 | it is necessary to link against Solaris' own curses library. To do | |
16 | this you need to link against lcurses rather than lncurses. | |
17 | ||
18 | --Installation | |
19 | ||
20 | If "configure" and "make" are successful: | |
21 | ||
22 | # make install | |
23 | ||
24 | Or if you aren't the superuser the program will still run if | |
25 | you have read access to the squid log file. | |
26 | ||
27 | This program assumes the main squid log file is here: | |
28 | /usr/local/squid/var/logs/access.log | |
29 | If it isn't just symlink it appropriately from the following | |
30 | default. This directory and links are made in the user's home | |
31 | space when first run by the user. | |
32 | ||
33 | graeme@localhost:~/.squidview$ ls -l | |
34 | HOWTO -> /usr/local/share/doc/squidview/HOWTO | |
35 | log1 -> /usr/local/squid/var/logs/access.log | |
36 | log2 -> log1 | |
37 | log3 -> log1 | |
38 | users | |
39 | words | |
40 | ||
41 | In this case squidview expects the primary log to be "log1", | |
42 | and the symlink redirects it to where the file actually is. | |
43 | The same thing applies to the readme. | |
44 | ||
45 | This tar.gz archive comes with an example access.log named | |
46 | example.log. Symlink it to view it with squidview. | |
47 | ||
48 | "users" and "words" are reporting files - these can be symlinks | |
49 | to /etc if you would rather have these files there. "aliases" is | |
50 | another text file, this time for mapping IP numbers to user- | |
51 | defined names. | |
52 | ||
53 | This package comes with example "users", "words" and "aliases" | |
54 | files you can build on. |
0 | bin_PROGRAMS = squidview | |
1 | squidview_SOURCES = squidview.cpp squidview.h | |
2 | pkgdata_DATA = HOWTO BUGS users words aliases example.log | |
3 | EXTRA_DIST = Makefile.old HOWTO BUGS users words aliases example.log |
0 | # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am | |
1 | ||
2 | # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
3 | # This Makefile.in is free software; the Free Software Foundation | |
4 | # gives unlimited permission to copy and/or distribute it, | |
5 | # with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | # This program is distributed in the hope that it will be useful, | |
8 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | # PARTICULAR PURPOSE. | |
11 | ||
12 | ||
13 | SHELL = @SHELL@ | |
14 | ||
15 | srcdir = @srcdir@ | |
16 | top_srcdir = @top_srcdir@ | |
17 | VPATH = @srcdir@ | |
18 | prefix = @prefix@ | |
19 | exec_prefix = @exec_prefix@ | |
20 | ||
21 | bindir = @bindir@ | |
22 | sbindir = @sbindir@ | |
23 | libexecdir = @libexecdir@ | |
24 | datadir = @datadir@ | |
25 | sysconfdir = @sysconfdir@ | |
26 | sharedstatedir = @sharedstatedir@ | |
27 | localstatedir = @localstatedir@ | |
28 | libdir = @libdir@ | |
29 | infodir = @infodir@ | |
30 | mandir = @mandir@ | |
31 | includedir = @includedir@ | |
32 | oldincludedir = /usr/include | |
33 | ||
34 | DESTDIR = | |
35 | ||
36 | pkgdatadir = $(datadir)/@PACKAGE@ | |
37 | pkglibdir = $(libdir)/@PACKAGE@ | |
38 | pkgincludedir = $(includedir)/@PACKAGE@ | |
39 | ||
40 | top_builddir = . | |
41 | ||
42 | ACLOCAL = @ACLOCAL@ | |
43 | AUTOCONF = @AUTOCONF@ | |
44 | AUTOMAKE = @AUTOMAKE@ | |
45 | AUTOHEADER = @AUTOHEADER@ | |
46 | ||
47 | INSTALL = @INSTALL@ | |
48 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) | |
49 | INSTALL_DATA = @INSTALL_DATA@ | |
50 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | |
51 | transform = @program_transform_name@ | |
52 | ||
53 | NORMAL_INSTALL = : | |
54 | PRE_INSTALL = : | |
55 | POST_INSTALL = : | |
56 | NORMAL_UNINSTALL = : | |
57 | PRE_UNINSTALL = : | |
58 | POST_UNINSTALL = : | |
59 | CXX = @CXX@ | |
60 | MAKEINFO = @MAKEINFO@ | |
61 | PACKAGE = @PACKAGE@ | |
62 | VERSION = @VERSION@ | |
63 | ||
64 | bin_PROGRAMS = squidview | |
65 | squidview_SOURCES = squidview.cpp squidview.h | |
66 | pkgdata_DATA = HOWTO BUGS users words aliases example.log | |
67 | EXTRA_DIST = Makefile.old HOWTO BUGS users words aliases example.log | |
68 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | |
69 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | |
70 | CONFIG_HEADER = config.h | |
71 | CONFIG_CLEAN_FILES = | |
72 | PROGRAMS = $(bin_PROGRAMS) | |
73 | ||
74 | ||
75 | DEFS = @DEFS@ -I. -I$(srcdir) -I. | |
76 | CPPFLAGS = @CPPFLAGS@ | |
77 | LDFLAGS = @LDFLAGS@ | |
78 | LIBS = @LIBS@ | |
79 | squidview_OBJECTS = squidview.o | |
80 | squidview_LDADD = $(LDADD) | |
81 | squidview_DEPENDENCIES = | |
82 | squidview_LDFLAGS = | |
83 | CXXFLAGS = @CXXFLAGS@ | |
84 | CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) | |
85 | CXXLD = $(CXX) | |
86 | CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ | |
87 | CFLAGS = @CFLAGS@ | |
88 | COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | |
89 | CCLD = $(CC) | |
90 | LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ | |
91 | DATA = $(pkgdata_DATA) | |
92 | ||
93 | DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \ | |
94 | Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.h.in \ | |
95 | configure configure.in install-sh missing mkinstalldirs | |
96 | ||
97 | ||
98 | DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) | |
99 | ||
100 | TAR = tar | |
101 | GZIP_ENV = --best | |
102 | SOURCES = $(squidview_SOURCES) | |
103 | OBJECTS = $(squidview_OBJECTS) | |
104 | ||
105 | all: all-redirect | |
106 | .SUFFIXES: | |
107 | .SUFFIXES: .S .c .cpp .o .s | |
108 | $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) | |
109 | cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile | |
110 | ||
111 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | |
112 | cd $(top_builddir) \ | |
113 | && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status | |
114 | ||
115 | $(ACLOCAL_M4): configure.in | |
116 | cd $(srcdir) && $(ACLOCAL) | |
117 | ||
118 | config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) | |
119 | $(SHELL) ./config.status --recheck | |
120 | $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) | |
121 | cd $(srcdir) && $(AUTOCONF) | |
122 | ||
123 | config.h: stamp-h | |
124 | @if test ! -f $@; then \ | |
125 | rm -f stamp-h; \ | |
126 | $(MAKE) stamp-h; \ | |
127 | else :; fi | |
128 | stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status | |
129 | cd $(top_builddir) \ | |
130 | && CONFIG_FILES= CONFIG_HEADERS=config.h \ | |
131 | $(SHELL) ./config.status | |
132 | @echo timestamp > stamp-h 2> /dev/null | |
133 | $(srcdir)/config.h.in: $(srcdir)/stamp-h.in | |
134 | @if test ! -f $@; then \ | |
135 | rm -f $(srcdir)/stamp-h.in; \ | |
136 | $(MAKE) $(srcdir)/stamp-h.in; \ | |
137 | else :; fi | |
138 | $(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h | |
139 | cd $(top_srcdir) && $(AUTOHEADER) | |
140 | @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null | |
141 | ||
142 | mostlyclean-hdr: | |
143 | ||
144 | clean-hdr: | |
145 | ||
146 | distclean-hdr: | |
147 | -rm -f config.h | |
148 | ||
149 | maintainer-clean-hdr: | |
150 | ||
151 | mostlyclean-binPROGRAMS: | |
152 | ||
153 | clean-binPROGRAMS: | |
154 | -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) | |
155 | ||
156 | distclean-binPROGRAMS: | |
157 | ||
158 | maintainer-clean-binPROGRAMS: | |
159 | ||
160 | install-binPROGRAMS: $(bin_PROGRAMS) | |
161 | @$(NORMAL_INSTALL) | |
162 | $(mkinstalldirs) $(DESTDIR)$(bindir) | |
163 | @list='$(bin_PROGRAMS)'; for p in $$list; do \ | |
164 | if test -f $$p; then \ | |
165 | echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ | |
166 | $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ | |
167 | else :; fi; \ | |
168 | done | |
169 | ||
170 | uninstall-binPROGRAMS: | |
171 | @$(NORMAL_UNINSTALL) | |
172 | list='$(bin_PROGRAMS)'; for p in $$list; do \ | |
173 | rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ | |
174 | done | |
175 | ||
176 | .c.o: | |
177 | $(COMPILE) -c $< | |
178 | ||
179 | .s.o: | |
180 | $(COMPILE) -c $< | |
181 | ||
182 | .S.o: | |
183 | $(COMPILE) -c $< | |
184 | ||
185 | mostlyclean-compile: | |
186 | -rm -f *.o core *.core | |
187 | ||
188 | clean-compile: | |
189 | ||
190 | distclean-compile: | |
191 | -rm -f *.tab.c | |
192 | ||
193 | maintainer-clean-compile: | |
194 | ||
195 | squidview: $(squidview_OBJECTS) $(squidview_DEPENDENCIES) | |
196 | @rm -f squidview | |
197 | $(CXXLINK) $(squidview_LDFLAGS) $(squidview_OBJECTS) $(squidview_LDADD) $(LIBS) | |
198 | .cpp.o: | |
199 | $(CXXCOMPILE) -c $< | |
200 | ||
201 | install-pkgdataDATA: $(pkgdata_DATA) | |
202 | @$(NORMAL_INSTALL) | |
203 | $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) | |
204 | @list='$(pkgdata_DATA)'; for p in $$list; do \ | |
205 | if test -f $(srcdir)/$$p; then \ | |
206 | echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \ | |
207 | $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \ | |
208 | else if test -f $$p; then \ | |
209 | echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \ | |
210 | $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \ | |
211 | fi; fi; \ | |
212 | done | |
213 | ||
214 | uninstall-pkgdataDATA: | |
215 | @$(NORMAL_UNINSTALL) | |
216 | list='$(pkgdata_DATA)'; for p in $$list; do \ | |
217 | rm -f $(DESTDIR)$(pkgdatadir)/$$p; \ | |
218 | done | |
219 | ||
220 | tags: TAGS | |
221 | ||
222 | ID: $(HEADERS) $(SOURCES) $(LISP) | |
223 | list='$(SOURCES) $(HEADERS)'; \ | |
224 | unique=`for i in $$list; do echo $$i; done | \ | |
225 | awk ' { files[$$0] = 1; } \ | |
226 | END { for (i in files) print i; }'`; \ | |
227 | here=`pwd` && cd $(srcdir) \ | |
228 | && mkid -f$$here/ID $$unique $(LISP) | |
229 | ||
230 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) | |
231 | tags=; \ | |
232 | here=`pwd`; \ | |
233 | list='$(SOURCES) $(HEADERS)'; \ | |
234 | unique=`for i in $$list; do echo $$i; done | \ | |
235 | awk ' { files[$$0] = 1; } \ | |
236 | END { for (i in files) print i; }'`; \ | |
237 | test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ | |
238 | || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) | |
239 | ||
240 | mostlyclean-tags: | |
241 | ||
242 | clean-tags: | |
243 | ||
244 | distclean-tags: | |
245 | -rm -f TAGS ID | |
246 | ||
247 | maintainer-clean-tags: | |
248 | ||
249 | distdir = $(PACKAGE)-$(VERSION) | |
250 | top_distdir = $(distdir) | |
251 | ||
252 | # This target untars the dist file and tries a VPATH configuration. Then | |
253 | # it guarantees that the distribution is self-contained by making another | |
254 | # tarfile. | |
255 | distcheck: dist | |
256 | -rm -rf $(distdir) | |
257 | GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz | |
258 | mkdir $(distdir)/=build | |
259 | mkdir $(distdir)/=inst | |
260 | dc_install_base=`cd $(distdir)/=inst && pwd`; \ | |
261 | cd $(distdir)/=build \ | |
262 | && ../configure --srcdir=.. --prefix=$$dc_install_base \ | |
263 | && $(MAKE) $(AM_MAKEFLAGS) \ | |
264 | && $(MAKE) $(AM_MAKEFLAGS) dvi \ | |
265 | && $(MAKE) $(AM_MAKEFLAGS) check \ | |
266 | && $(MAKE) $(AM_MAKEFLAGS) install \ | |
267 | && $(MAKE) $(AM_MAKEFLAGS) installcheck \ | |
268 | && $(MAKE) $(AM_MAKEFLAGS) dist | |
269 | -rm -rf $(distdir) | |
270 | @banner="$(distdir).tar.gz is ready for distribution"; \ | |
271 | dashes=`echo "$$banner" | sed s/./=/g`; \ | |
272 | echo "$$dashes"; \ | |
273 | echo "$$banner"; \ | |
274 | echo "$$dashes" | |
275 | dist: distdir | |
276 | -chmod -R a+r $(distdir) | |
277 | GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) | |
278 | -rm -rf $(distdir) | |
279 | dist-all: distdir | |
280 | -chmod -R a+r $(distdir) | |
281 | GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) | |
282 | -rm -rf $(distdir) | |
283 | distdir: $(DISTFILES) | |
284 | -rm -rf $(distdir) | |
285 | mkdir $(distdir) | |
286 | -chmod 777 $(distdir) | |
287 | @for file in $(DISTFILES); do \ | |
288 | d=$(srcdir); \ | |
289 | if test -d $$d/$$file; then \ | |
290 | cp -pr $$d/$$file $(distdir)/$$file; \ | |
291 | else \ | |
292 | test -f $(distdir)/$$file \ | |
293 | || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ | |
294 | || cp -p $$d/$$file $(distdir)/$$file || :; \ | |
295 | fi; \ | |
296 | done | |
297 | squidview.o: squidview.cpp config.h squidview.h | |
298 | ||
299 | info-am: | |
300 | info: info-am | |
301 | dvi-am: | |
302 | dvi: dvi-am | |
303 | check-am: all-am | |
304 | check: check-am | |
305 | installcheck-am: | |
306 | installcheck: installcheck-am | |
307 | all-recursive-am: config.h | |
308 | $(MAKE) $(AM_MAKEFLAGS) all-recursive | |
309 | ||
310 | install-exec-am: install-binPROGRAMS | |
311 | install-exec: install-exec-am | |
312 | ||
313 | install-data-am: install-pkgdataDATA | |
314 | install-data: install-data-am | |
315 | ||
316 | install-am: all-am | |
317 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | |
318 | install: install-am | |
319 | uninstall-am: uninstall-binPROGRAMS uninstall-pkgdataDATA | |
320 | uninstall: uninstall-am | |
321 | all-am: Makefile $(PROGRAMS) $(DATA) config.h | |
322 | all-redirect: all-am | |
323 | install-strip: | |
324 | $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install | |
325 | installdirs: | |
326 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) | |
327 | ||
328 | ||
329 | mostlyclean-generic: | |
330 | ||
331 | clean-generic: | |
332 | ||
333 | distclean-generic: | |
334 | -rm -f Makefile $(CONFIG_CLEAN_FILES) | |
335 | -rm -f config.cache config.log stamp-h stamp-h[0-9]* | |
336 | ||
337 | maintainer-clean-generic: | |
338 | mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ | |
339 | mostlyclean-compile mostlyclean-tags \ | |
340 | mostlyclean-generic | |
341 | ||
342 | mostlyclean: mostlyclean-am | |
343 | ||
344 | clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-tags \ | |
345 | clean-generic mostlyclean-am | |
346 | ||
347 | clean: clean-am | |
348 | ||
349 | distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \ | |
350 | distclean-tags distclean-generic clean-am | |
351 | ||
352 | distclean: distclean-am | |
353 | -rm -f config.status | |
354 | ||
355 | maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \ | |
356 | maintainer-clean-compile maintainer-clean-tags \ | |
357 | maintainer-clean-generic distclean-am | |
358 | @echo "This command is intended for maintainers to use;" | |
359 | @echo "it deletes files that may require special tools to rebuild." | |
360 | ||
361 | maintainer-clean: maintainer-clean-am | |
362 | -rm -f config.status | |
363 | ||
364 | .PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ | |
365 | mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ | |
366 | maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ | |
367 | mostlyclean-compile distclean-compile clean-compile \ | |
368 | maintainer-clean-compile uninstall-pkgdataDATA install-pkgdataDATA tags \ | |
369 | mostlyclean-tags distclean-tags clean-tags maintainer-clean-tags \ | |
370 | distdir info-am info dvi-am dvi check check-am installcheck-am \ | |
371 | installcheck all-recursive-am install-exec-am install-exec \ | |
372 | install-data-am install-data install-am install uninstall-am uninstall \ | |
373 | all-redirect all-am all installdirs mostlyclean-generic \ | |
374 | distclean-generic clean-generic maintainer-clean-generic clean \ | |
375 | mostlyclean distclean maintainer-clean | |
376 | ||
377 | ||
378 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | |
379 | # Otherwise a system limit (for SysV at least) may be exceeded. | |
380 | .NOEXPORT: |
0 | # squidview makefile | |
1 | ||
2 | # For the curious, see if my code conforms to standards. | |
3 | # It doesn't on Debian 3.0 or Redhat 9.0 ie no 64-bit | |
4 | # long long integer in ansi c++. Remove/add some of the | |
5 | # below directives as you please. I use -Wall -Werror. | |
6 | #CXXFLAGS = -Wall -ansi -pedantic -Werror | |
7 | CXXFLAGS = | |
8 | ||
9 | CXX = c++ | |
10 | PREFIX = /usr/local | |
11 | BINDIR = $(PREFIX)/bin | |
12 | DATADIR = $(PREFIX)/share | |
13 | DOCDIR = $(DATADIR)/doc | |
14 | ||
15 | squidview: squidview.cpp squidview.h | |
16 | $(CXX) squidview.cpp $(CXXFLAGS) -lncurses -o squidview | |
17 | ||
18 | oldgcc: squidview.cpp squidview.h | |
19 | $(CXX) squidview.cpp $(CXXFLAGS) -fhandle-exceptions -lncurses -o squidview | |
20 | ||
21 | install: | |
22 | install -d $(DESTDIR)$(BINDIR) | |
23 | install squidview $(DESTDIR)$(BINDIR) |
0 | squidview 0.60 (c) 2001 - 2003 Graeme Sheppard - GPL software | |
1 | www.rillion.net/squidview | |
2 | ||
3 | --Overview | |
4 | ||
5 | Squidview is a program meant to display the squid proxy server log | |
6 | file in a nice fashion, providing the log file is in squid's | |
7 | native reporting fashion. It has features such as search, report | |
8 | generation, monitor mode and supports three log files. | |
9 | ||
10 | Thus, the program can be used to monitor Internet usage on a | |
11 | networked site. But please note squid has to be running first and | |
12 | this program is not a proactive resource controller. What it can | |
13 | do is tell you who and which sites are consuming the most bandwidth. | |
14 | ||
15 | You will need the ncurses library. |
0 | /* Name of package. */ | |
1 | #undef PACKAGE | |
2 | ||
3 | /* Version of package. */ | |
4 | #undef VERSION | |
5 | ||
6 | #undef SHAREDIR |
0 | dnl aclocal.m4 generated automatically by aclocal 1.4-p4 | |
1 | ||
2 | dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. | |
3 | dnl This file is free software; the Free Software Foundation | |
4 | dnl gives unlimited permission to copy and/or distribute it, | |
5 | dnl with or without modifications, as long as this notice is preserved. | |
6 | ||
7 | dnl This program is distributed in the hope that it will be useful, | |
8 | dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
9 | dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
10 | dnl PARTICULAR PURPOSE. | |
11 | ||
12 | # Like AC_CONFIG_HEADER, but automatically create stamp file. | |
13 | ||
14 | AC_DEFUN(AM_CONFIG_HEADER, | |
15 | [AC_PREREQ([2.12]) | |
16 | AC_CONFIG_HEADER([$1]) | |
17 | dnl When config.status generates a header, we must update the stamp-h file. | |
18 | dnl This file resides in the same directory as the config header | |
19 | dnl that is generated. We must strip everything past the first ":", | |
20 | dnl and everything past the last "/". | |
21 | AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl | |
22 | ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, | |
23 | <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, | |
24 | <<am_indx=1 | |
25 | for am_file in <<$1>>; do | |
26 | case " <<$>>CONFIG_HEADERS " in | |
27 | *" <<$>>am_file "*<<)>> | |
28 | echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx | |
29 | ;; | |
30 | esac | |
31 | am_indx=`expr "<<$>>am_indx" + 1` | |
32 | done<<>>dnl>>) | |
33 | changequote([,]))]) | |
34 | ||
35 | # Do all the work for Automake. This macro actually does too much -- | |
36 | # some checks are only needed if your package does certain things. | |
37 | # But this isn't really a big deal. | |
38 | ||
39 | # serial 1 | |
40 | ||
41 | dnl Usage: | |
42 | dnl AM_INIT_AUTOMAKE(package,version, [no-define]) | |
43 | ||
44 | AC_DEFUN(AM_INIT_AUTOMAKE, | |
45 | [AC_REQUIRE([AC_PROG_INSTALL]) | |
46 | PACKAGE=[$1] | |
47 | AC_SUBST(PACKAGE) | |
48 | VERSION=[$2] | |
49 | AC_SUBST(VERSION) | |
50 | dnl test to see if srcdir already configured | |
51 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
52 | AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) | |
53 | fi | |
54 | ifelse([$3],, | |
55 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) | |
56 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) | |
57 | AC_REQUIRE([AM_SANITY_CHECK]) | |
58 | AC_REQUIRE([AC_ARG_PROGRAM]) | |
59 | dnl FIXME This is truly gross. | |
60 | missing_dir=`cd $ac_aux_dir && pwd` | |
61 | AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) | |
62 | AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) | |
63 | AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) | |
64 | AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) | |
65 | AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) | |
66 | AC_REQUIRE([AC_PROG_MAKE_SET])]) | |
67 | ||
68 | # | |
69 | # Check to make sure that the build environment is sane. | |
70 | # | |
71 | ||
72 | AC_DEFUN(AM_SANITY_CHECK, | |
73 | [AC_MSG_CHECKING([whether build environment is sane]) | |
74 | # Just in case | |
75 | sleep 1 | |
76 | echo timestamp > conftestfile | |
77 | # Do `set' in a subshell so we don't clobber the current shell's | |
78 | # arguments. Must try -L first in case configure is actually a | |
79 | # symlink; some systems play weird games with the mod time of symlinks | |
80 | # (eg FreeBSD returns the mod time of the symlink's containing | |
81 | # directory). | |
82 | if ( | |
83 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
84 | if test "[$]*" = "X"; then | |
85 | # -L didn't work. | |
86 | set X `ls -t $srcdir/configure conftestfile` | |
87 | fi | |
88 | if test "[$]*" != "X $srcdir/configure conftestfile" \ | |
89 | && test "[$]*" != "X conftestfile $srcdir/configure"; then | |
90 | ||
91 | # If neither matched, then we have a broken ls. This can happen | |
92 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
93 | # broken ls alias from the environment. This has actually | |
94 | # happened. Such a system could not be considered "sane". | |
95 | AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken | |
96 | alias in your environment]) | |
97 | fi | |
98 | ||
99 | test "[$]2" = conftestfile | |
100 | ) | |
101 | then | |
102 | # Ok. | |
103 | : | |
104 | else | |
105 | AC_MSG_ERROR([newly created file is older than distributed files! | |
106 | Check your system clock]) | |
107 | fi | |
108 | rm -f conftest* | |
109 | AC_MSG_RESULT(yes)]) | |
110 | ||
111 | dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) | |
112 | dnl The program must properly implement --version. | |
113 | AC_DEFUN(AM_MISSING_PROG, | |
114 | [AC_MSG_CHECKING(for working $2) | |
115 | # Run test in a subshell; some versions of sh will print an error if | |
116 | # an executable is not found, even if stderr is redirected. | |
117 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
118 | if ($2 --version) < /dev/null > /dev/null 2>&1; then | |
119 | $1=$2 | |
120 | AC_MSG_RESULT(found) | |
121 | else | |
122 | $1="$3/missing $2" | |
123 | AC_MSG_RESULT(missing) | |
124 | fi | |
125 | AC_SUBST($1)]) | |
126 |
0 | /* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ | |
1 | ||
2 | #undef SHAREDIR | |
3 | ||
4 | /* Define if you have the <curses.h> header file. */ | |
5 | #undef HAVE_CURSES_H | |
6 | ||
7 | /* Define if you have the <fcntl.h> header file. */ | |
8 | #undef HAVE_FCNTL_H | |
9 | ||
10 | /* Define if you have the <math.h> header file. */ | |
11 | #undef HAVE_MATH_H | |
12 | ||
13 | /* Define if you have the <signal.h> header file. */ | |
14 | #undef HAVE_SIGNAL_H | |
15 | ||
16 | /* Define if you have the <stdlib.h> header file. */ | |
17 | #undef HAVE_STDLIB_H | |
18 | ||
19 | /* Define if you have the <sys/stat.h> header file. */ | |
20 | #undef HAVE_SYS_STAT_H | |
21 | ||
22 | /* Define if you have the <sys/time.h> header file. */ | |
23 | #undef HAVE_SYS_TIME_H | |
24 | ||
25 | /* Define if you have the <sys/types.h> header file. */ | |
26 | #undef HAVE_SYS_TYPES_H | |
27 | ||
28 | /* Define if you have the <time.h> header file. */ | |
29 | #undef HAVE_TIME_H | |
30 | ||
31 | /* Define if you have the <unistd.h> header file. */ | |
32 | #undef HAVE_UNISTD_H | |
33 | ||
34 | /* Define if you have the ncurses library (-lncurses). */ | |
35 | #undef HAVE_LIBNCURSES | |
36 | ||
37 | /* Name of package */ | |
38 | #undef PACKAGE | |
39 | ||
40 | /* Version number of package */ | |
41 | #undef VERSION | |
42 |
0 | #! /bin/sh | |
1 | ||
2 | # Guess values for system-dependent variables and create Makefiles. | |
3 | # Generated automatically using autoconf version 2.13 | |
4 | # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. | |
5 | # | |
6 | # This configure script is free software; the Free Software Foundation | |
7 | # gives unlimited permission to copy, distribute and modify it. | |
8 | ||
9 | # Defaults: | |
10 | ac_help= | |
11 | ac_default_prefix=/usr/local | |
12 | # Any additions from configure.in: | |
13 | ||
14 | # Initialize some variables set by options. | |
15 | # The variables have the same names as the options, with | |
16 | # dashes changed to underlines. | |
17 | build=NONE | |
18 | cache_file=./config.cache | |
19 | exec_prefix=NONE | |
20 | host=NONE | |
21 | no_create= | |
22 | nonopt=NONE | |
23 | no_recursion= | |
24 | prefix=NONE | |
25 | program_prefix=NONE | |
26 | program_suffix=NONE | |
27 | program_transform_name=s,x,x, | |
28 | silent= | |
29 | site= | |
30 | srcdir= | |
31 | target=NONE | |
32 | verbose= | |
33 | x_includes=NONE | |
34 | x_libraries=NONE | |
35 | bindir='${exec_prefix}/bin' | |
36 | sbindir='${exec_prefix}/sbin' | |
37 | libexecdir='${exec_prefix}/libexec' | |
38 | datadir='${prefix}/share' | |
39 | sysconfdir='${prefix}/etc' | |
40 | sharedstatedir='${prefix}/com' | |
41 | localstatedir='${prefix}/var' | |
42 | libdir='${exec_prefix}/lib' | |
43 | includedir='${prefix}/include' | |
44 | oldincludedir='/usr/include' | |
45 | infodir='${prefix}/info' | |
46 | mandir='${prefix}/man' | |
47 | ||
48 | # Initialize some other variables. | |
49 | subdirs= | |
50 | MFLAGS= MAKEFLAGS= | |
51 | SHELL=${CONFIG_SHELL-/bin/sh} | |
52 | # Maximum number of lines to put in a shell here document. | |
53 | ac_max_here_lines=12 | |
54 | ||
55 | ac_prev= | |
56 | for ac_option | |
57 | do | |
58 | ||
59 | # If the previous option needs an argument, assign it. | |
60 | if test -n "$ac_prev"; then | |
61 | eval "$ac_prev=\$ac_option" | |
62 | ac_prev= | |
63 | continue | |
64 | fi | |
65 | ||
66 | case "$ac_option" in | |
67 | -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; | |
68 | *) ac_optarg= ;; | |
69 | esac | |
70 | ||
71 | # Accept the important Cygnus configure options, so we can diagnose typos. | |
72 | ||
73 | case "$ac_option" in | |
74 | ||
75 | -bindir | --bindir | --bindi | --bind | --bin | --bi) | |
76 | ac_prev=bindir ;; | |
77 | -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) | |
78 | bindir="$ac_optarg" ;; | |
79 | ||
80 | -build | --build | --buil | --bui | --bu) | |
81 | ac_prev=build ;; | |
82 | -build=* | --build=* | --buil=* | --bui=* | --bu=*) | |
83 | build="$ac_optarg" ;; | |
84 | ||
85 | -cache-file | --cache-file | --cache-fil | --cache-fi \ | |
86 | | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) | |
87 | ac_prev=cache_file ;; | |
88 | -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | |
89 | | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) | |
90 | cache_file="$ac_optarg" ;; | |
91 | ||
92 | -datadir | --datadir | --datadi | --datad | --data | --dat | --da) | |
93 | ac_prev=datadir ;; | |
94 | -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | |
95 | | --da=*) | |
96 | datadir="$ac_optarg" ;; | |
97 | ||
98 | -disable-* | --disable-*) | |
99 | ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` | |
100 | # Reject names that are not valid shell variable names. | |
101 | if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then | |
102 | { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } | |
103 | fi | |
104 | ac_feature=`echo $ac_feature| sed 's/-/_/g'` | |
105 | eval "enable_${ac_feature}=no" ;; | |
106 | ||
107 | -enable-* | --enable-*) | |
108 | ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` | |
109 | # Reject names that are not valid shell variable names. | |
110 | if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then | |
111 | { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } | |
112 | fi | |
113 | ac_feature=`echo $ac_feature| sed 's/-/_/g'` | |
114 | case "$ac_option" in | |
115 | *=*) ;; | |
116 | *) ac_optarg=yes ;; | |
117 | esac | |
118 | eval "enable_${ac_feature}='$ac_optarg'" ;; | |
119 | ||
120 | -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | |
121 | | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | |
122 | | --exec | --exe | --ex) | |
123 | ac_prev=exec_prefix ;; | |
124 | -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | |
125 | | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | |
126 | | --exec=* | --exe=* | --ex=*) | |
127 | exec_prefix="$ac_optarg" ;; | |
128 | ||
129 | -gas | --gas | --ga | --g) | |
130 | # Obsolete; use --with-gas. | |
131 | with_gas=yes ;; | |
132 | ||
133 | -help | --help | --hel | --he) | |
134 | # Omit some internal or obsolete options to make the list less imposing. | |
135 | # This message is too long to be a string in the A/UX 3.1 sh. | |
136 | cat << EOF | |
137 | Usage: configure [options] [host] | |
138 | Options: [defaults in brackets after descriptions] | |
139 | Configuration: | |
140 | --cache-file=FILE cache test results in FILE | |
141 | --help print this message | |
142 | --no-create do not create output files | |
143 | --quiet, --silent do not print \`checking...' messages | |
144 | --version print the version of autoconf that created configure | |
145 | Directory and file names: | |
146 | --prefix=PREFIX install architecture-independent files in PREFIX | |
147 | [$ac_default_prefix] | |
148 | --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX | |
149 | [same as prefix] | |
150 | --bindir=DIR user executables in DIR [EPREFIX/bin] | |
151 | --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] | |
152 | --libexecdir=DIR program executables in DIR [EPREFIX/libexec] | |
153 | --datadir=DIR read-only architecture-independent data in DIR | |
154 | [PREFIX/share] | |
155 | --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] | |
156 | --sharedstatedir=DIR modifiable architecture-independent data in DIR | |
157 | [PREFIX/com] | |
158 | --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] | |
159 | --libdir=DIR object code libraries in DIR [EPREFIX/lib] | |
160 | --includedir=DIR C header files in DIR [PREFIX/include] | |
161 | --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] | |
162 | --infodir=DIR info documentation in DIR [PREFIX/info] | |
163 | --mandir=DIR man documentation in DIR [PREFIX/man] | |
164 | --srcdir=DIR find the sources in DIR [configure dir or ..] | |
165 | --program-prefix=PREFIX prepend PREFIX to installed program names | |
166 | --program-suffix=SUFFIX append SUFFIX to installed program names | |
167 | --program-transform-name=PROGRAM | |
168 | run sed PROGRAM on installed program names | |
169 | EOF | |
170 | cat << EOF | |
171 | Host type: | |
172 | --build=BUILD configure for building on BUILD [BUILD=HOST] | |
173 | --host=HOST configure for HOST [guessed] | |
174 | --target=TARGET configure for TARGET [TARGET=HOST] | |
175 | Features and packages: | |
176 | --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) | |
177 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] | |
178 | --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] | |
179 | --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) | |
180 | --x-includes=DIR X include files are in DIR | |
181 | --x-libraries=DIR X library files are in DIR | |
182 | EOF | |
183 | if test -n "$ac_help"; then | |
184 | echo "--enable and --with options recognized:$ac_help" | |
185 | fi | |
186 | exit 0 ;; | |
187 | ||
188 | -host | --host | --hos | --ho) | |
189 | ac_prev=host ;; | |
190 | -host=* | --host=* | --hos=* | --ho=*) | |
191 | host="$ac_optarg" ;; | |
192 | ||
193 | -includedir | --includedir | --includedi | --included | --include \ | |
194 | | --includ | --inclu | --incl | --inc) | |
195 | ac_prev=includedir ;; | |
196 | -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | |
197 | | --includ=* | --inclu=* | --incl=* | --inc=*) | |
198 | includedir="$ac_optarg" ;; | |
199 | ||
200 | -infodir | --infodir | --infodi | --infod | --info | --inf) | |
201 | ac_prev=infodir ;; | |
202 | -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) | |
203 | infodir="$ac_optarg" ;; | |
204 | ||
205 | -libdir | --libdir | --libdi | --libd) | |
206 | ac_prev=libdir ;; | |
207 | -libdir=* | --libdir=* | --libdi=* | --libd=*) | |
208 | libdir="$ac_optarg" ;; | |
209 | ||
210 | -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | |
211 | | --libexe | --libex | --libe) | |
212 | ac_prev=libexecdir ;; | |
213 | -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | |
214 | | --libexe=* | --libex=* | --libe=*) | |
215 | libexecdir="$ac_optarg" ;; | |
216 | ||
217 | -localstatedir | --localstatedir | --localstatedi | --localstated \ | |
218 | | --localstate | --localstat | --localsta | --localst \ | |
219 | | --locals | --local | --loca | --loc | --lo) | |
220 | ac_prev=localstatedir ;; | |
221 | -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | |
222 | | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | |
223 | | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) | |
224 | localstatedir="$ac_optarg" ;; | |
225 | ||
226 | -mandir | --mandir | --mandi | --mand | --man | --ma | --m) | |
227 | ac_prev=mandir ;; | |
228 | -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) | |
229 | mandir="$ac_optarg" ;; | |
230 | ||
231 | -nfp | --nfp | --nf) | |
232 | # Obsolete; use --without-fp. | |
233 | with_fp=no ;; | |
234 | ||
235 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
236 | | --no-cr | --no-c) | |
237 | no_create=yes ;; | |
238 | ||
239 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
240 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) | |
241 | no_recursion=yes ;; | |
242 | ||
243 | -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | |
244 | | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | |
245 | | --oldin | --oldi | --old | --ol | --o) | |
246 | ac_prev=oldincludedir ;; | |
247 | -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | |
248 | | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | |
249 | | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) | |
250 | oldincludedir="$ac_optarg" ;; | |
251 | ||
252 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
253 | ac_prev=prefix ;; | |
254 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
255 | prefix="$ac_optarg" ;; | |
256 | ||
257 | -program-prefix | --program-prefix | --program-prefi | --program-pref \ | |
258 | | --program-pre | --program-pr | --program-p) | |
259 | ac_prev=program_prefix ;; | |
260 | -program-prefix=* | --program-prefix=* | --program-prefi=* \ | |
261 | | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) | |
262 | program_prefix="$ac_optarg" ;; | |
263 | ||
264 | -program-suffix | --program-suffix | --program-suffi | --program-suff \ | |
265 | | --program-suf | --program-su | --program-s) | |
266 | ac_prev=program_suffix ;; | |
267 | -program-suffix=* | --program-suffix=* | --program-suffi=* \ | |
268 | | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) | |
269 | program_suffix="$ac_optarg" ;; | |
270 | ||
271 | -program-transform-name | --program-transform-name \ | |
272 | | --program-transform-nam | --program-transform-na \ | |
273 | | --program-transform-n | --program-transform- \ | |
274 | | --program-transform | --program-transfor \ | |
275 | | --program-transfo | --program-transf \ | |
276 | | --program-trans | --program-tran \ | |
277 | | --progr-tra | --program-tr | --program-t) | |
278 | ac_prev=program_transform_name ;; | |
279 | -program-transform-name=* | --program-transform-name=* \ | |
280 | | --program-transform-nam=* | --program-transform-na=* \ | |
281 | | --program-transform-n=* | --program-transform-=* \ | |
282 | | --program-transform=* | --program-transfor=* \ | |
283 | | --program-transfo=* | --program-transf=* \ | |
284 | | --program-trans=* | --program-tran=* \ | |
285 | | --progr-tra=* | --program-tr=* | --program-t=*) | |
286 | program_transform_name="$ac_optarg" ;; | |
287 | ||
288 | -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | |
289 | | -silent | --silent | --silen | --sile | --sil) | |
290 | silent=yes ;; | |
291 | ||
292 | -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) | |
293 | ac_prev=sbindir ;; | |
294 | -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | |
295 | | --sbi=* | --sb=*) | |
296 | sbindir="$ac_optarg" ;; | |
297 | ||
298 | -sharedstatedir | --sharedstatedir | --sharedstatedi \ | |
299 | | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | |
300 | | --sharedst | --shareds | --shared | --share | --shar \ | |
301 | | --sha | --sh) | |
302 | ac_prev=sharedstatedir ;; | |
303 | -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | |
304 | | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | |
305 | | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | |
306 | | --sha=* | --sh=*) | |
307 | sharedstatedir="$ac_optarg" ;; | |
308 | ||
309 | -site | --site | --sit) | |
310 | ac_prev=site ;; | |
311 | -site=* | --site=* | --sit=*) | |
312 | site="$ac_optarg" ;; | |
313 | ||
314 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) | |
315 | ac_prev=srcdir ;; | |
316 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) | |
317 | srcdir="$ac_optarg" ;; | |
318 | ||
319 | -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | |
320 | | --syscon | --sysco | --sysc | --sys | --sy) | |
321 | ac_prev=sysconfdir ;; | |
322 | -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | |
323 | | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) | |
324 | sysconfdir="$ac_optarg" ;; | |
325 | ||
326 | -target | --target | --targe | --targ | --tar | --ta | --t) | |
327 | ac_prev=target ;; | |
328 | -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) | |
329 | target="$ac_optarg" ;; | |
330 | ||
331 | -v | -verbose | --verbose | --verbos | --verbo | --verb) | |
332 | verbose=yes ;; | |
333 | ||
334 | -version | --version | --versio | --versi | --vers) | |
335 | echo "configure generated by autoconf version 2.13" | |
336 | exit 0 ;; | |
337 | ||
338 | -with-* | --with-*) | |
339 | ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` | |
340 | # Reject names that are not valid shell variable names. | |
341 | if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then | |
342 | { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } | |
343 | fi | |
344 | ac_package=`echo $ac_package| sed 's/-/_/g'` | |
345 | case "$ac_option" in | |
346 | *=*) ;; | |
347 | *) ac_optarg=yes ;; | |
348 | esac | |
349 | eval "with_${ac_package}='$ac_optarg'" ;; | |
350 | ||
351 | -without-* | --without-*) | |
352 | ac_package=`echo $ac_option|sed -e 's/-*without-//'` | |
353 | # Reject names that are not valid shell variable names. | |
354 | if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then | |
355 | { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } | |
356 | fi | |
357 | ac_package=`echo $ac_package| sed 's/-/_/g'` | |
358 | eval "with_${ac_package}=no" ;; | |
359 | ||
360 | --x) | |
361 | # Obsolete; use --with-x. | |
362 | with_x=yes ;; | |
363 | ||
364 | -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | |
365 | | --x-incl | --x-inc | --x-in | --x-i) | |
366 | ac_prev=x_includes ;; | |
367 | -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | |
368 | | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) | |
369 | x_includes="$ac_optarg" ;; | |
370 | ||
371 | -x-libraries | --x-libraries | --x-librarie | --x-librari \ | |
372 | | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) | |
373 | ac_prev=x_libraries ;; | |
374 | -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | |
375 | | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) | |
376 | x_libraries="$ac_optarg" ;; | |
377 | ||
378 | -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } | |
379 | ;; | |
380 | ||
381 | *) | |
382 | if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then | |
383 | echo "configure: warning: $ac_option: invalid host type" 1>&2 | |
384 | fi | |
385 | if test "x$nonopt" != xNONE; then | |
386 | { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } | |
387 | fi | |
388 | nonopt="$ac_option" | |
389 | ;; | |
390 | ||
391 | esac | |
392 | done | |
393 | ||
394 | if test -n "$ac_prev"; then | |
395 | { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } | |
396 | fi | |
397 | ||
398 | trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 | |
399 | ||
400 | # File descriptor usage: | |
401 | # 0 standard input | |
402 | # 1 file creation | |
403 | # 2 errors and warnings | |
404 | # 3 some systems may open it to /dev/tty | |
405 | # 4 used on the Kubota Titan | |
406 | # 6 checking for... messages and results | |
407 | # 5 compiler messages saved in config.log | |
408 | if test "$silent" = yes; then | |
409 | exec 6>/dev/null | |
410 | else | |
411 | exec 6>&1 | |
412 | fi | |
413 | exec 5>./config.log | |
414 | ||
415 | echo "\ | |
416 | This file contains any messages produced by compilers while | |
417 | running configure, to aid debugging if configure makes a mistake. | |
418 | " 1>&5 | |
419 | ||
420 | # Strip out --no-create and --no-recursion so they do not pile up. | |
421 | # Also quote any args containing shell metacharacters. | |
422 | ac_configure_args= | |
423 | for ac_arg | |
424 | do | |
425 | case "$ac_arg" in | |
426 | -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | |
427 | | --no-cr | --no-c) ;; | |
428 | -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | |
429 | | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; | |
430 | *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) | |
431 | ac_configure_args="$ac_configure_args '$ac_arg'" ;; | |
432 | *) ac_configure_args="$ac_configure_args $ac_arg" ;; | |
433 | esac | |
434 | done | |
435 | ||
436 | # NLS nuisances. | |
437 | # Only set these to C if already set. These must not be set unconditionally | |
438 | # because not all systems understand e.g. LANG=C (notably SCO). | |
439 | # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! | |
440 | # Non-C LC_CTYPE values break the ctype check. | |
441 | if test "${LANG+set}" = set; then LANG=C; export LANG; fi | |
442 | if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi | |
443 | if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi | |
444 | if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi | |
445 | ||
446 | # confdefs.h avoids OS command line length limits that DEFS can exceed. | |
447 | rm -rf conftest* confdefs.h | |
448 | # AIX cpp loses on an empty file, so make sure it contains at least a newline. | |
449 | echo > confdefs.h | |
450 | ||
451 | # A filename unique to this package, relative to the directory that | |
452 | # configure is in, which we can look for to find out if srcdir is correct. | |
453 | ac_unique_file=squidview.cpp | |
454 | ||
455 | # Find the source files, if location was not specified. | |
456 | if test -z "$srcdir"; then | |
457 | ac_srcdir_defaulted=yes | |
458 | # Try the directory containing this script, then its parent. | |
459 | ac_prog=$0 | |
460 | ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` | |
461 | test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. | |
462 | srcdir=$ac_confdir | |
463 | if test ! -r $srcdir/$ac_unique_file; then | |
464 | srcdir=.. | |
465 | fi | |
466 | else | |
467 | ac_srcdir_defaulted=no | |
468 | fi | |
469 | if test ! -r $srcdir/$ac_unique_file; then | |
470 | if test "$ac_srcdir_defaulted" = yes; then | |
471 | { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } | |
472 | else | |
473 | { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } | |
474 | fi | |
475 | fi | |
476 | srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` | |
477 | ||
478 | # Prefer explicitly selected file to automatically selected ones. | |
479 | if test -z "$CONFIG_SITE"; then | |
480 | if test "x$prefix" != xNONE; then | |
481 | CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" | |
482 | else | |
483 | CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" | |
484 | fi | |
485 | fi | |
486 | for ac_site_file in $CONFIG_SITE; do | |
487 | if test -r "$ac_site_file"; then | |
488 | echo "loading site script $ac_site_file" | |
489 | . "$ac_site_file" | |
490 | fi | |
491 | done | |
492 | ||
493 | if test -r "$cache_file"; then | |
494 | echo "loading cache $cache_file" | |
495 | . $cache_file | |
496 | else | |
497 | echo "creating cache $cache_file" | |
498 | > $cache_file | |
499 | fi | |
500 | ||
501 | ac_ext=c | |
502 | # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
503 | ac_cpp='$CPP $CPPFLAGS' | |
504 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
505 | ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
506 | cross_compiling=$ac_cv_prog_cc_cross | |
507 | ||
508 | ac_exeext= | |
509 | ac_objext=o | |
510 | if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then | |
511 | # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. | |
512 | if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then | |
513 | ac_n= ac_c=' | |
514 | ' ac_t=' ' | |
515 | else | |
516 | ac_n=-n ac_c= ac_t= | |
517 | fi | |
518 | else | |
519 | ac_n= ac_c='\c' ac_t= | |
520 | fi | |
521 | ||
522 | ||
523 | ||
524 | ||
525 | ||
526 | ac_aux_dir= | |
527 | for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do | |
528 | if test -f $ac_dir/install-sh; then | |
529 | ac_aux_dir=$ac_dir | |
530 | ac_install_sh="$ac_aux_dir/install-sh -c" | |
531 | break | |
532 | elif test -f $ac_dir/install.sh; then | |
533 | ac_aux_dir=$ac_dir | |
534 | ac_install_sh="$ac_aux_dir/install.sh -c" | |
535 | break | |
536 | fi | |
537 | done | |
538 | if test -z "$ac_aux_dir"; then | |
539 | { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } | |
540 | fi | |
541 | ac_config_guess=$ac_aux_dir/config.guess | |
542 | ac_config_sub=$ac_aux_dir/config.sub | |
543 | ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. | |
544 | ||
545 | # Find a good install program. We prefer a C program (faster), | |
546 | # so one script is as good as another. But avoid the broken or | |
547 | # incompatible versions: | |
548 | # SysV /etc/install, /usr/sbin/install | |
549 | # SunOS /usr/etc/install | |
550 | # IRIX /sbin/install | |
551 | # AIX /bin/install | |
552 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag | |
553 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
554 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
555 | # ./install, which can be erroneously created by make from ./install.sh. | |
556 | echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 | |
557 | echo "configure:559: checking for a BSD compatible install" >&5 | |
558 | if test -z "$INSTALL"; then | |
559 | if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then | |
560 | echo $ac_n "(cached) $ac_c" 1>&6 | |
561 | else | |
562 | IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" | |
563 | for ac_dir in $PATH; do | |
564 | # Account for people who put trailing slashes in PATH elements. | |
565 | case "$ac_dir/" in | |
566 | /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; | |
567 | *) | |
568 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
569 | # Don't use installbsd from OSF since it installs stuff as root | |
570 | # by default. | |
571 | for ac_prog in ginstall scoinst install; do | |
572 | if test -f $ac_dir/$ac_prog; then | |
573 | if test $ac_prog = install && | |
574 | grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then | |
575 | # AIX install. It has an incompatible calling convention. | |
576 | : | |
577 | else | |
578 | ac_cv_path_install="$ac_dir/$ac_prog -c" | |
579 | break 2 | |
580 | fi | |
581 | fi | |
582 | done | |
583 | ;; | |
584 | esac | |
585 | done | |
586 | IFS="$ac_save_IFS" | |
587 | ||
588 | fi | |
589 | if test "${ac_cv_path_install+set}" = set; then | |
590 | INSTALL="$ac_cv_path_install" | |
591 | else | |
592 | # As a last resort, use the slow shell script. We don't cache a | |
593 | # path for INSTALL within a source directory, because that will | |
594 | # break other packages using the cache if that directory is | |
595 | # removed, or if the path is relative. | |
596 | INSTALL="$ac_install_sh" | |
597 | fi | |
598 | fi | |
599 | echo "$ac_t""$INSTALL" 1>&6 | |
600 | ||
601 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
602 | # It thinks the first close brace ends the variable substitution. | |
603 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
604 | ||
605 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
606 | ||
607 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
608 | ||
609 | echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 | |
610 | echo "configure:612: checking whether build environment is sane" >&5 | |
611 | # Just in case | |
612 | sleep 1 | |
613 | echo timestamp > conftestfile | |
614 | # Do `set' in a subshell so we don't clobber the current shell's | |
615 | # arguments. Must try -L first in case configure is actually a | |
616 | # symlink; some systems play weird games with the mod time of symlinks | |
617 | # (eg FreeBSD returns the mod time of the symlink's containing | |
618 | # directory). | |
619 | if ( | |
620 | set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` | |
621 | if test "$*" = "X"; then | |
622 | # -L didn't work. | |
623 | set X `ls -t $srcdir/configure conftestfile` | |
624 | fi | |
625 | if test "$*" != "X $srcdir/configure conftestfile" \ | |
626 | && test "$*" != "X conftestfile $srcdir/configure"; then | |
627 | ||
628 | # If neither matched, then we have a broken ls. This can happen | |
629 | # if, for instance, CONFIG_SHELL is bash and it inherits a | |
630 | # broken ls alias from the environment. This has actually | |
631 | # happened. Such a system could not be considered "sane". | |
632 | { echo "configure: error: ls -t appears to fail. Make sure there is not a broken | |
633 | alias in your environment" 1>&2; exit 1; } | |
634 | fi | |
635 | ||
636 | test "$2" = conftestfile | |
637 | ) | |
638 | then | |
639 | # Ok. | |
640 | : | |
641 | else | |
642 | { echo "configure: error: newly created file is older than distributed files! | |
643 | Check your system clock" 1>&2; exit 1; } | |
644 | fi | |
645 | rm -f conftest* | |
646 | echo "$ac_t""yes" 1>&6 | |
647 | if test "$program_transform_name" = s,x,x,; then | |
648 | program_transform_name= | |
649 | else | |
650 | # Double any \ or $. echo might interpret backslashes. | |
651 | cat <<\EOF_SED > conftestsed | |
652 | s,\\,\\\\,g; s,\$,$$,g | |
653 | EOF_SED | |
654 | program_transform_name="`echo $program_transform_name|sed -f conftestsed`" | |
655 | rm -f conftestsed | |
656 | fi | |
657 | test "$program_prefix" != NONE && | |
658 | program_transform_name="s,^,${program_prefix},; $program_transform_name" | |
659 | # Use a double $ so make ignores it. | |
660 | test "$program_suffix" != NONE && | |
661 | program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" | |
662 | ||
663 | # sed with no file args requires a program. | |
664 | test "$program_transform_name" = "" && program_transform_name="s,x,x," | |
665 | ||
666 | echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 | |
667 | echo "configure:669: checking whether ${MAKE-make} sets \${MAKE}" >&5 | |
668 | set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` | |
669 | if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then | |
670 | echo $ac_n "(cached) $ac_c" 1>&6 | |
671 | else | |
672 | cat > conftestmake <<\EOF | |
673 | all: | |
674 | @echo 'ac_maketemp="${MAKE}"' | |
675 | EOF | |
676 | # GNU make sometimes prints "make[1]: Entering...", which would confuse us. | |
677 | eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` | |
678 | if test -n "$ac_maketemp"; then | |
679 | eval ac_cv_prog_make_${ac_make}_set=yes | |
680 | else | |
681 | eval ac_cv_prog_make_${ac_make}_set=no | |
682 | fi | |
683 | rm -f conftestmake | |
684 | fi | |
685 | if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then | |
686 | echo "$ac_t""yes" 1>&6 | |
687 | SET_MAKE= | |
688 | else | |
689 | echo "$ac_t""no" 1>&6 | |
690 | SET_MAKE="MAKE=${MAKE-make}" | |
691 | fi | |
692 | ||
693 | ||
694 | PACKAGE=squidview | |
695 | ||
696 | VERSION=0.63 | |
697 | ||
698 | if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then | |
699 | { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } | |
700 | fi | |
701 | cat >> confdefs.h <<EOF | |
702 | #define PACKAGE "$PACKAGE" | |
703 | EOF | |
704 | ||
705 | cat >> confdefs.h <<EOF | |
706 | #define VERSION "$VERSION" | |
707 | EOF | |
708 | ||
709 | ||
710 | ||
711 | missing_dir=`cd $ac_aux_dir && pwd` | |
712 | echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 | |
713 | echo "configure:715: checking for working aclocal" >&5 | |
714 | # Run test in a subshell; some versions of sh will print an error if | |
715 | # an executable is not found, even if stderr is redirected. | |
716 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
717 | if (aclocal --version) < /dev/null > /dev/null 2>&1; then | |
718 | ACLOCAL=aclocal | |
719 | echo "$ac_t""found" 1>&6 | |
720 | else | |
721 | ACLOCAL="$missing_dir/missing aclocal" | |
722 | echo "$ac_t""missing" 1>&6 | |
723 | fi | |
724 | ||
725 | echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 | |
726 | echo "configure:728: checking for working autoconf" >&5 | |
727 | # Run test in a subshell; some versions of sh will print an error if | |
728 | # an executable is not found, even if stderr is redirected. | |
729 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
730 | if (autoconf --version) < /dev/null > /dev/null 2>&1; then | |
731 | AUTOCONF=autoconf | |
732 | echo "$ac_t""found" 1>&6 | |
733 | else | |
734 | AUTOCONF="$missing_dir/missing autoconf" | |
735 | echo "$ac_t""missing" 1>&6 | |
736 | fi | |
737 | ||
738 | echo $ac_n "checking for working automake""... $ac_c" 1>&6 | |
739 | echo "configure:741: checking for working automake" >&5 | |
740 | # Run test in a subshell; some versions of sh will print an error if | |
741 | # an executable is not found, even if stderr is redirected. | |
742 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
743 | if (automake --version) < /dev/null > /dev/null 2>&1; then | |
744 | AUTOMAKE=automake | |
745 | echo "$ac_t""found" 1>&6 | |
746 | else | |
747 | AUTOMAKE="$missing_dir/missing automake" | |
748 | echo "$ac_t""missing" 1>&6 | |
749 | fi | |
750 | ||
751 | echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 | |
752 | echo "configure:754: checking for working autoheader" >&5 | |
753 | # Run test in a subshell; some versions of sh will print an error if | |
754 | # an executable is not found, even if stderr is redirected. | |
755 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
756 | if (autoheader --version) < /dev/null > /dev/null 2>&1; then | |
757 | AUTOHEADER=autoheader | |
758 | echo "$ac_t""found" 1>&6 | |
759 | else | |
760 | AUTOHEADER="$missing_dir/missing autoheader" | |
761 | echo "$ac_t""missing" 1>&6 | |
762 | fi | |
763 | ||
764 | echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 | |
765 | echo "configure:767: checking for working makeinfo" >&5 | |
766 | # Run test in a subshell; some versions of sh will print an error if | |
767 | # an executable is not found, even if stderr is redirected. | |
768 | # Redirect stdin to placate older versions of autoconf. Sigh. | |
769 | if (makeinfo --version) < /dev/null > /dev/null 2>&1; then | |
770 | MAKEINFO=makeinfo | |
771 | echo "$ac_t""found" 1>&6 | |
772 | else | |
773 | MAKEINFO="$missing_dir/missing makeinfo" | |
774 | echo "$ac_t""missing" 1>&6 | |
775 | fi | |
776 | ||
777 | ||
778 | for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl | |
779 | do | |
780 | # Extract the first word of "$ac_prog", so it can be a program name with args. | |
781 | set dummy $ac_prog; ac_word=$2 | |
782 | echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 | |
783 | echo "configure:785: checking for $ac_word" >&5 | |
784 | if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then | |
785 | echo $ac_n "(cached) $ac_c" 1>&6 | |
786 | else | |
787 | if test -n "$CXX"; then | |
788 | ac_cv_prog_CXX="$CXX" # Let the user override the test. | |
789 | else | |
790 | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" | |
791 | ac_dummy="$PATH" | |
792 | for ac_dir in $ac_dummy; do | |
793 | test -z "$ac_dir" && ac_dir=. | |
794 | if test -f $ac_dir/$ac_word; then | |
795 | ac_cv_prog_CXX="$ac_prog" | |
796 | break | |
797 | fi | |
798 | done | |
799 | IFS="$ac_save_ifs" | |
800 | fi | |
801 | fi | |
802 | CXX="$ac_cv_prog_CXX" | |
803 | if test -n "$CXX"; then | |
804 | echo "$ac_t""$CXX" 1>&6 | |
805 | else | |
806 | echo "$ac_t""no" 1>&6 | |
807 | fi | |
808 | ||
809 | test -n "$CXX" && break | |
810 | done | |
811 | test -n "$CXX" || CXX="gcc" | |
812 | ||
813 | ||
814 | echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 | |
815 | echo "configure:817: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 | |
816 | ||
817 | ac_ext=C | |
818 | # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
819 | ac_cpp='$CXXCPP $CPPFLAGS' | |
820 | ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
821 | ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
822 | cross_compiling=$ac_cv_prog_cxx_cross | |
823 | ||
824 | cat > conftest.$ac_ext << EOF | |
825 | ||
826 | #line 828 "configure" | |
827 | #include "confdefs.h" | |
828 | ||
829 | int main(){return(0);} | |
830 | EOF | |
831 | if { (eval echo configure:833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | |
832 | ac_cv_prog_cxx_works=yes | |
833 | # If we can't run a trivial program, we are probably using a cross compiler. | |
834 | if (./conftest; exit) 2>/dev/null; then | |
835 | ac_cv_prog_cxx_cross=no | |
836 | else | |
837 | ac_cv_prog_cxx_cross=yes | |
838 | fi | |
839 | else | |
840 | echo "configure: failed program was:" >&5 | |
841 | cat conftest.$ac_ext >&5 | |
842 | ac_cv_prog_cxx_works=no | |
843 | fi | |
844 | rm -fr conftest* | |
845 | ac_ext=c | |
846 | # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
847 | ac_cpp='$CPP $CPPFLAGS' | |
848 | ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
849 | ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
850 | cross_compiling=$ac_cv_prog_cc_cross | |
851 | ||
852 | echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 | |
853 | if test $ac_cv_prog_cxx_works = no; then | |
854 | { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } | |
855 | fi | |
856 | echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 | |
857 | echo "configure:859: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 | |
858 | echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 | |
859 | cross_compiling=$ac_cv_prog_cxx_cross | |
860 | ||
861 | echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 | |
862 | echo "configure:864: checking whether we are using GNU C++" >&5 | |
863 | if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then | |
864 | echo $ac_n "(cached) $ac_c" 1>&6 | |
865 | else | |
866 | cat > conftest.C <<EOF | |
867 | #ifdef __GNUC__ | |
868 | yes; | |
869 | #endif | |
870 | EOF | |
871 | if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then | |
872 | ac_cv_prog_gxx=yes | |
873 | else | |
874 | ac_cv_prog_gxx=no | |
875 | fi | |
876 | fi | |
877 | ||
878 | echo "$ac_t""$ac_cv_prog_gxx" 1>&6 | |
879 | ||
880 | if test $ac_cv_prog_gxx = yes; then | |
881 | GXX=yes | |
882 | else | |
883 | GXX= | |
884 | fi | |
885 | ||
886 | ac_test_CXXFLAGS="${CXXFLAGS+set}" | |
887 | ac_save_CXXFLAGS="$CXXFLAGS" | |
888 | CXXFLAGS= | |
889 | echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 | |
890 | echo "configure:892: checking whether ${CXX-g++} accepts -g" >&5 | |
891 | if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then | |
892 | echo $ac_n "(cached) $ac_c" 1>&6 | |
893 | else | |
894 | echo 'void f(){}' > conftest.cc | |
895 | if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then | |
896 | ac_cv_prog_cxx_g=yes | |
897 | else | |
898 | ac_cv_prog_cxx_g=no | |
899 | fi | |
900 | rm -f conftest* | |
901 | ||
902 | fi | |
903 | ||
904 | echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 | |
905 | if test "$ac_test_CXXFLAGS" = set; then | |
906 | CXXFLAGS="$ac_save_CXXFLAGS" | |
907 | elif test $ac_cv_prog_cxx_g = yes; then | |
908 | if test "$GXX" = yes; then | |
909 | CXXFLAGS="-g -O2" | |
910 | else | |
911 | CXXFLAGS="-g" | |
912 | fi | |
913 | else | |
914 | if test "$GXX" = yes; then | |
915 | CXXFLAGS="-O2" | |
916 | else | |
917 | CXXFLAGS= | |
918 | fi | |
919 | fi | |
920 | ||
921 | # Find a good install program. We prefer a C program (faster), | |
922 | # so one script is as good as another. But avoid the broken or | |
923 | # incompatible versions: | |
924 | # SysV /etc/install, /usr/sbin/install | |
925 | # SunOS /usr/etc/install | |
926 | # IRIX /sbin/install | |
927 | # AIX /bin/install | |
928 | # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag | |
929 | # AFS /usr/afsws/bin/install, which mishandles nonexistent args | |
930 | # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" | |
931 | # ./install, which can be erroneously created by make from ./install.sh. | |
932 | echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 | |
933 | echo "configure:935: checking for a BSD compatible install" >&5 | |
934 | if test -z "$INSTALL"; then | |
935 | if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then | |
936 | echo $ac_n "(cached) $ac_c" 1>&6 | |
937 | else | |
938 | IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" | |
939 | for ac_dir in $PATH; do | |
940 | # Account for people who put trailing slashes in PATH elements. | |
941 | case "$ac_dir/" in | |
942 | /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; | |
943 | *) | |
944 | # OSF1 and SCO ODT 3.0 have their own names for install. | |
945 | # Don't use installbsd from OSF since it installs stuff as root | |
946 | # by default. | |
947 | for ac_prog in ginstall scoinst install; do | |
948 | if test -f $ac_dir/$ac_prog; then | |
949 | if test $ac_prog = install && | |
950 | grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then | |
951 | # AIX install. It has an incompatible calling convention. | |
952 | : | |
953 | else | |
954 | ac_cv_path_install="$ac_dir/$ac_prog -c" | |
955 | break 2 | |
956 | fi | |
957 | fi | |
958 | done | |
959 | ;; | |
960 | esac | |
961 | done | |
962 | IFS="$ac_save_IFS" | |
963 | ||
964 | fi | |
965 | if test "${ac_cv_path_install+set}" = set; then | |
966 | INSTALL="$ac_cv_path_install" | |
967 | else | |
968 | # As a last resort, use the slow shell script. We don't cache a | |
969 | # path for INSTALL within a source directory, because that will | |
970 | # break other packages using the cache if that directory is | |
971 | # removed, or if the path is relative. | |
972 | INSTALL="$ac_install_sh" | |
973 | fi | |
974 | fi | |
975 | echo "$ac_t""$INSTALL" 1>&6 | |
976 | ||
977 | # Use test -z because SunOS4 sh mishandles braces in ${var-val}. | |
978 | # It thinks the first close brace ends the variable substitution. | |
979 | test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' | |
980 | ||
981 | test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' | |
982 | ||
983 | test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' | |
984 | ||
985 | ||
986 | echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 | |
987 | echo "configure:989: checking how to run the C preprocessor" >&5 | |
988 | # On Suns, sometimes $CPP names a directory. | |
989 | if test -n "$CPP" && test -d "$CPP"; then | |
990 | CPP= | |
991 | fi | |
992 | if test -z "$CPP"; then | |
993 | if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then | |
994 | echo $ac_n "(cached) $ac_c" 1>&6 | |
995 | else | |
996 | # This must be in double quotes, not single quotes, because CPP may get | |
997 | # substituted into the Makefile and "${CC-cc}" will confuse make. | |
998 | CPP="${CC-cc} -E" | |
999 | # On the NeXT, cc -E runs the code through the compiler's parser, | |
1000 | # not just through cpp. | |
1001 | cat > conftest.$ac_ext <<EOF | |
1002 | #line 1004 "configure" | |
1003 | #include "confdefs.h" | |
1004 | #include <assert.h> | |
1005 | Syntax Error | |
1006 | EOF | |
1007 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1008 | { (eval echo configure:1010: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1009 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1010 | if test -z "$ac_err"; then | |
1011 | : | |
1012 | else | |
1013 | echo "$ac_err" >&5 | |
1014 | echo "configure: failed program was:" >&5 | |
1015 | cat conftest.$ac_ext >&5 | |
1016 | rm -rf conftest* | |
1017 | CPP="${CC-cc} -E -traditional-cpp" | |
1018 | cat > conftest.$ac_ext <<EOF | |
1019 | #line 1021 "configure" | |
1020 | #include "confdefs.h" | |
1021 | #include <assert.h> | |
1022 | Syntax Error | |
1023 | EOF | |
1024 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1025 | { (eval echo configure:1027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1026 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1027 | if test -z "$ac_err"; then | |
1028 | : | |
1029 | else | |
1030 | echo "$ac_err" >&5 | |
1031 | echo "configure: failed program was:" >&5 | |
1032 | cat conftest.$ac_ext >&5 | |
1033 | rm -rf conftest* | |
1034 | CPP="${CC-cc} -nologo -E" | |
1035 | cat > conftest.$ac_ext <<EOF | |
1036 | #line 1038 "configure" | |
1037 | #include "confdefs.h" | |
1038 | #include <assert.h> | |
1039 | Syntax Error | |
1040 | EOF | |
1041 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1042 | { (eval echo configure:1044: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1043 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1044 | if test -z "$ac_err"; then | |
1045 | : | |
1046 | else | |
1047 | echo "$ac_err" >&5 | |
1048 | echo "configure: failed program was:" >&5 | |
1049 | cat conftest.$ac_ext >&5 | |
1050 | rm -rf conftest* | |
1051 | CPP=/lib/cpp | |
1052 | fi | |
1053 | rm -f conftest* | |
1054 | fi | |
1055 | rm -f conftest* | |
1056 | fi | |
1057 | rm -f conftest* | |
1058 | ac_cv_prog_CPP="$CPP" | |
1059 | fi | |
1060 | CPP="$ac_cv_prog_CPP" | |
1061 | else | |
1062 | ac_cv_prog_CPP="$CPP" | |
1063 | fi | |
1064 | echo "$ac_t""$CPP" 1>&6 | |
1065 | ||
1066 | for ac_hdr in curses.h signal.h sys/time.h sys/types.h sys/stat.h \ | |
1067 | unistd.h fcntl.h time.h stdlib.h math.h | |
1068 | do | |
1069 | ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` | |
1070 | echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 | |
1071 | echo "configure:1073: checking for $ac_hdr" >&5 | |
1072 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
1073 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1074 | else | |
1075 | cat > conftest.$ac_ext <<EOF | |
1076 | #line 1078 "configure" | |
1077 | #include "confdefs.h" | |
1078 | #include <$ac_hdr> | |
1079 | EOF | |
1080 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1081 | { (eval echo configure:1083: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1082 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1083 | if test -z "$ac_err"; then | |
1084 | rm -rf conftest* | |
1085 | eval "ac_cv_header_$ac_safe=yes" | |
1086 | else | |
1087 | echo "$ac_err" >&5 | |
1088 | echo "configure: failed program was:" >&5 | |
1089 | cat conftest.$ac_ext >&5 | |
1090 | rm -rf conftest* | |
1091 | eval "ac_cv_header_$ac_safe=no" | |
1092 | fi | |
1093 | rm -f conftest* | |
1094 | fi | |
1095 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
1096 | echo "$ac_t""yes" 1>&6 | |
1097 | ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` | |
1098 | cat >> confdefs.h <<EOF | |
1099 | #define $ac_tr_hdr 1 | |
1100 | EOF | |
1101 | ||
1102 | else | |
1103 | echo "$ac_t""no" 1>&6 | |
1104 | \ | |
1105 | { echo "configure: error: header missing" 1>&2; exit 1; } | |
1106 | fi | |
1107 | done | |
1108 | ||
1109 | echo $ac_n "checking for wgetch in -lncurses""... $ac_c" 1>&6 | |
1110 | echo "configure:1112: checking for wgetch in -lncurses" >&5 | |
1111 | ac_lib_var=`echo ncurses'_'wgetch | sed 'y%./+-%__p_%'` | |
1112 | if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then | |
1113 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1114 | else | |
1115 | ac_save_LIBS="$LIBS" | |
1116 | LIBS="-lncurses $LIBS" | |
1117 | cat > conftest.$ac_ext <<EOF | |
1118 | #line 1120 "configure" | |
1119 | #include "confdefs.h" | |
1120 | /* Override any gcc2 internal prototype to avoid an error. */ | |
1121 | /* We use char because int might match the return type of a gcc2 | |
1122 | builtin and then its argument prototype would still apply. */ | |
1123 | char wgetch(); | |
1124 | ||
1125 | int main() { | |
1126 | wgetch() | |
1127 | ; return 0; } | |
1128 | EOF | |
1129 | if { (eval echo configure:1131: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then | |
1130 | rm -rf conftest* | |
1131 | eval "ac_cv_lib_$ac_lib_var=yes" | |
1132 | else | |
1133 | echo "configure: failed program was:" >&5 | |
1134 | cat conftest.$ac_ext >&5 | |
1135 | rm -rf conftest* | |
1136 | eval "ac_cv_lib_$ac_lib_var=no" | |
1137 | fi | |
1138 | rm -f conftest* | |
1139 | LIBS="$ac_save_LIBS" | |
1140 | ||
1141 | fi | |
1142 | if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then | |
1143 | echo "$ac_t""yes" 1>&6 | |
1144 | ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \ | |
1145 | -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` | |
1146 | cat >> confdefs.h <<EOF | |
1147 | #define $ac_tr_lib 1 | |
1148 | EOF | |
1149 | ||
1150 | LIBS="-lncurses $LIBS" | |
1151 | ||
1152 | else | |
1153 | echo "$ac_t""no" 1>&6 | |
1154 | { echo "configure: error: recent ncurses installed?" 1>&2; exit 1; } | |
1155 | fi | |
1156 | ||
1157 | ||
1158 | ac_ext=C | |
1159 | # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
1160 | ac_cpp='$CXXCPP $CPPFLAGS' | |
1161 | ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
1162 | ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
1163 | cross_compiling=$ac_cv_prog_cxx_cross | |
1164 | ||
1165 | echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 | |
1166 | echo "configure:1168: checking how to run the C++ preprocessor" >&5 | |
1167 | if test -z "$CXXCPP"; then | |
1168 | if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then | |
1169 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1170 | else | |
1171 | ac_ext=C | |
1172 | # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
1173 | ac_cpp='$CXXCPP $CPPFLAGS' | |
1174 | ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
1175 | ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
1176 | cross_compiling=$ac_cv_prog_cxx_cross | |
1177 | CXXCPP="${CXX-g++} -E" | |
1178 | cat > conftest.$ac_ext <<EOF | |
1179 | #line 1181 "configure" | |
1180 | #include "confdefs.h" | |
1181 | #include <stdlib.h> | |
1182 | EOF | |
1183 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1184 | { (eval echo configure:1186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1185 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1186 | if test -z "$ac_err"; then | |
1187 | : | |
1188 | else | |
1189 | echo "$ac_err" >&5 | |
1190 | echo "configure: failed program was:" >&5 | |
1191 | cat conftest.$ac_ext >&5 | |
1192 | rm -rf conftest* | |
1193 | CXXCPP=/lib/cpp | |
1194 | fi | |
1195 | rm -f conftest* | |
1196 | ac_cv_prog_CXXCPP="$CXXCPP" | |
1197 | ac_ext=C | |
1198 | # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. | |
1199 | ac_cpp='$CXXCPP $CPPFLAGS' | |
1200 | ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' | |
1201 | ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' | |
1202 | cross_compiling=$ac_cv_prog_cxx_cross | |
1203 | fi | |
1204 | fi | |
1205 | CXXCPP="$ac_cv_prog_CXXCPP" | |
1206 | echo "$ac_t""$CXXCPP" 1>&6 | |
1207 | ||
1208 | ac_safe=`echo "string" | sed 'y%./+-%__p_%'` | |
1209 | echo $ac_n "checking for string""... $ac_c" 1>&6 | |
1210 | echo "configure:1212: checking for string" >&5 | |
1211 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
1212 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1213 | else | |
1214 | cat > conftest.$ac_ext <<EOF | |
1215 | #line 1217 "configure" | |
1216 | #include "confdefs.h" | |
1217 | #include <string> | |
1218 | EOF | |
1219 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1220 | { (eval echo configure:1222: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1221 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1222 | if test -z "$ac_err"; then | |
1223 | rm -rf conftest* | |
1224 | eval "ac_cv_header_$ac_safe=yes" | |
1225 | else | |
1226 | echo "$ac_err" >&5 | |
1227 | echo "configure: failed program was:" >&5 | |
1228 | cat conftest.$ac_ext >&5 | |
1229 | rm -rf conftest* | |
1230 | eval "ac_cv_header_$ac_safe=no" | |
1231 | fi | |
1232 | rm -f conftest* | |
1233 | fi | |
1234 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
1235 | echo "$ac_t""yes" 1>&6 | |
1236 | : | |
1237 | else | |
1238 | echo "$ac_t""no" 1>&6 | |
1239 | { echo "configure: error: C++ STL string class missing" 1>&2; exit 1; } | |
1240 | fi | |
1241 | ||
1242 | ac_safe=`echo "vector" | sed 'y%./+-%__p_%'` | |
1243 | echo $ac_n "checking for vector""... $ac_c" 1>&6 | |
1244 | echo "configure:1246: checking for vector" >&5 | |
1245 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
1246 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1247 | else | |
1248 | cat > conftest.$ac_ext <<EOF | |
1249 | #line 1251 "configure" | |
1250 | #include "confdefs.h" | |
1251 | #include <vector> | |
1252 | EOF | |
1253 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1254 | { (eval echo configure:1256: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1255 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1256 | if test -z "$ac_err"; then | |
1257 | rm -rf conftest* | |
1258 | eval "ac_cv_header_$ac_safe=yes" | |
1259 | else | |
1260 | echo "$ac_err" >&5 | |
1261 | echo "configure: failed program was:" >&5 | |
1262 | cat conftest.$ac_ext >&5 | |
1263 | rm -rf conftest* | |
1264 | eval "ac_cv_header_$ac_safe=no" | |
1265 | fi | |
1266 | rm -f conftest* | |
1267 | fi | |
1268 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
1269 | echo "$ac_t""yes" 1>&6 | |
1270 | : | |
1271 | else | |
1272 | echo "$ac_t""no" 1>&6 | |
1273 | { echo "configure: error: C++ STL vector class missing" 1>&2; exit 1; } | |
1274 | fi | |
1275 | ||
1276 | ac_safe=`echo "algorithm" | sed 'y%./+-%__p_%'` | |
1277 | echo $ac_n "checking for algorithm""... $ac_c" 1>&6 | |
1278 | echo "configure:1280: checking for algorithm" >&5 | |
1279 | if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then | |
1280 | echo $ac_n "(cached) $ac_c" 1>&6 | |
1281 | else | |
1282 | cat > conftest.$ac_ext <<EOF | |
1283 | #line 1285 "configure" | |
1284 | #include "confdefs.h" | |
1285 | #include <algorithm> | |
1286 | EOF | |
1287 | ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" | |
1288 | { (eval echo configure:1290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } | |
1289 | ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` | |
1290 | if test -z "$ac_err"; then | |
1291 | rm -rf conftest* | |
1292 | eval "ac_cv_header_$ac_safe=yes" | |
1293 | else | |
1294 | echo "$ac_err" >&5 | |
1295 | echo "configure: failed program was:" >&5 | |
1296 | cat conftest.$ac_ext >&5 | |
1297 | rm -rf conftest* | |
1298 | eval "ac_cv_header_$ac_safe=no" | |
1299 | fi | |
1300 | rm -f conftest* | |
1301 | fi | |
1302 | if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then | |
1303 | echo "$ac_t""yes" 1>&6 | |
1304 | : | |
1305 | else | |
1306 | echo "$ac_t""no" 1>&6 | |
1307 | { echo "configure: error: C++ STL algorithm class missing" 1>&2; exit 1; } | |
1308 | fi | |
1309 | ||
1310 | ||
1311 | sv1="$prefix" | |
1312 | test "x$prefix" = "xNONE" && prefix="$ac_default_prefix" | |
1313 | sv2=`eval echo $datadir/$PACKAGE` | |
1314 | prefix="$sv1" | |
1315 | cat >> confdefs.h <<EOF | |
1316 | #define SHAREDIR "$sv2" | |
1317 | EOF | |
1318 | ||
1319 | trap '' 1 2 15 | |
1320 | cat > confcache <<\EOF | |
1321 | # This file is a shell script that caches the results of configure | |
1322 | # tests run on this system so they can be shared between configure | |
1323 | # scripts and configure runs. It is not useful on other systems. | |
1324 | # If it contains results you don't want to keep, you may remove or edit it. | |
1325 | # | |
1326 | # By default, configure uses ./config.cache as the cache file, | |
1327 | # creating it if it does not exist already. You can give configure | |
1328 | # the --cache-file=FILE option to use a different cache file; that is | |
1329 | # what configure does when it calls configure scripts in | |
1330 | # subdirectories, so they share the cache. | |
1331 | # Giving --cache-file=/dev/null disables caching, for debugging configure. | |
1332 | # config.status only pays attention to the cache file if you give it the | |
1333 | # --recheck option to rerun configure. | |
1334 | # | |
1335 | EOF | |
1336 | # The following way of writing the cache mishandles newlines in values, | |
1337 | # but we know of no workaround that is simple, portable, and efficient. | |
1338 | # So, don't put newlines in cache variables' values. | |
1339 | # Ultrix sh set writes to stderr and can't be redirected directly, | |
1340 | # and sets the high bit in the cache file unless we assign to the vars. | |
1341 | (set) 2>&1 | | |
1342 | case `(ac_space=' '; set | grep ac_space) 2>&1` in | |
1343 | *ac_space=\ *) | |
1344 | # `set' does not quote correctly, so add quotes (double-quote substitution | |
1345 | # turns \\\\ into \\, and sed turns \\ into \). | |
1346 | sed -n \ | |
1347 | -e "s/'/'\\\\''/g" \ | |
1348 | -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" | |
1349 | ;; | |
1350 | *) | |
1351 | # `set' quotes correctly as required by POSIX, so do not add quotes. | |
1352 | sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' | |
1353 | ;; | |
1354 | esac >> confcache | |
1355 | if cmp -s $cache_file confcache; then | |
1356 | : | |
1357 | else | |
1358 | if test -w $cache_file; then | |
1359 | echo "updating cache $cache_file" | |
1360 | cat confcache > $cache_file | |
1361 | else | |
1362 | echo "not updating unwritable cache $cache_file" | |
1363 | fi | |
1364 | fi | |
1365 | rm -f confcache | |
1366 | ||
1367 | trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 | |
1368 | ||
1369 | test "x$prefix" = xNONE && prefix=$ac_default_prefix | |
1370 | # Let make expand exec_prefix. | |
1371 | test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' | |
1372 | ||
1373 | # Any assignment to VPATH causes Sun make to only execute | |
1374 | # the first set of double-colon rules, so remove it if not needed. | |
1375 | # If there is a colon in the path, we need to keep it. | |
1376 | if test "x$srcdir" = x.; then | |
1377 | ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' | |
1378 | fi | |
1379 | ||
1380 | trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 | |
1381 | ||
1382 | DEFS=-DHAVE_CONFIG_H | |
1383 | ||
1384 | # Without the "./", some shells look in PATH for config.status. | |
1385 | : ${CONFIG_STATUS=./config.status} | |
1386 | ||
1387 | echo creating $CONFIG_STATUS | |
1388 | rm -f $CONFIG_STATUS | |
1389 | cat > $CONFIG_STATUS <<EOF | |
1390 | #! /bin/sh | |
1391 | # Generated automatically by configure. | |
1392 | # Run this file to recreate the current configuration. | |
1393 | # This directory was configured as follows, | |
1394 | # on host `(hostname || uname -n) 2>/dev/null | sed 1q`: | |
1395 | # | |
1396 | # $0 $ac_configure_args | |
1397 | # | |
1398 | # Compiler output produced by configure, useful for debugging | |
1399 | # configure, is in ./config.log if it exists. | |
1400 | ||
1401 | ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" | |
1402 | for ac_option | |
1403 | do | |
1404 | case "\$ac_option" in | |
1405 | -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) | |
1406 | echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" | |
1407 | exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; | |
1408 | -version | --version | --versio | --versi | --vers | --ver | --ve | --v) | |
1409 | echo "$CONFIG_STATUS generated by autoconf version 2.13" | |
1410 | exit 0 ;; | |
1411 | -help | --help | --hel | --he | --h) | |
1412 | echo "\$ac_cs_usage"; exit 0 ;; | |
1413 | *) echo "\$ac_cs_usage"; exit 1 ;; | |
1414 | esac | |
1415 | done | |
1416 | ||
1417 | ac_given_srcdir=$srcdir | |
1418 | ac_given_INSTALL="$INSTALL" | |
1419 | ||
1420 | trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 | |
1421 | EOF | |
1422 | cat >> $CONFIG_STATUS <<EOF | |
1423 | ||
1424 | # Protect against being on the right side of a sed subst in config.status. | |
1425 | sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; | |
1426 | s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF | |
1427 | $ac_vpsub | |
1428 | $extrasub | |
1429 | s%@SHELL@%$SHELL%g | |
1430 | s%@CFLAGS@%$CFLAGS%g | |
1431 | s%@CPPFLAGS@%$CPPFLAGS%g | |
1432 | s%@CXXFLAGS@%$CXXFLAGS%g | |
1433 | s%@FFLAGS@%$FFLAGS%g | |
1434 | s%@DEFS@%$DEFS%g | |
1435 | s%@LDFLAGS@%$LDFLAGS%g | |
1436 | s%@LIBS@%$LIBS%g | |
1437 | s%@exec_prefix@%$exec_prefix%g | |
1438 | s%@prefix@%$prefix%g | |
1439 | s%@program_transform_name@%$program_transform_name%g | |
1440 | s%@bindir@%$bindir%g | |
1441 | s%@sbindir@%$sbindir%g | |
1442 | s%@libexecdir@%$libexecdir%g | |
1443 | s%@datadir@%$datadir%g | |
1444 | s%@sysconfdir@%$sysconfdir%g | |
1445 | s%@sharedstatedir@%$sharedstatedir%g | |
1446 | s%@localstatedir@%$localstatedir%g | |
1447 | s%@libdir@%$libdir%g | |
1448 | s%@includedir@%$includedir%g | |
1449 | s%@oldincludedir@%$oldincludedir%g | |
1450 | s%@infodir@%$infodir%g | |
1451 | s%@mandir@%$mandir%g | |
1452 | s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g | |
1453 | s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g | |
1454 | s%@INSTALL_DATA@%$INSTALL_DATA%g | |
1455 | s%@PACKAGE@%$PACKAGE%g | |
1456 | s%@VERSION@%$VERSION%g | |
1457 | s%@ACLOCAL@%$ACLOCAL%g | |
1458 | s%@AUTOCONF@%$AUTOCONF%g | |
1459 | s%@AUTOMAKE@%$AUTOMAKE%g | |
1460 | s%@AUTOHEADER@%$AUTOHEADER%g | |
1461 | s%@MAKEINFO@%$MAKEINFO%g | |
1462 | s%@SET_MAKE@%$SET_MAKE%g | |
1463 | s%@CXX@%$CXX%g | |
1464 | s%@CPP@%$CPP%g | |
1465 | s%@CXXCPP@%$CXXCPP%g | |
1466 | ||
1467 | CEOF | |
1468 | EOF | |
1469 | ||
1470 | cat >> $CONFIG_STATUS <<\EOF | |
1471 | ||
1472 | # Split the substitutions into bite-sized pieces for seds with | |
1473 | # small command number limits, like on Digital OSF/1 and HP-UX. | |
1474 | ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. | |
1475 | ac_file=1 # Number of current file. | |
1476 | ac_beg=1 # First line for current file. | |
1477 | ac_end=$ac_max_sed_cmds # Line after last line for current file. | |
1478 | ac_more_lines=: | |
1479 | ac_sed_cmds="" | |
1480 | while $ac_more_lines; do | |
1481 | if test $ac_beg -gt 1; then | |
1482 | sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file | |
1483 | else | |
1484 | sed "${ac_end}q" conftest.subs > conftest.s$ac_file | |
1485 | fi | |
1486 | if test ! -s conftest.s$ac_file; then | |
1487 | ac_more_lines=false | |
1488 | rm -f conftest.s$ac_file | |
1489 | else | |
1490 | if test -z "$ac_sed_cmds"; then | |
1491 | ac_sed_cmds="sed -f conftest.s$ac_file" | |
1492 | else | |
1493 | ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" | |
1494 | fi | |
1495 | ac_file=`expr $ac_file + 1` | |
1496 | ac_beg=$ac_end | |
1497 | ac_end=`expr $ac_end + $ac_max_sed_cmds` | |
1498 | fi | |
1499 | done | |
1500 | if test -z "$ac_sed_cmds"; then | |
1501 | ac_sed_cmds=cat | |
1502 | fi | |
1503 | EOF | |
1504 | ||
1505 | cat >> $CONFIG_STATUS <<EOF | |
1506 | ||
1507 | CONFIG_FILES=\${CONFIG_FILES-"Makefile"} | |
1508 | EOF | |
1509 | cat >> $CONFIG_STATUS <<\EOF | |
1510 | for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then | |
1511 | # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". | |
1512 | case "$ac_file" in | |
1513 | *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` | |
1514 | ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; | |
1515 | *) ac_file_in="${ac_file}.in" ;; | |
1516 | esac | |
1517 | ||
1518 | # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. | |
1519 | ||
1520 | # Remove last slash and all that follows it. Not all systems have dirname. | |
1521 | ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` | |
1522 | if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then | |
1523 | # The file is in a subdirectory. | |
1524 | test ! -d "$ac_dir" && mkdir "$ac_dir" | |
1525 | ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" | |
1526 | # A "../" for each directory in $ac_dir_suffix. | |
1527 | ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` | |
1528 | else | |
1529 | ac_dir_suffix= ac_dots= | |
1530 | fi | |
1531 | ||
1532 | case "$ac_given_srcdir" in | |
1533 | .) srcdir=. | |
1534 | if test -z "$ac_dots"; then top_srcdir=. | |
1535 | else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; | |
1536 | /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; | |
1537 | *) # Relative path. | |
1538 | srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" | |
1539 | top_srcdir="$ac_dots$ac_given_srcdir" ;; | |
1540 | esac | |
1541 | ||
1542 | case "$ac_given_INSTALL" in | |
1543 | [/$]*) INSTALL="$ac_given_INSTALL" ;; | |
1544 | *) INSTALL="$ac_dots$ac_given_INSTALL" ;; | |
1545 | esac | |
1546 | ||
1547 | echo creating "$ac_file" | |
1548 | rm -f "$ac_file" | |
1549 | configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." | |
1550 | case "$ac_file" in | |
1551 | *Makefile*) ac_comsub="1i\\ | |
1552 | # $configure_input" ;; | |
1553 | *) ac_comsub= ;; | |
1554 | esac | |
1555 | ||
1556 | ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` | |
1557 | sed -e "$ac_comsub | |
1558 | s%@configure_input@%$configure_input%g | |
1559 | s%@srcdir@%$srcdir%g | |
1560 | s%@top_srcdir@%$top_srcdir%g | |
1561 | s%@INSTALL@%$INSTALL%g | |
1562 | " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file | |
1563 | fi; done | |
1564 | rm -f conftest.s* | |
1565 | ||
1566 | # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where | |
1567 | # NAME is the cpp macro being defined and VALUE is the value it is being given. | |
1568 | # | |
1569 | # ac_d sets the value in "#define NAME VALUE" lines. | |
1570 | ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' | |
1571 | ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' | |
1572 | ac_dC='\3' | |
1573 | ac_dD='%g' | |
1574 | # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". | |
1575 | ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' | |
1576 | ac_uB='\([ ]\)%\1#\2define\3' | |
1577 | ac_uC=' ' | |
1578 | ac_uD='\4%g' | |
1579 | # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". | |
1580 | ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' | |
1581 | ac_eB='$%\1#\2define\3' | |
1582 | ac_eC=' ' | |
1583 | ac_eD='%g' | |
1584 | ||
1585 | if test "${CONFIG_HEADERS+set}" != set; then | |
1586 | EOF | |
1587 | cat >> $CONFIG_STATUS <<EOF | |
1588 | CONFIG_HEADERS="config.h" | |
1589 | EOF | |
1590 | cat >> $CONFIG_STATUS <<\EOF | |
1591 | fi | |
1592 | for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then | |
1593 | # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". | |
1594 | case "$ac_file" in | |
1595 | *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` | |
1596 | ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; | |
1597 | *) ac_file_in="${ac_file}.in" ;; | |
1598 | esac | |
1599 | ||
1600 | echo creating $ac_file | |
1601 | ||
1602 | rm -f conftest.frag conftest.in conftest.out | |
1603 | ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` | |
1604 | cat $ac_file_inputs > conftest.in | |
1605 | ||
1606 | EOF | |
1607 | ||
1608 | # Transform confdefs.h into a sed script conftest.vals that substitutes | |
1609 | # the proper values into config.h.in to produce config.h. And first: | |
1610 | # Protect against being on the right side of a sed subst in config.status. | |
1611 | # Protect against being in an unquoted here document in config.status. | |
1612 | rm -f conftest.vals | |
1613 | cat > conftest.hdr <<\EOF | |
1614 | s/[\\&%]/\\&/g | |
1615 | s%[\\$`]%\\&%g | |
1616 | s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp | |
1617 | s%ac_d%ac_u%gp | |
1618 | s%ac_u%ac_e%gp | |
1619 | EOF | |
1620 | sed -n -f conftest.hdr confdefs.h > conftest.vals | |
1621 | rm -f conftest.hdr | |
1622 | ||
1623 | # This sed command replaces #undef with comments. This is necessary, for | |
1624 | # example, in the case of _POSIX_SOURCE, which is predefined and required | |
1625 | # on some systems where configure will not decide to define it. | |
1626 | cat >> conftest.vals <<\EOF | |
1627 | s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% | |
1628 | EOF | |
1629 | ||
1630 | # Break up conftest.vals because some shells have a limit on | |
1631 | # the size of here documents, and old seds have small limits too. | |
1632 | ||
1633 | rm -f conftest.tail | |
1634 | while : | |
1635 | do | |
1636 | ac_lines=`grep -c . conftest.vals` | |
1637 | # grep -c gives empty output for an empty file on some AIX systems. | |
1638 | if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi | |
1639 | # Write a limited-size here document to conftest.frag. | |
1640 | echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS | |
1641 | sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS | |
1642 | echo 'CEOF | |
1643 | sed -f conftest.frag conftest.in > conftest.out | |
1644 | rm -f conftest.in | |
1645 | mv conftest.out conftest.in | |
1646 | ' >> $CONFIG_STATUS | |
1647 | sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail | |
1648 | rm -f conftest.vals | |
1649 | mv conftest.tail conftest.vals | |
1650 | done | |
1651 | rm -f conftest.vals | |
1652 | ||
1653 | cat >> $CONFIG_STATUS <<\EOF | |
1654 | rm -f conftest.frag conftest.h | |
1655 | echo "/* $ac_file. Generated automatically by configure. */" > conftest.h | |
1656 | cat conftest.in >> conftest.h | |
1657 | rm -f conftest.in | |
1658 | if cmp -s $ac_file conftest.h 2>/dev/null; then | |
1659 | echo "$ac_file is unchanged" | |
1660 | rm -f conftest.h | |
1661 | else | |
1662 | # Remove last slash and all that follows it. Not all systems have dirname. | |
1663 | ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` | |
1664 | if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then | |
1665 | # The file is in a subdirectory. | |
1666 | test ! -d "$ac_dir" && mkdir "$ac_dir" | |
1667 | fi | |
1668 | rm -f $ac_file | |
1669 | mv conftest.h $ac_file | |
1670 | fi | |
1671 | fi; done | |
1672 | ||
1673 | EOF | |
1674 | cat >> $CONFIG_STATUS <<EOF | |
1675 | ||
1676 | ||
1677 | EOF | |
1678 | cat >> $CONFIG_STATUS <<\EOF | |
1679 | test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h | |
1680 | ||
1681 | exit 0 | |
1682 | EOF | |
1683 | chmod +x $CONFIG_STATUS | |
1684 | rm -fr confdefs* $ac_clean_files | |
1685 | test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 | |
1686 |
0 | AC_INIT(squidview.cpp) | |
1 | AM_CONFIG_HEADER(config.h) | |
2 | AM_INIT_AUTOMAKE(squidview,0.63) | |
3 | AC_PROG_CXX | |
4 | AC_PROG_INSTALL | |
5 | ||
6 | AC_CHECK_HEADERS(curses.h signal.h sys/time.h sys/types.h sys/stat.h \ | |
7 | unistd.h fcntl.h time.h stdlib.h math.h,, \ | |
8 | AC_MSG_ERROR([header missing])) | |
9 | AC_CHECK_LIB(ncurses, wgetch,,AC_MSG_ERROR([recent ncurses installed?])) | |
10 | ||
11 | AC_LANG_CPLUSPLUS | |
12 | AC_CHECK_HEADER(string,,AC_MSG_ERROR(C++ STL string class missing)) | |
13 | AC_CHECK_HEADER(vector,,AC_MSG_ERROR(C++ STL vector class missing)) | |
14 | AC_CHECK_HEADER(algorithm,,AC_MSG_ERROR(C++ STL algorithm class missing)) | |
15 | ||
16 | sv1="$prefix" | |
17 | test "x$prefix" = "xNONE" && prefix="$ac_default_prefix" | |
18 | sv2=`eval echo $datadir/$PACKAGE` | |
19 | prefix="$sv1" | |
20 | AC_DEFINE_UNQUOTED(SHAREDIR, "$sv2") | |
21 | AC_OUTPUT(Makefile) |
0 | 1007949021.553 86 192.168.0.103 TCP_MEM_HIT/200 6947 GET http://us.a1.yimg.com/us.yimg.com/i/ww/m5v6.gif graeme NONE/- image/gif | |
1 | 1007949022.484 4374 192.168.0.103 TCP_MISS/200 22349 GET http://www.yahoo.com/ graeme DIRECT/64.58.76.223 text/html | |
2 | 1007949022.884 74 192.168.0.103 TCP_HIT/200 4043 GET http://us.a1.yimg.com/us.yimg.com/a/ya/yahoo_promotions/fp2.gif graeme NONE/- image/gif | |
3 | 1007949027.488 4418 192.168.0.103 TCP_MISS/000 0 GET http://us.a1.yimg.com/us.yimg.com/i/us/auc/b/auc16_1.gif graeme NONE/- - | |
4 | 1007949028.056 4569 192.168.0.103 TCP_MISS/000 0 GET http://us.i1.yimg.com/us.yimg.com/i/us/sh/pr/hol01/rib.gif graeme NONE/- - | |
5 | 1007949028.059 4604 192.168.0.103 TCP_MISS/000 0 GET http://us.i1.yimg.com/us.yimg.com/i/us/sh/pr/hol01/bow.gif graeme NONE/- - | |
6 | 1007949028.061 4544 192.168.0.103 TCP_MISS/000 0 GET http://us.i1.yimg.com/us.yimg.com/i/space.gif graeme NONE/- - | |
7 | 1007949028.063 4346 192.168.0.103 TCP_MISS/000 0 GET http://us.a1.yimg.com/us.yimg.com/i/sh/h99/holly.gif graeme NONE/- - | |
8 | 1007949028.065 4258 192.168.0.103 TCP_MISS/000 0 GET http://us.a1.yimg.com/us.yimg.com/a/an/anchor/shopping/ads/new37/dell.gif graeme NONE/- - | |
9 | 1007949029.233 1163 192.168.0.103 TCP_MISS/302 148 GET http://www.yahoo.com/r/m1 graeme DIRECT/64.58.76.227 - | |
10 | 1007949032.096 73 192.168.0.103 TCP_HIT/200 1365 GET http://us.i1.yimg.com/us.yimg.com/i/us/pim/maillogin.gif graeme NONE/- image/gif | |
11 | 1007949032.324 3089 192.168.0.103 TCP_MISS/200 12044 GET http://mail.yahoo.com/? graeme DIRECT/64.58.76.99 text/html | |
12 | 1007949032.581 310 192.168.0.103 TCP_HIT/200 14051 GET http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v3_2.jpg graeme NONE/- image/jpeg | |
13 | 1007949032.581 253 192.168.0.103 TCP_HIT/200 1664 GET http://us.i1.yimg.com/us.yimg.com/i/us/pim/lgn/v3_6.gif graeme NONE/- image/gif | |
14 | 1007949033.280 282 192.168.0.103 TCP_HIT/200 2972 GET http://us.i1.yimg.com/us.yimg.com/i/mail/ntap2.gif graeme NONE/- image/gif | |
15 | 1007949051.448 2521 192.168.0.103 TCP_MISS/200 1832 CONNECT login.yahoo.com:443 graeme DIRECT/64.58.76.98 - | |
16 | 1007949052.939 1489 192.168.0.103 TCP_MISS/302 646 GET http://f207.mail.yahoo.com/ym/login? graeme DIRECT/216.136.226.186 text/html | |
17 | 1007949054.492 1551 192.168.0.103 TCP_MISS/200 1123 GET http://us.f207.mail.yahoo.com/ym/login? graeme DIRECT/216.136.226.186 text/html | |
18 | 1007949056.697 1968 192.168.0.103 TCP_MISS/200 6260 GET http://us.f207.mail.yahoo.com/ym/Navbar? graeme DIRECT/216.136.226.186 text/html | |
19 | 1007949057.713 2517 192.168.0.103 TCP_MISS/200 17554 GET http://us.f207.mail.yahoo.com/ym/login? graeme DIRECT/216.136.226.186 text/html | |
20 | 1007949063.757 1288 192.168.0.103 TCP_MISS/200 1262 GET http://us.i1.yimg.com/us.yimg.com/i/us/pim/mail3.gif graeme DIRECT/210.57.17.223 image/gif | |
21 | 1007949063.762 1264 192.168.0.103 TCP_MISS/200 306 GET http://us.i1.yimg.com/us.yimg.com/i/space.gif graeme DIRECT/210.57.17.231 image/gif | |
22 | 1007949063.886 1244 192.168.0.103 TCP_MISS/200 324 GET http://us.i1.yimg.com/us.yimg.com/i/pim/line.gif graeme DIRECT/210.57.17.223 image/gif | |
23 | 1007949064.258 1610 192.168.0.103 TCP_MISS/200 361 GET http://us.i1.yimg.com/us.yimg.com/i/us/pim/pls.gif graeme DIRECT/210.57.17.231 image/gif | |
24 | 1007949064.506 1295 192.168.0.103 TCP_MISS/200 759 GET http://us.i1.yimg.com/us.yimg.com/i/pim/mls2.gif graeme DIRECT/210.57.17.223 image/gif | |
25 | 1007949064.641 1391 192.168.0.103 TCP_MISS/200 450 GET http://us.i1.yimg.com/us.yimg.com/i/pim/ad2.gif graeme DIRECT/210.57.17.231 image/gif | |
26 | 1007949064.799 1296 192.168.0.103 TCP_MISS/200 456 GET http://us.i1.yimg.com/us.yimg.com/i/pim/np2.gif graeme DIRECT/210.57.17.223 image/gif | |
27 | 1007949065.061 1548 192.168.0.103 TCP_MISS/200 455 GET http://us.i1.yimg.com/us.yimg.com/i/pim/cl2.gif graeme DIRECT/210.57.17.231 image/gif | |
28 | 1007949066.013 951 192.168.0.103 TCP_MISS/200 577 GET http://us.a1.yimg.com/us.yimg.com/i/ww/m/hearts.gif graeme DIRECT/210.57.17.224 image/gif | |
29 | 1007949066.269 698 192.168.0.103 TCP_MISS/200 649 GET http://us.i1.yimg.com/us.yimg.com/i/us/mail/mailbox.gif graeme DIRECT/210.57.17.223 image/gif | |
30 | 1007949066.559 544 192.168.0.103 TCP_MISS/200 973 GET http://us.i1.yimg.com/us.yimg.com/i/mo/mov_i_sm.gif graeme DIRECT/210.57.17.231 image/gif | |
31 | 1007949066.567 534 192.168.0.103 TCP_MISS/200 491 GET http://us.i1.yimg.com/us.yimg.com/i/sh/bag28.gif graeme DIRECT/210.57.17.223 image/gif | |
32 | 1007949066.581 521 192.168.0.103 TCP_MISS/200 811 GET http://us.i1.yimg.com/us.yimg.com/i/greet/icon.gif graeme DIRECT/210.57.17.231 image/gif | |
33 | 1007949066.741 468 192.168.0.103 TCP_MISS/200 391 GET http://us.i1.yimg.com/us.yimg.com/i/buzz/mail.gif graeme DIRECT/210.57.17.223 image/gif | |
34 | 1007949067.008 426 192.168.0.103 TCP_MISS/200 453 GET http://us.i1.yimg.com/us.yimg.com/i/us/per/gr/heart.gif graeme DIRECT/210.57.17.231 image/gif | |
35 | 1007949067.706 1627 192.168.0.103 TCP_MISS/200 25467 GET http://us.a1.yimg.com/us.yimg.com/a/ya/yahoo_shopping/shopping_winter_lrec_01.gif graeme DIRECT/210.57.17.224 image/gif | |
36 | 1007949071.643 1084 192.168.0.103 TCP_MISS/200 11495 GET http://us.f207.mail.yahoo.com/ym/ShowFolder? graeme DIRECT/216.136.226.186 text/html | |
37 | 1007949071.898 576 192.168.0.103 TCP_MISS/200 345 GET http://us.i1.yimg.com/us.yimg.com/i/mail/down.gif graeme DIRECT/210.57.17.223 image/gif | |
38 | 1007949077.020 994 192.168.0.103 TCP_MISS/302 1071 GET http://us.f207.mail.yahoo.com/ym/Logout? graeme DIRECT/216.136.226.186 text/html | |
39 | 1007949078.358 1335 192.168.0.103 TCP_MISS/200 10212 GET http://login.yahoo.com/config/exit? graeme DIRECT/64.58.76.99 text/html | |
40 | 1007949079.313 775 192.168.0.103 TCP_MISS/200 5433 GET http://us.a1.yimg.com/us.yimg.com/a/im/imotors/orange_monster_left.gif graeme DIRECT/210.57.17.224 image/gif | |
41 | 1007949081.301 2441 192.168.0.103 TCP_MISS/200 22866 GET http://us.a1.yimg.com/us.yimg.com/a/im/imotors/orange_monster_bottom.gif graeme DIRECT/210.57.17.230 image/gif | |
42 | 1007949084.572 1765 192.168.0.103 TCP_MISS/200 12616 GET http://login.yahoo.com/config/login? graeme DIRECT/64.58.76.98 text/html | |
43 | 1007949085.603 766 192.168.0.103 TCP_MISS/200 2322 GET http://us.a1.yimg.com/us.yimg.com/a/ma/marsmusic/mm120x30.gif graeme DIRECT/210.57.17.230 image/gif | |
44 | 1007949085.894 1318 192.168.0.103 TCP_MISS/200 17282 GET http://us.a1.yimg.com/us.yimg.com/a/bm/bmg/210570/stack_425x270.gif graeme DIRECT/210.57.17.224 image/gif | |
45 | 1007949086.076 1139 192.168.0.103 TCP_MISS/200 1072 GET http://us.a1.yimg.com/us.yimg.com/a/an/anchor/shopping/eddiebauer/2/120x30_yahoo.gif graeme DIRECT/210.57.17.224 image/gif | |
46 | 1007949086.280 1187 192.168.0.103 TCP_MISS/200 2306 GET http://us.a1.yimg.com/us.yimg.com/a/ci/circuit_city/120x30_button.gif graeme DIRECT/210.57.17.230 image/gif | |
47 | 1007949086.421 865 192.168.0.103 TCP_HIT/200 1632 GET http://us.a1.yimg.com/us.yimg.com/a/ve/verizon/120x30_yahoo_registration.gif graeme NONE/- image/gif | |
48 | 1007949086.582 56 192.168.0.103 TCP_HIT/200 1558 GET http://us.a1.yimg.com/us.yimg.com/a/ba/barnesnoble/2477_logo_24.gif graeme NONE/- image/gif | |
49 | 1007949086.730 1216 192.168.0.103 TCP_MISS/200 778 GET http://us.a1.yimg.com/us.yimg.com/a/es/estee_lauder/estee_lauder.gif graeme DIRECT/210.57.17.230 image/gif | |
50 | 1007949086.957 179 192.168.0.103 TCP_HIT/200 2280 GET http://us.a1.yimg.com/us.yimg.com/a/ga/gateway/gwlogo_120x30.gif graeme NONE/- image/gif | |
51 | 1007949086.962 1354 192.168.0.103 TCP_MISS/200 1610 GET http://us.a1.yimg.com/us.yimg.com/a/gs/gsi/215269/DSP_Logo_120x30.gif graeme DIRECT/210.57.17.224 image/gif | |
52 | 1007949087.199 615 192.168.0.103 TCP_MISS/200 1216 GET http://us.a1.yimg.com/us.yimg.com/a/lo/lowes/loweslogo_120x30.gif graeme DIRECT/210.57.17.224 image/gif | |
53 | 1007949087.321 1675 192.168.0.103 TCP_MISS/200 3353 GET http://us.a1.yimg.com/us.yimg.com/a/av/avon/yahooholidaylogoavon.gif graeme DIRECT/210.57.17.230 image/gif | |
54 | 1007949087.587 624 192.168.0.103 TCP_MISS/200 3912 GET http://us.a1.yimg.com/us.yimg.com/a/ft/ftd/120x30plain.gif graeme DIRECT/210.57.17.230 image/gif | |
55 | 1007949087.648 447 192.168.0.103 TCP_MISS/200 2083 GET http://us.a1.yimg.com/us.yimg.com/a/go/godiva/logo_120x30.gif graeme DIRECT/210.57.17.224 image/gif | |
56 | 1008100534.362 2539 192.168.0.129 TCP_MISS/302 411 GET http://www.complex.is/ graeme DIRECT/193.4.210.100 text/html | |
57 | 1008100535.861 1470 192.168.0.129 TCP_MISS/200 8717 GET http://www.complex.is/cgi-bin/home_pager graeme DIRECT/193.4.210.100 text/html | |
58 | 1008100536.313 291 192.168.0.129 TCP_HIT/200 3224 GET http://www.f-prot.com/f-prot/friskstyle.css graeme NONE/- text/plain | |
59 | 1008100537.321 1358 192.168.0.129 TCP_MISS/200 848 GET http://images.f-prot.com/w2/images/leftline2.jpg graeme DIRECT/193.4.210.106 image/jpeg | |
60 | 1008100538.899 344 192.168.0.129 TCP_HIT/200 2187 GET http://images.f-prot.com/w2/buttons/home-down.gif graeme NONE/- image/gif | |
61 | 1008100538.906 552 192.168.0.129 TCP_REFRESH_HIT/200 5999 GET http://images.f-prot.com/w2/images/logo_background.gif graeme DIRECT/193.4.210.106 image/gif | |
62 | 1008100539.375 913 192.168.0.129 TCP_REFRESH_HIT/200 6343 GET http://images.f-prot.com/w2/images/fsi500.gif graeme DIRECT/193.4.210.2 image/gif | |
63 | 1008100539.791 1263 192.168.0.129 TCP_REFRESH_HIT/200 1376 GET http://images.f-prot.com/w2/images/upperline2.gif graeme DIRECT/193.4.210.2 image/gif | |
64 | 1008100539.820 1046 192.168.0.129 TCP_REFRESH_HIT/200 3610 GET http://images.f-prot.com/w2/buttons/products-up.gif graeme DIRECT/193.4.210.2 image/gif | |
65 | 1008100540.288 1773 192.168.0.129 TCP_REFRESH_HIT/200 2312 GET http://images.f-prot.com/w2/images/lefttopline2.gif graeme DIRECT/193.4.210.106 image/gif | |
66 | 1008100540.293 1683 192.168.0.129 TCP_MISS/200 816 GET http://images.f-prot.com/w2/images/1.gif graeme DIRECT/193.4.210.106 image/gif | |
67 | 1008100540.322 1550 192.168.0.129 TCP_MISS/200 849 GET http://images.f-prot.com/w2/images/2.gif graeme DIRECT/193.4.210.106 image/gif | |
68 | 1008100540.799 780 192.168.0.129 TCP_REFRESH_HIT/200 3605 GET http://images.f-prot.com/w2/buttons/support-up.gif graeme DIRECT/193.4.210.106 image/gif | |
69 | 1008100541.733 1171 192.168.0.129 TCP_MISS/200 755 GET http://images.f-prot.com/w2/images/3.gif graeme DIRECT/193.4.210.106 image/gif | |
70 | 1008100541.793 743 192.168.0.129 TCP_HIT/200 3609 GET http://images.f-prot.com/w2/buttons/download-up.gif graeme NONE/- image/gif | |
71 | 1008100542.442 1159 192.168.0.129 TCP_MISS/200 738 GET http://images.f-prot.com/w2/images/4.gif graeme DIRECT/193.4.210.106 image/gif | |
72 | 1008100542.856 226 192.168.0.129 TCP_HIT/200 4930 GET http://images.f-prot.com/w2/images/buybanner1.jpg graeme NONE/- image/jpeg | |
73 | 1008100542.875 1534 192.168.0.129 TCP_REFRESH_HIT/200 1510 GET http://images.f-prot.com/w2/buttons/order-up.jpg graeme DIRECT/193.4.210.2 image/jpeg | |
74 | 1008100542.976 988 192.168.0.129 TCP_MISS/200 766 GET http://images.f-prot.com/w2/images/5.gif graeme DIRECT/193.4.210.106 image/gif | |
75 | 1008100543.475 90 192.168.0.129 TCP_HIT/200 1524 GET http://images.f-prot.com/w2/images/zone.gif graeme NONE/- image/gif | |
76 | 1008100543.475 1500 192.168.0.129 TCP_REFRESH_HIT/200 3572 GET http://images.f-prot.com/w2/buttons/virusinfo-up.gif graeme DIRECT/193.4.210.106 image/gif | |
77 | 1008100543.511 1392 192.168.0.129 TCP_MISS/200 753 GET http://images.f-prot.com/w2/images/6.gif graeme DIRECT/193.4.210.2 image/gif | |
78 | 1008100543.544 1102 192.168.0.129 TCP_REFRESH_HIT/200 3589 GET http://images.f-prot.com/w2/buttons/company-up.gif graeme DIRECT/193.4.210.2 image/gif | |
79 | 1008100543.544 1321 192.168.0.129 TCP_REFRESH_HIT/200 3617 GET http://images.f-prot.com/w2/buttons/feedback-up.gif graeme DIRECT/193.4.210.106 image/gif | |
80 | 1008100543.862 1405 192.168.0.129 TCP_REFRESH_HIT/200 3007 GET http://images.f-prot.com/w2/buttons/login-up.gif graeme DIRECT/193.4.210.106 image/gif | |
81 | 1008100553.677 63 192.168.0.129 TCP_IMS_HIT/304 226 GET http://www.f-prot.com/f-prot/friskstyle.css graeme NONE/- text/plain | |
82 | 1008100553.732 2933 192.168.0.129 TCP_REFRESH_MISS/200 8350 GET http://www.f-prot.com/f-prot/download/ graeme DIRECT/193.4.210.100 text/html | |
83 | 1008100554.938 873 192.168.0.129 TCP_REFRESH_HIT/200 3572 GET http://images.f-prot.com/w2/buttons/home-up.gif graeme DIRECT/193.4.210.106 image/gif | |
84 | 1008100555.213 1003 192.168.0.129 TCP_REFRESH_HIT/200 2163 GET http://images.f-prot.com/w2/buttons/download-down.gif graeme DIRECT/193.4.210.2 image/gif | |
85 | 1008100577.252 734 192.168.0.129 TCP_MISS/200 1199 GET http://www.paradise.net.nz/ graeme DIRECT/203.96.152.127 text/html | |
86 | 1008100579.903 148 192.168.0.129 TCP_HIT/200 6038 GET http://www.paradise.net.nz/standard/menus/main.html graeme NONE/- text/html | |
87 | 1008100580.460 707 192.168.0.129 TCP_MISS/200 10040 GET http://www.paradise.net.nz/cgi-bin/main/index graeme DIRECT/203.96.152.127 text/html | |
88 | 1008100585.897 252 192.168.0.129 TCP_MISS/200 810 GET http://www.paradise.net.nz/common/media/tables/b-topleft.gif graeme DIRECT/203.96.152.127 image/gif | |
89 | 1008100586.091 307 192.168.0.129 TCP_HIT/200 2510 GET http://www.paradise.net.nz/standard/media/menu/members.gif graeme NONE/- image/gif | |
90 | 1008100586.185 365 192.168.0.129 TCP_HIT/200 12306 GET http://www.paradise.net.nz/common/media/logos.gif graeme NONE/- image/gif | |
91 | 1008100586.259 353 192.168.0.129 TCP_HIT/200 1980 GET http://www.paradise.net.nz/standard/media/menu/plans.gif graeme NONE/- image/gif | |
92 | 1008100586.290 339 192.168.0.129 TCP_HIT/200 1981 GET http://www.paradise.net.nz/standard/media/menu/about.gif graeme NONE/- image/gif | |
93 | 1008100586.368 664 192.168.0.129 TCP_MISS/200 1265 GET http://www.paradise.net.nz/common/style/main.css graeme DIRECT/203.96.152.127 text/css | |
94 | 1008100586.701 997 192.168.0.129 TCP_MISS/200 542 GET http://www.paradise.net.nz/common/media/tables/b-top.gif graeme DIRECT/203.96.152.127 image/gif | |
95 | 1008100588.083 1993 192.168.0.129 TCP_HIT/200 1878 GET http://www.paradise.net.nz/standard/media/menu/join.gif graeme NONE/- image/gif | |
96 | 1008100589.182 508 192.168.0.129 TCP_HIT/200 2123 GET http://www.paradise.net.nz/standard/media/menu/mail.gif graeme NONE/- image/gif | |
97 | 1008100589.540 358 192.168.0.129 TCP_HIT/200 2136 GET http://www.paradise.net.nz/standard/media/menu/help.gif graeme NONE/- image/gif | |
98 | 1008100589.606 376 192.168.0.129 TCP_MISS/200 818 GET http://www.paradise.net.nz/common/media/tables/b-topright.gif graeme DIRECT/203.96.152.127 image/gif | |
99 | 1008100589.627 309 192.168.0.129 TCP_MISS/200 450 GET http://www.paradise.net.nz/common/media/tables/b-left.gif graeme DIRECT/203.96.152.127 image/gif | |
100 | 1008100590.121 460 192.168.0.129 TCP_MISS/200 425 GET http://www.paradise.net.nz/common/media/tables/trans.gif graeme DIRECT/203.96.152.127 image/gif | |
101 | 1008100590.504 275 192.168.0.129 TCP_MISS/200 558 GET http://www.paradise.net.nz/common/media/tables/b-in-tl.gif graeme DIRECT/203.96.152.127 image/gif | |
102 | 1008100590.535 347 192.168.0.129 TCP_MISS/200 445 GET http://www.paradise.net.nz/common/media/tables/b-in-top.gif graeme DIRECT/203.96.152.127 image/gif | |
103 | 1008100590.558 306 192.168.0.129 TCP_MISS/200 565 GET http://www.paradise.net.nz/common/media/tables/b-in-tr.gif graeme DIRECT/203.96.152.127 image/gif | |
104 | 1008100590.651 308 192.168.0.129 TCP_MISS/200 453 GET http://www.paradise.net.nz/common/media/tables/b-right.gif graeme DIRECT/203.96.152.127 image/gif | |
105 | 1008100591.069 371 192.168.0.129 TCP_MISS/200 425 GET http://www.paradise.net.nz/common/media/trans.gif graeme DIRECT/203.96.152.127 image/gif | |
106 | 1008100592.486 1094 192.168.0.129 TCP_MISS/200 416 GET http://www.paradise.net.nz/common/media/tables/b-in-l.gif graeme DIRECT/203.96.152.127 image/gif | |
107 | 1008100592.511 566 192.168.0.129 TCP_MISS/304 254 GET http://www.paradise.net.nz/common/style/main.css graeme DIRECT/203.96.152.127 - | |
108 | 1008100592.511 827 192.168.0.129 TCP_MISS/200 416 GET http://www.paradise.net.nz/common/media/tables/b-in-r.gif graeme DIRECT/203.96.152.127 image/gif | |
109 | 1008100592.915 696 192.168.0.129 TCP_MISS/200 9913 GET http://www.paradise.net.nz/standard/media/main/netguide-2001.gif graeme DIRECT/203.96.152.127 image/gif | |
110 | 1008100592.930 895 192.168.0.129 TCP_MISS/200 10775 GET http://www.paradise.net.nz/standard/media/banners/distro.gif graeme DIRECT/203.96.152.127 image/gif | |
111 | 1008100592.979 429 192.168.0.129 TCP_MISS/200 2667 GET http://www.paradise.net.nz/standard/media/main/google.gif graeme DIRECT/203.96.152.127 image/gif | |
112 | 1008100593.816 568 192.168.0.129 TCP_MISS/200 1016 GET http://www.paradise.net.nz/standard/media/main/search.gif graeme DIRECT/203.96.152.127 image/gif | |
113 | 1008100594.242 239 192.168.0.129 TCP_MISS/200 555 GET http://www.paradise.net.nz/common/media/tables/b-in-bl.gif graeme DIRECT/203.96.152.127 image/gif | |
114 | 1008100594.829 574 192.168.0.129 TCP_MISS/200 444 GET http://www.paradise.net.nz/common/media/tables/b-in-bot.gif graeme DIRECT/203.96.152.127 image/gif | |
115 | 1008100595.175 672 192.168.0.129 TCP_MISS/200 554 GET http://www.paradise.net.nz/common/media/tables/b-in-br.gif graeme DIRECT/203.96.152.127 image/gif | |
116 | 1008100595.645 745 192.168.0.129 TCP_MISS/200 823 GET http://www.paradise.net.nz/common/media/tables/b-bottomleft.gif graeme DIRECT/203.96.152.127 image/gif | |
117 | 1008100595.734 604 192.168.0.129 TCP_MISS/200 522 GET http://www.paradise.net.nz/common/media/tables/b-bottom.gif graeme DIRECT/203.96.152.127 image/gif | |
118 | 1008100597.064 668 192.168.0.129 TCP_MISS/200 711 GET http://www.paradise.net.nz/common/media/tables/b-bottomright.gif graeme DIRECT/203.96.152.127 image/gif | |
119 | 1008100597.683 1067 192.168.0.129 TCP_MISS/200 1369 GET http://counter.paradise.net.nz/cgi-bin/Count.cgi? graeme DIRECT/203.96.152.15 image/gif | |
120 | 1008100614.570 1908 192.168.0.129 TCP_MISS/200 2275 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
121 | 1008100621.273 759 192.168.0.129 TCP_MISS/200 1360 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
122 | 1008100622.461 444 192.168.0.129 TCP_MISS/200 5354 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
123 | 1008100622.575 568 192.168.0.129 TCP_MISS/200 1448 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
124 | 1008100624.431 1718 192.168.0.129 TCP_MISS/200 7535 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
125 | 1008100628.638 702 192.168.0.129 TCP_MISS/200 691 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
126 | 1008100628.832 537 192.168.0.129 TCP_MISS/200 959 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
127 | 1008100628.918 579 192.168.0.129 TCP_MISS/200 2332 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
128 | 1008100629.030 776 192.168.0.129 TCP_MISS/200 12464 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
129 | 1008100629.052 1046 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
130 | 1008100629.881 989 192.168.0.129 TCP_MISS/200 2183 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
131 | 1008100629.915 1012 192.168.0.129 TCP_MISS/200 2312 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
132 | 1008100629.986 946 192.168.0.129 TCP_MISS/200 2281 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
133 | 1008100630.483 812 192.168.0.129 TCP_MISS/200 542 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
134 | 1008100630.500 986 192.168.0.129 TCP_MISS/200 967 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
135 | 1008100631.026 768 192.168.0.129 TCP_MISS/200 574 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
136 | 1008100631.082 1000 192.168.0.129 TCP_MISS/200 599 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
137 | 1008100631.473 966 192.168.0.129 TCP_MISS/200 707 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
138 | 1008100631.698 997 192.168.0.129 TCP_MISS/200 594 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
139 | 1008100631.863 769 192.168.0.129 TCP_MISS/200 714 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
140 | 1008100632.109 826 192.168.0.129 TCP_MISS/200 602 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
141 | 1008100632.517 1144 192.168.0.129 TCP_MISS/200 574 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
142 | 1008100632.672 1134 192.168.0.129 TCP_MISS/200 565 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
143 | 1008100632.817 996 192.168.0.129 TCP_MISS/200 565 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
144 | 1008100633.023 1033 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
145 | 1008100633.747 1635 192.168.0.129 TCP_MISS/200 13522 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
146 | 1008100633.795 1276 192.168.0.129 TCP_MISS/200 704 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
147 | 1008100633.983 1251 192.168.0.129 TCP_MISS/200 593 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
148 | 1008100634.084 715 192.168.0.129 TCP_MISS/200 703 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
149 | 1008100635.239 879 192.168.0.129 TCP_MISS/200 972 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
150 | 1008100635.722 646 192.168.0.129 TCP_MISS/200 671 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
151 | 1008100636.608 1478 192.168.0.129 TCP_MISS/200 860 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
152 | 1008100643.828 1101 192.168.0.129 TCP_MISS/200 6224 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
153 | 1008100646.216 574 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
154 | 1008100655.510 1061 192.168.0.129 TCP_MISS/200 8724 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
155 | 1008100659.278 441 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
156 | 1008100665.654 921 192.168.0.129 TCP_MISS/200 6224 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
157 | 1008100668.265 884 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
158 | 1008100682.064 10432 192.168.0.129 TCP_MISS/200 10300 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
159 | 1008100684.754 606 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
160 | 1008100728.981 1554 192.168.0.129 TCP_MISS/200 17280 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
161 | 1008100731.992 678 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
162 | 1008100756.795 7290 192.168.0.129 TCP_MISS/200 26341 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
163 | 1008100760.421 940 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
164 | 1008100791.488 17454 192.168.0.129 TCP_MISS/200 33765 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
165 | 1008100794.653 659 192.168.0.129 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
166 | 1008100821.459 655 192.168.0.129 TCP_MISS/200 1360 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
167 | 1008100825.116 518 192.168.0.129 TCP_MISS/200 5354 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
168 | 1008100825.508 909 192.168.0.129 TCP_MISS/200 7530 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
169 | 1008100849.818 713 192.168.0.129 TCP_MISS/503 1188 GET http://www.akamaitechnologies.com/ graeme NONE/- - | |
170 | 1008100860.693 319 192.168.0.129 TCP_MISS/503 1147 GET http://akamaitechnologies.com/ graeme NONE/- - | |
171 | 1008100916.055 1019 192.168.0.129 TCP_MISS/400 399 GET http://210.57.17.225/ graeme DIRECT/210.57.17.225 text/html | |
172 | 1008100942.175 2691 192.168.0.129 TCP_MISS/401 620 GET http://intranet.taita.school.nz/ graeme DIRECT/192.168.0.30 text/html | |
173 | 1008100947.987 540 192.168.0.129 TCP_MISS/200 787 GET http://intranet.taita.school.nz/ graeme DIRECT/192.168.0.30 text/html | |
174 | 1008100949.488 804 192.168.0.129 TCP_MISS/200 645 GET http://intranet.taita.school.nz/menubar.php graeme DIRECT/192.168.0.30 text/html | |
175 | 1008100949.643 992 192.168.0.129 TCP_MISS/200 765 GET http://intranet.taita.school.nz/home.php graeme DIRECT/192.168.0.30 text/html | |
176 | 1008100949.932 1376 192.168.0.129 TCP_MISS/200 439 GET http://intranet.taita.school.nz/header.php graeme DIRECT/192.168.0.30 text/html | |
177 | 1008100957.581 114 192.168.0.129 TCP_MISS/200 1545 GET http://intranet.taita.school.nz/menubar.css graeme DIRECT/192.168.0.30 text/css | |
178 | 1008100958.285 641 192.168.0.129 TCP_HIT/200 1375 GET http://intranet.taita.school.nz/taita.css graeme NONE/- text/css | |
179 | 1008100958.621 334 192.168.0.129 TCP_MISS/200 9599 GET http://intranet.taita.school.nz/images/intranethead.gif graeme DIRECT/192.168.0.30 image/gif | |
180 | 1008100963.137 91 192.168.0.129 TCP_MISS/200 1572 GET http://intranet.taita.school.nz/menubar.php? graeme DIRECT/192.168.0.30 text/html | |
181 | 1008100963.571 38 192.168.0.129 TCP_MISS/304 224 GET http://intranet.taita.school.nz/menubar.css graeme DIRECT/192.168.0.30 - | |
182 | 1008100969.005 268 192.168.0.129 TCP_MISS/200 10052 GET http://intranet.taita.school.nz/squidlogs/topsites.php graeme DIRECT/192.168.0.30 text/html | |
183 | 1008100969.337 97 192.168.0.129 TCP_MISS/200 1366 GET http://intranet.taita.school.nz/squidlogs/taita.css graeme DIRECT/192.168.0.30 text/css | |
184 | 1008100994.713 120 192.168.0.129 TCP_MISS/200 8600 GET http://intranet.taita.school.nz/squidlogs/topusers.php graeme DIRECT/192.168.0.30 text/html | |
185 | 1008100995.566 306 192.168.0.129 TCP_MISS/304 224 GET http://intranet.taita.school.nz/squidlogs/taita.css graeme DIRECT/192.168.0.30 - | |
186 | 1008106721.564 839 192.168.0.60 TCP_CLIENT_REFRESH_MISS/200 1356 GET http://windowsupdate.microsoft.com/ident.cab graeme DIRECT/207.46.106.88 application/octet-stream | |
187 | 1008106721.611 11 192.168.0.60 TCP_HIT/200 2389 GET http://windowsupdate.microsoft.com/ident.cab graeme NONE/- application/octet-stream | |
188 | 1008106726.474 201 192.168.0.60 TCP_MISS/200 313 HEAD http://windowsupdate.microsoft.com/ident.cab graeme DIRECT/207.46.106.88 application/octet-stream | |
189 | 1008106727.341 227 192.168.0.60 TCP_MISS/200 312 HEAD http://windowsupdate.microsoft.com/qmgr/rel1083.11/x86/w9x/en/Drizzle.cab graeme DIRECT/207.46.106.88 application/octet-stream | |
190 | 1008106736.312 29 192.168.0.60 TCP_MISS/401 620 GET http://intranet.taita.school.nz/ graeme DIRECT/192.168.0.30 text/html | |
191 | 1008106741.899 40 192.168.0.60 TCP_MISS/200 787 GET http://intranet.taita.school.nz/ graeme DIRECT/192.168.0.30 text/html | |
192 | 1008106743.060 20 192.168.0.60 TCP_MISS/200 439 GET http://intranet.taita.school.nz/header.php graeme DIRECT/192.168.0.30 text/html | |
193 | 1008106743.247 42 192.168.0.60 TCP_MISS/200 645 GET http://intranet.taita.school.nz/menubar.php graeme DIRECT/192.168.0.30 text/html | |
194 | 1008106743.334 47 192.168.0.60 TCP_MISS/200 765 GET http://intranet.taita.school.nz/home.php graeme DIRECT/192.168.0.30 text/html | |
195 | 1008106743.832 36 192.168.0.60 TCP_MISS/200 1545 GET http://intranet.taita.school.nz/menubar.css graeme DIRECT/192.168.0.30 text/css | |
196 | 1008106743.836 40 192.168.0.60 TCP_MISS/200 9599 GET http://intranet.taita.school.nz/images/intranethead.gif graeme DIRECT/192.168.0.30 image/gif | |
197 | 1008106744.396 127 192.168.0.60 TCP_IMS_HIT/304 224 GET http://intranet.taita.school.nz/taita.css graeme NONE/- text/css | |
198 | 1008106746.662 955 192.168.0.60 TCP_MISS/200 1572 GET http://intranet.taita.school.nz/menubar.php? graeme DIRECT/192.168.0.30 text/html | |
199 | 1008106749.725 927 192.168.0.60 TCP_MISS/200 14589 GET http://intranet.taita.school.nz/admin/laptops.php graeme DIRECT/192.168.0.30 text/html | |
200 | 1008106749.861 44 192.168.0.60 TCP_MISS/200 1366 GET http://intranet.taita.school.nz/admin/taita.css graeme DIRECT/192.168.0.30 text/css | |
201 | 1008106749.876 47 192.168.0.60 TCP_MISS/200 915 GET http://intranet.taita.school.nz/images/more.gif graeme DIRECT/192.168.0.30 image/gif | |
202 | 1008106749.896 73 192.168.0.60 TCP_MISS/200 508 GET http://intranet.taita.school.nz/images/yep.gif graeme DIRECT/192.168.0.30 image/gif | |
203 | 1008106749.900 64 192.168.0.60 TCP_MISS/200 506 GET http://intranet.taita.school.nz/images/nope.gif graeme DIRECT/192.168.0.30 image/gif | |
204 | 1008106771.542 993 192.168.0.60 TCP_MISS/200 6806 GET http://intranet.taita.school.nz/admin/laptop_detail.php? graeme DIRECT/192.168.0.30 text/html | |
205 | 1008106771.787 208 192.168.0.60 TCP_MISS/200 899 GET http://intranet.taita.school.nz/images/back.gif graeme DIRECT/192.168.0.30 image/gif | |
206 | 1008106771.791 43 192.168.0.60 TCP_MISS/200 871 GET http://intranet.taita.school.nz/images/edit.gif graeme DIRECT/192.168.0.30 image/gif | |
207 | 1008106771.806 14 192.168.0.60 TCP_MISS/200 1028 GET http://intranet.taita.school.nz/images/rubbish.gif graeme DIRECT/192.168.0.30 image/gif | |
208 | 1008106772.714 145 192.168.0.60 TCP_MISS/200 1001 GET http://intranet.taita.school.nz/images/addnote.gif graeme DIRECT/192.168.0.30 image/gif | |
209 | 1008106936.815 66 192.168.0.60 TCP_MISS/200 14589 GET http://intranet.taita.school.nz/admin/laptops.php graeme DIRECT/192.168.0.30 text/html | |
210 | 1008106944.458 71 192.168.0.60 TCP_MISS/200 6085 GET http://intranet.taita.school.nz/admin/laptop_detail.php? graeme DIRECT/192.168.0.30 text/html | |
211 | 1008106951.747 71 192.168.0.60 TCP_MISS/200 14589 GET http://intranet.taita.school.nz/admin/laptops.php graeme DIRECT/192.168.0.30 text/html | |
212 | 1008106954.234 94 192.168.0.60 TCP_MISS/200 8243 GET http://intranet.taita.school.nz/admin/laptop_detail.php? graeme DIRECT/192.168.0.30 text/html | |
213 | 1008106966.601 65 192.168.0.60 TCP_MISS/200 14589 GET http://intranet.taita.school.nz/admin/laptops.php graeme DIRECT/192.168.0.30 text/html | |
214 | 1008106975.469 61 192.168.0.60 TCP_MISS/200 6806 GET http://intranet.taita.school.nz/admin/laptop_detail.php? graeme DIRECT/192.168.0.30 text/html | |
215 | 1008106980.184 64 192.168.0.60 TCP_MISS/200 3247 GET http://intranet.taita.school.nz/admin/laptop_edit.php? graeme DIRECT/192.168.0.30 text/html | |
216 | 1008106980.236 19 192.168.0.60 TCP_MISS/200 900 GET http://intranet.taita.school.nz/images/save.gif graeme DIRECT/192.168.0.30 image/gif | |
217 | 1008106986.886 877 192.168.0.60 TCP_MISS/200 3254 POST http://intranet.taita.school.nz/admin/laptop_edit.php graeme DIRECT/192.168.0.30 text/html | |
218 | 1008106989.675 62 192.168.0.60 TCP_MISS/200 6805 GET http://intranet.taita.school.nz/admin/laptop_detail.php? graeme DIRECT/192.168.0.30 text/html | |
219 | 1008106991.597 66 192.168.0.60 TCP_MISS/200 14588 GET http://intranet.taita.school.nz/admin/laptops.php graeme DIRECT/192.168.0.30 text/html | |
220 | 1008109145.318 166 192.168.0.194 TCP_MISS/401 620 GET http://intranet.taita.school.nz/ graeme DIRECT/192.168.0.30 text/html | |
221 | 1008109147.512 30 192.168.0.194 TCP_HIT/200 1375 GET http://intranet.taita.school.nz/taita.css graeme NONE/- text/css | |
222 | 1008109156.215 1175 192.168.0.194 TCP_MISS/200 1199 GET http://www.paradise.net.nz/ graeme DIRECT/203.96.152.127 text/html | |
223 | 1008109157.611 60 192.168.0.194 TCP_HIT/200 6038 GET http://www.paradise.net.nz/standard/menus/main.html graeme NONE/- text/html | |
224 | 1008109157.911 299 192.168.0.194 TCP_MISS/200 1265 GET http://www.paradise.net.nz/common/style/main.css graeme DIRECT/203.96.152.127 text/css | |
225 | 1008109157.973 192 192.168.0.194 TCP_MISS/200 2402 GET http://www.paradise.net.nz/common/scripts/paradise.js graeme DIRECT/203.96.152.127 application/x-javascript | |
226 | 1008109158.219 439 192.168.0.194 TCP_MISS/200 10084 GET http://www.paradise.net.nz/cgi-bin/main/index graeme DIRECT/203.96.152.127 text/html | |
227 | 1008109158.361 128 192.168.0.194 TCP_MISS/200 393 GET http://www.paradise.net.nz/common/media/000000.gif graeme DIRECT/203.96.152.127 image/gif | |
228 | 1008109158.467 105 192.168.0.194 TCP_HIT/200 2510 GET http://www.paradise.net.nz/standard/media/menu/members.gif graeme NONE/- image/gif | |
229 | 1008109158.472 171 192.168.0.194 TCP_MISS/200 810 GET http://www.paradise.net.nz/common/media/tables/b-topleft.gif graeme DIRECT/203.96.152.127 image/gif | |
230 | 1008109158.475 113 192.168.0.194 TCP_HIT/200 12306 GET http://www.paradise.net.nz/common/media/logos.gif graeme NONE/- image/gif | |
231 | 1008109158.565 167 192.168.0.194 TCP_MISS/200 542 GET http://www.paradise.net.nz/common/media/tables/b-top.gif graeme DIRECT/203.96.152.127 image/gif | |
232 | 1008109158.683 108 192.168.0.194 TCP_HIT/200 1981 GET http://www.paradise.net.nz/standard/media/menu/about.gif graeme NONE/- image/gif | |
233 | 1008109158.683 108 192.168.0.194 TCP_HIT/200 1980 GET http://www.paradise.net.nz/standard/media/menu/plans.gif graeme NONE/- image/gif | |
234 | 1008109158.689 41 192.168.0.194 TCP_HIT/200 1878 GET http://www.paradise.net.nz/standard/media/menu/join.gif graeme NONE/- image/gif | |
235 | 1008109158.764 73 192.168.0.194 TCP_HIT/200 2123 GET http://www.paradise.net.nz/standard/media/menu/mail.gif graeme NONE/- image/gif | |
236 | 1008109158.764 18 192.168.0.194 TCP_HIT/200 2136 GET http://www.paradise.net.nz/standard/media/menu/help.gif graeme NONE/- image/gif | |
237 | 1008109158.812 66 192.168.0.194 TCP_MISS/200 818 GET http://www.paradise.net.nz/common/media/tables/b-topright.gif graeme DIRECT/203.96.152.127 image/gif | |
238 | 1008109159.007 194 192.168.0.194 TCP_MISS/200 425 GET http://www.paradise.net.nz/common/media/tables/trans.gif graeme DIRECT/203.96.152.127 image/gif | |
239 | 1008109159.076 200 192.168.0.194 TCP_MISS/200 558 GET http://www.paradise.net.nz/common/media/tables/b-in-tl.gif graeme DIRECT/203.96.152.127 image/gif | |
240 | 1008109159.101 226 192.168.0.194 TCP_MISS/200 565 GET http://www.paradise.net.nz/common/media/tables/b-in-tr.gif graeme DIRECT/203.96.152.127 image/gif | |
241 | 1008109159.225 350 192.168.0.194 TCP_MISS/200 445 GET http://www.paradise.net.nz/common/media/tables/b-in-top.gif graeme DIRECT/203.96.152.127 image/gif | |
242 | 1008109159.237 135 192.168.0.194 TCP_MISS/200 450 GET http://www.paradise.net.nz/common/media/tables/b-left.gif graeme DIRECT/203.96.152.127 image/gif | |
243 | 1008109159.237 230 192.168.0.194 TCP_MISS/200 425 GET http://www.paradise.net.nz/common/media/trans.gif graeme DIRECT/203.96.152.127 image/gif | |
244 | 1008109159.287 166 192.168.0.194 TCP_MISS/200 453 GET http://www.paradise.net.nz/common/media/tables/b-right.gif graeme DIRECT/203.96.152.127 image/gif | |
245 | 1008109159.395 27 192.168.0.194 TCP_MEM_HIT/200 9923 GET http://www.paradise.net.nz/standard/media/main/netguide-2001.gif graeme NONE/- image/gif | |
246 | 1008109159.439 43 192.168.0.194 TCP_MEM_HIT/200 2677 GET http://www.paradise.net.nz/standard/media/main/google.gif graeme NONE/- image/gif | |
247 | 1008109159.655 287 192.168.0.194 TCP_MISS/200 416 GET http://www.paradise.net.nz/common/media/tables/b-in-r.gif graeme DIRECT/203.96.152.127 image/gif | |
248 | 1008109159.667 378 192.168.0.194 TCP_MISS/200 416 GET http://www.paradise.net.nz/common/media/tables/b-in-l.gif graeme DIRECT/203.96.152.127 image/gif | |
249 | 1008109159.696 255 192.168.0.194 TCP_MISS/200 1015 GET http://www.paradise.net.nz/standard/media/main/search.gif graeme DIRECT/203.96.152.127 image/gif | |
250 | 1008109159.777 408 192.168.0.194 TCP_MISS/200 17115 GET http://www.paradise.net.nz/standard/media/banners/audio.gif graeme DIRECT/203.96.152.127 image/gif | |
251 | 1008109159.811 144 192.168.0.194 TCP_MISS/200 555 GET http://www.paradise.net.nz/common/media/tables/b-in-bl.gif graeme DIRECT/203.96.152.127 image/gif | |
252 | 1008109159.847 151 192.168.0.194 TCP_MISS/200 444 GET http://www.paradise.net.nz/common/media/tables/b-in-bot.gif graeme DIRECT/203.96.152.127 image/gif | |
253 | 1008109159.904 208 192.168.0.194 TCP_MISS/200 554 GET http://www.paradise.net.nz/common/media/tables/b-in-br.gif graeme DIRECT/203.96.152.127 image/gif | |
254 | 1008109159.925 145 192.168.0.194 TCP_MISS/200 823 GET http://www.paradise.net.nz/common/media/tables/b-bottomleft.gif graeme DIRECT/203.96.152.127 image/gif | |
255 | 1008109160.018 204 192.168.0.194 TCP_MISS/200 711 GET http://www.paradise.net.nz/common/media/tables/b-bottomright.gif graeme DIRECT/203.96.152.127 image/gif | |
256 | 1008109160.106 198 192.168.0.194 TCP_MISS/200 522 GET http://www.paradise.net.nz/common/media/tables/b-bottom.gif graeme DIRECT/203.96.152.127 image/gif | |
257 | 1008109160.145 211 192.168.0.194 TCP_MISS/200 2445 GET http://www.paradise.net.nz/standard/media/menu/members-o.gif graeme DIRECT/203.96.152.127 image/gif | |
258 | 1008109160.234 214 192.168.0.194 TCP_MISS/200 2096 GET http://www.paradise.net.nz/standard/media/menu/mail-o.gif graeme DIRECT/203.96.152.127 image/gif | |
259 | 1008109160.277 168 192.168.0.194 TCP_MISS/200 2111 GET http://www.paradise.net.nz/standard/media/menu/help-o.gif graeme DIRECT/203.96.152.127 image/gif | |
260 | 1008109160.360 215 192.168.0.194 TCP_MISS/200 1936 GET http://www.paradise.net.nz/standard/media/menu/about-o.gif graeme DIRECT/203.96.152.127 image/gif | |
261 | 1008109160.391 156 192.168.0.194 TCP_MISS/200 1929 GET http://www.paradise.net.nz/standard/media/menu/plans-o.gif graeme DIRECT/203.96.152.127 image/gif | |
262 | 1008109160.400 553 192.168.0.194 TCP_MISS/200 1369 GET http://counter.paradise.net.nz/cgi-bin/Count.cgi? graeme DIRECT/203.96.152.15 image/gif | |
263 | 1008109160.454 159 192.168.0.194 TCP_MISS/200 1843 GET http://www.paradise.net.nz/standard/media/menu/join-o.gif graeme DIRECT/203.96.152.127 image/gif | |
264 | 1008109160.561 105 192.168.0.194 TCP_MISS/200 983 GET http://www.paradise.net.nz/standard/media/main/search-o.gif graeme DIRECT/203.96.152.127 image/gif | |
265 | 1008109163.800 1597 192.168.0.194 TCP_MISS/200 2275 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
266 | 1008109171.230 428 192.168.0.194 TCP_MISS/200 1360 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
267 | 1008109172.131 754 192.168.0.194 TCP_MISS/200 1448 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
268 | 1008109172.170 787 192.168.0.194 TCP_MISS/200 5354 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
269 | 1008109172.511 316 192.168.0.194 TCP_MISS/200 2552 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
270 | 1008109172.533 329 192.168.0.194 TCP_MISS/200 1414 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
271 | 1008109173.296 1153 192.168.0.194 TCP_MISS/200 7535 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
272 | 1008109173.407 736 192.168.0.194 TCP_MISS/200 542 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
273 | 1008109173.472 801 192.168.0.194 TCP_MISS/200 959 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
274 | 1008109173.632 1017 192.168.0.194 TCP_MISS/200 12464 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
275 | 1008109173.759 385 192.168.0.194 TCP_MISS/200 2332 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
276 | 1008109173.839 416 192.168.0.194 TCP_MISS/200 2312 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
277 | 1008109173.881 398 192.168.0.194 TCP_MISS/200 2183 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
278 | 1008109173.992 350 192.168.0.194 TCP_MISS/200 2281 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
279 | 1008109174.129 344 192.168.0.194 TCP_MISS/200 967 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
280 | 1008109174.147 294 192.168.0.194 TCP_MISS/200 574 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
281 | 1008109174.433 296 192.168.0.194 TCP_MISS/200 574 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
282 | 1008109174.464 310 192.168.0.194 TCP_MISS/200 691 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
283 | 1008109212.881 6544 192.168.0.194 TCP_MISS/200 33765 CONNECT www.paradise.net.nz:443 graeme DIRECT/203.96.152.127 - | |
284 | 1008110359.238 13685 192.168.0.60 TCP_CLIENT_REFRESH_MISS/200 1356 GET http://windowsupdate.microsoft.com/ident.cab graeme DIRECT/207.46.106.88 application/x-compressed | |
285 | 1008110359.278 14 192.168.0.60 TCP_HIT/200 2389 GET http://windowsupdate.microsoft.com/ident.cab graeme NONE/- application/x-compressed | |
286 | 1008110364.189 355 192.168.0.60 TCP_MISS/200 313 HEAD http://windowsupdate.microsoft.com/ident.cab graeme DIRECT/207.46.106.88 application/x-compressed | |
287 | 1008110366.883 2583 192.168.0.60 TCP_MISS/200 312 HEAD http://windowsupdate.microsoft.com/qmgr/rel1083.11/x86/w9x/en/Drizzle.cab graeme DIRECT/207.46.106.88 application/x-compressed | |
288 | 1008110498.641 2281 192.168.0.60 TCP_MISS/200 43698 GET http://www.top50.co.nz/ graeme DIRECT/202.37.240.34 text/html | |
289 | 1008110498.959 141 192.168.0.60 TCP_MISS/304 218 GET http://www.top50.co.nz/js/menu_nav.js graeme DIRECT/202.37.240.34 - | |
290 | 1008110499.252 292 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/style.css graeme DIRECT/202.37.240.34 - | |
291 | 1008110499.738 484 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_rianz.jpg graeme DIRECT/202.37.240.34 - | |
292 | 1008110500.192 133 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_title.gif graeme DIRECT/202.37.240.34 - | |
293 | 1008110500.286 180 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/spacer.gif graeme DIRECT/202.37.240.34 - | |
294 | 1008110500.440 152 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_head_topright.gif graeme DIRECT/202.37.240.34 - | |
295 | 1008110500.477 126 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subtitle_top50.gif graeme DIRECT/202.37.240.34 - | |
296 | 1008110500.609 253 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_rianz.gif graeme DIRECT/202.37.240.34 - | |
297 | 1008110500.668 190 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_ppnz.gif graeme DIRECT/202.37.240.34 - | |
298 | 1008110500.892 222 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_rap.gif graeme DIRECT/202.37.240.34 - | |
299 | 1008110500.924 118 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_awards.gif graeme DIRECT/202.37.240.34 - | |
300 | 1008110500.931 117 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_top50.gif graeme DIRECT/202.37.240.34 - | |
301 | 1008110501.051 206 192.168.0.60 TCP_MISS/304 219 GET http://www.top50.co.nz/images/home_scholarships.gif graeme DIRECT/202.37.240.34 - | |
302 | 1008110501.091 126 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_home.gif graeme DIRECT/202.37.240.34 - | |
303 | 1008110501.234 294 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_credit.gif graeme DIRECT/202.37.240.34 - | |
304 | 1008110501.309 256 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/button_go.gif graeme DIRECT/202.37.240.34 - | |
305 | 1008110501.318 224 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/printer_icon.gif graeme DIRECT/202.37.240.34 - | |
306 | 1008110501.321 356 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/top50_subscribe.gif graeme DIRECT/202.37.240.34 - | |
307 | 1008110501.481 244 192.168.0.60 TCP_MISS/200 8106 GET http://www.top50.co.nz/images/logo_top50_R.gif graeme DIRECT/202.37.240.34 image/gif | |
308 | 1008110501.537 215 192.168.0.60 TCP_MISS/304 219 GET http://www.top50.co.nz/images/cert_gold.gif graeme DIRECT/202.37.240.34 - | |
309 | 1008110501.565 237 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/cert_plat.gif graeme DIRECT/202.37.240.34 - | |
310 | 1008110501.680 369 192.168.0.60 TCP_MISS/200 11663 GET http://www.top50.co.nz/images/BRN_GT_BRNT.jpg graeme DIRECT/202.37.240.34 image/jpeg | |
311 | 1008110502.127 109 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_address.gif graeme DIRECT/202.37.240.34 - | |
312 | 1008110502.209 271 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_left_logo.gif graeme DIRECT/202.37.240.34 - | |
313 | 1008110502.280 261 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_right.gif graeme DIRECT/202.37.240.34 - | |
314 | 1008110503.747 1713 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_head_wall.gif graeme DIRECT/202.37.240.34 - | |
315 | 1008110503.825 1544 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_navwall.gif graeme DIRECT/202.37.240.34 - | |
316 | 1008110503.842 1629 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_wallright.gif graeme DIRECT/202.37.240.34 - | |
317 | 1008110503.879 1750 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subtitle_wall.gif graeme DIRECT/202.37.240.34 - | |
318 | 1008110504.118 292 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_navwall.gif graeme DIRECT/202.37.240.34 - | |
319 | 1008110504.128 381 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_wallleft.gif graeme DIRECT/202.37.240.34 - | |
320 | 1008110504.166 323 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_wallfooter.gif graeme DIRECT/202.37.240.34 - | |
321 | 1008110504.677 509 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_ppnz.jpg graeme DIRECT/202.37.240.34 - | |
322 | 1008110504.800 202 192.168.0.60 TCP_MISS/404 1529 GET http://www.top50.co.nz/images/subover/rap.jpg graeme DIRECT/202.37.240.34 text/html | |
323 | 1008110504.886 214 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_awards.jpg graeme DIRECT/202.37.240.34 - | |
324 | 1008110504.889 209 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_top50.jpg graeme DIRECT/202.37.240.34 - | |
325 | 1008110504.893 135 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_scholarships.jpg graeme DIRECT/202.37.240.34 - | |
326 | 1008110504.977 135 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_credit.jpg graeme DIRECT/202.37.240.34 - | |
327 | 1008110509.438 1159 192.168.0.60 TCP_MISS/200 43697 GET http://www.top50.co.nz/ graeme DIRECT/202.37.240.34 text/html | |
328 | 1008110509.444 120 192.168.0.60 TCP_MISS/304 218 GET http://www.top50.co.nz/js/menu_nav.js graeme DIRECT/202.37.240.34 - | |
329 | 1008110509.578 132 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/style.css graeme DIRECT/202.37.240.34 - | |
330 | 1008110509.604 101 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_rianz.jpg graeme DIRECT/202.37.240.34 - | |
331 | 1008110509.686 106 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_title.gif graeme DIRECT/202.37.240.34 - | |
332 | 1008110509.709 122 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/spacer.gif graeme DIRECT/202.37.240.34 - | |
333 | 1008110509.798 192 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_head_wall.gif graeme DIRECT/202.37.240.34 - | |
334 | 1008110509.840 129 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subtitle_top50.gif graeme DIRECT/202.37.240.34 - | |
335 | 1008110509.883 171 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_head_topright.gif graeme DIRECT/202.37.240.34 - | |
336 | 1008110509.987 267 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_rianz.gif graeme DIRECT/202.37.240.34 - | |
337 | 1008110510.535 547 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_ppnz.gif graeme DIRECT/202.37.240.34 - | |
338 | 1008110510.539 440 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_rap.gif graeme DIRECT/202.37.240.34 - | |
339 | 1008110510.557 450 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_awards.gif graeme DIRECT/202.37.240.34 - | |
340 | 1008110510.616 407 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_top50.gif graeme DIRECT/202.37.240.34 - | |
341 | 1008110510.676 136 192.168.0.60 TCP_MISS/304 219 GET http://www.top50.co.nz/images/home_scholarships.gif graeme DIRECT/202.37.240.34 - | |
342 | 1008110510.705 157 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_credit.gif graeme DIRECT/202.37.240.34 - | |
343 | 1008110510.731 172 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/home_home.gif graeme DIRECT/202.37.240.34 - | |
344 | 1008110510.823 206 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/top50_subscribe.gif graeme DIRECT/202.37.240.34 - | |
345 | 1008110510.929 251 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/button_go.gif graeme DIRECT/202.37.240.34 - | |
346 | 1008110510.953 246 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/printer_icon.gif graeme DIRECT/202.37.240.34 - | |
347 | 1008110511.013 280 192.168.0.60 TCP_CLIENT_REFRESH_MISS/304 220 GET http://www.top50.co.nz/images/logo_top50_R.gif graeme DIRECT/202.37.240.34 - | |
348 | 1008110511.053 229 192.168.0.60 TCP_CLIENT_REFRESH_MISS/304 220 GET http://www.top50.co.nz/images/BRN_GT_BRNT.jpg graeme DIRECT/202.37.240.34 - | |
349 | 1008110511.233 177 192.168.0.60 TCP_MISS/304 219 GET http://www.top50.co.nz/images/cert_gold.gif graeme DIRECT/202.37.240.34 - | |
350 | 1008110511.264 171 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subtitle_wall.gif graeme DIRECT/202.37.240.34 - | |
351 | 1008110511.329 197 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/cert_plat.gif graeme DIRECT/202.37.240.34 - | |
352 | 1008110511.355 189 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_left_logo.gif graeme DIRECT/202.37.240.34 - | |
353 | 1008110511.427 192 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_right.gif graeme DIRECT/202.37.240.34 - | |
354 | 1008110511.456 190 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_address.gif graeme DIRECT/202.37.240.34 - | |
355 | 1008110511.511 155 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_wallright.gif graeme DIRECT/202.37.240.34 - | |
356 | 1008110511.599 170 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_wallleft.gif graeme DIRECT/202.37.240.34 - | |
357 | 1008110511.613 238 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_navwall.gif graeme DIRECT/202.37.240.34 - | |
358 | 1008110511.690 232 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_footer_navwall.gif graeme DIRECT/202.37.240.34 - | |
359 | 1008110511.746 233 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/sub_wallfooter.gif graeme DIRECT/202.37.240.34 - | |
360 | 1008110511.898 111 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_awards.jpg graeme DIRECT/202.37.240.34 - | |
361 | 1008110512.107 321 192.168.0.60 TCP_CLIENT_REFRESH_MISS/404 1529 GET http://www.top50.co.nz/images/subover/rap.jpg graeme DIRECT/202.37.240.34 text/html | |
362 | 1008110512.192 406 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_top50.jpg graeme DIRECT/202.37.240.34 - | |
363 | 1008110512.196 449 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_ppnz.jpg graeme DIRECT/202.37.240.34 - | |
364 | 1008110512.200 301 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_scholarships.jpg graeme DIRECT/202.37.240.34 - | |
365 | 1008110512.292 180 192.168.0.60 TCP_MISS/304 220 GET http://www.top50.co.nz/images/subover_credit.jpg graeme DIRECT/202.37.240.34 - | |
366 | 1008110518.517 700 192.168.0.60 TCP_MISS/301 579 GET http://www.slashdot.org/ graeme DIRECT/64.28.67.150 text/html | |
367 | 1008110519.843 30 192.168.0.60 TCP_IMS_HIT/200 3861 GET http://images.slashdot.org/title.gif graeme NONE/- image/gif | |
368 | 1008110520.632 1144 192.168.0.60 TCP_MISS/200 343 GET http://images2.slashdot.org/Slashdot/pc.gif? graeme DIRECT/64.28.67.114 image/gif | |
369 | 1008110521.200 2472 192.168.0.60 TCP_MISS/200 45759 GET http://slashdot.org/ graeme DIRECT/64.28.67.150 text/html | |
370 | 1008110521.287 654 192.168.0.60 TCP_MISS/200 1840 GET http://images.slashdot.org/topics/topicprogramming.gif graeme DIRECT/64.28.67.57 image/gif | |
371 | 1008110521.431 1686 192.168.0.60 TCP_MISS/200 16809 GET http://images.slashdot.org/banner/tkgk0213en.gif? graeme DIRECT/64.28.67.57 image/gif | |
372 | 1008110521.616 68 192.168.0.60 TCP_IMS_HIT/200 2427 GET http://images.slashdot.org/topics/topicinternet.gif graeme NONE/- image/gif | |
373 | 1008110521.829 583 192.168.0.60 TCP_MISS/200 1499 GET http://images.slashdot.org/topics/topicpatents.gif graeme DIRECT/64.28.67.57 image/gif | |
374 | 1008110522.016 583 192.168.0.60 TCP_MISS/200 1561 GET http://images.slashdot.org/topics/topichardware.gif graeme DIRECT/64.28.67.57 image/gif | |
375 | 1008110522.060 40 192.168.0.60 TCP_HIT/200 1864 GET http://images.slashdot.org/topics/topicmovies.gif graeme NONE/- image/gif | |
376 | 1008110522.206 589 192.168.0.60 TCP_MISS/200 513 GET http://images.slashdot.org/slc.gif graeme DIRECT/64.28.67.57 image/gif | |
377 | 1008110522.545 622 192.168.0.60 TCP_MISS/200 2121 GET http://images.slashdot.org/topics/topicapple.gif graeme DIRECT/64.28.67.57 image/gif | |
378 | 1008110522.723 662 192.168.0.60 TCP_MISS/200 1301 GET http://images.slashdot.org/topics/topicquake.gif graeme DIRECT/64.28.67.57 image/gif | |
379 | 1008110522.861 653 192.168.0.60 TCP_MISS/200 1389 GET http://images.slashdot.org/topics/topicgames.jpg graeme DIRECT/64.28.67.57 image/jpeg | |
380 | 1008110523.121 82 192.168.0.60 TCP_IMS_HIT/200 1574 GET http://images.slashdot.org/topics/topicspace.gif graeme NONE/- image/gif | |
381 | 1008110523.166 619 192.168.0.60 TCP_MISS/200 1911 GET http://images.slashdot.org/topics/topicgnu.jpg graeme DIRECT/64.28.67.57 image/jpeg | |
382 | 1008110523.483 613 192.168.0.60 TCP_MISS/200 1992 GET http://images.slashdot.org/topics/topicnews.gif graeme DIRECT/64.28.67.57 image/gif | |
383 | 1008110523.780 657 192.168.0.60 TCP_MISS/200 1459 GET http://images.slashdot.org/topics/topicscience.gif graeme DIRECT/64.28.67.57 image/gif | |
384 | 1008110523.798 626 192.168.0.60 TCP_MISS/200 426 GET http://images.slashdot.org/greendot.gif graeme DIRECT/64.28.67.57 image/gif | |
385 | 1008110523.958 3755 192.168.0.60 TCP_MISS/200 2364 GET http://images.slashdot.org/topics/topiclinux.gif graeme DIRECT/64.28.67.57 image/gif | |
386 | 1008114300.121 1118 192.168.0.60 TCP_CLIENT_REFRESH_MISS/200 1356 GET http://windowsupdate.microsoft.com/ident.cab graeme DIRECT/207.68.131.27 application/x-compressed | |
387 | 1008114300.365 223 192.168.0.60 TCP_HIT/200 2389 GET http://windowsupdate.microsoft.com/ident.cab graeme NONE/- application/x-compressed | |
388 | 1008114305.179 274 192.168.0.60 TCP_MISS/200 313 HEAD http://windowsupdate.microsoft.com/ident.cab graeme DIRECT/207.68.131.27 application/x-compressed | |
389 | 1008114305.586 265 192.168.0.60 TCP_MISS/200 312 HEAD http://windowsupdate.microsoft.com/qmgr/rel1083.11/x86/w9x/en/Drizzle.cab graeme DIRECT/207.68.131.27 application/x-compressed | |
390 | 1008273843.076 2605 192.168.0.146 TCP_MISS/302 411 GET http://www.complex.is/ graeme DIRECT/193.4.210.100 text/html | |
391 | 1008273844.273 39 192.168.0.146 TCP_HIT/200 6356 GET http://images.f-prot.com/w2/images/fsi500.gif graeme NONE/- image/gif | |
392 | 1008273844.305 30 192.168.0.146 TCP_HIT/200 1389 GET http://images.f-prot.com/w2/images/upperline2.gif graeme NONE/- image/gif | |
393 | 1008273844.344 37 192.168.0.146 TCP_HIT/200 2325 GET http://images.f-prot.com/w2/images/lefttopline2.gif graeme NONE/- image/gif | |
394 | 1008273844.548 1431 192.168.0.146 TCP_MISS/200 8618 GET http://www.complex.is/cgi-bin/home_pager graeme DIRECT/193.4.210.100 text/html | |
395 | 1008273845.703 1474 192.168.0.146 TCP_MISS/200 856 GET http://images.f-prot.com/w2/images/leftline2.jpg graeme DIRECT/193.4.210.2 image/jpeg | |
396 | 1008273845.730 25 192.168.0.146 TCP_HIT/200 3623 GET http://images.f-prot.com/w2/buttons/products-up.gif graeme NONE/- image/gif | |
397 | 1008273845.778 1589 192.168.0.146 TCP_REFRESH_HIT/200 3211 GET http://www.f-prot.com/f-prot/friskstyle.css graeme DIRECT/193.4.210.100 text/plain | |
398 | 1008273845.802 22 192.168.0.146 TCP_HIT/200 3618 GET http://images.f-prot.com/w2/buttons/support-up.gif graeme NONE/- image/gif | |
399 | 1008273845.861 1515 192.168.0.146 TCP_REFRESH_HIT/200 2174 GET http://images.f-prot.com/w2/buttons/home-down.gif graeme DIRECT/193.4.210.2 image/gif | |
400 | 1008273845.880 1318 192.168.0.146 TCP_MISS/200 816 GET http://images.f-prot.com/w2/images/1.gif graeme DIRECT/193.4.210.106 image/gif | |
401 | 1008273846.199 468 192.168.0.146 TCP_MISS/200 857 GET http://images.f-prot.com/w2/images/2.gif graeme DIRECT/193.4.210.2 image/gif | |
402 | 1008273846.248 29 192.168.0.146 TCP_HIT/200 1523 GET http://images.f-prot.com/w2/buttons/order-up.jpg graeme NONE/- image/jpeg | |
403 | 1008273846.321 459 192.168.0.146 TCP_REFRESH_HIT/200 3596 GET http://images.f-prot.com/w2/buttons/download-up.gif graeme DIRECT/193.4.210.106 image/gif | |
404 | 1008273846.349 26 192.168.0.146 TCP_HIT/200 3585 GET http://images.f-prot.com/w2/buttons/virusinfo-up.gif graeme NONE/- image/gif | |
405 | 1008273846.585 782 192.168.0.146 TCP_MISS/200 763 GET http://images.f-prot.com/w2/images/3.gif graeme DIRECT/193.4.210.2 image/gif | |
406 | 1008273846.606 19 192.168.0.146 TCP_HIT/200 3630 GET http://images.f-prot.com/w2/buttons/feedback-up.gif graeme NONE/- image/gif | |
407 | 1008273846.622 14 192.168.0.146 TCP_HIT/200 3602 GET http://images.f-prot.com/w2/buttons/company-up.gif graeme NONE/- image/gif | |
408 | 1008273846.644 20 192.168.0.146 TCP_HIT/200 3020 GET http://images.f-prot.com/w2/buttons/login-up.gif graeme NONE/- image/gif | |
409 | 1008273846.679 429 192.168.0.146 TCP_MISS/200 774 GET http://images.f-prot.com/w2/images/5.gif graeme DIRECT/193.4.210.2 image/gif | |
410 | 1008273846.700 810 192.168.0.146 TCP_MISS/200 738 GET http://images.f-prot.com/w2/images/4.gif graeme DIRECT/193.4.210.106 image/gif | |
411 | 1008273846.734 32 192.168.0.146 TCP_HIT/200 6012 GET http://images.f-prot.com/w2/images/logo_background.gif graeme NONE/- image/gif | |
412 | 1008273847.046 401 192.168.0.146 TCP_REFRESH_HIT/200 4917 GET http://images.f-prot.com/w2/images/buybanner1.jpg graeme DIRECT/193.4.210.2 image/jpeg | |
413 | 1008273847.127 446 192.168.0.146 TCP_REFRESH_HIT/200 1511 GET http://images.f-prot.com/w2/images/zone.gif graeme DIRECT/193.4.210.2 image/gif | |
414 | 1008273847.175 825 192.168.0.146 TCP_MISS/200 753 GET http://images.f-prot.com/w2/images/6.gif graeme DIRECT/193.4.210.2 image/gif | |
415 | 1008273862.002 46 192.168.0.146 TCP_HIT/200 3585 GET http://images.f-prot.com/w2/buttons/home-up.gif graeme NONE/- image/gif | |
416 | 1008273862.354 24 192.168.0.146 TCP_HIT/200 2176 GET http://images.f-prot.com/w2/buttons/download-down.gif graeme NONE/- image/gif | |
417 | 1008273862.392 1844 192.168.0.146 TCP_REFRESH_MISS/200 8350 GET http://www.f-prot.com/f-prot/download/ graeme DIRECT/193.4.210.100 text/html | |
418 | 1008274090.920 1149 192.168.0.146 TCP_MISS/302 435 GET http://www.complex.is/cgi-bin/get_randomly? graeme DIRECT/193.4.210.100 text/html |
0 | #!/bin/sh | |
1 | # | |
2 | # install - install a program, script, or datafile | |
3 | # This comes from X11R5 (mit/util/scripts/install.sh). | |
4 | # | |
5 | # Copyright 1991 by the Massachusetts Institute of Technology | |
6 | # | |
7 | # Permission to use, copy, modify, distribute, and sell this software and its | |
8 | # documentation for any purpose is hereby granted without fee, provided that | |
9 | # the above copyright notice appear in all copies and that both that | |
10 | # copyright notice and this permission notice appear in supporting | |
11 | # documentation, and that the name of M.I.T. not be used in advertising or | |
12 | # publicity pertaining to distribution of the software without specific, | |
13 | # written prior permission. M.I.T. makes no representations about the | |
14 | # suitability of this software for any purpose. It is provided "as is" | |
15 | # without express or implied warranty. | |
16 | # | |
17 | # Calling this script install-sh is preferred over install.sh, to prevent | |
18 | # `make' implicit rules from creating a file called install from it | |
19 | # when there is no Makefile. | |
20 | # | |
21 | # This script is compatible with the BSD install script, but was written | |
22 | # from scratch. It can only install one file at a time, a restriction | |
23 | # shared with many OS's install programs. | |
24 | ||
25 | ||
26 | # set DOITPROG to echo to test this script | |
27 | ||
28 | # Don't use :- since 4.3BSD and earlier shells don't like it. | |
29 | doit="${DOITPROG-}" | |
30 | ||
31 | ||
32 | # put in absolute paths if you don't have them in your path; or use env. vars. | |
33 | ||
34 | mvprog="${MVPROG-mv}" | |
35 | cpprog="${CPPROG-cp}" | |
36 | chmodprog="${CHMODPROG-chmod}" | |
37 | chownprog="${CHOWNPROG-chown}" | |
38 | chgrpprog="${CHGRPPROG-chgrp}" | |
39 | stripprog="${STRIPPROG-strip}" | |
40 | rmprog="${RMPROG-rm}" | |
41 | mkdirprog="${MKDIRPROG-mkdir}" | |
42 | ||
43 | transformbasename="" | |
44 | transform_arg="" | |
45 | instcmd="$mvprog" | |
46 | chmodcmd="$chmodprog 0755" | |
47 | chowncmd="" | |
48 | chgrpcmd="" | |
49 | stripcmd="" | |
50 | rmcmd="$rmprog -f" | |
51 | mvcmd="$mvprog" | |
52 | src="" | |
53 | dst="" | |
54 | dir_arg="" | |
55 | ||
56 | while [ x"$1" != x ]; do | |
57 | case $1 in | |
58 | -c) instcmd="$cpprog" | |
59 | shift | |
60 | continue;; | |
61 | ||
62 | -d) dir_arg=true | |
63 | shift | |
64 | continue;; | |
65 | ||
66 | -m) chmodcmd="$chmodprog $2" | |
67 | shift | |
68 | shift | |
69 | continue;; | |
70 | ||
71 | -o) chowncmd="$chownprog $2" | |
72 | shift | |
73 | shift | |
74 | continue;; | |
75 | ||
76 | -g) chgrpcmd="$chgrpprog $2" | |
77 | shift | |
78 | shift | |
79 | continue;; | |
80 | ||
81 | -s) stripcmd="$stripprog" | |
82 | shift | |
83 | continue;; | |
84 | ||
85 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` | |
86 | shift | |
87 | continue;; | |
88 | ||
89 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` | |
90 | shift | |
91 | continue;; | |
92 | ||
93 | *) if [ x"$src" = x ] | |
94 | then | |
95 | src=$1 | |
96 | else | |
97 | # this colon is to work around a 386BSD /bin/sh bug | |
98 | : | |
99 | dst=$1 | |
100 | fi | |
101 | shift | |
102 | continue;; | |
103 | esac | |
104 | done | |
105 | ||
106 | if [ x"$src" = x ] | |
107 | then | |
108 | echo "install: no input file specified" | |
109 | exit 1 | |
110 | else | |
111 | true | |
112 | fi | |
113 | ||
114 | if [ x"$dir_arg" != x ]; then | |
115 | dst=$src | |
116 | src="" | |
117 | ||
118 | if [ -d $dst ]; then | |
119 | instcmd=: | |
120 | chmodcmd="" | |
121 | else | |
122 | instcmd=mkdir | |
123 | fi | |
124 | else | |
125 | ||
126 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command | |
127 | # might cause directories to be created, which would be especially bad | |
128 | # if $src (and thus $dsttmp) contains '*'. | |
129 | ||
130 | if [ -f $src -o -d $src ] | |
131 | then | |
132 | true | |
133 | else | |
134 | echo "install: $src does not exist" | |
135 | exit 1 | |
136 | fi | |
137 | ||
138 | if [ x"$dst" = x ] | |
139 | then | |
140 | echo "install: no destination specified" | |
141 | exit 1 | |
142 | else | |
143 | true | |
144 | fi | |
145 | ||
146 | # If destination is a directory, append the input filename; if your system | |
147 | # does not like double slashes in filenames, you may need to add some logic | |
148 | ||
149 | if [ -d $dst ] | |
150 | then | |
151 | dst="$dst"/`basename $src` | |
152 | else | |
153 | true | |
154 | fi | |
155 | fi | |
156 | ||
157 | ## this sed command emulates the dirname command | |
158 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` | |
159 | ||
160 | # Make sure that the destination directory exists. | |
161 | # this part is taken from Noah Friedman's mkinstalldirs script | |
162 | ||
163 | # Skip lots of stat calls in the usual case. | |
164 | if [ ! -d "$dstdir" ]; then | |
165 | defaultIFS=' | |
166 | ' | |
167 | IFS="${IFS-${defaultIFS}}" | |
168 | ||
169 | oIFS="${IFS}" | |
170 | # Some sh's can't handle IFS=/ for some reason. | |
171 | IFS='%' | |
172 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` | |
173 | IFS="${oIFS}" | |
174 | ||
175 | pathcomp='' | |
176 | ||
177 | while [ $# -ne 0 ] ; do | |
178 | pathcomp="${pathcomp}${1}" | |
179 | shift | |
180 | ||
181 | if [ ! -d "${pathcomp}" ] ; | |
182 | then | |
183 | $mkdirprog "${pathcomp}" | |
184 | else | |
185 | true | |
186 | fi | |
187 | ||
188 | pathcomp="${pathcomp}/" | |
189 | done | |
190 | fi | |
191 | ||
192 | if [ x"$dir_arg" != x ] | |
193 | then | |
194 | $doit $instcmd $dst && | |
195 | ||
196 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && | |
197 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && | |
198 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && | |
199 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi | |
200 | else | |
201 | ||
202 | # If we're going to rename the final executable, determine the name now. | |
203 | ||
204 | if [ x"$transformarg" = x ] | |
205 | then | |
206 | dstfile=`basename $dst` | |
207 | else | |
208 | dstfile=`basename $dst $transformbasename | | |
209 | sed $transformarg`$transformbasename | |
210 | fi | |
211 | ||
212 | # don't allow the sed command to completely eliminate the filename | |
213 | ||
214 | if [ x"$dstfile" = x ] | |
215 | then | |
216 | dstfile=`basename $dst` | |
217 | else | |
218 | true | |
219 | fi | |
220 | ||
221 | # Make a temp file name in the proper directory. | |
222 | ||
223 | dsttmp=$dstdir/#inst.$$# | |
224 | ||
225 | # Move or copy the file name to the temp name | |
226 | ||
227 | $doit $instcmd $src $dsttmp && | |
228 | ||
229 | trap "rm -f ${dsttmp}" 0 && | |
230 | ||
231 | # and set any options; do chmod last to preserve setuid bits | |
232 | ||
233 | # If any of these fail, we abort the whole thing. If we want to | |
234 | # ignore errors from any of these, just make sure not to ignore | |
235 | # errors from the above "$doit $instcmd $src $dsttmp" command. | |
236 | ||
237 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && | |
238 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && | |
239 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && | |
240 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && | |
241 | ||
242 | # Now rename the file to the real destination. | |
243 | ||
244 | $doit $rmcmd -f $dstdir/$dstfile && | |
245 | $doit $mvcmd $dsttmp $dstdir/$dstfile | |
246 | ||
247 | fi && | |
248 | ||
249 | ||
250 | exit 0 |
0 | #! /bin/sh | |
1 | # Common stub for a few missing GNU programs while installing. | |
2 | # Copyright (C) 1996, 1997 Free Software Foundation, Inc. | |
3 | # Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996. | |
4 | ||
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2, or (at your option) | |
8 | # any later version. | |
9 | ||
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | ||
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
18 | # 02111-1307, USA. | |
19 | ||
20 | if test $# -eq 0; then | |
21 | echo 1>&2 "Try \`$0 --help' for more information" | |
22 | exit 1 | |
23 | fi | |
24 | ||
25 | case "$1" in | |
26 | ||
27 | -h|--h|--he|--hel|--help) | |
28 | echo "\ | |
29 | $0 [OPTION]... PROGRAM [ARGUMENT]... | |
30 | ||
31 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an | |
32 | error status if there is no known handling for PROGRAM. | |
33 | ||
34 | Options: | |
35 | -h, --help display this help and exit | |
36 | -v, --version output version information and exit | |
37 | ||
38 | Supported PROGRAM values: | |
39 | aclocal touch file \`aclocal.m4' | |
40 | autoconf touch file \`configure' | |
41 | autoheader touch file \`config.h.in' | |
42 | automake touch all \`Makefile.in' files | |
43 | bison create \`y.tab.[ch]', if possible, from existing .[ch] | |
44 | flex create \`lex.yy.c', if possible, from existing .c | |
45 | lex create \`lex.yy.c', if possible, from existing .c | |
46 | makeinfo touch the output file | |
47 | yacc create \`y.tab.[ch]', if possible, from existing .[ch]" | |
48 | ;; | |
49 | ||
50 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) | |
51 | echo "missing - GNU libit 0.0" | |
52 | ;; | |
53 | ||
54 | -*) | |
55 | echo 1>&2 "$0: Unknown \`$1' option" | |
56 | echo 1>&2 "Try \`$0 --help' for more information" | |
57 | exit 1 | |
58 | ;; | |
59 | ||
60 | aclocal) | |
61 | echo 1>&2 "\ | |
62 | WARNING: \`$1' is missing on your system. You should only need it if | |
63 | you modified \`acinclude.m4' or \`configure.in'. You might want | |
64 | to install the \`Automake' and \`Perl' packages. Grab them from | |
65 | any GNU archive site." | |
66 | touch aclocal.m4 | |
67 | ;; | |
68 | ||
69 | autoconf) | |
70 | echo 1>&2 "\ | |
71 | WARNING: \`$1' is missing on your system. You should only need it if | |
72 | you modified \`configure.in'. You might want to install the | |
73 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU | |
74 | archive site." | |
75 | touch configure | |
76 | ;; | |
77 | ||
78 | autoheader) | |
79 | echo 1>&2 "\ | |
80 | WARNING: \`$1' is missing on your system. You should only need it if | |
81 | you modified \`acconfig.h' or \`configure.in'. You might want | |
82 | to install the \`Autoconf' and \`GNU m4' packages. Grab them | |
83 | from any GNU archive site." | |
84 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` | |
85 | test -z "$files" && files="config.h" | |
86 | touch_files= | |
87 | for f in $files; do | |
88 | case "$f" in | |
89 | *:*) touch_files="$touch_files "`echo "$f" | | |
90 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; | |
91 | *) touch_files="$touch_files $f.in";; | |
92 | esac | |
93 | done | |
94 | touch $touch_files | |
95 | ;; | |
96 | ||
97 | automake) | |
98 | echo 1>&2 "\ | |
99 | WARNING: \`$1' is missing on your system. You should only need it if | |
100 | you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. | |
101 | You might want to install the \`Automake' and \`Perl' packages. | |
102 | Grab them from any GNU archive site." | |
103 | find . -type f -name Makefile.am -print | | |
104 | sed 's/\.am$/.in/' | | |
105 | while read f; do touch "$f"; done | |
106 | ;; | |
107 | ||
108 | bison|yacc) | |
109 | echo 1>&2 "\ | |
110 | WARNING: \`$1' is missing on your system. You should only need it if | |
111 | you modified a \`.y' file. You may need the \`Bison' package | |
112 | in order for those modifications to take effect. You can get | |
113 | \`Bison' from any GNU archive site." | |
114 | rm -f y.tab.c y.tab.h | |
115 | if [ $# -ne 1 ]; then | |
116 | eval LASTARG="\${$#}" | |
117 | case "$LASTARG" in | |
118 | *.y) | |
119 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` | |
120 | if [ -f "$SRCFILE" ]; then | |
121 | cp "$SRCFILE" y.tab.c | |
122 | fi | |
123 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` | |
124 | if [ -f "$SRCFILE" ]; then | |
125 | cp "$SRCFILE" y.tab.h | |
126 | fi | |
127 | ;; | |
128 | esac | |
129 | fi | |
130 | if [ ! -f y.tab.h ]; then | |
131 | echo >y.tab.h | |
132 | fi | |
133 | if [ ! -f y.tab.c ]; then | |
134 | echo 'main() { return 0; }' >y.tab.c | |
135 | fi | |
136 | ;; | |
137 | ||
138 | lex|flex) | |
139 | echo 1>&2 "\ | |
140 | WARNING: \`$1' is missing on your system. You should only need it if | |
141 | you modified a \`.l' file. You may need the \`Flex' package | |
142 | in order for those modifications to take effect. You can get | |
143 | \`Flex' from any GNU archive site." | |
144 | rm -f lex.yy.c | |
145 | if [ $# -ne 1 ]; then | |
146 | eval LASTARG="\${$#}" | |
147 | case "$LASTARG" in | |
148 | *.l) | |
149 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` | |
150 | if [ -f "$SRCFILE" ]; then | |
151 | cp "$SRCFILE" lex.yy.c | |
152 | fi | |
153 | ;; | |
154 | esac | |
155 | fi | |
156 | if [ ! -f lex.yy.c ]; then | |
157 | echo 'main() { return 0; }' >lex.yy.c | |
158 | fi | |
159 | ;; | |
160 | ||
161 | makeinfo) | |
162 | echo 1>&2 "\ | |
163 | WARNING: \`$1' is missing on your system. You should only need it if | |
164 | you modified a \`.texi' or \`.texinfo' file, or any other file | |
165 | indirectly affecting the aspect of the manual. The spurious | |
166 | call might also be the consequence of using a buggy \`make' (AIX, | |
167 | DU, IRIX). You might want to install the \`Texinfo' package or | |
168 | the \`GNU make' package. Grab either from any GNU archive site." | |
169 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` | |
170 | if test -z "$file"; then | |
171 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` | |
172 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` | |
173 | fi | |
174 | touch $file | |
175 | ;; | |
176 | ||
177 | *) | |
178 | echo 1>&2 "\ | |
179 | WARNING: \`$1' is needed, and you do not seem to have it handy on your | |
180 | system. You might have modified some files without having the | |
181 | proper tools for further handling them. Check the \`README' file, | |
182 | it often tells you about the needed prerequirements for installing | |
183 | this package. You may also peek at any GNU archive site, in case | |
184 | some other package would contain this missing \`$1' program." | |
185 | exit 1 | |
186 | ;; | |
187 | esac | |
188 | ||
189 | exit 0 |
0 | #! /bin/sh | |
1 | # mkinstalldirs --- make directory hierarchy | |
2 | # Author: Noah Friedman <friedman@prep.ai.mit.edu> | |
3 | # Created: 1993-05-16 | |
4 | # Public domain | |
5 | ||
6 | # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ | |
7 | ||
8 | errstatus=0 | |
9 | ||
10 | for file | |
11 | do | |
12 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` | |
13 | shift | |
14 | ||
15 | pathcomp= | |
16 | for d | |
17 | do | |
18 | pathcomp="$pathcomp$d" | |
19 | case "$pathcomp" in | |
20 | -* ) pathcomp=./$pathcomp ;; | |
21 | esac | |
22 | ||
23 | if test ! -d "$pathcomp"; then | |
24 | echo "mkdir $pathcomp" | |
25 | ||
26 | mkdir "$pathcomp" || lasterr=$? | |
27 | ||
28 | if test ! -d "$pathcomp"; then | |
29 | errstatus=$lasterr | |
30 | fi | |
31 | fi | |
32 | ||
33 | pathcomp="$pathcomp/" | |
34 | done | |
35 | done | |
36 | ||
37 | exit $errstatus | |
38 | ||
39 | # mkinstalldirs ends here |
0 | /* | |
1 | * This program is free software; you can redistribute it and/or modify | |
2 | * it under the terms of the GNU General Public License as published by | |
3 | * the Free Software Foundation; either version 2 of the License, or | |
4 | * (at your option) any later version. | |
5 | * | |
6 | * This program is distributed in the hope that it will be useful, | |
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | * GNU Library General Public License for more details. | |
10 | * | |
11 | * You should have received a copy of the GNU General Public License | |
12 | * along with this program; if not, write to the Free Software | |
13 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
14 | ||
15 | squidview 0.6 | |
16 | ||
17 | A program to nicely browse your squid log | |
18 | ||
19 | (c) 2001, 2002, 2003 Graeme Sheppard | |
20 | ||
21 | This program is not how it would be if I had to rewrite it from scratch. | |
22 | It started off very simple (quick and nasty) and needed to be fast because | |
23 | the computer was only a 486. So it was done in C. Then it would encounter | |
24 | a long request line, buffer overflow and seg fault. So I doubled the | |
25 | buffer size. OK for a while then same thing. Should've been C++ from the | |
26 | start because I kept doubling. | |
27 | ||
28 | A report generator a mile long, and a mile deep. Global variables like crazy. | |
29 | A half-baked keyboard input system. A half-baked console out display. The | |
30 | last one has a view good things about it. | |
31 | ||
32 | The program should have been split into several files at least. The code | |
33 | logic is followable which is something. | |
34 | ||
35 | Warning: those who complain about the source code might be requested to | |
36 | be the one who rewrites it. | |
37 | ||
38 | */ | |
39 | ||
40 | #ifdef HAVE_CONFIG_H | |
41 | #include <config.h> | |
42 | #else | |
43 | # define SHAREDIR "/usr/local/share/squidview" | |
44 | # define PACKAGE "squidview" | |
45 | # define VERSION "0.6" | |
46 | #endif | |
47 | ||
48 | #include <string> | |
49 | #include <vector> | |
50 | #include <algorithm> | |
51 | ||
52 | #include <curses.h> | |
53 | #include <signal.h> | |
54 | #include <sys/time.h> | |
55 | #include <sys/types.h> | |
56 | #include <sys/stat.h> | |
57 | #include <unistd.h> | |
58 | #include <fcntl.h> | |
59 | #include <time.h> | |
60 | #include <stdlib.h> | |
61 | #include <math.h> | |
62 | #include <ctype.h> | |
63 | ||
64 | #include "squidview.h" | |
65 | ||
66 | using namespace std; | |
67 | ||
68 | ||
69 | ct con; // screen output | |
70 | cUsersMode aTally; // an instance of users' tally | |
71 | ||
72 | void ShowHighLightMessage (const string& sText); | |
73 | ||
74 | ||
75 | // is the text null? | |
76 | // this function fixed by Mike Reid | |
77 | bool NullText (const char* szText) | |
78 | { | |
79 | if (szText != 0) | |
80 | { | |
81 | const int length = strlen(szText); | |
82 | for (int index = 0; index < length; ++index) | |
83 | { | |
84 | if (!isspace(szText[index])) | |
85 | return false; | |
86 | } | |
87 | } | |
88 | ||
89 | // If got here then string is null. | |
90 | return true; | |
91 | } | |
92 | ||
93 | ||
94 | // string to lower case | |
95 | // this function fixed by Mike Reid | |
96 | void StrLwr (string& sString) | |
97 | { | |
98 | const int length = sString.length(); | |
99 | for (int index = 0; index < length; ++index) | |
100 | sString[index] = tolower(sString[index]); | |
101 | } | |
102 | ||
103 | ||
104 | // support the next function | |
105 | inline bool CompactThis (string& sString, const string& sSubString) | |
106 | { | |
107 | int iLen = sString.length(); | |
108 | int iSubLen = sSubString.length(); | |
109 | string sTemp; | |
110 | ||
111 | if (iSubLen > iLen) | |
112 | return false; | |
113 | sTemp = sString.substr (iLen - iSubLen, iSubLen); | |
114 | if (sSubString == sTemp) | |
115 | { | |
116 | sString.replace (iLen - iSubLen, iSubLen, ""); | |
117 | return true; | |
118 | } | |
119 | else | |
120 | return false; | |
121 | } | |
122 | ||
123 | ||
124 | // Remove trailing spaces: " "s or "%20"s | |
125 | void Compact (string& sString) | |
126 | { | |
127 | bool bDone; | |
128 | ||
129 | for (;;) | |
130 | { | |
131 | bDone = true; | |
132 | if (CompactThis (sString, " ")) | |
133 | bDone = false; | |
134 | if (CompactThis (sString, "%20")) | |
135 | bDone = false; | |
136 | if (bDone) | |
137 | return; | |
138 | } | |
139 | } | |
140 | ||
141 | ||
142 | // remove leading " "s | |
143 | void NoLeadingSpaces (string& sText) | |
144 | { | |
145 | while ((sText != "") && (sText [0] == ' ')) | |
146 | sText.replace (0, 1, ""); | |
147 | } | |
148 | ||
149 | ||
150 | // return the size of a file | |
151 | tFilePos GetFileSize (const string& sFileName) | |
152 | { | |
153 | struct stat sLog; | |
154 | int iRet; | |
155 | ||
156 | iRet = stat (sFileName.c_str(), &sLog); | |
157 | if (iRet != 0) | |
158 | return 0; | |
159 | ||
160 | return sLog.st_size; | |
161 | } | |
162 | ||
163 | ||
164 | // execute a shell command | |
165 | void RunProgram (const string& sCommand, int iErase) | |
166 | { | |
167 | if (iErase) | |
168 | { | |
169 | erase(); | |
170 | refresh(); | |
171 | } | |
172 | curs_set (1); | |
173 | echo(); | |
174 | nocbreak(); | |
175 | if (wTemp) | |
176 | delwin (wTemp); | |
177 | system ("reset -Q"); | |
178 | system (sCommand.c_str()); | |
179 | if (iErase) | |
180 | system ("clear"); | |
181 | wTemp = newwin (1, 1, LINES - 1, COLS - 1); | |
182 | keypad (stdscr, TRUE); | |
183 | nonl(); | |
184 | cbreak(); | |
185 | curs_set (0); | |
186 | noecho(); | |
187 | if (iErase) | |
188 | { | |
189 | erase(); | |
190 | refresh(); | |
191 | } | |
192 | } | |
193 | ||
194 | ||
195 | // allows check of keyboard buffer to see if keypress ready | |
196 | void GoForNoDelay() | |
197 | { | |
198 | if (wTemp) | |
199 | delwin (wTemp); | |
200 | wTemp = newwin (1, 1, LINES - 1, COLS - 1); | |
201 | wrefresh (wTemp); | |
202 | nodelay (wTemp, true); | |
203 | } | |
204 | ||
205 | ||
206 | // int to string conversion | |
207 | string ItoS (int iNumber) | |
208 | { | |
209 | char szTemp [20]; | |
210 | string sReturn; | |
211 | ||
212 | if (snprintf (szTemp, sizeof (szTemp), "%d", iNumber) < 0) | |
213 | return "0"; | |
214 | sReturn = szTemp; | |
215 | return sReturn; | |
216 | } | |
217 | ||
218 | ||
219 | // 12345 to "12,345" | |
220 | string ItoCommas (tByteTotal iNumber) | |
221 | { | |
222 | char szTemp [40]; | |
223 | string sReturn; | |
224 | int iIndex, iCount; | |
225 | ||
226 | if (snprintf (szTemp, sizeof (szTemp), "%lld", iNumber) < 0) | |
227 | return "0"; | |
228 | ||
229 | sReturn = szTemp; | |
230 | iIndex = sReturn.length(); | |
231 | if (iIndex == 0) | |
232 | return sReturn; | |
233 | iIndex--; | |
234 | iCount = 4; | |
235 | while (iIndex >= 0) | |
236 | { | |
237 | if (--iCount == 0) | |
238 | { | |
239 | sReturn.insert (iIndex + 1, ","); | |
240 | iCount = 3; | |
241 | } | |
242 | iIndex--; | |
243 | } | |
244 | return sReturn; | |
245 | } | |
246 | ||
247 | ||
248 | // return xxx.yy% of first number to second number | |
249 | void CalcPercentage (tFilePos iCurrent, tFilePos iEnd, | |
250 | string& sOutput) | |
251 | { | |
252 | float fPC; | |
253 | int iNum; | |
254 | char szTemp [20] = ""; | |
255 | ||
256 | if ((iCurrent == 0) || (iEnd == 0)) | |
257 | sOutput = " 0.00%"; | |
258 | else | |
259 | if (iCurrent >= iEnd) | |
260 | sOutput = "100.00%"; | |
261 | else | |
262 | { | |
263 | iNum = int (10000.0 * iCurrent / iEnd); | |
264 | fPC = float (iNum) / 100.0; | |
265 | if (snprintf (szTemp, sizeof (szTemp), "%6.2f%%", fPC) < 0) | |
266 | sOutput = " -.--%"; | |
267 | else | |
268 | sOutput = szTemp; | |
269 | } | |
270 | } | |
271 | ||
272 | ||
273 | // parse "50000 250000 1000000" for size catches | |
274 | // given a pointer to it, return the number and the new pointer | |
275 | int NextCatchSize (const char** ppcText) | |
276 | { | |
277 | const char* pcLetter; | |
278 | char cLetter; | |
279 | int iNum; | |
280 | ||
281 | iNum = 0; | |
282 | pcLetter = *ppcText; | |
283 | for (;;) | |
284 | { | |
285 | cLetter = *pcLetter; | |
286 | if (cLetter == '\0') | |
287 | { | |
288 | *ppcText = pcLetter; | |
289 | return iNum; | |
290 | } | |
291 | pcLetter++; | |
292 | if (cLetter == ' ') | |
293 | { | |
294 | *ppcText = pcLetter; | |
295 | return iNum; | |
296 | } | |
297 | if ((cLetter < '0') || (cLetter > '9')) | |
298 | return -1; | |
299 | iNum = iNum * 10 + cLetter - '0'; | |
300 | } | |
301 | } | |
302 | ||
303 | ||
304 | string RightJustify (const string& sText, int iCols) | |
305 | { | |
306 | string sTemp; | |
307 | ||
308 | if (int (sText.length()) >= iCols) | |
309 | return sText; | |
310 | sTemp.assign (iCols - int (sText.length()), ' '); | |
311 | sTemp += sText; | |
312 | return sTemp; | |
313 | } | |
314 | ||
315 | ||
316 | // clears the screen | |
317 | void MyCls() | |
318 | { | |
319 | attroff (A_REVERSE); | |
320 | erase(); | |
321 | refresh(); | |
322 | move (0, 0); | |
323 | } | |
324 | ||
325 | ||
326 | ct& ct::operator << (const char* szText) | |
327 | { | |
328 | addstr (const_cast<char*> (szText)); | |
329 | return *this; | |
330 | } | |
331 | ||
332 | ||
333 | ct& ct::operator << (const string& sText) | |
334 | { | |
335 | addstr (const_cast<char*> (sText.c_str())); | |
336 | return *this; | |
337 | } | |
338 | ||
339 | ||
340 | ct& ct::operator << (char cLetter) | |
341 | { | |
342 | addch (cLetter); | |
343 | return *this; | |
344 | } | |
345 | ||
346 | ||
347 | ct& ct::operator << (bool bYes) | |
348 | { | |
349 | if (bYes) | |
350 | addstr ("yes"); | |
351 | else | |
352 | addstr ("no"); | |
353 | return *this; | |
354 | } | |
355 | ||
356 | ||
357 | ct& ct::operator << (int iNumber) | |
358 | { | |
359 | string sTemp; | |
360 | ||
361 | sTemp = ItoS (iNumber); | |
362 | addstr (const_cast<char*> (sTemp.c_str())); | |
363 | return *this; | |
364 | } | |
365 | ||
366 | ||
367 | bool CheckInterrupt() | |
368 | { | |
369 | for (;;) | |
370 | { | |
371 | switch (wgetch (wTemp)) | |
372 | { | |
373 | case 's': | |
374 | return true; | |
375 | case ERR: | |
376 | return false; | |
377 | } | |
378 | } | |
379 | } | |
380 | ||
381 | ||
382 | bool CheckTicker() | |
383 | { | |
384 | static time_t iTicker = 0; | |
385 | time_t iCurrentime_t; | |
386 | ||
387 | iCurrentime_t = time (0); | |
388 | if (iCurrentime_t == iTicker) | |
389 | return false; | |
390 | ||
391 | iTicker = iCurrentime_t; | |
392 | return true; | |
393 | } | |
394 | ||
395 | ||
396 | void UpdateTicker (const char* szText, tFilePos iPos, tFilePos iMax) | |
397 | { | |
398 | string sTemp; | |
399 | ||
400 | CalcPercentage (iPos, iMax, sTemp); | |
401 | sTemp += string (" ") + szText + " | <s> to abort"; | |
402 | ShowHighLightMessage (sTemp); | |
403 | } | |
404 | ||
405 | ||
406 | // goto log at a certain position, read a line into buffer | |
407 | // return start of next line | |
408 | tFilePos GetLine (tFilePos iOffset) | |
409 | { | |
410 | FILE *fLog; | |
411 | tFilePos iBlock, iAvailable, iReturn; | |
412 | int iCount; | |
413 | char *pcBuffer; | |
414 | ||
415 | pcReqBuff = pcEmpty; | |
416 | ||
417 | iBlock = iLogFileSize - iOffset; | |
418 | if (iBlock <= 0) | |
419 | return 0; | |
420 | if (iBlock > nReadBuffer) | |
421 | iBlock = nReadBuffer; | |
422 | ||
423 | fLog = fopen (pszCurrentLog, "rb"); | |
424 | if (fLog == 0) | |
425 | return 0; | |
426 | ||
427 | iReturn = 0; | |
428 | ||
429 | if (fseek (fLog, iOffset, SEEK_SET) == 0) | |
430 | { | |
431 | iAvailable = fread (&cDiskBuffer, 1, iBlock, fLog); | |
432 | if (iAvailable > 0) | |
433 | { | |
434 | pcBuffer = cDiskBuffer; | |
435 | for (iCount = 0; iCount < iAvailable; iCount++) | |
436 | { | |
437 | if (*pcBuffer == cEOL) | |
438 | break; | |
439 | pcBuffer++; | |
440 | } | |
441 | if (iCount >= iAvailable) | |
442 | iCount = iAvailable - 1; | |
443 | iReturn = iOffset + iCount + 1; | |
444 | cDiskBuffer [iCount] = '\0'; | |
445 | pcReqBuff = cDiskBuffer; | |
446 | } | |
447 | } | |
448 | ||
449 | fclose (fLog); | |
450 | return iReturn; | |
451 | } | |
452 | ||
453 | ||
454 | // return the line before, eg for going backwards | |
455 | tFilePos GetPrevLine (tFilePos iOffset) | |
456 | { | |
457 | FILE *fLog; | |
458 | tFilePos iBlock, iBase, iAvailable, iReturn; | |
459 | int iIndex; | |
460 | char* pcBuffer; | |
461 | ||
462 | pcReqBuff = pcEmpty; | |
463 | ||
464 | if (iOffset == 0) | |
465 | return iOffset; | |
466 | ||
467 | iBlock = iOffset; | |
468 | if (iBlock > nReadBuffer) | |
469 | iBlock = nReadBuffer; | |
470 | ||
471 | fLog = fopen (pszCurrentLog, "rb"); | |
472 | if (fLog == 0) | |
473 | return iOffset; | |
474 | ||
475 | iReturn = iOffset; | |
476 | ||
477 | iBase = iOffset - iBlock; | |
478 | if (fseek (fLog, iBase, SEEK_SET) == 0) | |
479 | { | |
480 | iAvailable = fread (&cDiskBuffer, 1, iBlock, fLog); | |
481 | if (iAvailable > 3) | |
482 | { | |
483 | if (cDiskBuffer [iAvailable - 2] == cEOL) | |
484 | { | |
485 | iReturn = iBase + iAvailable - 2; | |
486 | } | |
487 | else | |
488 | { | |
489 | iIndex = iAvailable - 3; | |
490 | pcBuffer = cDiskBuffer + iIndex; | |
491 | while (iIndex > 0) | |
492 | { | |
493 | if (*pcBuffer == cEOL) | |
494 | { | |
495 | iReturn = iBase + iIndex + 1; | |
496 | pcReqBuff = cDiskBuffer + iIndex + 1; | |
497 | cDiskBuffer [iAvailable] = '\0'; | |
498 | break; | |
499 | } | |
500 | iIndex--; | |
501 | pcBuffer--; | |
502 | } | |
503 | if (iIndex == 0) | |
504 | iReturn = iBase; | |
505 | } | |
506 | } | |
507 | } | |
508 | ||
509 | fclose (fLog); | |
510 | return iReturn; | |
511 | } | |
512 | ||
513 | ||
514 | // rationalise log file statistics | |
515 | void CalcLastPage() | |
516 | { | |
517 | tFilePos iThis, iNext; | |
518 | int iCount; | |
519 | ||
520 | iLogFileSize = GetFileSize (pszCurrentLog); | |
521 | if (iLogFileSize == 0) | |
522 | { | |
523 | iMaxLinesDown = 0; | |
524 | iLastPage = 0; | |
525 | iLastLinePos = 0; | |
526 | iLinesDown = 0; | |
527 | return; | |
528 | } | |
529 | ||
530 | iLastLinePos = GetPrevLine (iLogFileSize - 1); | |
531 | ||
532 | iThis = GetLine (0); | |
533 | for (iCount = 0; iCount < iMainLines; iCount++) | |
534 | { | |
535 | iNext = GetLine (iThis); | |
536 | if ((iNext == iThis) || (iNext == 0)) | |
537 | { | |
538 | iMaxLinesDown = iCount; | |
539 | iLastPage = 0; | |
540 | if (iLinesDown > iMaxLinesDown) | |
541 | iLinesDown = iMaxLinesDown; | |
542 | return; | |
543 | } | |
544 | iThis = iNext; | |
545 | } | |
546 | iMaxLinesDown = iMainLines - 1; | |
547 | if (iLinesDown > iMaxLinesDown) | |
548 | iLinesDown = iMaxLinesDown; | |
549 | ||
550 | iThis = iLogFileSize; | |
551 | for (iCount = 0; iCount < iMainLines; iCount++) | |
552 | iThis = GetPrevLine (iThis); | |
553 | iLastPage = iThis; | |
554 | } | |
555 | ||
556 | ||
557 | // goto some point in log, place in middle of screen and | |
558 | // highlight it | |
559 | void CentreScreen (tFilePos iGoto) | |
560 | { | |
561 | tFilePos iTempPos; | |
562 | int iCount, iHalf; | |
563 | ||
564 | if (iGoto >= iLastPage) | |
565 | { | |
566 | iLinesDown = 0; | |
567 | iPagePos = iTempPos = iLastPage; | |
568 | for (iCount = 0; iCount < iMaxLinesDown; iCount++) | |
569 | { | |
570 | if (iTempPos == iGoto) | |
571 | return; | |
572 | iTempPos = GetLine (iTempPos); | |
573 | iLinesDown++; | |
574 | } | |
575 | iLinesDown = iMaxLinesDown; | |
576 | return; | |
577 | } | |
578 | ||
579 | iHalf = iMaxLinesDown / 2; | |
580 | iLinesDown = 0; | |
581 | iTempPos = iGoto; | |
582 | for (iCount = 0; iCount < iHalf; iCount++) | |
583 | { | |
584 | if (iTempPos == 0) | |
585 | { | |
586 | iPagePos = 0; | |
587 | return; | |
588 | } | |
589 | iTempPos = GetPrevLine (iTempPos); | |
590 | iLinesDown++; | |
591 | } | |
592 | iPagePos = iTempPos; | |
593 | } | |
594 | ||
595 | ||
596 | // return space seperated column number iNum | |
597 | // first = 1 | |
598 | void GetColumn (const char* pcText0, int iNum, string& sResult) | |
599 | { | |
600 | int iColumn, iIndex, iStart; | |
601 | bool bCapture, bSkipSpace; | |
602 | char cLetter; | |
603 | const char* pcText; | |
604 | ||
605 | bCapture = iNum == 1 ? true : false; | |
606 | bSkipSpace = false; | |
607 | iStart = iIndex = 0; | |
608 | iColumn = 1; | |
609 | pcText = pcText0; | |
610 | ||
611 | for (;;) | |
612 | { | |
613 | cLetter = *pcText; | |
614 | if ((cLetter == 0) || (cLetter == cEOL) || (cLetter == cCR)) | |
615 | break; | |
616 | if (cLetter == ' ') | |
617 | { | |
618 | if (bCapture) | |
619 | break; | |
620 | bSkipSpace = true; | |
621 | } | |
622 | else | |
623 | if (bSkipSpace) | |
624 | { | |
625 | if (++iColumn == iNum) | |
626 | { | |
627 | bCapture = true; | |
628 | iStart = iIndex; | |
629 | } | |
630 | bSkipSpace = false; | |
631 | } | |
632 | pcText++; | |
633 | iIndex++; | |
634 | } | |
635 | sResult = ""; | |
636 | if (bCapture) | |
637 | sResult.append (pcText0 + iStart, iIndex - iStart); | |
638 | } | |
639 | ||
640 | ||
641 | // do we really need to see heaps of "http://" and "ftp://"? | |
642 | void RemoveSlashes (string& sText) | |
643 | { | |
644 | char szTemp [20]; | |
645 | ||
646 | sText.copy (szTemp, 15); | |
647 | ||
648 | szTemp [7] = 0; | |
649 | if (strcmp (szTemp, "http://") == 0) | |
650 | { | |
651 | sText.replace (0, 7, ""); | |
652 | return; | |
653 | } | |
654 | ||
655 | szTemp [6] = 0; | |
656 | if (strcmp (szTemp, "ftp://") == 0) | |
657 | { | |
658 | sText.replace (0, 6, ""); | |
659 | return; | |
660 | } | |
661 | } | |
662 | ||
663 | ||
664 | void GetDomainName (const char* szRequest, string& sDomain) | |
665 | { | |
666 | int iCount, iSize; | |
667 | ||
668 | GetColumn (szRequest, nTargetCol, sDomain); | |
669 | RemoveSlashes (sDomain); | |
670 | iSize = sDomain.length(); | |
671 | for (iCount = 0; iCount < iSize; iCount++) | |
672 | if (sDomain [iCount] == '/') | |
673 | { | |
674 | sDomain.replace (iCount, iSize - iCount, ""); | |
675 | return; | |
676 | } | |
677 | } | |
678 | ||
679 | ||
680 | // pad a string with spaces to the edge specified, eg screen | |
681 | void Columnize (string& sText, int iWidth) | |
682 | { | |
683 | int iLength, iSpaces; | |
684 | string sTemp; | |
685 | ||
686 | iLength = sText.length(); | |
687 | if (iLength == iWidth) | |
688 | return; | |
689 | if (iLength > iWidth) | |
690 | sText.replace (iWidth, iLength - iWidth, ""); | |
691 | else | |
692 | { | |
693 | iSpaces = iWidth - iLength; | |
694 | sTemp.assign (iSpaces, ' '); | |
695 | sText += sTemp; | |
696 | } | |
697 | } | |
698 | ||
699 | ||
700 | time_t GetTimeNumber (const char* szRequest) | |
701 | { | |
702 | string sTemp; | |
703 | int iPos, iLength; | |
704 | char cLetter; | |
705 | time_t iTime; | |
706 | ||
707 | GetColumn (szRequest, nTimeCol, sTemp); | |
708 | if (sTemp == "") | |
709 | return 0; | |
710 | ||
711 | iTime = 0; | |
712 | iPos = 0; | |
713 | iLength = sTemp.length(); | |
714 | for (;;) | |
715 | { | |
716 | if (iPos >= iLength) | |
717 | return iTime; | |
718 | cLetter = sTemp [iPos]; | |
719 | if ((cLetter == '.') || (cLetter == 0)) | |
720 | return iTime; | |
721 | if ((cLetter >= '0') && (cLetter <= '9')) | |
722 | iTime = (iTime * 10) + cLetter - '0'; | |
723 | else | |
724 | return 0; | |
725 | iPos++; | |
726 | } | |
727 | } | |
728 | ||
729 | ||
730 | void CalcTime (time_t iTime, string& sDate) | |
731 | { | |
732 | int iCount; | |
733 | char szTemp [80]; | |
734 | ||
735 | strncpy (szTemp, ctime (&iTime), sizeof (szTemp) - 1); | |
736 | szTemp [sizeof (szTemp) - 1] = '\0'; // Ensure the time string is null-terminated. | |
737 | ||
738 | iCount = strlen (szTemp); | |
739 | if (iCount > 0) | |
740 | if (szTemp [iCount - 1] == '\n') | |
741 | szTemp [iCount - 1] = 0; | |
742 | sDate = szTemp; | |
743 | } | |
744 | ||
745 | ||
746 | void EraseStatusLine() | |
747 | { | |
748 | move (iMainLines, 0); | |
749 | attroff (A_REVERSE); | |
750 | clrtoeol(); | |
751 | } | |
752 | ||
753 | ||
754 | void ShowHighLightMessage (const string& sText) | |
755 | { | |
756 | EraseStatusLine(); | |
757 | move (iMainLines, 0); | |
758 | attron (A_REVERSE); | |
759 | con << sText; | |
760 | refresh(); | |
761 | } | |
762 | ||
763 | ||
764 | void PromptForText (const string& sQuestion, string& sResult) | |
765 | { | |
766 | char szTemp [nInputLen]; | |
767 | ||
768 | EraseStatusLine(); | |
769 | move (iMainLines, 0); | |
770 | attroff (A_REVERSE); | |
771 | con << sQuestion; | |
772 | curs_set (1); | |
773 | echo(); | |
774 | getstr (szTemp); | |
775 | curs_set (0); | |
776 | noecho(); | |
777 | EraseStatusLine(); | |
778 | sResult = szTemp; | |
779 | } | |
780 | ||
781 | ||
782 | char PromptForKey (const string& sQuestion) | |
783 | { | |
784 | char cKey; | |
785 | ||
786 | EraseStatusLine(); | |
787 | move (iMainLines, 0); | |
788 | attroff (A_REVERSE); | |
789 | con << sQuestion; | |
790 | cKey = getch(); | |
791 | EraseStatusLine(); | |
792 | return cKey; | |
793 | } | |
794 | ||
795 | ||
796 | bool CharGood (char cLetter) | |
797 | { | |
798 | if ((cLetter >= '0') && (cLetter <= '9')) | |
799 | return true; | |
800 | if ((cLetter >= 'A') && (cLetter <= 'Z')) | |
801 | return true; | |
802 | if ((cLetter >= 'a') && (cLetter <= 'z')) | |
803 | return true; | |
804 | switch (cLetter) | |
805 | { | |
806 | case '-': | |
807 | case '_': | |
808 | return true; | |
809 | } | |
810 | return false; | |
811 | } | |
812 | ||
813 | ||
814 | string CheckFileName (const string& sName) | |
815 | { | |
816 | int iCount; | |
817 | char cLetter; | |
818 | string sReturn; | |
819 | ||
820 | for (iCount = 0; iCount < int (sName.length()); iCount++) | |
821 | { | |
822 | cLetter = sName [iCount]; | |
823 | if (CharGood (cLetter) == false) | |
824 | { | |
825 | if ((cLetter < 32) || (cLetter > 126)) | |
826 | return "Illegal character."; | |
827 | sReturn = string ("Illegal character: '") + cLetter + "'."; | |
828 | return sReturn; | |
829 | } | |
830 | } | |
831 | return ""; | |
832 | } | |
833 | ||
834 | ||
835 | string CheckEmail (const string& sName) | |
836 | { | |
837 | int iCount; | |
838 | char cLetter; | |
839 | string sReturn; | |
840 | ||
841 | for (iCount = 0; iCount < int (sName.length()); iCount++) | |
842 | { | |
843 | cLetter = sName [iCount]; | |
844 | if ((cLetter != '@') && (cLetter != '.') && (CharGood (cLetter) == false)) | |
845 | { | |
846 | if ((cLetter < 32) || (cLetter > 126)) | |
847 | return "Illegal character."; | |
848 | sReturn = string ("Illegal character: '") + cLetter + "'."; | |
849 | return sReturn; | |
850 | } | |
851 | } | |
852 | return ""; | |
853 | } | |
854 | ||
855 | ||
856 | void GetText (string& sText) | |
857 | { | |
858 | char szTemp [nInputLen]; | |
859 | ||
860 | curs_set (1); | |
861 | echo(); | |
862 | getstr (szTemp); | |
863 | curs_set (0); | |
864 | noecho(); | |
865 | sText = szTemp; | |
866 | } | |
867 | ||
868 | ||
869 | void GetFileName (string& sResult, bool* pbGood = 0) | |
870 | { | |
871 | string sCheck; | |
872 | ||
873 | if (pbGood) | |
874 | *pbGood = true; | |
875 | GetText (sResult); | |
876 | if (sResult == "") | |
877 | return; | |
878 | ||
879 | sCheck = CheckFileName (sResult); | |
880 | if (sCheck == "") | |
881 | { | |
882 | sResult += sReportExt; | |
883 | return; | |
884 | } | |
885 | ||
886 | con << "Problem: " << sCheck << " Press any key."; | |
887 | getch(); | |
888 | con << "\n"; | |
889 | sResult = ""; | |
890 | if (pbGood) | |
891 | *pbGood = false; | |
892 | } | |
893 | ||
894 | ||
895 | /* unused | |
896 | void RemoveTrailingSpaces (string& sText) | |
897 | { | |
898 | int iIndex, iKeep; | |
899 | bool bStrip; | |
900 | ||
901 | iIndex = iKeep = sText.length(); | |
902 | if (iIndex == 0) | |
903 | return; | |
904 | iIndex--; | |
905 | bStrip = false; | |
906 | for (;;) | |
907 | { | |
908 | if (sText [iIndex] != ' ') | |
909 | break; | |
910 | if (--iIndex < 0) | |
911 | { | |
912 | sText = ""; | |
913 | return; | |
914 | } | |
915 | bStrip = true; | |
916 | iKeep--; | |
917 | } | |
918 | if (bStrip) | |
919 | sText.resize (iKeep); | |
920 | } | |
921 | */ | |
922 | ||
923 | ||
924 | // load the search phrases | |
925 | int LoadWords() | |
926 | { | |
927 | int iFile, iIndex, iRead, iLetter, iLength; | |
928 | ||
929 | sWords = ""; | |
930 | iIndex = iLength = 0; | |
931 | iFile = open (sWordFile.c_str(), O_RDONLY); | |
932 | if (iFile <= 0) | |
933 | return 0; | |
934 | ||
935 | iRead = 1; | |
936 | while (iRead == 1) | |
937 | { | |
938 | iLetter = 0; | |
939 | iRead = read (iFile, &iLetter, 1); | |
940 | if (iRead == 1) | |
941 | { | |
942 | if (iLetter == cEOL) | |
943 | { | |
944 | if (iLength > 0) | |
945 | sWords += cSeperator; | |
946 | iLength = 0; | |
947 | } | |
948 | else | |
949 | if (iLetter >= ' ') | |
950 | { | |
951 | sWords += iLetter; | |
952 | iLength++; | |
953 | } | |
954 | } | |
955 | } | |
956 | close (iFile); | |
957 | ||
958 | if ((sWords != "") && (sWords [sWords.length() - 1] != cSeperator)) | |
959 | sWords += cSeperator; | |
960 | return 1; | |
961 | } | |
962 | ||
963 | ||
964 | // save the search phrases | |
965 | int SaveWords() | |
966 | { | |
967 | int iIndex, iWrite, iReturn; | |
968 | char cLetter, cWrite; | |
969 | FILE* fOutput; | |
970 | ||
971 | fOutput = fopen (sWordFile.c_str(), "w"); | |
972 | if (fOutput <= 0) | |
973 | return 0; | |
974 | ||
975 | iIndex = 0; | |
976 | iReturn = -1; | |
977 | while (iReturn == -1) | |
978 | { | |
979 | cLetter = sWords [iIndex++]; | |
980 | cWrite = 0; | |
981 | switch (cLetter) | |
982 | { | |
983 | case 0: | |
984 | iReturn = 1; | |
985 | break; | |
986 | ||
987 | case cSeperator: | |
988 | cWrite = '\n'; | |
989 | break; | |
990 | ||
991 | default: | |
992 | cWrite = cLetter; | |
993 | } | |
994 | if (cWrite) | |
995 | { | |
996 | iWrite = fwrite (&cWrite, 1, 1, fOutput); | |
997 | if (iWrite != 1) | |
998 | iReturn = 0; | |
999 | } | |
1000 | } | |
1001 | fclose (fOutput); | |
1002 | return iReturn; | |
1003 | } | |
1004 | ||
1005 | ||
1006 | tIPnum GetIP (const string& sText) | |
1007 | { | |
1008 | tIPnum iReturn = 0; | |
1009 | int iLength = sText.length(); | |
1010 | int iIndex = 0; | |
1011 | int iByte = 0; | |
1012 | char cLetter, cLast = 0; | |
1013 | ||
1014 | while (iIndex < iLength) | |
1015 | { | |
1016 | cLetter = sText [iIndex++]; | |
1017 | if (cLetter == '.') | |
1018 | { | |
1019 | if (cLast == '.') | |
1020 | return 0; | |
1021 | iReturn = (iReturn << 8) + iByte; | |
1022 | iByte = 0; | |
1023 | } | |
1024 | else | |
1025 | if ((cLetter >= '0') && (cLetter <= '9')) | |
1026 | { | |
1027 | iByte = (iByte * 10) + (cLetter - '0'); | |
1028 | if (iByte > 255) | |
1029 | return 0; | |
1030 | } | |
1031 | else | |
1032 | return 0; | |
1033 | cLast = cLetter; | |
1034 | } | |
1035 | ||
1036 | if (cLetter == '.') | |
1037 | return 0; | |
1038 | ||
1039 | iReturn = (iReturn << 8) + iByte; | |
1040 | return iReturn; | |
1041 | } | |
1042 | ||
1043 | ||
1044 | // load aliases | |
1045 | void LoadAliases() | |
1046 | { | |
1047 | int iFile, iIndex, iRead, iLetter, iLength, iNames, iLine, iCount; | |
1048 | string sLine, sColumn; | |
1049 | tIPnum iIP; | |
1050 | rAliasRecord rEntry; | |
1051 | ||
1052 | while (!vAliasList.empty()) | |
1053 | vAliasList.pop_back(); | |
1054 | while (!vAliasUserName.empty()) | |
1055 | vAliasUserName.pop_back(); | |
1056 | ||
1057 | iIndex = iLength = iNames = 0; | |
1058 | iLine = 1; | |
1059 | ||
1060 | iFile = open (sAliasesFile.c_str(), O_RDONLY); | |
1061 | if (iFile <= 0) | |
1062 | return; | |
1063 | ||
1064 | iRead = 1; | |
1065 | sLine = ""; | |
1066 | while (iRead == 1) | |
1067 | { | |
1068 | iLetter = 0; | |
1069 | iRead = read (iFile, &iLetter, 1); | |
1070 | if (iRead == 1) | |
1071 | { | |
1072 | if (iLetter == cEOL) | |
1073 | { | |
1074 | GetColumn (sLine.c_str(), 1, sColumn); | |
1075 | if (sColumn != "") | |
1076 | { | |
1077 | vAliasUserName.push_back (sColumn); | |
1078 | iCount = 2; | |
1079 | for (;;) | |
1080 | { | |
1081 | GetColumn (sLine.c_str(), iCount++, sColumn); | |
1082 | if (sColumn == "") | |
1083 | break; | |
1084 | iIP = GetIP (sColumn); | |
1085 | if (iIP <= 0) | |
1086 | { | |
1087 | sStatusMessage = string ("Error in aliases file at line ") + | |
1088 | ItoS (iLine); | |
1089 | close (iFile); | |
1090 | return; | |
1091 | } | |
1092 | rEntry.iIPnum = iIP; | |
1093 | rEntry.iUserNum = iNames; | |
1094 | vAliasList.push_back (rEntry); | |
1095 | } | |
1096 | iNames++; | |
1097 | } | |
1098 | sLine = ""; | |
1099 | iLine++; | |
1100 | } | |
1101 | else | |
1102 | sLine += char (iLetter); | |
1103 | } | |
1104 | } | |
1105 | close (iFile); | |
1106 | } | |
1107 | ||
1108 | ||
1109 | // does szText contain any of the search phrases? | |
1110 | // skip lines if they match with a ! (skip) search word | |
1111 | eSearch SearchString (const char* szText) | |
1112 | { | |
1113 | const char *pcWords, *pcWords2; | |
1114 | const char *pcText0, *pcText, *pcText2; | |
1115 | char cLetter, cFirst; | |
1116 | bool bFound; | |
1117 | eSearch iReturn; | |
1118 | ||
1119 | pcWords = sWords.c_str(); | |
1120 | pcText0 = szText; | |
1121 | while (*pcWords) | |
1122 | { | |
1123 | iReturn = hit; | |
1124 | if (*pcWords == '!') | |
1125 | { | |
1126 | iReturn = veto; | |
1127 | pcWords++; | |
1128 | } | |
1129 | cFirst = *pcWords; | |
1130 | pcText = pcText0; | |
1131 | while ((cLetter = *pcText) != 0) | |
1132 | { | |
1133 | if (cLetter == cFirst) | |
1134 | { | |
1135 | bFound = true; | |
1136 | pcWords2 = pcWords + 1; | |
1137 | pcText2 = pcText + 1; | |
1138 | while (*pcWords2 != cSeperator) | |
1139 | { | |
1140 | if (*pcText2 != *pcWords2) | |
1141 | { | |
1142 | bFound = false; | |
1143 | break; | |
1144 | } | |
1145 | pcWords2++; | |
1146 | pcText2++; | |
1147 | } | |
1148 | if (bFound) | |
1149 | return iReturn; | |
1150 | } | |
1151 | pcText++; | |
1152 | } | |
1153 | while (*pcWords != cSeperator) | |
1154 | pcWords++; | |
1155 | pcWords++; | |
1156 | } | |
1157 | return miss; | |
1158 | } | |
1159 | ||
1160 | ||
1161 | // find full name of user | |
1162 | string GetLongUserName (const string& sLoginName) | |
1163 | { | |
1164 | string sUserLine, sUserName, sTemp, sReturn; | |
1165 | int iFile, iRead; | |
1166 | char cLetter; | |
1167 | ||
1168 | iFile = open (sUsersFile.c_str(), O_RDONLY); | |
1169 | if (iFile <= 0) | |
1170 | return ""; | |
1171 | ||
1172 | sUserName = sLoginName; | |
1173 | StrLwr (sUserName); | |
1174 | sUserLine = sReturn = ""; | |
1175 | ||
1176 | for (;;) | |
1177 | { | |
1178 | iRead = read (iFile, &cLetter, 1); | |
1179 | if (iRead < 1) | |
1180 | break; | |
1181 | if (cLetter == cEOL) | |
1182 | { | |
1183 | GetColumn (sUserLine.c_str(), 1, sTemp); | |
1184 | if (sTemp == sUserName) | |
1185 | { | |
1186 | sReturn = sUserLine; | |
1187 | sReturn.replace (0, sUserName.length() + 1, ""); | |
1188 | break; | |
1189 | } | |
1190 | sUserLine = ""; | |
1191 | } | |
1192 | else | |
1193 | if (cLetter != cCR) | |
1194 | sUserLine += cLetter; | |
1195 | } | |
1196 | close (iFile); | |
1197 | return sReturn; | |
1198 | } | |
1199 | ||
1200 | ||
1201 | string LookupIP (const string& sIPtext) | |
1202 | { | |
1203 | tIPnum iIP; | |
1204 | int iCount, iTotal; | |
1205 | ||
1206 | iIP = GetIP (sIPtext); | |
1207 | if (iIP <= 0) | |
1208 | return ""; | |
1209 | iTotal = vAliasList.size(); | |
1210 | ||
1211 | for (iCount = 0; iCount < iTotal; iCount++) | |
1212 | if (vAliasList [iCount].iIPnum == iIP) | |
1213 | return vAliasUserName [vAliasList [iCount].iUserNum]; | |
1214 | ||
1215 | return ""; | |
1216 | } | |
1217 | ||
1218 | ||
1219 | string ChopOffNetwork (const string& sSourceIP, int iLength) | |
1220 | { | |
1221 | string sTemp = sSourceIP; | |
1222 | int iLen, iIndex; | |
1223 | ||
1224 | for (;;) | |
1225 | { | |
1226 | if ((iLen = sTemp.length()) <= iLength) | |
1227 | return sTemp; | |
1228 | iIndex = 0; | |
1229 | for (;;) | |
1230 | { | |
1231 | if (iIndex >= iLen) | |
1232 | return sTemp; | |
1233 | if (sTemp [iIndex] == '.') | |
1234 | { | |
1235 | sTemp.replace (0, iIndex + 1, ""); | |
1236 | break; | |
1237 | } | |
1238 | iIndex++; | |
1239 | } | |
1240 | } | |
1241 | } | |
1242 | ||
1243 | ||
1244 | // get username from column in request line, lower case it, remove "%20"s | |
1245 | // if dashed shorten the returned user by default | |
1246 | string GetUserName (const char* szRequest, bool bTruncate) | |
1247 | { | |
1248 | string sTemp, sIP; | |
1249 | ||
1250 | GetColumn (szRequest, iUserCol, sTemp); | |
1251 | ||
1252 | if (bAliases && (sTemp == "-")) | |
1253 | { | |
1254 | GetColumn (szRequest, iIPCol, sIP); | |
1255 | sIP = LookupIP (sIP); | |
1256 | if (sIP != "") | |
1257 | return sIP; | |
1258 | } | |
1259 | ||
1260 | if (bLookupIP && (sTemp == "-")) | |
1261 | { | |
1262 | GetColumn (szRequest, iIPCol, sTemp); | |
1263 | if (!bTruncate) | |
1264 | return sTemp; | |
1265 | else | |
1266 | return ChopOffNetwork (sTemp, iUserNameLen); | |
1267 | } | |
1268 | ||
1269 | Compact (sTemp); | |
1270 | StrLwr (sTemp); | |
1271 | return sTemp; | |
1272 | } | |
1273 | ||
1274 | ||
1275 | // return the number of bytes in the request | |
1276 | int GetRequestSize (const char* szRequest) | |
1277 | { | |
1278 | string sTemp; | |
1279 | tFilePos iSize; | |
1280 | ||
1281 | GetColumn (szRequest, nSizeCol, sTemp); | |
1282 | if (sTemp == "") | |
1283 | return 0; | |
1284 | iSize = atoi (sTemp.c_str()); | |
1285 | return iSize; | |
1286 | } | |
1287 | ||
1288 | ||
1289 | void GetRequestCacheHit (const char* szRequest, char& cHit, int& iHitNumber) | |
1290 | { | |
1291 | string sBoth, sLeft, sRight; | |
1292 | int iCount, iLength, iSlash = -1; | |
1293 | ||
1294 | cHit = ' '; | |
1295 | iHitNumber = 0; | |
1296 | GetColumn (szRequest, nCacheHitCol, sBoth); | |
1297 | iLength = sBoth.length(); | |
1298 | for (iCount = 0; iCount < iLength; iCount++) | |
1299 | if (sBoth [iCount] == '/') | |
1300 | { | |
1301 | iSlash = iCount; | |
1302 | break; | |
1303 | } | |
1304 | if (iSlash == -1) | |
1305 | return; | |
1306 | ||
1307 | sLeft = sRight = ""; | |
1308 | if (iSlash >= 1) | |
1309 | sLeft = sBoth.substr (0, iSlash); | |
1310 | if (iSlash < iLength - 1) | |
1311 | sRight = sBoth.substr (iSlash + 1, iLength - iSlash - 1); | |
1312 | ||
1313 | if (sLeft == "TCP_MISS") cHit = ' '; else | |
1314 | if (sLeft == "TCP_HIT") cHit = 'H'; else | |
1315 | if (sLeft == "TCP_IMS_HIT") cHit = 'I'; else | |
1316 | if (sLeft == "TCP_REFRESH_HIT") cHit = 'R'; else | |
1317 | if (sLeft == "TCP_NEGATIVE_HIT") cHit = 'N'; else | |
1318 | if (sLeft == "TCP_MEM_HIT") cHit = 'M'; else | |
1319 | if (sLeft == "TCP_DENIED") cHit = 'd'; else | |
1320 | if (sLeft == "TCP_REFRESH_MISS") cHit = 'm'; else | |
1321 | if (sLeft == "TCP_CLIENT_REFRESH") cHit = 'r'; else | |
1322 | if (sLeft == "TCP_CLIENT_REFRESH_MISS") cHit = 'c'; else | |
1323 | cHit = '?'; | |
1324 | ||
1325 | iHitNumber = atoi (sRight.c_str()); | |
1326 | } | |
1327 | ||
1328 | ||
1329 | // return Request Flags | |
1330 | void GetRequestFlags (const char* szRequest, string& sFlags) | |
1331 | { | |
1332 | tFilePos iSize, iTemp; | |
1333 | int iCount; | |
1334 | const char* pcLetter; | |
1335 | char cLetter; | |
1336 | string sTemp; | |
1337 | ||
1338 | switch (SearchString (szRequest)) | |
1339 | { | |
1340 | case hit: | |
1341 | sFlags = "w"; | |
1342 | break; | |
1343 | ||
1344 | case miss: | |
1345 | sFlags = " "; | |
1346 | break; | |
1347 | ||
1348 | case veto: | |
1349 | sFlags = "-"; | |
1350 | break; | |
1351 | } | |
1352 | ||
1353 | if (bAliases && (sFlags == " ")) | |
1354 | { | |
1355 | sTemp = GetUserName (szRequest, false); | |
1356 | switch (SearchString (sTemp.c_str())) | |
1357 | { | |
1358 | case hit: | |
1359 | sFlags = "w"; | |
1360 | break; | |
1361 | ||
1362 | case veto: | |
1363 | sFlags = "-"; | |
1364 | break; | |
1365 | ||
1366 | case miss: | |
1367 | break; | |
1368 | } | |
1369 | } | |
1370 | ||
1371 | iSize = GetRequestSize (szRequest); | |
1372 | pcLetter = sSizeHits.c_str(); | |
1373 | iCount = 0; | |
1374 | for (;;) | |
1375 | { | |
1376 | iTemp = NextCatchSize (&pcLetter); | |
1377 | if (iTemp <= 0) | |
1378 | break; | |
1379 | if (iTemp >= iSize) | |
1380 | break; | |
1381 | iCount++; | |
1382 | } | |
1383 | if (iCount == 0) | |
1384 | sFlags += ' '; | |
1385 | else | |
1386 | sFlags += char (iCount + '0'); | |
1387 | ||
1388 | GetRequestCacheHit (szRequest, cLetter, iCount); | |
1389 | sFlags += cLetter; | |
1390 | ||
1391 | cLetter = ' '; | |
1392 | if (iRepFocus == user) | |
1393 | { | |
1394 | sTemp = GetUserName (szRequest, false); | |
1395 | if (sTemp == sRepFocus) | |
1396 | cLetter = 'f'; | |
1397 | } | |
1398 | sFlags += cLetter; | |
1399 | } | |
1400 | ||
1401 | ||
1402 | inline bool SearchHit (const string& sFlags) | |
1403 | { | |
1404 | if ((iRepFocus == user) && (sFlags [3] != 'f')) | |
1405 | return false; | |
1406 | if (sFlags [0] == 'w') | |
1407 | return true; | |
1408 | if (sFlags [0] == '-') | |
1409 | return false; | |
1410 | if (iSizeHitGrade == 0) | |
1411 | return false; | |
1412 | if (sFlags [1] >= char (iSizeHitGrade + '0')) | |
1413 | return true; | |
1414 | return false; | |
1415 | } | |
1416 | ||
1417 | ||
1418 | void GetPaddedUserName (const char* szRequest, string& sUser) | |
1419 | { | |
1420 | sUser = GetUserName (szRequest, true); | |
1421 | Columnize (sUser, iUserNameLen); | |
1422 | } | |
1423 | ||
1424 | ||
1425 | // search the log file in up (-1) or down (+1) direction | |
1426 | void SearchWords (int iDir) | |
1427 | { | |
1428 | tFilePos iCurrent, iTempPos; | |
1429 | string sFlags, sDispLine; | |
1430 | ||
1431 | if ((iDir < 0) && (iPagePos == 0) && (iLinesDown == 0)) | |
1432 | return; | |
1433 | if ((iDir > 0) && (iPagePos >= iLastPage) && (iLinesDown == iMaxLinesDown)) | |
1434 | return; | |
1435 | ||
1436 | iCurrent = iLinePos; | |
1437 | if (iDir > 0) | |
1438 | iCurrent = GetLine (iCurrent); | |
1439 | ||
1440 | for (;;) | |
1441 | { | |
1442 | if (iDir > 0) | |
1443 | iTempPos = GetLine (iCurrent); | |
1444 | else | |
1445 | iTempPos = GetPrevLine (iCurrent); | |
1446 | ||
1447 | GetRequestFlags (pcReqBuff, sFlags); | |
1448 | if (SearchHit (sFlags)) | |
1449 | { | |
1450 | if (iDir > 0) | |
1451 | CentreScreen (iCurrent); | |
1452 | else | |
1453 | CentreScreen (iTempPos); | |
1454 | return; | |
1455 | } | |
1456 | ||
1457 | if (iDir < 0) | |
1458 | { | |
1459 | iCurrent = iTempPos; | |
1460 | if (iCurrent <= 0) | |
1461 | { | |
1462 | iPagePos = 0; | |
1463 | iLinesDown = 0; | |
1464 | return; | |
1465 | } | |
1466 | } | |
1467 | else | |
1468 | { | |
1469 | if ((iTempPos == 0) || (iTempPos == iCurrent)) | |
1470 | { | |
1471 | iPagePos = iLastPage; | |
1472 | iLinesDown = iMaxLinesDown; | |
1473 | return; | |
1474 | } | |
1475 | iCurrent = iTempPos; | |
1476 | } | |
1477 | ||
1478 | if (CheckInterrupt()) | |
1479 | return; | |
1480 | if (CheckTicker()) | |
1481 | UpdateTicker ("Searching...", iCurrent, iLastPage); | |
1482 | } | |
1483 | } | |
1484 | ||
1485 | ||
1486 | // remove seconds from time string | |
1487 | inline void RemoveSeconds (string& sTime) | |
1488 | { | |
1489 | if (sTime.length() > 21) | |
1490 | sTime.replace (16, 3, ""); | |
1491 | } | |
1492 | ||
1493 | ||
1494 | string PosToTime (tFilePos iCurrent) | |
1495 | { | |
1496 | string sTime; | |
1497 | time_t iTime; | |
1498 | ||
1499 | if (iLogFileSize == 0) | |
1500 | return ""; | |
1501 | ||
1502 | GetLine (iCurrent); | |
1503 | if (NullText (pcReqBuff)) | |
1504 | return ""; | |
1505 | ||
1506 | iTime = GetTimeNumber (pcReqBuff); | |
1507 | CalcTime (iTime, sTime); | |
1508 | RemoveSeconds (sTime); | |
1509 | return sTime; | |
1510 | } | |
1511 | ||
1512 | ||
1513 | bool ReportOptions() | |
1514 | { | |
1515 | string sTemp, sTemp1, sTemp2, sWordMode, sBUTmode, sBDTmode, sBDImode; | |
1516 | int iTemp, iKey; | |
1517 | bool bGood; | |
1518 | ||
1519 | for (;;) | |
1520 | { | |
1521 | MyCls(); | |
1522 | ||
1523 | if (iRepStart == 0) | |
1524 | sTemp1 = "begining of log"; | |
1525 | else | |
1526 | sTemp1 = PosToTime (iRepStart); | |
1527 | ||
1528 | if (iRepEnd == 0) | |
1529 | sTemp2 = "end of log"; | |
1530 | else | |
1531 | sTemp2 = PosToTime (iRepEnd); | |
1532 | ||
1533 | switch (iRepWordHits) | |
1534 | { | |
1535 | case no_word: | |
1536 | sWordMode = "none"; | |
1537 | break; | |
1538 | ||
1539 | case text: | |
1540 | sWordMode = "normal text"; | |
1541 | break; | |
1542 | ||
1543 | case CSV: | |
1544 | sWordMode = "CSV"; | |
1545 | break; | |
1546 | ||
1547 | default: | |
1548 | sWordMode = "<error>"; | |
1549 | break; | |
1550 | } | |
1551 | ||
1552 | switch (iRepBUT) | |
1553 | { | |
1554 | case nBUT_none: | |
1555 | sBUTmode = "none"; | |
1556 | break; | |
1557 | ||
1558 | case nBUT_notveto: | |
1559 | sBUTmode = "domains not skipped"; | |
1560 | break; | |
1561 | ||
1562 | case nBUT_all: | |
1563 | sBUTmode = "all domains"; | |
1564 | break; | |
1565 | ||
1566 | default: | |
1567 | sBUTmode = "<error>"; | |
1568 | break; | |
1569 | } | |
1570 | ||
1571 | switch (iRepBDT) | |
1572 | { | |
1573 | case nBDT_none: | |
1574 | sBDTmode = "none"; | |
1575 | break; | |
1576 | ||
1577 | case nBDT_all: | |
1578 | sBDTmode = "all users"; | |
1579 | break; | |
1580 | ||
1581 | case nBDT_user: | |
1582 | sBDTmode = "only user " + sRepBDTuser; | |
1583 | break; | |
1584 | ||
1585 | default: | |
1586 | sBDTmode = "<error>"; | |
1587 | break; | |
1588 | } | |
1589 | ||
1590 | switch (iRepBDI) | |
1591 | { | |
1592 | case nBDI_notveto: | |
1593 | sBDImode = "domains not skipped"; | |
1594 | break; | |
1595 | ||
1596 | case nBDI_all: | |
1597 | sBDImode = "all domains"; | |
1598 | break; | |
1599 | ||
1600 | default: | |
1601 | sBDImode = "<error>"; | |
1602 | break; | |
1603 | } | |
1604 | ||
1605 | con << "Log A Report Options\n" | |
1606 | << "\na. start from " << sTemp1 | |
1607 | << "\nb. finish at " << sTemp2 | |
1608 | << "\nc. report file name: " << sRepFileName | |
1609 | << "\nd. title of report: " << sRepTitle | |
1610 | << "\ne. cache hit report: " << bRepCacheReport | |
1611 | << "\nf. user bandwidth totals: " << sBUTmode | |
1612 | << "\ng. domain bandwidth totals: " << sBDTmode | |
1613 | << "\nh. domain bandwidth includes: " << sBDImode | |
1614 | << "\ni. word hit action: " << sWordMode | |
1615 | << "\nj. normal text: total columns " << iRepColumns | |
1616 | << "\nk. normal text: split long lines: " << bRepSplit | |
1617 | << "\nl. normal text: show request size: " << bRepShowSize | |
1618 | << "\nm. CSV: field seperator: \"" << sRepSeperator << "\"" | |
1619 | << "\nn. CSV: target columns " << iRepCSVcols | |
1620 | << "\n\nPress <enter> to go or q to quit:"; | |
1621 | ||
1622 | iKey = getch(); | |
1623 | con << "\n\n"; | |
1624 | switch (iKey) | |
1625 | { | |
1626 | case 'a': | |
1627 | iRepStart = iRepStart == 0 ? iLinePos : 0; | |
1628 | break; | |
1629 | ||
1630 | case 'b': | |
1631 | iRepEnd = iRepEnd == 0 ? iLinePos : 0; | |
1632 | break; | |
1633 | ||
1634 | case 'c': | |
1635 | con << "New file name : "; | |
1636 | GetFileName (sTemp, &bGood); | |
1637 | if (bGood) | |
1638 | sRepFileName = sTemp; | |
1639 | break; | |
1640 | ||
1641 | case 'd': | |
1642 | con << "New title : "; | |
1643 | GetText (sRepTitle); | |
1644 | break; | |
1645 | ||
1646 | case 'e': | |
1647 | bRepCacheReport = !bRepCacheReport; | |
1648 | break; | |
1649 | ||
1650 | case 'f': | |
1651 | if (++iRepBUT >= 3) | |
1652 | iRepBUT = 0; | |
1653 | break; | |
1654 | ||
1655 | case 'g': | |
1656 | MyCls(); | |
1657 | if (iRepFocus == user) | |
1658 | sTemp1 = sRepFocus; | |
1659 | else | |
1660 | sTemp1 = ""; | |
1661 | sTemp2 = ""; | |
1662 | GetLine (iLinePos); | |
1663 | if (NullText (pcReqBuff)) | |
1664 | sTemp2 = ""; | |
1665 | else | |
1666 | sTemp2 = GetUserName (pcReqBuff, false); | |
1667 | con << "Bandwidth By Domain Option:-\n\n" | |
1668 | "1. no domain totals\n" | |
1669 | "2. all users contribute to domain totals\n" | |
1670 | "3. only focus user " << sTemp1 << "\n" | |
1671 | "4. only current user " << sTemp2 << "\n" | |
1672 | "5. specify a different user\n\n" | |
1673 | "Your choice: "; | |
1674 | iKey = getch(); | |
1675 | con << "\n\n"; | |
1676 | sTemp = "NON3"; | |
1677 | switch (iKey) | |
1678 | { | |
1679 | case '1': | |
1680 | iRepBDT = nBDT_none; | |
1681 | break; | |
1682 | ||
1683 | case '2': | |
1684 | iRepBDT = nBDT_all; | |
1685 | break; | |
1686 | ||
1687 | case '3': | |
1688 | sTemp = sTemp1; | |
1689 | break; | |
1690 | ||
1691 | case '4': | |
1692 | sTemp = sTemp2; | |
1693 | break; | |
1694 | ||
1695 | case '5': | |
1696 | con << "Enter user name: "; | |
1697 | GetText (sTemp); | |
1698 | con << "\n"; | |
1699 | StrLwr (sTemp); | |
1700 | break; | |
1701 | } | |
1702 | if (sTemp != "NON3") | |
1703 | { | |
1704 | if (sTemp == "") | |
1705 | { | |
1706 | con << "No user there. Press any key. "; | |
1707 | getch(); | |
1708 | } | |
1709 | else | |
1710 | { | |
1711 | sRepBDTuser = sTemp; | |
1712 | iRepBDT = nBDT_user; | |
1713 | } | |
1714 | } | |
1715 | break; | |
1716 | ||
1717 | case 'h': | |
1718 | if (++iRepBDI >= 2) | |
1719 | iRepBDI = 0; | |
1720 | break; | |
1721 | ||
1722 | case 'i': | |
1723 | if (++iRepWordHits >= 3) | |
1724 | iRepWordHits = 0; | |
1725 | break; | |
1726 | ||
1727 | case 'j': | |
1728 | con << "New normal columns: "; | |
1729 | GetText (sTemp); | |
1730 | iTemp = atoi (sTemp.c_str()); | |
1731 | if ((iTemp >= 45) && (iTemp <= 256)) | |
1732 | iRepColumns = iTemp; | |
1733 | break; | |
1734 | ||
1735 | case 'k': | |
1736 | bRepSplit = !bRepSplit; | |
1737 | break; | |
1738 | ||
1739 | case 'l': | |
1740 | bRepShowSize = !bRepShowSize; | |
1741 | break; | |
1742 | ||
1743 | case 'm': | |
1744 | con << "New CSV seperator: "; | |
1745 | GetText (sRepSeperator); | |
1746 | break; | |
1747 | ||
1748 | case 'n': | |
1749 | con << "New CSV target max size: "; | |
1750 | GetText (sTemp); | |
1751 | iTemp = atoi (sTemp.c_str()); | |
1752 | if ((iTemp > 10) && (iTemp < 600)) | |
1753 | iRepCSVcols = iTemp; | |
1754 | break; | |
1755 | ||
1756 | case cEOL: | |
1757 | case cCR: | |
1758 | return true; | |
1759 | ||
1760 | case 'q': | |
1761 | return false; | |
1762 | } | |
1763 | } | |
1764 | } | |
1765 | ||
1766 | ||
1767 | void KeepExtension (string& sTarget, int iColumns) | |
1768 | { | |
1769 | int iLen = sTarget.length(); | |
1770 | int iIndex, iRemove, iDomainStart, iPathStart; | |
1771 | ||
1772 | if ((iRemove = iLen - iColumns) < 0) | |
1773 | return; | |
1774 | ||
1775 | if (!bRepKeepExt) | |
1776 | { | |
1777 | sTarget.replace (iColumns, iRemove, ""); | |
1778 | return; | |
1779 | } | |
1780 | ||
1781 | iIndex = iLen - 1; | |
1782 | for (;;) | |
1783 | { | |
1784 | if (iIndex < 0) | |
1785 | { | |
1786 | iDomainStart = 0; | |
1787 | break; | |
1788 | } | |
1789 | if (sTarget [iIndex] == ' ') | |
1790 | { | |
1791 | iDomainStart = iIndex + 1; | |
1792 | break; | |
1793 | } | |
1794 | iIndex--; | |
1795 | } | |
1796 | ||
1797 | iIndex = iDomainStart; | |
1798 | for (;;) | |
1799 | { | |
1800 | if (iIndex >= iLen) | |
1801 | { | |
1802 | iPathStart = iLen; | |
1803 | break; | |
1804 | } | |
1805 | if (sTarget [iIndex] == '/') | |
1806 | { | |
1807 | iPathStart = iIndex + 1; | |
1808 | break; | |
1809 | } | |
1810 | iIndex++; | |
1811 | } | |
1812 | ||
1813 | if (iLen - iPathStart >= iRemove) | |
1814 | { | |
1815 | sTarget.replace (iPathStart, iRemove, ""); | |
1816 | return; | |
1817 | } | |
1818 | ||
1819 | sTarget.replace (iColumns, iRemove, ""); | |
1820 | } | |
1821 | ||
1822 | ||
1823 | inline sRecordPointer sRecordPointer::operator= (const sRecordPointer& sFrom) | |
1824 | { | |
1825 | iBytes = sFrom.iBytes; | |
1826 | iHits = sFrom.iHits; | |
1827 | iRecordNumber = sFrom.iRecordNumber; | |
1828 | return *this; | |
1829 | } | |
1830 | ||
1831 | ||
1832 | void sListRecords::Empty() | |
1833 | { | |
1834 | while (!vList.empty()) | |
1835 | vList.pop_back(); | |
1836 | } | |
1837 | ||
1838 | ||
1839 | bool CompareBytes (const sRecordPointer& rLeft, const sRecordPointer& rRight) | |
1840 | { | |
1841 | if (rLeft.iBytes < rRight.iBytes) | |
1842 | return false; | |
1843 | else | |
1844 | return true; | |
1845 | } | |
1846 | ||
1847 | ||
1848 | /// | |
1849 | bool CompareHits (const sRecordPointer& rLeft, const sRecordPointer& rRight) | |
1850 | { | |
1851 | if (rLeft.iHits > rRight.iHits) | |
1852 | return false; | |
1853 | else | |
1854 | return true; | |
1855 | } | |
1856 | ||
1857 | ||
1858 | void sListRecords::Sort (eSortType nSelect) | |
1859 | { | |
1860 | bool bDone, bSwitch; | |
1861 | int iIndex; | |
1862 | sRecordPointer rTemp; | |
1863 | ||
1864 | if (vList.size() < 2) | |
1865 | return; | |
1866 | ||
1867 | if (!bRepMySort) | |
1868 | { | |
1869 | switch (nSelect) | |
1870 | { | |
1871 | case nSortBytes: | |
1872 | iSortFlag = 1014; | |
1873 | sort (vList.begin(), vList.end(), CompareBytes); | |
1874 | iSortFlag = 0; | |
1875 | return; | |
1876 | ||
1877 | case nSortHits: | |
1878 | iSortFlag = 1015; | |
1879 | sort (vList.begin(), vList.end(), CompareHits); | |
1880 | iSortFlag = 0; | |
1881 | return; | |
1882 | } | |
1883 | } | |
1884 | ||
1885 | iSortFlag = 824; | |
1886 | ||
1887 | for (;;) | |
1888 | { | |
1889 | bDone = true; | |
1890 | for (iIndex = vList.size() - 2; iIndex >= 0; iIndex--) | |
1891 | { | |
1892 | bSwitch = false; | |
1893 | switch (nSelect) | |
1894 | { | |
1895 | case nSortHits: | |
1896 | if (vList [iIndex].iHits > vList [iIndex + 1].iHits) | |
1897 | bSwitch = true; | |
1898 | break; | |
1899 | ||
1900 | case nSortBytes: | |
1901 | if (vList [iIndex].iBytes < vList [iIndex + 1].iBytes) | |
1902 | bSwitch = true; | |
1903 | break; | |
1904 | } | |
1905 | if (bSwitch) | |
1906 | { | |
1907 | bDone = false; | |
1908 | rTemp = vList [iIndex]; | |
1909 | vList [iIndex] = vList [iIndex + 1]; | |
1910 | vList [iIndex + 1] = rTemp; | |
1911 | } | |
1912 | } | |
1913 | if (bDone) | |
1914 | { | |
1915 | iSortFlag = 0; | |
1916 | return; | |
1917 | } | |
1918 | } | |
1919 | } | |
1920 | ||
1921 | ||
1922 | class GenerateReport | |
1923 | { | |
1924 | public: | |
1925 | void Run(); | |
1926 | ||
1927 | enum eDone {done, ioerror, keybreak}; | |
1928 | ||
1929 | private: | |
1930 | void WriteReportLine (const string& sText); | |
1931 | void HandleCSV(); | |
1932 | void HandleNormal(); | |
1933 | void ZeroCounters(); | |
1934 | ||
1935 | bool bLogOutput; | |
1936 | bool bMadeOutput; | |
1937 | FILE* fOutput; | |
1938 | string sBytePad, sFlags; | |
1939 | time_t iLastime_t; | |
1940 | tByteTotal iRequestSize; | |
1941 | string sStatusLine; | |
1942 | bool bDisplayOutput; | |
1943 | ||
1944 | vector <sUserRecord> vUserDetails; | |
1945 | vector <sDomainRecord> vDomainDetails; | |
1946 | sListRecords rUserPointers; | |
1947 | sListRecords rDomainPointers; | |
1948 | }; | |
1949 | ||
1950 | ||
1951 | // to compile on Slackware and other oldies don't | |
1952 | // use clear() because of naming problems: ncurses | |
1953 | // has a macro "clear" and it takes over. | |
1954 | inline void GenerateReport::ZeroCounters() | |
1955 | { | |
1956 | while (!vUserDetails.empty()) | |
1957 | vUserDetails.pop_back(); | |
1958 | while (!vDomainDetails.empty()) | |
1959 | vDomainDetails.pop_back(); | |
1960 | rUserPointers.Empty(); | |
1961 | rDomainPointers.Empty(); | |
1962 | } | |
1963 | ||
1964 | ||
1965 | inline void GenerateReport::WriteReportLine (const string& sText) | |
1966 | { | |
1967 | if (bLogOutput == false) | |
1968 | return; | |
1969 | ||
1970 | if (bDisplayOutput) | |
1971 | { | |
1972 | EraseStatusLine(); | |
1973 | refresh(); | |
1974 | printf ("%s\r", sText.c_str()); | |
1975 | ShowHighLightMessage (sStatusLine); | |
1976 | } | |
1977 | ||
1978 | if (fwrite (sText.c_str(), 1, sText.length(), fOutput) != sText.length()) | |
1979 | throw ioerror; | |
1980 | } | |
1981 | ||
1982 | ||
1983 | inline void GenerateReport::HandleCSV() | |
1984 | { | |
1985 | static string sTemp; | |
1986 | static string sDispLine; | |
1987 | static time_t iTime; | |
1988 | ||
1989 | GetColumn (pcReqBuff, nSizeCol, sTemp); | |
1990 | sDispLine = sTemp + sRepSeperator; | |
1991 | sTemp = GetUserName (pcReqBuff, true); | |
1992 | sDispLine += sTemp + sRepSeperator; | |
1993 | sDispLine += sFlags + sRepSeperator; | |
1994 | GetColumn (pcReqBuff, nTimeCol, sTemp); | |
1995 | sDispLine += sTemp + sRepSeperator; | |
1996 | iTime = GetTimeNumber (pcReqBuff); | |
1997 | CalcTime (iTime, sTemp); | |
1998 | RemoveSeconds (sTemp); | |
1999 | sDispLine += sTemp + sRepSeperator; | |
2000 | GetColumn (pcReqBuff, nTargetCol, sTemp); | |
2001 | KeepExtension (sTemp, iRepCSVcols); | |
2002 | sDispLine += sTemp + "\n"; | |
2003 | WriteReportLine (sDispLine); | |
2004 | } | |
2005 | ||
2006 | ||
2007 | inline void GenerateReport::HandleNormal() | |
2008 | { | |
2009 | static time_t iTime; | |
2010 | const time_t iTimeMod = 60; | |
2011 | static string sTemp1; | |
2012 | static string sTemp2; | |
2013 | static string sTarget; | |
2014 | static string sTime; | |
2015 | int iColsNotCSV, iCount, iDLfrom, iDLsize; | |
2016 | ||
2017 | iTime = GetTimeNumber (pcReqBuff); | |
2018 | iTime = iTime - (iTime % iTimeMod); | |
2019 | if (iTime != iLastime_t) | |
2020 | { | |
2021 | iLastime_t = iTime; | |
2022 | CalcTime (iTime, sTime); | |
2023 | RemoveSeconds (sTime); | |
2024 | } | |
2025 | else | |
2026 | sTime = ""; | |
2027 | ||
2028 | if (bRepShowSize) | |
2029 | sTemp1 = RightJustify (ItoCommas (iRequestSize), nSizeCols) + " "; | |
2030 | else | |
2031 | sTemp1 = ""; | |
2032 | ||
2033 | GetPaddedUserName (pcReqBuff, sTemp2); | |
2034 | sTemp1 += sTemp2 + " " + sFlags + " "; | |
2035 | if (sBytePad == "") | |
2036 | sBytePad.assign (sTemp1.length(), ' '); | |
2037 | ||
2038 | if (sTime != "") | |
2039 | WriteReportLine (sBytePad + sTime + "\n"); | |
2040 | ||
2041 | GetColumn (pcReqBuff, nTargetCol, sTarget); | |
2042 | RemoveSlashes (sTarget); | |
2043 | ||
2044 | if (bRepSplit == false) | |
2045 | { | |
2046 | sTemp1 += sTarget; | |
2047 | KeepExtension (sTemp1, iRepColumns); | |
2048 | sTemp1 += "\n"; | |
2049 | WriteReportLine (sTemp1); | |
2050 | } | |
2051 | else | |
2052 | { | |
2053 | iColsNotCSV = iRepColumns - sBytePad.length(); | |
2054 | if (iRepColumns < 5) | |
2055 | iRepColumns = 5; | |
2056 | iDLfrom = 0; | |
2057 | iCount = sTarget.length(); | |
2058 | iDLsize = iCount; | |
2059 | if (iDLsize > iColsNotCSV) | |
2060 | iDLsize = iColsNotCSV; | |
2061 | for (;;) | |
2062 | { | |
2063 | WriteReportLine (sTemp1 + sTarget.substr (iDLfrom, iDLsize) + "\n"); | |
2064 | iDLfrom += iDLsize; | |
2065 | if (iDLfrom >= iCount) | |
2066 | break; | |
2067 | iDLsize = iCount - iDLfrom; | |
2068 | if (iDLsize > iColsNotCSV) | |
2069 | iDLsize = iColsNotCSV; | |
2070 | sTemp1 = sBytePad; | |
2071 | } | |
2072 | } | |
2073 | } | |
2074 | ||
2075 | ||
2076 | /// make the report | |
2077 | void GenerateReport::Run() | |
2078 | { | |
2079 | tFilePos iCurrent, iTempPos, iStopPos, iScanArea; | |
2080 | eDone iResult; | |
2081 | int iHits, iVectorCount, iNumRecords, iThisEntry, iPointer; | |
2082 | tByteTotal iByteTotal, iSearchHitTotal, iFocusTotal, iDashTotal; | |
2083 | tByteTotal iUserBandWidth, iDomainBandWidth; | |
2084 | tByteTotal iCacheHitBytes; | |
2085 | int iCacheHitRequests, iRequests; | |
2086 | int iFile, iRead; | |
2087 | string sDispLine, sTemp, sTemp2, sUserName; | |
2088 | sRecordPointer rPointer; | |
2089 | sUserRecord rUserRecord; | |
2090 | sDomainRecord rDomainRecord; | |
2091 | bool bHandled, bTemp; | |
2092 | char cLetter; | |
2093 | time_t iTime; | |
2094 | int iLine; | |
2095 | ||
2096 | bLogOutput = sRepFileName == "" ? false : true; | |
2097 | iCurrent = iRepStart; | |
2098 | iStopPos = iRepEnd == 0 ? -1 : iRepEnd; | |
2099 | iScanArea = (iRepEnd == 0 ? iLastPage : iRepEnd) - iRepStart; | |
2100 | sBytePad = ""; | |
2101 | iByteTotal = iSearchHitTotal = iFocusTotal = iDashTotal = 0; | |
2102 | iUserBandWidth = iDomainBandWidth = 0; | |
2103 | iCacheHitBytes = iCacheHitRequests = iRequests = 0; | |
2104 | iHits = 0; | |
2105 | iLine = 1; | |
2106 | iLastime_t = -1; | |
2107 | ||
2108 | if (bLogOutput) | |
2109 | { | |
2110 | fOutput = fopen (string (sPathToFiles + "/" + sRepFileName) | |
2111 | .c_str(), "w"); | |
2112 | if (fOutput == 0) | |
2113 | { | |
2114 | sStatusMessage = "Could not write to " + sRepFileName; | |
2115 | return; | |
2116 | } | |
2117 | } | |
2118 | ||
2119 | ZeroCounters(); | |
2120 | GoForNoDelay(); | |
2121 | bMadeOutput = false; | |
2122 | iTime = time (0); | |
2123 | ||
2124 | sStatusLine = ""; | |
2125 | bDisplayOutput = true; | |
2126 | ||
2127 | try | |
2128 | { | |
2129 | if (sRepTitle != "") | |
2130 | WriteReportLine (sRepTitle + "\n\n"); | |
2131 | ||
2132 | sTemp = PosToTime (iCurrent); | |
2133 | if (iRepEnd == 0) | |
2134 | sTemp2 = PosToTime (iLastPage); | |
2135 | else | |
2136 | sTemp2 = PosToTime (iRepEnd); | |
2137 | ||
2138 | if (sTemp2 == sTemp) | |
2139 | WriteReportLine ("For " + sTemp + "\n\n"); | |
2140 | else | |
2141 | WriteReportLine ("For " + sTemp + " to " + sTemp2 + "\n\n"); | |
2142 | ||
2143 | for (;;) | |
2144 | { | |
2145 | if ((iStopPos > 0) && (iCurrent >= iStopPos)) | |
2146 | throw done; | |
2147 | iTempPos = GetLine (iCurrent); | |
2148 | if ((iTempPos == 0) || (iTempPos == iCurrent)) | |
2149 | throw done; | |
2150 | if (!NullText (pcReqBuff)) | |
2151 | { | |
2152 | GetRequestFlags (pcReqBuff, sFlags); | |
2153 | iRequestSize = GetRequestSize (pcReqBuff); | |
2154 | iByteTotal += iRequestSize; | |
2155 | iRequests++; | |
2156 | GetColumn (pcReqBuff, iUserCol, sTemp); | |
2157 | if (sTemp == "-") | |
2158 | iDashTotal += iRequestSize; | |
2159 | ||
2160 | bHandled = SearchHit (sFlags); | |
2161 | if (bHandled) | |
2162 | { | |
2163 | iHits++; | |
2164 | iSearchHitTotal += iRequestSize; | |
2165 | if (bLogOutput) | |
2166 | { | |
2167 | switch (iRepWordHits) | |
2168 | { | |
2169 | case text: | |
2170 | HandleNormal(); | |
2171 | bMadeOutput = true; | |
2172 | break; | |
2173 | ||
2174 | case CSV: | |
2175 | HandleCSV(); | |
2176 | bMadeOutput = true; | |
2177 | break; | |
2178 | } | |
2179 | } | |
2180 | } | |
2181 | ||
2182 | bTemp = false; | |
2183 | if (iRepBUT == nBUT_all) | |
2184 | bTemp = true; | |
2185 | if ((iRepBUT == nBUT_notveto) && (sFlags [0] != '-')) | |
2186 | bTemp = true; | |
2187 | if (iRequestSize <= 0) | |
2188 | bTemp = false; | |
2189 | ||
2190 | if (bTemp) | |
2191 | { | |
2192 | iUserBandWidth += iRequestSize; | |
2193 | sUserName = GetUserName (pcReqBuff, false); | |
2194 | if (sUserName != "") | |
2195 | { | |
2196 | iNumRecords = rUserPointers.vList.size(); | |
2197 | iThisEntry = -1; | |
2198 | for (iVectorCount = iNumRecords - 1; | |
2199 | iVectorCount >= 0; | |
2200 | iVectorCount--) | |
2201 | { | |
2202 | iPointer = rUserPointers.vList [iVectorCount].iRecordNumber; | |
2203 | if (sUserName == vUserDetails [iPointer].sLoginName) | |
2204 | { | |
2205 | iThisEntry = iVectorCount; | |
2206 | rUserPointers.vList [iVectorCount].iBytes += iRequestSize; | |
2207 | rUserPointers.vList [iVectorCount].iHits++; | |
2208 | break; | |
2209 | } | |
2210 | } | |
2211 | if (iThisEntry == -1) | |
2212 | { | |
2213 | rPointer.iBytes = iRequestSize; | |
2214 | rPointer.iHits = 1; | |
2215 | rPointer.iRecordNumber = iNumRecords; | |
2216 | rUserPointers.vList.push_back (rPointer); | |
2217 | ||
2218 | rUserRecord.sLoginName = sUserName; | |
2219 | rUserRecord.sFullName = ""; | |
2220 | vUserDetails.push_back (rUserRecord); | |
2221 | } | |
2222 | } | |
2223 | } | |
2224 | ||
2225 | bTemp = false; | |
2226 | if (iRepBDT == nBDT_all) | |
2227 | bTemp = true; | |
2228 | if (iRepBDT >= nBDT_user) | |
2229 | { | |
2230 | sUserName = GetUserName (pcReqBuff, false); | |
2231 | if (sUserName == sRepBDTuser) | |
2232 | bTemp = true; | |
2233 | } | |
2234 | if ((iRepBDI == nBDI_notveto) && (sFlags [0] == '-')) | |
2235 | bTemp = false; | |
2236 | if (iRequestSize <= 0) | |
2237 | bTemp = false; | |
2238 | ||
2239 | if (bTemp) | |
2240 | { | |
2241 | iDomainBandWidth += iRequestSize; | |
2242 | GetDomainName (pcReqBuff, sTemp); | |
2243 | iNumRecords = rDomainPointers.vList.size(); | |
2244 | iThisEntry = -1; | |
2245 | for (iVectorCount = iNumRecords - 1; | |
2246 | iVectorCount >= 0; | |
2247 | iVectorCount--) | |
2248 | { | |
2249 | iPointer = rDomainPointers.vList [iVectorCount].iRecordNumber; | |
2250 | if (sTemp == vDomainDetails [iPointer].sDomainName) | |
2251 | { | |
2252 | iThisEntry = iVectorCount; | |
2253 | rDomainPointers.vList [iVectorCount].iBytes += iRequestSize; | |
2254 | rDomainPointers.vList [iVectorCount].iHits++; | |
2255 | break; | |
2256 | } | |
2257 | } | |
2258 | if (iThisEntry == -1) | |
2259 | { | |
2260 | rPointer.iBytes = iRequestSize; | |
2261 | rPointer.iHits = 1; | |
2262 | rPointer.iRecordNumber = iNumRecords; | |
2263 | rDomainPointers.vList.push_back (rPointer); | |
2264 | ||
2265 | rDomainRecord.sDomainName = sTemp; | |
2266 | vDomainDetails.push_back (rDomainRecord); | |
2267 | } | |
2268 | } | |
2269 | ||
2270 | if ((sFlags [2] >= 'A') && (sFlags [2] <= 'Z')) | |
2271 | { | |
2272 | iCacheHitBytes += iRequestSize; | |
2273 | iCacheHitRequests++; | |
2274 | } | |
2275 | } | |
2276 | ||
2277 | if ((iStopPos > 0) && (iTempPos >= iStopPos)) | |
2278 | throw done; | |
2279 | iCurrent = iTempPos; | |
2280 | ||
2281 | if ((iRepFast) && (iLine % iRepFast == 0)) | |
2282 | { | |
2283 | rUserPointers.Sort (sListRecords::nSortHits); | |
2284 | rDomainPointers.Sort (sListRecords::nSortHits); | |
2285 | } | |
2286 | iLine++; | |
2287 | ||
2288 | if (CheckInterrupt()) | |
2289 | throw keybreak; | |
2290 | ||
2291 | if (bHandled || CheckTicker()) | |
2292 | { | |
2293 | sTemp = string ("complete: ") + | |
2294 | ItoCommas (iByteTotal) + " bytes, " + | |
2295 | ItoCommas (iHits) + " hits"; | |
2296 | UpdateTicker (sTemp.c_str(), iCurrent - iRepStart, iScanArea); | |
2297 | } | |
2298 | } | |
2299 | } | |
2300 | catch (eDone iTemp) | |
2301 | { | |
2302 | iResult = iTemp; | |
2303 | } | |
2304 | ||
2305 | bDisplayOutput = false; | |
2306 | MyCls(); | |
2307 | ||
2308 | if (iResult == done) | |
2309 | { | |
2310 | try | |
2311 | { | |
2312 | WriteReportLine ("\n" + | |
2313 | RightJustify (ItoCommas (iByteTotal), nSizeCols) + | |
2314 | " scanned bytes, " + ItoCommas (iHits) + " hits total " + | |
2315 | ItoCommas (iSearchHitTotal) + " bytes\n"); | |
2316 | ||
2317 | WriteReportLine ("\nBytes attributed to \"-\" user: " + | |
2318 | ItoCommas (iDashTotal) + "\n"); | |
2319 | ||
2320 | if (bRepCacheReport) | |
2321 | { | |
2322 | bMadeOutput = true; | |
2323 | WriteReportLine ("\nCache hit statistics:\n"); | |
2324 | CalcPercentage (iCacheHitRequests, iRequests, sTemp); | |
2325 | WriteReportLine (ItoCommas (iCacheHitRequests) + " requests out of " | |
2326 | + ItoCommas (iRequests) + ": " + sTemp + "\n"); | |
2327 | CalcPercentage (iCacheHitBytes, iByteTotal, sTemp); | |
2328 | WriteReportLine (ItoCommas (iCacheHitBytes) + " bytes out of " | |
2329 | + ItoCommas (iByteTotal) + ": " + sTemp + "\n"); | |
2330 | } | |
2331 | ||
2332 | if (iRepBUT != nBUT_none) | |
2333 | { | |
2334 | ShowHighLightMessage ("Sorting users' totals..."); | |
2335 | rUserPointers.Sort (sListRecords::nSortBytes); | |
2336 | ShowHighLightMessage ("Finding full user names..."); | |
2337 | ||
2338 | iFile = open (sUsersFile.c_str(), O_RDONLY); | |
2339 | if (iFile > 0) | |
2340 | { | |
2341 | sDispLine = ""; | |
2342 | iNumRecords = vUserDetails.size(); | |
2343 | ||
2344 | for (;;) | |
2345 | { | |
2346 | iRead = read (iFile, &cLetter, 1); | |
2347 | if (iRead < 1) | |
2348 | break; | |
2349 | if ((cLetter == cEOL) || (cLetter == cCR)) | |
2350 | { | |
2351 | if (sDispLine != "") | |
2352 | { | |
2353 | GetColumn (sDispLine.c_str(), 1, sTemp); | |
2354 | for (iVectorCount = 0; iVectorCount < iNumRecords; iVectorCount++) | |
2355 | { | |
2356 | if (sTemp == vUserDetails [iVectorCount].sLoginName) | |
2357 | { | |
2358 | sDispLine.replace (0, sTemp.length() + 1, ""); | |
2359 | vUserDetails [iVectorCount].sFullName = sDispLine; | |
2360 | break; | |
2361 | } | |
2362 | } | |
2363 | sDispLine = ""; | |
2364 | } | |
2365 | } | |
2366 | else | |
2367 | sDispLine += cLetter; | |
2368 | } | |
2369 | close (iFile); | |
2370 | } | |
2371 | ||
2372 | ShowHighLightMessage ("Done finding full user names."); | |
2373 | ||
2374 | sTemp = "\n" + RightJustify (ItoCommas (iUserBandWidth), nSizeCols); | |
2375 | if (iRepBUT == nBUT_notveto) | |
2376 | sTemp += " bytes not skipped domains"; | |
2377 | else | |
2378 | if (iRepBUT == nBUT_all) | |
2379 | sTemp += " bytes all domains"; | |
2380 | WriteReportLine (sTemp + "\n"); | |
2381 | ||
2382 | iNumRecords = rUserPointers.vList.size(); | |
2383 | for (iVectorCount = 0; iVectorCount < iNumRecords; iVectorCount++) | |
2384 | { | |
2385 | bMadeOutput = true; | |
2386 | sTemp = RightJustify ( | |
2387 | ItoCommas ( | |
2388 | rUserPointers.vList [iVectorCount].iBytes), nSizeCols); | |
2389 | if (iRepWordHits == CSV) | |
2390 | sTemp += sRepSeperator; | |
2391 | else | |
2392 | sTemp += ' '; | |
2393 | iPointer = rUserPointers.vList [iVectorCount].iRecordNumber; | |
2394 | sTemp += vUserDetails [iPointer].sLoginName; | |
2395 | if (vUserDetails [iPointer].sFullName != "") | |
2396 | sTemp += " : " + vUserDetails [iPointer].sFullName; | |
2397 | WriteReportLine (sTemp + "\n"); | |
2398 | } | |
2399 | } | |
2400 | ||
2401 | if (iRepBDT != nBDT_none) | |
2402 | { | |
2403 | ShowHighLightMessage ("Sorting destination domain totals..."); | |
2404 | rDomainPointers.Sort (sListRecords::nSortBytes); | |
2405 | ShowHighLightMessage ("Done sorting domain totals."); | |
2406 | ||
2407 | WriteReportLine ("\n"); | |
2408 | if (iRepBDT >= nBDT_user) | |
2409 | { | |
2410 | sTemp = GetLongUserName (sRepBDTuser); | |
2411 | if (sTemp != "") | |
2412 | WriteReportLine (sRepBDTuser + " is " + sTemp + "\n"); | |
2413 | } | |
2414 | ||
2415 | sTemp = RightJustify (ItoCommas (iDomainBandWidth), nSizeCols); | |
2416 | if (iRepBDT >= nBDT_user) | |
2417 | sTemp += " bytes user " + sRepBDTuser + " bandwidth: "; | |
2418 | else | |
2419 | sTemp += " bytes all users bandwidth: "; | |
2420 | ||
2421 | if (iRepBDI == nBDI_notveto) | |
2422 | sTemp += "domains not skipped"; | |
2423 | if (iRepBDI == nBDI_all) | |
2424 | sTemp += "all domains"; | |
2425 | WriteReportLine (sTemp + "\n"); | |
2426 | ||
2427 | iNumRecords = rDomainPointers.vList.size(); | |
2428 | for (iVectorCount = 0; iVectorCount < iNumRecords; iVectorCount++) | |
2429 | { | |
2430 | bMadeOutput = true; | |
2431 | sTemp = RightJustify ( | |
2432 | ItoCommas ( | |
2433 | rDomainPointers.vList [iVectorCount].iBytes), nSizeCols); | |
2434 | if (iRepWordHits == CSV) | |
2435 | sTemp += sRepSeperator; | |
2436 | else | |
2437 | sTemp += ' '; | |
2438 | iPointer = rDomainPointers.vList [iVectorCount].iRecordNumber; | |
2439 | sTemp += vDomainDetails [iPointer].sDomainName; | |
2440 | WriteReportLine (sTemp + "\n"); | |
2441 | } | |
2442 | } | |
2443 | } | |
2444 | catch (eDone iTemp) | |
2445 | { | |
2446 | iResult = iTemp; | |
2447 | } | |
2448 | } | |
2449 | ||
2450 | ZeroCounters(); | |
2451 | if (bLogOutput) | |
2452 | fclose (fOutput); | |
2453 | ||
2454 | iTime = time (0) - iTime; | |
2455 | ||
2456 | if (wTemp) | |
2457 | nodelay (wTemp, false); | |
2458 | ||
2459 | if (iResult == ioerror) | |
2460 | { | |
2461 | sStatusMessage = "Could not append to " + sRepFileName; | |
2462 | return; | |
2463 | } | |
2464 | ||
2465 | if (iResult == keybreak) | |
2466 | { | |
2467 | sStatusMessage = "Report canceled."; | |
2468 | return; | |
2469 | } | |
2470 | ||
2471 | sTemp = ItoCommas (iByteTotal) + " scanned bytes, " + | |
2472 | ItoCommas (iHits) + " hits - " + ItoS (iTime) + " seconds"; | |
2473 | ||
2474 | if (bLogOutput) | |
2475 | { | |
2476 | if (!bMadeOutput) | |
2477 | { | |
2478 | sStatusMessage = "No report: " + sTemp + "."; | |
2479 | return; | |
2480 | } | |
2481 | sCurrentReport = sRepFileName; | |
2482 | sDispLine = sRepFileName + " made: " + sTemp + "; View? "; | |
2483 | if (PromptForKey (sDispLine) == 'y') | |
2484 | { | |
2485 | sTemp = sViewer + " " +sPathToFiles + "/" + sRepFileName; | |
2486 | RunProgram (sTemp, 1); | |
2487 | } | |
2488 | sStatusMessage = "Press 'n' for misc. operations you can do on " | |
2489 | + sRepFileName; | |
2490 | } | |
2491 | else | |
2492 | { | |
2493 | sStatusMessage = "Summary: " + sTemp + "."; | |
2494 | } | |
2495 | } | |
2496 | ||
2497 | ||
2498 | // prepend a word to the search list | |
2499 | void PrependFindText() | |
2500 | { | |
2501 | string sText; | |
2502 | ||
2503 | PromptForText ("find text: ", sText); | |
2504 | if (sText != "") | |
2505 | { | |
2506 | sText += cSeperator; | |
2507 | sWords = sText + sWords; | |
2508 | sStatusMessage = "Now press <- or ->"; | |
2509 | } | |
2510 | } | |
2511 | ||
2512 | ||
2513 | void AppendFindText() | |
2514 | { | |
2515 | string sText; | |
2516 | ||
2517 | PromptForText ("Find text: ", sText); | |
2518 | if (sText != "") | |
2519 | { | |
2520 | sWords += sText; | |
2521 | sWords += cSeperator; | |
2522 | sStatusMessage = "Now press <- or ->"; | |
2523 | } | |
2524 | } | |
2525 | ||
2526 | ||
2527 | // size hit sub menu | |
2528 | void SizeHitOptions() | |
2529 | { | |
2530 | int iCount, iSize, iTemp; | |
2531 | const char *pcLetter; | |
2532 | string sTemp; | |
2533 | ||
2534 | for (;;) | |
2535 | { | |
2536 | MyCls(); | |
2537 | con << "Hit sizes are:-\n\n0: <off>\n"; | |
2538 | pcLetter = sSizeHits.c_str(); | |
2539 | iCount = 1; | |
2540 | for (;;) | |
2541 | { | |
2542 | iSize = NextCatchSize (&pcLetter); | |
2543 | if (iSize <= 0) | |
2544 | break; | |
2545 | con << ItoS (iCount++) << ": " << ItoCommas (iSize) << "\n"; | |
2546 | } | |
2547 | ||
2548 | if (iSizeHitGrade == 0) | |
2549 | con << "\nNo hit size set.\n"; | |
2550 | else | |
2551 | con << "\nCurrent hit grade is " << iSizeHitGrade << ": " + | |
2552 | ItoCommas (iSizeHitBytes) + " bytes\n"; | |
2553 | ||
2554 | con << "\n-1 to -9 deletes entry, 0 to 9 sets grade.\n" | |
2555 | "A large number inserts a new grade.\n" | |
2556 | "Enter nothing to dismiss.\n\nEnter choice: "; | |
2557 | GetText (sTemp); | |
2558 | if (sTemp == "") | |
2559 | return; | |
2560 | iTemp = atoi (sTemp.c_str()); | |
2561 | ||
2562 | if (iTemp >= 10) | |
2563 | { | |
2564 | if (iCount >= 10) | |
2565 | { | |
2566 | con << "\nNot enough room!\n\nPress a key: "; | |
2567 | getch(); | |
2568 | } | |
2569 | else | |
2570 | { | |
2571 | pcLetter = sSizeHits.c_str(); | |
2572 | sTemp = ""; | |
2573 | iCount = 1; | |
2574 | for (;;) | |
2575 | { | |
2576 | iSize = NextCatchSize (&pcLetter); | |
2577 | if (iTemp == iSize) | |
2578 | iTemp = -1; | |
2579 | if (iSize == 0) | |
2580 | { | |
2581 | if (iTemp >= 10) | |
2582 | sTemp += " " + ItoS (iTemp); | |
2583 | break; | |
2584 | } | |
2585 | if ((iTemp >= 10) && (iTemp < iSize)) | |
2586 | { | |
2587 | sTemp += " " + ItoS (iTemp); | |
2588 | iSizeHitGrade = iCount; | |
2589 | iSizeHitBytes = iTemp; | |
2590 | iTemp = -1; | |
2591 | } | |
2592 | sTemp += " " + ItoS (iSize); | |
2593 | iCount++; | |
2594 | } | |
2595 | if ((sTemp != "") && (sTemp [0] == ' ')) | |
2596 | sTemp.replace (0, 1, ""); | |
2597 | sSizeHits = sTemp; | |
2598 | } | |
2599 | } | |
2600 | else | |
2601 | if (iTemp < 0) | |
2602 | { | |
2603 | pcLetter = sSizeHits.c_str(); | |
2604 | iCount = -1; | |
2605 | sTemp = ""; | |
2606 | for (;;) | |
2607 | { | |
2608 | iSize = NextCatchSize (&pcLetter); | |
2609 | if (iSize <= 0) | |
2610 | break; | |
2611 | if (iTemp != iCount--) | |
2612 | sTemp += " " + ItoS (iSize); | |
2613 | } | |
2614 | if ((sTemp != "") && (sTemp [0] == ' ')) | |
2615 | sTemp.replace (0, 1, ""); | |
2616 | sSizeHits = sTemp; | |
2617 | ||
2618 | iSizeHitGrade = 0; | |
2619 | pcLetter = sSizeHits.c_str(); | |
2620 | iCount = 1; | |
2621 | for (;;) | |
2622 | { | |
2623 | iSize = NextCatchSize (&pcLetter); | |
2624 | if (iSize <= 0) | |
2625 | break; | |
2626 | if (iSize == iSizeHitBytes) | |
2627 | { | |
2628 | iSizeHitGrade = iCount; | |
2629 | break; | |
2630 | } | |
2631 | iCount++; | |
2632 | } | |
2633 | if (iSizeHitGrade == 0) | |
2634 | iSizeHitBytes = 0; | |
2635 | } | |
2636 | else | |
2637 | if (sTemp == "0") | |
2638 | { | |
2639 | iSizeHitGrade = 0; | |
2640 | iSizeHitBytes = 0; | |
2641 | } | |
2642 | else | |
2643 | if ((iTemp >= 1) && (iTemp <= 9)) | |
2644 | { | |
2645 | pcLetter = sSizeHits.c_str(); | |
2646 | iCount = 1; | |
2647 | for (;;) | |
2648 | { | |
2649 | iSize = NextCatchSize (&pcLetter); | |
2650 | if (iSize == 0) | |
2651 | break; | |
2652 | if (iTemp == iCount) | |
2653 | { | |
2654 | iSizeHitGrade = iCount; | |
2655 | iSizeHitBytes = iSize; | |
2656 | break; | |
2657 | } | |
2658 | iCount++; | |
2659 | } | |
2660 | } | |
2661 | } | |
2662 | } | |
2663 | ||
2664 | ||
2665 | int CountLeadingSpaces (const string& sText) | |
2666 | { | |
2667 | int iIndex = 0; | |
2668 | int iLen = sText.length(); | |
2669 | ||
2670 | for (iIndex = 0; iIndex < iLen; iIndex++) | |
2671 | if (sText [iIndex] != ' ') | |
2672 | return iIndex; | |
2673 | return iLen; | |
2674 | } | |
2675 | ||
2676 | ||
2677 | bool IsDateTime (const string& sText) | |
2678 | { | |
2679 | string sTemp; | |
2680 | ||
2681 | GetColumn (sText.c_str(), 2, sTemp); | |
2682 | if (sTemp == "Sun") return true; | |
2683 | if (sTemp == "Mon") return true; | |
2684 | if (sTemp == "Tue") return true; | |
2685 | if (sTemp == "Wed") return true; | |
2686 | if (sTemp == "Thu") return true; | |
2687 | if (sTemp == "Fri") return true; | |
2688 | if (sTemp == "Sat") return true; | |
2689 | return false; | |
2690 | } | |
2691 | ||
2692 | ||
2693 | bool IsTimeSpan (const string& sText) | |
2694 | { | |
2695 | string sTemp; | |
2696 | ||
2697 | GetColumn (sText.c_str(), 1, sTemp); | |
2698 | if (sTemp != "For") | |
2699 | return false; | |
2700 | return IsDateTime (sText); | |
2701 | } | |
2702 | ||
2703 | ||
2704 | bool IsGrandTotal (const string& sText) | |
2705 | { | |
2706 | string sTemp; | |
2707 | ||
2708 | GetColumn (sText.c_str(), 2, sTemp); | |
2709 | if (sTemp != "scanned") | |
2710 | return false; | |
2711 | GetColumn (sText.c_str(), 3, sTemp); | |
2712 | if (sTemp != "bytes,") | |
2713 | return false; | |
2714 | ||
2715 | return true; | |
2716 | } | |
2717 | ||
2718 | ||
2719 | bool IsUsersRequest (const string& sText, const string& sUser) | |
2720 | { | |
2721 | string sTemp; | |
2722 | int iCount; | |
2723 | ||
2724 | for (iCount = 1; iCount <= 3; iCount++) | |
2725 | { | |
2726 | GetColumn (sText.c_str(), iCount, sTemp); | |
2727 | if (sTemp == sUser) | |
2728 | return true; | |
2729 | } | |
2730 | return false; | |
2731 | } | |
2732 | ||
2733 | ||
2734 | bool FilterReport (const string& sSrc, const string& sDest, | |
2735 | const string& sUser) | |
2736 | { | |
2737 | int iIn, iOut, iLetter, iLen, iSpaces; | |
2738 | string sLine, sTime, sLastTime, sTemp; | |
2739 | bool bWrite, bRet, bSplitting, bTimed, bGrand; | |
2740 | const char* szLine; | |
2741 | ||
2742 | iSpaces = 0; | |
2743 | sTime = ""; | |
2744 | bSplitting = bTimed = bGrand = bRet = false; | |
2745 | ||
2746 | iIn = open (string (sPathToFiles + "/" + sSrc).c_str(), O_RDONLY); | |
2747 | if (iIn <= 0) | |
2748 | sStatusMessage = "Can't open " + sSrc + " for reading."; | |
2749 | else | |
2750 | { | |
2751 | iOut = open (string (sPathToFiles + "/" + sDest).c_str(), | |
2752 | O_WRONLY | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE); | |
2753 | if (iOut <= 0) | |
2754 | sStatusMessage = "Can't open " + sDest + " for writing."; | |
2755 | else | |
2756 | { | |
2757 | sLine = "Web usage report on "; | |
2758 | sTemp = GetLongUserName (sUser); | |
2759 | if (sTemp == "") | |
2760 | sLine += sUser + "\n\n"; | |
2761 | else | |
2762 | sLine += "\"" + sUser + "\" who is " + sTemp + "\n\n"; | |
2763 | write (iOut, sLine.c_str(), sLine.length()); | |
2764 | ||
2765 | sLine = ""; | |
2766 | for (;;) | |
2767 | { | |
2768 | iLetter = 0; | |
2769 | iLen = read (iIn, &iLetter, 1); | |
2770 | if ((iLen < 1) || (iLetter == cEOL)) | |
2771 | { | |
2772 | bWrite = false; | |
2773 | sLastTime = sTime; | |
2774 | szLine = sLine.c_str(); | |
2775 | ||
2776 | if (!bWrite) | |
2777 | { | |
2778 | if (IsTimeSpan (sLine)) | |
2779 | { | |
2780 | sLine += "\n"; | |
2781 | bWrite = true; | |
2782 | } | |
2783 | } | |
2784 | ||
2785 | if (!bWrite) | |
2786 | { | |
2787 | if (IsDateTime (sLine)) | |
2788 | { | |
2789 | sTime = sLine; | |
2790 | iSpaces = CountLeadingSpaces (sLine); | |
2791 | } | |
2792 | } | |
2793 | ||
2794 | if (!bWrite) | |
2795 | { | |
2796 | if (IsUsersRequest (sLine, sUser)) | |
2797 | { | |
2798 | bRet = true; | |
2799 | if (bGrand) | |
2800 | { | |
2801 | GetColumn (sLine.c_str(), 1, sTemp); | |
2802 | if (sTemp == "") | |
2803 | GetColumn (sLine.c_str(), 2, sTemp); | |
2804 | if (sTemp == "") | |
2805 | sTemp = "unkown"; | |
2806 | sLine = "Total bytes including small requests: " + sTemp + "\n"; | |
2807 | bWrite = true; | |
2808 | iLen = 0; | |
2809 | } | |
2810 | else | |
2811 | { | |
2812 | sTemp = ""; | |
2813 | if (!bTimed) | |
2814 | { | |
2815 | sTemp = sTime + "\n"; | |
2816 | sLastTime = sTime; | |
2817 | } | |
2818 | sLine = sTemp + sLine; | |
2819 | bWrite = true; | |
2820 | bSplitting = true; | |
2821 | } | |
2822 | } | |
2823 | else | |
2824 | { | |
2825 | if ((IsDateTime (sLine)) || | |
2826 | (CountLeadingSpaces (sLine) != iSpaces)) | |
2827 | bSplitting = false; | |
2828 | } | |
2829 | } | |
2830 | ||
2831 | if (!bWrite) | |
2832 | { | |
2833 | if (IsGrandTotal (sLine)) | |
2834 | { | |
2835 | sLine = ""; | |
2836 | bWrite = bGrand = true; | |
2837 | } | |
2838 | } | |
2839 | ||
2840 | if (bWrite || bSplitting) | |
2841 | { | |
2842 | sLine += "\n"; | |
2843 | write (iOut, sLine.c_str(), sLine.length()); | |
2844 | } | |
2845 | sLine = ""; | |
2846 | } | |
2847 | else | |
2848 | sLine += char (iLetter); | |
2849 | if (iLen < 1) | |
2850 | break; | |
2851 | } | |
2852 | close (iOut); | |
2853 | } | |
2854 | close (iIn); | |
2855 | } | |
2856 | return bRet; | |
2857 | } | |
2858 | ||
2859 | ||
2860 | // menu | |
2861 | void SearchOptions() | |
2862 | { | |
2863 | int iKey = 0, iPause; | |
2864 | const char* pcLetter; | |
2865 | char cLetter; | |
2866 | string sCatch, sTemp, sFocus; | |
2867 | ||
2868 | for (;;) | |
2869 | { | |
2870 | MyCls(); | |
2871 | ||
2872 | con << "Search Options: current words are:-\n\n"; | |
2873 | pcLetter = sWords.c_str(); | |
2874 | while ((cLetter = *pcLetter++) != 0) | |
2875 | { | |
2876 | if (cLetter == cSeperator) | |
2877 | cLetter = ' '; | |
2878 | addch (cLetter); | |
2879 | } | |
2880 | ||
2881 | if (iSizeHitGrade == 0) | |
2882 | sCatch = "<off>"; | |
2883 | else | |
2884 | sCatch = ItoS (iSizeHitGrade) + " (" + | |
2885 | ItoCommas (iSizeHitBytes) + ")"; | |
2886 | ||
2887 | switch (iRepFocus) | |
2888 | { | |
2889 | case no_focus: | |
2890 | sFocus = "no focus"; | |
2891 | break; | |
2892 | ||
2893 | case user: | |
2894 | sFocus = "focus on user " + sRepFocus; | |
2895 | break; | |
2896 | ||
2897 | default: | |
2898 | sFocus = "<error>"; | |
2899 | break; | |
2900 | } | |
2901 | ||
2902 | con << "\n\nIn the case of skips (\"!\"s) first words " | |
2903 | "have higher preference.\n\n" | |
2904 | "Commands:\n\n" | |
2905 | "n. null words\n" | |
2906 | "r. reload words\n" | |
2907 | "s. save words\n" | |
2908 | "c. change request hit size from " << sCatch << "\n" | |
2909 | "f. focus: " << sFocus << "\n" | |
2910 | "q. quit this screen\n\n" | |
2911 | "Your choice: "; | |
2912 | refresh(); | |
2913 | ||
2914 | iKey = getch(); | |
2915 | iPause = 0; | |
2916 | switch (iKey) | |
2917 | { | |
2918 | case 'n': | |
2919 | sWords = ""; | |
2920 | con << "\n\nAll words gone.\n"; | |
2921 | iPause = 1; | |
2922 | break; | |
2923 | ||
2924 | case 'r': | |
2925 | if (LoadWords()) | |
2926 | con << "\n\nWords reset.\n"; | |
2927 | else | |
2928 | con << "\n\nOpps, problem loading words.\n"; | |
2929 | iPause = 1; | |
2930 | break; | |
2931 | ||
2932 | case 's': | |
2933 | if (SaveWords()) | |
2934 | con << "\n\nWords saved.\n"; | |
2935 | else | |
2936 | con << "\n\nOpps, problem saving words.\n"; | |
2937 | iPause = 1; | |
2938 | break; | |
2939 | ||
2940 | case 'c': | |
2941 | SizeHitOptions(); | |
2942 | break; | |
2943 | ||
2944 | case 'f': | |
2945 | MyCls(); | |
2946 | con << "Focus options:\n\n" | |
2947 | "1. no focus\n" | |
2948 | "2. a user\n"; | |
2949 | sFocus = ""; | |
2950 | GetLine (iLinePos); | |
2951 | if (NullText (pcReqBuff)) | |
2952 | sTemp = ""; | |
2953 | else | |
2954 | { | |
2955 | sFocus = GetUserName (pcReqBuff, false); | |
2956 | if (sFocus != "") | |
2957 | con << "3. focus on user " << sFocus << "\n"; | |
2958 | } | |
2959 | con << "\nYour choice: "; | |
2960 | switch (getch()) | |
2961 | { | |
2962 | case '1': | |
2963 | iRepFocus = no_focus; | |
2964 | break; | |
2965 | ||
2966 | case '2': | |
2967 | con << "\n\nEnter user name: "; | |
2968 | GetText (sTemp); | |
2969 | if (sTemp == "") | |
2970 | iRepFocus = no_focus; | |
2971 | else | |
2972 | { | |
2973 | StrLwr (sTemp); | |
2974 | sRepFocus = sTemp; | |
2975 | iRepFocus = user; | |
2976 | } | |
2977 | break; | |
2978 | ||
2979 | case '3': | |
2980 | if (sFocus != "") | |
2981 | { | |
2982 | sRepFocus = sFocus; | |
2983 | iRepFocus = user; | |
2984 | } | |
2985 | break; | |
2986 | } | |
2987 | break; | |
2988 | ||
2989 | case 'q': | |
2990 | return; | |
2991 | } | |
2992 | if (iPause) | |
2993 | { | |
2994 | con << "\nPress any key."; | |
2995 | getch(); | |
2996 | } | |
2997 | } | |
2998 | } | |
2999 | ||
3000 | ||
3001 | void CommonOptions() | |
3002 | { | |
3003 | int iKey, iTemp; | |
3004 | string sTemp; | |
3005 | ||
3006 | for (;;) | |
3007 | { | |
3008 | MyCls(); | |
3009 | con << "Common Options\n\n" | |
3010 | "These affect both the browsing window and reports.\n" | |
3011 | "\ne. keep target/extension/file type: " << bRepKeepExt << | |
3012 | "\nn. IP number instead of null user: " << bLookupIP << | |
3013 | "\na. use alias file to map IPs to names: " << bAliases << | |
3014 | "\nw. width of user name field: eg 8 (for names) " | |
3015 | "or 15 (for IPs): " << iUserNameLen << | |
3016 | "\nq. quit this menu\n\n" | |
3017 | "Your choice: "; | |
3018 | iKey = getch(); | |
3019 | con << "\n\n"; | |
3020 | switch (iKey) | |
3021 | { | |
3022 | case 'q': | |
3023 | return; | |
3024 | ||
3025 | case 'e': | |
3026 | bRepKeepExt = !bRepKeepExt; | |
3027 | break; | |
3028 | ||
3029 | case 'n': | |
3030 | bLookupIP = !bLookupIP; | |
3031 | break; | |
3032 | ||
3033 | case 'a': | |
3034 | bAliases = !bAliases; | |
3035 | if (bAliases && vAliasList.empty()) | |
3036 | { | |
3037 | con << "Get a working aliases file first.\nPress a key. "; | |
3038 | getch(); | |
3039 | bAliases = false; | |
3040 | } | |
3041 | break; | |
3042 | ||
3043 | case 'w': | |
3044 | con << "New width: "; | |
3045 | GetText (sTemp); | |
3046 | iTemp = atoi (sTemp.c_str()); | |
3047 | if ((iTemp >= 1) && (iTemp <= 64)) | |
3048 | iUserNameLen = iTemp; | |
3049 | break; | |
3050 | ||
3051 | default: | |
3052 | con << "Bad option. Press a key. "; | |
3053 | getch(); | |
3054 | } | |
3055 | } | |
3056 | } | |
3057 | ||
3058 | ||
3059 | void MiscLogOptions() | |
3060 | { | |
3061 | int iKey = 0, iPause; | |
3062 | string sTemp, sFile, sFilter, sCheck, sTemp1, sTemp2, sUser, sDest; | |
3063 | bool bGood; | |
3064 | ||
3065 | for (;;) | |
3066 | { | |
3067 | MyCls(); | |
3068 | con << "Misc Log Options\n\n" | |
3069 | "Current report is: " << sCurrentReport << "\n" | |
3070 | "Current filtered report is: " << sRepFilter << "\n" | |
3071 | "Current email is: " << sCurrentEmail << "\n\n" | |
3072 | "Commands:\n\n" | |
3073 | "c. change current report\n" | |
3074 | "C. change filter report\n" | |
3075 | "l. list reports\n" | |
3076 | "d. delete the report\n" | |
3077 | "v. view current report with " << sViewer << "\n" | |
3078 | "V. view filtered report\n" | |
3079 | "f. filter the report for just one user\n" | |
3080 | "e. change current email\n" | |
3081 | "m. mail current report to current email with Pine\n" | |
3082 | "s. show built in log filenames\n" | |
3083 | "q. quit this menu\n\n" | |
3084 | "Your choice: "; | |
3085 | iKey = getch(); | |
3086 | con << "\n\n"; | |
3087 | iPause = 0; | |
3088 | sFile = sPathToFiles + "/" + sCurrentReport; | |
3089 | sFilter = sPathToFiles + "/" + sRepFilter; | |
3090 | switch (iKey) | |
3091 | { | |
3092 | case 'c': | |
3093 | con << "Enter new current report: "; | |
3094 | GetFileName (sTemp); | |
3095 | if (sTemp != "") | |
3096 | sCurrentReport = sTemp; | |
3097 | break; | |
3098 | ||
3099 | case 'C': | |
3100 | con << "Enter filtered report name: "; | |
3101 | GetFileName (sTemp); | |
3102 | if (sTemp != "") | |
3103 | sRepFilter = sTemp; | |
3104 | break; | |
3105 | ||
3106 | case 'l': | |
3107 | MyCls(); | |
3108 | sTemp = "cd " + sPathToFiles + " ; " + | |
3109 | "echo -e \"Current reports:-\n\" ; " + | |
3110 | "ls -l *" + sReportExt; | |
3111 | RunProgram (sTemp, 0); | |
3112 | iPause = 1; | |
3113 | break; | |
3114 | ||
3115 | case 'd': | |
3116 | if (sCurrentReport == "") | |
3117 | { | |
3118 | con << "No current report to delete.\n"; | |
3119 | iPause = 1; | |
3120 | break; | |
3121 | } | |
3122 | sTemp = "rm " + sFile; | |
3123 | RunProgram (sTemp, 0); | |
3124 | sCurrentReport = ""; | |
3125 | break; | |
3126 | ||
3127 | case 'v': | |
3128 | if (GetFileSize (sFile.c_str()) == 0) | |
3129 | { | |
3130 | con << "Empty file :(\n"; | |
3131 | iPause = 1; | |
3132 | } | |
3133 | else | |
3134 | { | |
3135 | sTemp = sViewer + " " + sFile; | |
3136 | RunProgram (sTemp, 1); | |
3137 | } | |
3138 | break; | |
3139 | ||
3140 | case 'V': | |
3141 | if (GetFileSize (sFilter.c_str()) == 0) | |
3142 | { | |
3143 | con << "Empty file :(\n"; | |
3144 | iPause = 1; | |
3145 | } | |
3146 | else | |
3147 | { | |
3148 | sTemp = sViewer + " " + sFilter; | |
3149 | RunProgram (sTemp, 1); | |
3150 | } | |
3151 | break; | |
3152 | ||
3153 | case 'f': | |
3154 | if (GetFileSize (sFile.c_str()) == 0) | |
3155 | { | |
3156 | con << "No or empty file :(\n"; | |
3157 | iPause = 1; | |
3158 | break; | |
3159 | } | |
3160 | ||
3161 | MyCls(); | |
3162 | con << "Filter a report leaving one user.\n\nEnter new report name: "; | |
3163 | GetFileName (sDest, &bGood); | |
3164 | if (!bGood) | |
3165 | break; | |
3166 | con << "\n"; | |
3167 | ||
3168 | if (sDest == sCurrentReport) | |
3169 | { | |
3170 | con << "Destination report must be different to source.\n\n"; | |
3171 | iPause = 1; | |
3172 | break; | |
3173 | } | |
3174 | ||
3175 | if (iRepFocus == user) | |
3176 | sTemp1 = sRepFocus; | |
3177 | else | |
3178 | sTemp1 = ""; | |
3179 | GetLine (iLinePos); | |
3180 | if (NullText (pcReqBuff)) | |
3181 | sTemp2 = ""; | |
3182 | else | |
3183 | sTemp2 = GetUserName (pcReqBuff, false); | |
3184 | ||
3185 | con << "Filter report for:-\n\n" | |
3186 | "1. focus user " << sTemp1 << "\n" | |
3187 | "2. current user " << sTemp2 << "\n" | |
3188 | "3. specify a different user\n\n" | |
3189 | "Your choice: "; | |
3190 | iKey = getch(); | |
3191 | con << "\n\n"; | |
3192 | sUser = ""; | |
3193 | switch (iKey) | |
3194 | { | |
3195 | case '1': | |
3196 | sUser = sTemp1; | |
3197 | break; | |
3198 | ||
3199 | case '2': | |
3200 | sUser = sTemp2; | |
3201 | break; | |
3202 | ||
3203 | case '3': | |
3204 | con << "Enter user name: "; | |
3205 | GetText (sUser); | |
3206 | con << "\n"; | |
3207 | StrLwr (sUser); | |
3208 | break; | |
3209 | } | |
3210 | if (sUser != "") | |
3211 | { | |
3212 | con << "Working... "; | |
3213 | sStatusMessage = ""; | |
3214 | bGood = FilterReport (sCurrentReport, sDest, sUser); | |
3215 | if (bGood) | |
3216 | { | |
3217 | sRepFilter = sDest; | |
3218 | con << "\n\nReport " + sDest + " made: view?"; | |
3219 | if (getch() == 'y') | |
3220 | { | |
3221 | sTemp = sViewer + " " + sPathToFiles + "/" + sDest; | |
3222 | RunProgram (sTemp, 1); | |
3223 | } | |
3224 | } | |
3225 | else | |
3226 | { | |
3227 | con << "\n\nEmpty report " << sDest << ":\n" | |
3228 | << sStatusMessage << "\n"; | |
3229 | iPause = 1; | |
3230 | } | |
3231 | sStatusMessage = ""; | |
3232 | } | |
3233 | break; | |
3234 | ||
3235 | case 'e': | |
3236 | con << "Enter new email address: "; | |
3237 | GetText (sTemp); | |
3238 | if (sTemp != "") | |
3239 | { | |
3240 | sCheck = CheckEmail (sTemp); | |
3241 | if (sCheck != "") | |
3242 | { | |
3243 | con << "\nSorry, no illegal characters.\n"; | |
3244 | iPause = 1; | |
3245 | } | |
3246 | else | |
3247 | sCurrentEmail = sTemp; | |
3248 | } | |
3249 | break; | |
3250 | ||
3251 | case 'm': | |
3252 | if (GetFileSize (sFile) == 0) | |
3253 | { | |
3254 | con << "Empty file :(\n"; | |
3255 | iPause = 1; | |
3256 | break; | |
3257 | } | |
3258 | if (sCurrentEmail == "") | |
3259 | { | |
3260 | con << "No email address.\n"; | |
3261 | iPause = 1; | |
3262 | break; | |
3263 | } | |
3264 | con << "You are about to send the report using the\n" | |
3265 | "email program Pine. Press <ctrl>-x in Pine to\n" | |
3266 | "send it.\n" | |
3267 | "\n" | |
3268 | "Press any key to begin"; | |
3269 | getch(); | |
3270 | sTemp = "pine -attach " + sFile + " " + sCurrentEmail; | |
3271 | RunProgram (sTemp, 1); | |
3272 | break; | |
3273 | ||
3274 | case 's': | |
3275 | MyCls(); | |
3276 | con << "Log files:\n\n" | |
3277 | << szLabel1 << " -> " << sLogFile1 << "\n" | |
3278 | << szLabel2 << " -> " << sLogFile2 << "\n" | |
3279 | << szLabel3 << " -> " << sLogFile3 << "\n" | |
3280 | << "\nTo adjust these do this:\n\n" | |
3281 | << "cd ~/.squidview\n" | |
3282 | << "rm log1\n" | |
3283 | << "ln -s /var/whatever/access.log log1\n"; | |
3284 | iPause = 1; | |
3285 | break; | |
3286 | ||
3287 | case 'q': | |
3288 | return; | |
3289 | } | |
3290 | if (iPause) | |
3291 | { | |
3292 | con << "\nPress any key."; | |
3293 | getch(); | |
3294 | system ("clear"); | |
3295 | } | |
3296 | } | |
3297 | } | |
3298 | ||
3299 | ||
3300 | // put some text at the end of a string (overwrite) | |
3301 | void ShowMsg (string& sLine, const string& sMsg) | |
3302 | { | |
3303 | int iLLen, iMLen; | |
3304 | ||
3305 | iLLen = sLine.length(); | |
3306 | iMLen = sMsg.length(); | |
3307 | if (iMLen > iLLen) | |
3308 | return; | |
3309 | sLine.replace (iLLen - iMLen, iMLen, ""); | |
3310 | sLine += sMsg; | |
3311 | } | |
3312 | ||
3313 | ||
3314 | // go to a certain point in the log file | |
3315 | void GotoPercentage() | |
3316 | { | |
3317 | string sText; | |
3318 | double dPercent; | |
3319 | ||
3320 | PromptForText ("Goto percentage: ", sText); | |
3321 | if (sText != "") | |
3322 | { | |
3323 | dPercent = strtod (sText.c_str(), 0); | |
3324 | if ((dPercent >= 0) && (dPercent <= 100)) | |
3325 | CentreScreen (GetLine (tFilePos (iLastLinePos * dPercent / 100))); | |
3326 | } | |
3327 | } | |
3328 | ||
3329 | ||
3330 | // next position ahead in log | |
3331 | inline tFilePos ForwardNextLeap (tFilePos iStart, tFilePos iInc) | |
3332 | { | |
3333 | tFilePos iNext, iMiddle; | |
3334 | ||
3335 | if (iStart >= iLastLinePos) | |
3336 | return -1; | |
3337 | ||
3338 | iNext = iStart + iInc; | |
3339 | if (iNext >= iLastLinePos) | |
3340 | return iLastLinePos; | |
3341 | ||
3342 | iMiddle = GetPrevLine (iNext); | |
3343 | if (iMiddle <= iStart) | |
3344 | { | |
3345 | iMiddle = GetLine (iStart); | |
3346 | if ((iMiddle == 0) || (iMiddle >= iLastLinePos)) | |
3347 | return -1; | |
3348 | } | |
3349 | return iMiddle; | |
3350 | } | |
3351 | ||
3352 | ||
3353 | // next position backwards in log | |
3354 | inline tFilePos BackwardNextLeap (tFilePos iStart, tFilePos iInc) | |
3355 | { | |
3356 | tFilePos iNext, iMiddle; | |
3357 | ||
3358 | if (iStart <= 0) | |
3359 | return -1; | |
3360 | ||
3361 | iNext = iStart - iInc; | |
3362 | if (iNext <= 0) | |
3363 | return 0; | |
3364 | ||
3365 | iMiddle = GetPrevLine (iNext); | |
3366 | if (iMiddle <= 0) | |
3367 | iMiddle = 0; | |
3368 | ||
3369 | return iMiddle; | |
3370 | } | |
3371 | ||
3372 | ||
3373 | // seconds of highlighted line | |
3374 | time_t CalcCurrentSecs() | |
3375 | { | |
3376 | string sBuff; | |
3377 | time_t tSecs; | |
3378 | ||
3379 | GetLine (iLinePos); | |
3380 | if (NullText (pcReqBuff)) | |
3381 | return 0; | |
3382 | ||
3383 | tSecs = GetTimeNumber (pcReqBuff); | |
3384 | return tSecs; | |
3385 | } | |
3386 | ||
3387 | ||
3388 | // this is necessary to get around daylight savings issues | |
3389 | time_t Get4am (time_t tSecs) | |
3390 | { | |
3391 | struct tm* tmTable; | |
3392 | ||
3393 | tmTable = localtime (&tSecs); | |
3394 | tmTable->tm_sec = 0; | |
3395 | tmTable->tm_min = 0; | |
3396 | tmTable->tm_hour = 4; | |
3397 | return mktime (tmTable); | |
3398 | } | |
3399 | ||
3400 | ||
3401 | // nuke minutes and hours of a day | |
3402 | time_t Get12am (time_t tSecs) | |
3403 | { | |
3404 | struct tm* tmTable; | |
3405 | ||
3406 | tmTable = localtime (&tSecs); | |
3407 | tmTable->tm_sec = 0; | |
3408 | tmTable->tm_min = 0; | |
3409 | tmTable->tm_hour = 0; | |
3410 | return mktime (tmTable); | |
3411 | } | |
3412 | ||
3413 | ||
3414 | // return day of month | |
3415 | inline int CalcDayFromSecs (time_t tSecs) | |
3416 | { | |
3417 | struct tm* tmTable; | |
3418 | ||
3419 | if (tSecs == 0) | |
3420 | return 0; | |
3421 | ||
3422 | tmTable = localtime (&tSecs); | |
3423 | return tmTable->tm_mday; | |
3424 | } | |
3425 | ||
3426 | ||
3427 | // having the above and lower bounds in log, zoom in | |
3428 | void SequenceJump (tFilePos iBelow, tFilePos iAbove, time_t iSecs) | |
3429 | { | |
3430 | tFilePos iNext; | |
3431 | ||
3432 | ShowHighLightMessage ("Sequencing..."); | |
3433 | ||
3434 | for (;;) | |
3435 | { | |
3436 | iNext = GetLine (iBelow); | |
3437 | if (GetTimeNumber (pcReqBuff) >= iSecs) | |
3438 | { | |
3439 | CentreScreen (iBelow); | |
3440 | return; | |
3441 | } | |
3442 | if (iNext >= iAbove) | |
3443 | { | |
3444 | CentreScreen (iAbove); | |
3445 | return; | |
3446 | } | |
3447 | iBelow = iNext; | |
3448 | } | |
3449 | } | |
3450 | ||
3451 | ||
3452 | // split in two until time in range, then zoom | |
3453 | void SplitJump (time_t iSecs) | |
3454 | { | |
3455 | tFilePos iBelow, iAbove, iMiddle; | |
3456 | time_t iTry; | |
3457 | ||
3458 | iBelow = 0; | |
3459 | iAbove = iLastLinePos; | |
3460 | ||
3461 | ShowHighLightMessage ("Splitting pointer..."); | |
3462 | ||
3463 | for (;;) | |
3464 | { | |
3465 | if (iAbove <= iBelow) | |
3466 | { | |
3467 | CentreScreen (iBelow); | |
3468 | return; | |
3469 | } | |
3470 | if (iAbove - iBelow < 100000) | |
3471 | { | |
3472 | SequenceJump (iBelow, iAbove, iSecs); | |
3473 | return; | |
3474 | } | |
3475 | ||
3476 | iMiddle = (iBelow + iAbove) >> 1; | |
3477 | iMiddle = GetLine (iMiddle); | |
3478 | for (;;) | |
3479 | { | |
3480 | iMiddle = GetLine (iMiddle); | |
3481 | iTry = GetTimeNumber (pcReqBuff); | |
3482 | if (iTry != 0) | |
3483 | break; | |
3484 | if (iMiddle >= iAbove) | |
3485 | { | |
3486 | sStatusMessage = "Problem in jump :("; | |
3487 | return; | |
3488 | } | |
3489 | } | |
3490 | if (iTry < iSecs) | |
3491 | iBelow = iMiddle; | |
3492 | else | |
3493 | iAbove = iMiddle; | |
3494 | } | |
3495 | } | |
3496 | ||
3497 | ||
3498 | // move along to a certain day | |
3499 | void JumpToDayForward() | |
3500 | { | |
3501 | int iDay, iCount; | |
3502 | time_t tCReq; | |
3503 | string sBuffer; | |
3504 | ||
3505 | if (iLogFileSize == 0) | |
3506 | return; | |
3507 | ||
3508 | tCReq = CalcCurrentSecs(); | |
3509 | if (tCReq == 0) | |
3510 | { | |
3511 | sStatusMessage = "Bad day to start with."; | |
3512 | return; | |
3513 | } | |
3514 | ||
3515 | PromptForText ("Jump forward to day of month: ", sBuffer); | |
3516 | if (sBuffer == "") | |
3517 | return; | |
3518 | iDay = atoi (sBuffer.c_str()); | |
3519 | if ((iDay < 1) || (iDay > 31)) | |
3520 | return; | |
3521 | ||
3522 | ShowHighLightMessage ("Finding day..."); | |
3523 | ||
3524 | tCReq = Get4am (tCReq); | |
3525 | if (iDay == CalcDayFromSecs (tCReq)) | |
3526 | tCReq += nSecsInDay; | |
3527 | ||
3528 | iCount = 0; | |
3529 | for (;;) | |
3530 | { | |
3531 | if (CalcDayFromSecs (tCReq) == iDay) | |
3532 | break; | |
3533 | if (++iCount > 100) | |
3534 | { | |
3535 | sStatusMessage = "Couldn't find day"; | |
3536 | return; | |
3537 | } | |
3538 | tCReq += nSecsInDay; | |
3539 | } | |
3540 | ||
3541 | tCReq = Get12am (tCReq); | |
3542 | ||
3543 | SplitJump (tCReq); | |
3544 | return; | |
3545 | } | |
3546 | ||
3547 | ||
3548 | // move backward to a certain day | |
3549 | void JumpToDayBackward() | |
3550 | { | |
3551 | string sBuffer; | |
3552 | int iDay, iCount; | |
3553 | time_t tCReq; | |
3554 | ||
3555 | if (iLogFileSize == 0) | |
3556 | return; | |
3557 | ||
3558 | tCReq = CalcCurrentSecs(); | |
3559 | if (tCReq == 0) | |
3560 | { | |
3561 | sStatusMessage = "Bad day to start with."; | |
3562 | return; | |
3563 | } | |
3564 | ||
3565 | PromptForText ("Jump backward to day of month: ", sBuffer); | |
3566 | if (sBuffer == "") | |
3567 | return; | |
3568 | iDay = atoi (sBuffer.c_str()); | |
3569 | if ((iDay < 1) || (iDay > 31)) | |
3570 | return; | |
3571 | ||
3572 | ShowHighLightMessage ("Finding day..."); | |
3573 | ||
3574 | tCReq = Get4am (tCReq); | |
3575 | if (iDay == CalcDayFromSecs (tCReq)) | |
3576 | tCReq -= nSecsInDay; | |
3577 | ||
3578 | iCount = 0; | |
3579 | for (;;) | |
3580 | { | |
3581 | if (CalcDayFromSecs (tCReq) == iDay) | |
3582 | break; | |
3583 | if (++iCount > 100) | |
3584 | { | |
3585 | sStatusMessage = "Couldn't find day"; | |
3586 | return; | |
3587 | } | |
3588 | tCReq -= nSecsInDay; | |
3589 | } | |
3590 | ||
3591 | tCReq = Get12am (tCReq); | |
3592 | ||
3593 | SplitJump (tCReq); | |
3594 | return; | |
3595 | } | |
3596 | ||
3597 | ||
3598 | void ChangeLog (int iNewLog) | |
3599 | { | |
3600 | string sTemp; | |
3601 | ||
3602 | switch (iNewLog) | |
3603 | { | |
3604 | case 1: | |
3605 | pszCurrentLog = sLogFile1.c_str(); | |
3606 | pszCurrentName = szLabel1; | |
3607 | iCurrentLog = iNewLog; | |
3608 | break; | |
3609 | ||
3610 | case 2: | |
3611 | pszCurrentLog = sLogFile2.c_str(); | |
3612 | pszCurrentName = szLabel2; | |
3613 | iCurrentLog = iNewLog; | |
3614 | break; | |
3615 | ||
3616 | case 3: | |
3617 | pszCurrentLog = sLogFile3.c_str(); | |
3618 | pszCurrentName = szLabel3; | |
3619 | iCurrentLog = iNewLog; | |
3620 | break; | |
3621 | } | |
3622 | ||
3623 | if (iNewLog >= 1) | |
3624 | aTally.ZeroAll(); | |
3625 | ||
3626 | CalcLastPage(); | |
3627 | iRepStart = 0; | |
3628 | iRepEnd = 0; | |
3629 | if (iMonitorMode) | |
3630 | { | |
3631 | iPagePos = iLastPage; | |
3632 | iLinesDown = iMaxLinesDown; | |
3633 | } | |
3634 | else | |
3635 | { | |
3636 | iPagePos = 0; | |
3637 | iLinesDown = 0; | |
3638 | } | |
3639 | ||
3640 | GetLine (0); | |
3641 | GetColumn (pcReqBuff, 3, sTemp); | |
3642 | if ((sTemp == "") || (sTemp [0] < 'A')) | |
3643 | { | |
3644 | iUserCol = nUserCol_a; | |
3645 | iIPCol = nIPCol_a; | |
3646 | } | |
3647 | else | |
3648 | { | |
3649 | iUserCol = nUserCol_b; | |
3650 | iIPCol = nIPCol_b; | |
3651 | } | |
3652 | } | |
3653 | ||
3654 | ||
3655 | void ViewSelectedLine (tFilePos iLogPos) | |
3656 | { | |
3657 | string sUserName, sLongName; | |
3658 | int iKey = 0; | |
3659 | bool bLegal; | |
3660 | ||
3661 | MyCls(); | |
3662 | GetLine (iLogPos); | |
3663 | if (NullText (pcReqBuff)) | |
3664 | { | |
3665 | con << "Line not available.\n"; | |
3666 | bLegal = false; | |
3667 | } | |
3668 | else | |
3669 | bLegal = true; | |
3670 | ||
3671 | if (bLegal) | |
3672 | { | |
3673 | con << pcReqBuff << "\n\n" | |
3674 | << "Request size = " << ItoCommas (GetRequestSize (pcReqBuff)) | |
3675 | << "\n\nLooking for user..."; | |
3676 | sUserName = GetUserName (pcReqBuff, false); | |
3677 | sLongName = GetLongUserName (sUserName); | |
3678 | if (sLongName == "") | |
3679 | con << "not found.\n"; | |
3680 | else | |
3681 | con << "\n\n" << sUserName << " is " << sLongName << "\n"; | |
3682 | } | |
3683 | ||
3684 | con << "\nPress q:"; | |
3685 | refresh(); | |
3686 | ||
3687 | while (iKey != 'q') | |
3688 | iKey = getch(); | |
3689 | ||
3690 | MyCls(); | |
3691 | } | |
3692 | ||
3693 | ||
3694 | int CheckUpdate() | |
3695 | { | |
3696 | static int iScreenVal = -1; | |
3697 | int iTemp; | |
3698 | int ReCalc; | |
3699 | ||
3700 | ReCalc = 0; | |
3701 | iTemp = (COLS * 65536) + LINES; | |
3702 | if (iScreenVal != iTemp) | |
3703 | { | |
3704 | erase(); | |
3705 | iScreenVal = iTemp; | |
3706 | iMainLines = LINES - 1; | |
3707 | ReCalc = 2; | |
3708 | } | |
3709 | if (GetFileSize (pszCurrentLog) != iLogFileSize) | |
3710 | ReCalc++; | |
3711 | if (ReCalc) | |
3712 | { | |
3713 | CalcLastPage(); | |
3714 | if (ReCalc >= 2) | |
3715 | { | |
3716 | ChangeLog (-1); | |
3717 | return 1; | |
3718 | } | |
3719 | } | |
3720 | return 0; | |
3721 | } | |
3722 | ||
3723 | ||
3724 | class SettingsIO | |
3725 | { | |
3726 | public: | |
3727 | SettingsIO(); | |
3728 | void Save(); | |
3729 | void Load(); | |
3730 | ||
3731 | private: | |
3732 | FILE* fIO; | |
3733 | bool bSave; | |
3734 | string sLoadName, sLoadValue; | |
3735 | bool bError; | |
3736 | ||
3737 | void Write (string sText); | |
3738 | void IOsetting (string sName, string sValue); | |
3739 | void IObool (char*, bool&); | |
3740 | void IOint (char*, int&); | |
3741 | void IOfloat (char*, float&); | |
3742 | void IOstring (char*, string&); | |
3743 | void EachOne(); | |
3744 | }; | |
3745 | ||
3746 | ||
3747 | SettingsIO::SettingsIO() | |
3748 | { | |
3749 | sSetFileName = "squidview.conf"; | |
3750 | } | |
3751 | ||
3752 | ||
3753 | void SettingsIO::Save() | |
3754 | { | |
3755 | bSave = true; | |
3756 | bError = false; | |
3757 | fIO = fopen (sSetFileName.c_str(), "w"); | |
3758 | if (fIO == 0) | |
3759 | { | |
3760 | sStatusMessage = string ("Could not write to ") + sSetFileName; | |
3761 | return; | |
3762 | } | |
3763 | Write ("# this complete file is reset on every clean exit\n"); | |
3764 | EachOne(); | |
3765 | fclose (fIO); | |
3766 | } | |
3767 | ||
3768 | ||
3769 | void SettingsIO::Load() | |
3770 | { | |
3771 | int iFile, iRead, iLetter, iCount, iLength; | |
3772 | char cLetter; | |
3773 | bool bGotEquals; | |
3774 | string sLine; | |
3775 | ||
3776 | bSave = false; | |
3777 | bError = false; | |
3778 | ||
3779 | iFile = open (sSetFileName.c_str(), O_RDONLY); | |
3780 | if (iFile <= 0) | |
3781 | { | |
3782 | sStatusMessage = string ("Could not read ") + sSetFileName; | |
3783 | return; | |
3784 | } | |
3785 | ||
3786 | sLine = ""; | |
3787 | iRead = 1; | |
3788 | while (iRead == 1) | |
3789 | { | |
3790 | iLetter = 0; | |
3791 | iRead = read (iFile, &iLetter, 1); | |
3792 | if (iRead == 1) | |
3793 | { | |
3794 | if ((iLetter == cEOL) || (iLetter == cCR)) | |
3795 | { | |
3796 | iLength = sLine.length(); | |
3797 | if ((iLength > 0) && (sLine [0] != '#')) | |
3798 | { | |
3799 | sLoadName = ""; | |
3800 | sLoadValue = ""; | |
3801 | bGotEquals = false; | |
3802 | for (iCount = 0; iCount < iLength; iCount++) | |
3803 | { | |
3804 | cLetter = sLine [iCount]; | |
3805 | if (bGotEquals) | |
3806 | sLoadValue += cLetter; | |
3807 | else | |
3808 | if (cLetter == '=') | |
3809 | bGotEquals = true; | |
3810 | else | |
3811 | sLoadName += cLetter; | |
3812 | } | |
3813 | EachOne(); | |
3814 | } | |
3815 | sLine = ""; | |
3816 | } | |
3817 | else | |
3818 | sLine += char (iLetter); | |
3819 | } | |
3820 | } | |
3821 | close (iFile); | |
3822 | } | |
3823 | ||
3824 | ||
3825 | void SettingsIO::Write (string sText) | |
3826 | { | |
3827 | int iTemp; | |
3828 | ||
3829 | if (bError) | |
3830 | return; | |
3831 | ||
3832 | iTemp = sText.length(); | |
3833 | if (int (fwrite (sText.c_str(), 1, iTemp, fIO)) == iTemp) | |
3834 | return; | |
3835 | sStatusMessage = string ("Could not append to ") + sSetFileName; | |
3836 | bError = true; | |
3837 | } | |
3838 | ||
3839 | ||
3840 | ||
3841 | void SettingsIO::IOsetting (string sName, string sValue) | |
3842 | { | |
3843 | if (bError) | |
3844 | return; | |
3845 | ||
3846 | if (bSave) | |
3847 | Write (sName + "=" + sValue + "\n"); | |
3848 | } | |
3849 | ||
3850 | ||
3851 | void SettingsIO::IObool (char* szText, bool& bVariable) | |
3852 | { | |
3853 | string sTemp; | |
3854 | ||
3855 | if (bSave) | |
3856 | { | |
3857 | sTemp = bVariable == true ? "yes" : "no"; | |
3858 | IOsetting (szText, sTemp); | |
3859 | } | |
3860 | else | |
3861 | if (sLoadName == szText) | |
3862 | bVariable = sLoadValue == "yes" ? true: false; | |
3863 | } | |
3864 | ||
3865 | ||
3866 | void SettingsIO::IOint (char* szText, int& iVariable) | |
3867 | { | |
3868 | if (bSave) | |
3869 | IOsetting (szText, ItoS (iVariable)); | |
3870 | else | |
3871 | if (sLoadName == szText) | |
3872 | iVariable = atoi (sLoadValue.c_str()); | |
3873 | } | |
3874 | ||
3875 | ||
3876 | void SettingsIO::IOfloat (char* szText, float& fVariable) | |
3877 | { | |
3878 | char szTemp [32]; | |
3879 | ||
3880 | if (bSave) | |
3881 | { | |
3882 | snprintf (szTemp, sizeof (szTemp), "%f", fVariable); | |
3883 | IOsetting (szText, szTemp); | |
3884 | } | |
3885 | else | |
3886 | if (sLoadName == szText) | |
3887 | fVariable = atof (sLoadValue.c_str()); | |
3888 | } | |
3889 | ||
3890 | ||
3891 | void SettingsIO::IOstring (char* szText, string& sVariable) | |
3892 | { | |
3893 | if (bSave) | |
3894 | IOsetting (szText, sVariable); | |
3895 | else | |
3896 | if (sLoadName == szText) | |
3897 | sVariable = sLoadValue; | |
3898 | } | |
3899 | ||
3900 | ||
3901 | /// store these variables in config file | |
3902 | void SettingsIO::EachOne() | |
3903 | { | |
3904 | IOstring ("sRepFileName", sRepFileName); | |
3905 | IOstring ("sRepFilter", sRepFilter); | |
3906 | IOstring ("sRepTitle", sRepTitle); | |
3907 | IObool ("bRepKeepExt", bRepKeepExt); | |
3908 | IOint ("iRepColumns", iRepColumns); | |
3909 | IObool ("bRepSplit", bRepSplit); | |
3910 | IObool ("bRepShowSize", bRepShowSize); | |
3911 | IObool ("bRepCacheReport", bRepCacheReport); | |
3912 | IOstring ("sRepSeperator", sRepSeperator); | |
3913 | IOint ("iRepCSVcols", iRepCSVcols); | |
3914 | IOint ("iRepWordHits", iRepWordHits); | |
3915 | IOint ("iRepBUT", iRepBUT); | |
3916 | IOint ("iRepBDT", iRepBDT); | |
3917 | IOint ("iRepBDI", iRepBDI); | |
3918 | IOint ("iRepFocus", iRepFocus); | |
3919 | IOstring ("sRepFocus", sRepFocus); | |
3920 | IOstring ("sRepBDTuser", sRepBDTuser); | |
3921 | IOstring ("sViewer", sViewer); | |
3922 | IOstring ("sCurrentReport", sCurrentReport); | |
3923 | IOstring ("sCurrentEmail", sCurrentEmail); | |
3924 | IOint ("iSizeHitGrade", iSizeHitGrade); | |
3925 | IOint ("iSizeHitBytes", iSizeHitBytes); | |
3926 | IOstring ("sSizeHits", sSizeHits); | |
3927 | IOint ("iCurrentLog", iCurrentLog); | |
3928 | IOint ("iMonitorMode", iMonitorMode); | |
3929 | IObool ("bLookupIP", bLookupIP); | |
3930 | IObool ("bAliases", bAliases); | |
3931 | IOint ("iUserNameLen", iUserNameLen); | |
3932 | IOint ("iRepFast", iRepFast); | |
3933 | IObool ("bRepMySort", bRepMySort); | |
3934 | ||
3935 | IOint ("iTallyHP", aTally.iHistoryPeriod); | |
3936 | IOfloat ("iTallyFade", aTally.fFadeFactor); | |
3937 | IOfloat ("iTallyEntry", aTally.fEntryFactor); | |
3938 | IObool ("iTallyMonitor", aTally.bUsersMonitorMode); | |
3939 | IObool ("iTallyDenies", aTally.bAcceptDenies); | |
3940 | } | |
3941 | ||
3942 | ||
3943 | void ViewHowTo() | |
3944 | { | |
3945 | if (GetFileSize (sHowToLink) <= 0) | |
3946 | { | |
3947 | MyCls(); | |
3948 | con << "I can't find the howto for this program.\n\n" | |
3949 | << "There should be this link:\n\n" | |
3950 | << sHowToLink << "\n\n" | |
3951 | << "pointing to:\n\n" | |
3952 | << SHAREDIR << "/" << szHowToFile << "\n\n" | |
3953 | << "You can set the correct link manually.\n" | |
3954 | << "Press q:"; | |
3955 | for (;;) | |
3956 | { | |
3957 | if (getch() == 'q') | |
3958 | return; | |
3959 | } | |
3960 | } | |
3961 | else | |
3962 | RunProgram (sViewer + " " + sHowToLink, 1); | |
3963 | } | |
3964 | ||
3965 | ||
3966 | int WaitKeyOrLog (tFilePos iLastSize) | |
3967 | { | |
3968 | fd_set fdsInput; | |
3969 | struct timeval tvTimeOut; | |
3970 | int iTemp; | |
3971 | ||
3972 | for (;;) | |
3973 | { | |
3974 | FD_ZERO (&fdsInput); | |
3975 | FD_SET (0, &fdsInput); | |
3976 | tvTimeOut.tv_sec = 3; | |
3977 | tvTimeOut.tv_usec = 0; | |
3978 | iTemp = select (1, &fdsInput, 0, 0, &tvTimeOut); | |
3979 | if (iTemp) | |
3980 | return getch(); | |
3981 | else | |
3982 | if (GetFileSize (pszCurrentLog) != iLastSize) | |
3983 | return 0; | |
3984 | } | |
3985 | } | |
3986 | ||
3987 | ||
3988 | string CalcIdle (time_t iLastTime) | |
3989 | { | |
3990 | int iTime; | |
3991 | ||
3992 | iTime = time (0) - iLastTime; | |
3993 | if (iTime < 0) | |
3994 | return "!"; | |
3995 | if (iTime < 60) | |
3996 | return ItoS (iTime) + "s"; | |
3997 | ||
3998 | iTime = iTime / 60; | |
3999 | if (iTime < 60) | |
4000 | return ItoS (iTime) + "m"; | |
4001 | ||
4002 | iTime = iTime / 60; | |
4003 | if (iTime < 60) | |
4004 | return ItoS (iTime) + "h"; | |
4005 | ||
4006 | iTime = iTime / 24; | |
4007 | return ItoS (iTime) + "d"; | |
4008 | } | |
4009 | ||
4010 | ||
4011 | time_t TimeLapse (time_t iInstant = 0) | |
4012 | { | |
4013 | if (iInstant == 0) | |
4014 | return time (0); | |
4015 | else | |
4016 | return time (0) - iInstant; | |
4017 | } | |
4018 | ||
4019 | ||
4020 | bool EnterUserHistory (const string& sLoginName) | |
4021 | { | |
4022 | cUserHistory aUH; | |
4023 | ||
4024 | return aUH.Run (sLoginName); | |
4025 | } | |
4026 | ||
4027 | ||
4028 | bool cUserHistory::Run (const string& sLoginName) | |
4029 | { | |
4030 | sUser = sLoginName; | |
4031 | iScreenStart = iSelectedRow = 0; | |
4032 | MyCls(); | |
4033 | CalcScreen(); | |
4034 | iNorthMark = -1; | |
4035 | iSouthMark = iSouthMarkEnd = iOneUserFileSize; | |
4036 | AddHistory(); | |
4037 | return Browse(); | |
4038 | } | |
4039 | ||
4040 | ||
4041 | void cUserHistory::CalcScreen() | |
4042 | { | |
4043 | tFilePos iCurrent; | |
4044 | ||
4045 | iCurrent = GetFileSize (pszCurrentLog); | |
4046 | if (iCurrent < iOneUserFileSize) | |
4047 | ZeroAll(); | |
4048 | else | |
4049 | iLogFileSize = iOneUserFileSize = iCurrent; | |
4050 | iScreenHeight = LINES - 2; | |
4051 | iTotalRows = vRequests.size(); | |
4052 | iSelectedAddress = iScreenStart + iSelectedRow; | |
4053 | iLastScreenRow = iTotalRows - iScreenHeight; | |
4054 | if (iLastScreenRow < 0) | |
4055 | iLastScreenRow = 0; | |
4056 | } | |
4057 | ||
4058 | ||
4059 | void cUserHistory::ZeroAll() | |
4060 | { | |
4061 | while (!vRequests.empty()) | |
4062 | vRequests.pop_back(); | |
4063 | iScreenStart = iSelectedRow = 0; | |
4064 | iNorthMark = 0; | |
4065 | iSouthMark = iSouthMarkEnd = 0; | |
4066 | iLogFileSize = iOneUserFileSize = 0; | |
4067 | } | |
4068 | ||
4069 | ||
4070 | bool cUserHistory::Browse() | |
4071 | { | |
4072 | int iKey; | |
4073 | string sTemp; | |
4074 | ||
4075 | for (;;) | |
4076 | { | |
4077 | CalcScreen(); | |
4078 | DisplayHistory(); | |
4079 | refresh(); | |
4080 | iKey = WaitKeyOrLog (iOneUserFileSize); | |
4081 | CalcScreen(); | |
4082 | ||
4083 | switch (iKey) | |
4084 | { | |
4085 | case KEY_UP: | |
4086 | case '8': | |
4087 | if (iSelectedRow > 0) | |
4088 | iSelectedRow--; | |
4089 | else | |
4090 | { | |
4091 | if (iScreenStart > 0) | |
4092 | iScreenStart--; | |
4093 | else | |
4094 | AddHistoryNorth(); | |
4095 | } | |
4096 | break; | |
4097 | ||
4098 | case KEY_DOWN: | |
4099 | case '2': | |
4100 | if (iSelectedRow < iScreenHeight - 1) | |
4101 | { | |
4102 | if (iSelectedAddress < iTotalRows - 1) | |
4103 | iSelectedRow++; | |
4104 | else | |
4105 | { | |
4106 | if (AddHistorySouth() > 0) | |
4107 | { | |
4108 | if (vRequests.size() == 1) | |
4109 | iSelectedRow = 0; | |
4110 | else | |
4111 | iSelectedRow++; | |
4112 | } | |
4113 | } | |
4114 | } | |
4115 | else | |
4116 | { | |
4117 | if (iScreenStart < iLastScreenRow) | |
4118 | iScreenStart++; | |
4119 | else | |
4120 | { | |
4121 | if (AddHistorySouth() > 0) | |
4122 | iScreenStart++; | |
4123 | } | |
4124 | } | |
4125 | break; | |
4126 | ||
4127 | case KEY_PPAGE: | |
4128 | case '9': | |
4129 | if (iScreenStart == 0) | |
4130 | iSelectedRow = 0; | |
4131 | else | |
4132 | { | |
4133 | iScreenStart = iScreenStart - iScreenHeight; | |
4134 | if (iScreenStart < 0) | |
4135 | iScreenStart = 0; | |
4136 | } | |
4137 | break; | |
4138 | ||
4139 | case KEY_NPAGE: | |
4140 | case '3': | |
4141 | if (iScreenStart >= iLastScreenRow) | |
4142 | { | |
4143 | iScreenStart = iLastScreenRow; | |
4144 | iSelectedRow = iScreenHeight - 1; | |
4145 | if (iSelectedRow > iTotalRows - 1) | |
4146 | iSelectedRow = iTotalRows - 1; | |
4147 | } | |
4148 | else | |
4149 | { | |
4150 | iScreenStart += iScreenHeight; | |
4151 | if (iScreenStart > iLastScreenRow) | |
4152 | iScreenStart = iLastScreenRow; | |
4153 | } | |
4154 | break; | |
4155 | ||
4156 | case KEY_HOME: | |
4157 | case '7': | |
4158 | iScreenStart = iSelectedRow = 0; | |
4159 | break; | |
4160 | ||
4161 | case KEY_END: | |
4162 | case '1': | |
4163 | iScreenStart = iLastScreenRow; | |
4164 | if (iTotalRows < iScreenHeight) | |
4165 | iSelectedRow = iTotalRows - 1; | |
4166 | else | |
4167 | iSelectedRow = iScreenHeight - 1; | |
4168 | if (iSelectedRow < 0) | |
4169 | iSelectedRow = 0; | |
4170 | break; | |
4171 | ||
4172 | case 'v': | |
4173 | if (iSelectedAddress < iTotalRows) | |
4174 | ViewSelectedLine (vRequests [iSelectedAddress]); | |
4175 | break; | |
4176 | ||
4177 | case 'u': | |
4178 | PromptForText ("Switch to user: ", sTemp); | |
4179 | if (sTemp != "") | |
4180 | { | |
4181 | MyCls(); | |
4182 | sUser = sTemp; | |
4183 | ZeroAll(); | |
4184 | } | |
4185 | break; | |
4186 | ||
4187 | case 'Z': | |
4188 | ZeroAll(); | |
4189 | break; | |
4190 | ||
4191 | case 'h': | |
4192 | DisplayHelp(); | |
4193 | break; | |
4194 | ||
4195 | case 'r': | |
4196 | ViewHowTo(); | |
4197 | break; | |
4198 | ||
4199 | case 'q': | |
4200 | return false; | |
4201 | ||
4202 | case 24: // ctrl-x | |
4203 | return true; | |
4204 | } | |
4205 | } | |
4206 | } | |
4207 | ||
4208 | ||
4209 | void cUserHistory::AddHistory() | |
4210 | { | |
4211 | int iCount; | |
4212 | time_t iInstant; | |
4213 | ||
4214 | CalcScreen(); | |
4215 | iCount = 0; | |
4216 | iInstant = TimeLapse (0); | |
4217 | ||
4218 | for (;;) | |
4219 | { | |
4220 | if (AddHistoryNorth() == 0) | |
4221 | break; | |
4222 | if (++iCount >= iScreenHeight) | |
4223 | break; | |
4224 | if (TimeLapse (iInstant) >= 2) | |
4225 | break; | |
4226 | } | |
4227 | ||
4228 | CalcScreen(); | |
4229 | } | |
4230 | ||
4231 | ||
4232 | int cUserHistory::AddHistoryNorth() | |
4233 | { | |
4234 | tFilePos iCurrentPos; | |
4235 | string sComment; | |
4236 | int iCount, iReturn, iSize; | |
4237 | bool bFound; | |
4238 | ||
4239 | if (iNorthMark == 0) | |
4240 | return 0; | |
4241 | ||
4242 | if (iNorthMark > 0) | |
4243 | iCurrentPos = iNorthMark; | |
4244 | else | |
4245 | { | |
4246 | if (vRequests.size() == 0) | |
4247 | iCurrentPos = iOneUserFileSize; | |
4248 | else | |
4249 | iCurrentPos = vRequests [0]; | |
4250 | } | |
4251 | ||
4252 | sComment = "History of " + sUser; | |
4253 | iCount = 0; | |
4254 | GoForNoDelay(); | |
4255 | bFound = false; | |
4256 | ||
4257 | for (;;) | |
4258 | { | |
4259 | iNorthMark = GetPrevLine (iCurrentPos); | |
4260 | if (iNorthMark == 0) | |
4261 | { | |
4262 | iReturn = 0; | |
4263 | break; | |
4264 | } | |
4265 | ||
4266 | if (!NullText (pcReqBuff)) | |
4267 | if (GetUserName (pcReqBuff, false) == sUser) | |
4268 | { | |
4269 | bFound = true; | |
4270 | break; | |
4271 | } | |
4272 | ||
4273 | if (++iCount > nMaxNorth) | |
4274 | { | |
4275 | iReturn = -1; | |
4276 | break; | |
4277 | } | |
4278 | ||
4279 | if (CheckInterrupt()) | |
4280 | { | |
4281 | // bUsersMonitorMode = false; | |
4282 | iReturn = -2; | |
4283 | break; | |
4284 | } | |
4285 | if (CheckTicker()) | |
4286 | { | |
4287 | UpdateTicker (sComment.c_str(), iNorthMark, iOneUserFileSize); | |
4288 | } | |
4289 | ||
4290 | iCurrentPos = iNorthMark; | |
4291 | } | |
4292 | ||
4293 | if (wTemp) | |
4294 | nodelay (wTemp, false); | |
4295 | ||
4296 | if (!bFound) | |
4297 | return iReturn; | |
4298 | ||
4299 | iSize = int (vRequests.size()); | |
4300 | if (iSize < nMaxRows) | |
4301 | vRequests.push_back (iNorthMark); | |
4302 | else | |
4303 | { | |
4304 | iSouthMark = vRequests [iSize - 2]; | |
4305 | iSouthMarkEnd = vRequests [iSize - 1]; | |
4306 | } | |
4307 | for (iCount = vRequests.size() - 1; iCount > 0; iCount--) | |
4308 | vRequests [iCount] = vRequests [iCount - 1]; | |
4309 | vRequests [0] = iNorthMark; | |
4310 | return 1; | |
4311 | } | |
4312 | ||
4313 | ||
4314 | int cUserHistory::AddHistorySouth() | |
4315 | { | |
4316 | tFilePos iCurrentPos, iNextPos; | |
4317 | string sComment; | |
4318 | int iCount, iReturn, iSize; | |
4319 | bool bFound; | |
4320 | ||
4321 | if (iSouthMarkEnd >= iOneUserFileSize) | |
4322 | return 0; | |
4323 | ||
4324 | iCurrentPos = iSouthMarkEnd; | |
4325 | ||
4326 | sComment = "History of " + sUser; | |
4327 | iCount = 0; | |
4328 | GoForNoDelay(); | |
4329 | bFound = false; | |
4330 | ||
4331 | for (;;) | |
4332 | { | |
4333 | iNextPos = GetLine (iCurrentPos); | |
4334 | if (iNextPos <= iCurrentPos) | |
4335 | { | |
4336 | iReturn = 0; | |
4337 | iNextPos = iCurrentPos; | |
4338 | break; | |
4339 | } | |
4340 | ||
4341 | if (!NullText (pcReqBuff)) | |
4342 | if (GetUserName (pcReqBuff, false) == sUser) | |
4343 | { | |
4344 | bFound = true; | |
4345 | break; | |
4346 | } | |
4347 | ||
4348 | if (++iCount > nMaxSouth) | |
4349 | { | |
4350 | iReturn = -1; | |
4351 | break; | |
4352 | } | |
4353 | ||
4354 | if (CheckInterrupt()) | |
4355 | { | |
4356 | // bUsersMonitorMode = false; | |
4357 | iReturn = -2; | |
4358 | break; | |
4359 | } | |
4360 | if (CheckTicker()) | |
4361 | { | |
4362 | UpdateTicker (sComment.c_str(), iNextPos, iOneUserFileSize); | |
4363 | } | |
4364 | ||
4365 | iCurrentPos = iNextPos; | |
4366 | } | |
4367 | ||
4368 | if (wTemp) | |
4369 | nodelay (wTemp, false); | |
4370 | ||
4371 | iSouthMarkEnd = iNextPos; | |
4372 | ||
4373 | if (!bFound) | |
4374 | return iReturn; | |
4375 | ||
4376 | iSouthMark = iCurrentPos; | |
4377 | iSize = int (vRequests.size()); | |
4378 | if (iSize < nMaxRows) | |
4379 | { | |
4380 | vRequests.push_back (iSouthMark); | |
4381 | return 1; | |
4382 | } | |
4383 | else | |
4384 | { | |
4385 | for (iCount = 0; iCount < iSize - 1; iCount++) | |
4386 | vRequests [iCount] = vRequests [iCount + 1]; | |
4387 | vRequests [iSize - 1] = iSouthMark; | |
4388 | iNorthMark = vRequests [0]; | |
4389 | return 0; | |
4390 | } | |
4391 | } | |
4392 | ||
4393 | ||
4394 | void cUserHistory::DisplayHistory() | |
4395 | { | |
4396 | int iScreenY, iCount, iRow, iColumns; | |
4397 | string sLine, sFlags, sTarget, sTemp; | |
4398 | bool bInverse; | |
4399 | time_t iTime; | |
4400 | ||
4401 | iColumns = COLS - 1; | |
4402 | sLine = "One user history: " + sUser; | |
4403 | Columnize (sLine, iColumns); | |
4404 | move (0, 0); | |
4405 | attron (A_REVERSE); | |
4406 | con << sLine; | |
4407 | ||
4408 | iRow = iScreenStart; | |
4409 | iScreenY = 1; | |
4410 | iTime = 0; | |
4411 | ||
4412 | for (iCount = 0; iCount < iScreenHeight; iCount++) | |
4413 | { | |
4414 | sLine = ""; | |
4415 | bInverse = false; | |
4416 | if (iRow < iTotalRows) | |
4417 | { | |
4418 | if (GetLine (vRequests [iRow]) > vRequests [iRow]) | |
4419 | { | |
4420 | GetRequestFlags (pcReqBuff, sFlags); | |
4421 | GetColumn (pcReqBuff, nTargetCol, sTarget); | |
4422 | RemoveSlashes (sTarget); | |
4423 | sLine = sFlags + " " + sTarget; | |
4424 | KeepExtension (sLine, iColumns); | |
4425 | if (iRow == iSelectedAddress) | |
4426 | { | |
4427 | iTime = GetTimeNumber (pcReqBuff); | |
4428 | bInverse = true; | |
4429 | } | |
4430 | } | |
4431 | } | |
4432 | Columnize (sLine, iColumns); | |
4433 | move (iScreenY, 0); | |
4434 | if (bInverse) | |
4435 | attron (A_REVERSE); | |
4436 | else | |
4437 | attroff (A_REVERSE); | |
4438 | con << sLine; | |
4439 | iScreenY++; | |
4440 | iRow++; | |
4441 | } | |
4442 | ||
4443 | CalcPercentage (iNorthMark, iOneUserFileSize, sTemp); | |
4444 | NoLeadingSpaces (sTemp); | |
4445 | sLine = "(" + sTemp; | |
4446 | CalcPercentage (iSouthMarkEnd, iOneUserFileSize, sTemp); | |
4447 | NoLeadingSpaces (sTemp); | |
4448 | sLine += " to " + sTemp; | |
4449 | CalcPercentage (iSelectedAddress, iTotalRows == 0 ? 0 : iTotalRows - 1, sTemp); | |
4450 | NoLeadingSpaces (sTemp); | |
4451 | sLine += ") " + sTemp; | |
4452 | ||
4453 | if (iTime > 0) | |
4454 | { | |
4455 | CalcTime (iTime, sTemp); | |
4456 | RemoveSeconds (sTemp); | |
4457 | sLine += " " + sTemp; | |
4458 | } | |
4459 | ||
4460 | Columnize (sLine, iColumns); | |
4461 | ShowMsg (sLine, " | h = help"); | |
4462 | move (iScreenY, 0); | |
4463 | attron (A_REVERSE); | |
4464 | con << sLine; | |
4465 | } | |
4466 | ||
4467 | ||
4468 | ||
4469 | void cUserHistory::DisplayHelp() | |
4470 | { | |
4471 | erase(); | |
4472 | move (0, 0); | |
4473 | attroff (A_REVERSE); | |
4474 | con << "One User's History help\n\n" | |
4475 | "v. view line\n" | |
4476 | "u. zero and switch to new user\n" | |
4477 | "Z. zero (wipe) history\n" | |
4478 | "r. read howto\n" | |
4479 | "q. quit this mode\n" | |
4480 | "ctrl-x: quit squidview\n" | |
4481 | "\nPress any key or r: "; | |
4482 | if (getch() == 'r') | |
4483 | ViewHowTo(); | |
4484 | } | |
4485 | ||
4486 | ||
4487 | cUsersMode::cUsersMode() | |
4488 | { | |
4489 | iSortMode = nSortN; | |
4490 | iLastAdjustTime = iNextAdjustTime = 0; | |
4491 | iHistoryPeriod = 3600; | |
4492 | fFadeFactor = 0.75; | |
4493 | fEntryFactor = 1.0; | |
4494 | iScreenMode = nPoints; | |
4495 | iScreenStart = iSelectedRow = 0; | |
4496 | iCurrentLogPos = 0; | |
4497 | bUsersMonitorMode = true; | |
4498 | bAcceptDenies = true; | |
4499 | } | |
4500 | ||
4501 | ||
4502 | bool cUsersMode::Enter() | |
4503 | { | |
4504 | string sTemp; | |
4505 | int iKey; | |
4506 | ||
4507 | MyCls(); | |
4508 | if (iCurrentLogPos == 0) | |
4509 | { | |
4510 | CalcPercentage (iLinePos, iLastLinePos, sTemp); | |
4511 | NoLeadingSpaces (sTemp); | |
4512 | con << "All Users' Tally Mode\n\nCurrent position is " | |
4513 | << PosToTime (iRepStart) | |
4514 | << " (" << sTemp << ")\n\nPress enter to begin from here.\n\n" | |
4515 | << "Note this might take a while."; | |
4516 | iKey = getch(); | |
4517 | if ((iKey == cEOL) || (iKey == cCR)) | |
4518 | AddData (iLinePos, iLastLinePos + 1); | |
4519 | else | |
4520 | return false; | |
4521 | MyCls(); | |
4522 | } | |
4523 | return Browse(); | |
4524 | } | |
4525 | ||
4526 | ||
4527 | /// | |
4528 | bool cUsersMode::Browse() | |
4529 | { | |
4530 | int iKey, iMode; | |
4531 | string sLine, sTemp; | |
4532 | ||
4533 | for (;;) | |
4534 | { | |
4535 | CalcScreen(); | |
4536 | ||
4537 | switch (iScreenMode) | |
4538 | { | |
4539 | case nPoints: | |
4540 | DisplayPoints(); | |
4541 | break; | |
4542 | ||
4543 | case nFullNames: | |
4544 | DisplayFullNames(); | |
4545 | break; | |
4546 | ||
4547 | case nGreatest: | |
4548 | DisplayGreatestURLs(); | |
4549 | break; | |
4550 | ||
4551 | case nLast: | |
4552 | DisplayLastURLs(); | |
4553 | break; | |
4554 | ||
4555 | default: | |
4556 | break; | |
4557 | } | |
4558 | ||
4559 | CalcPercentage (iSelectedAddress, iTotalRows - 1, sLine); | |
4560 | sLine += string (" ") + SortMode(); | |
4561 | Columnize (sLine, COLS - 1); | |
4562 | sTemp = bAcceptDenies == false ? "-d " : ""; | |
4563 | sTemp += bUsersMonitorMode ? "mon ": ""; | |
4564 | sTemp += "| h = help"; | |
4565 | ShowMsg (sLine, sTemp); | |
4566 | ShowHighLightMessage (sLine); | |
4567 | ||
4568 | if (bUsersMonitorMode) | |
4569 | iKey = WaitKeyOrLog (iUsersFileSize); | |
4570 | else | |
4571 | while ((iKey = getch()) == 0) {} | |
4572 | ||
4573 | CalcScreen(); | |
4574 | rUserHistory& rUH = vHistory [iSelectedAddress]; | |
4575 | ||
4576 | switch (iKey) | |
4577 | { | |
4578 | case 0: | |
4579 | AddData (iCurrentLogPos, iUsersFileSize); | |
4580 | break; | |
4581 | ||
4582 | case KEY_UP: | |
4583 | case '8': | |
4584 | if (iSelectedRow > 0) | |
4585 | iSelectedRow--; | |
4586 | else | |
4587 | if (iScreenStart > 0) | |
4588 | iScreenStart--; | |
4589 | break; | |
4590 | ||
4591 | case KEY_DOWN: | |
4592 | case '2': | |
4593 | if (iSelectedRow < iScreenHeight - 1) | |
4594 | { | |
4595 | if (iSelectedAddress < iTotalRows - 1) | |
4596 | iSelectedRow++; | |
4597 | } | |
4598 | else | |
4599 | if (iScreenStart < iLastScreenRow) | |
4600 | iScreenStart++; | |
4601 | break; | |
4602 | ||
4603 | case KEY_PPAGE: | |
4604 | case '9': | |
4605 | if (iScreenStart == 0) | |
4606 | iSelectedRow = 0; | |
4607 | else | |
4608 | { | |
4609 | iScreenStart = iScreenStart - iScreenHeight; | |
4610 | if (iScreenStart < 0) | |
4611 | iScreenStart = 0; | |
4612 | } | |
4613 | break; | |
4614 | ||
4615 | case KEY_NPAGE: | |
4616 | case '3': | |
4617 | if (iScreenStart >= iLastScreenRow) | |
4618 | { | |
4619 | iScreenStart = iLastScreenRow; | |
4620 | iSelectedRow = iScreenHeight - 1; | |
4621 | } | |
4622 | else | |
4623 | { | |
4624 | iScreenStart += iScreenHeight; | |
4625 | if (iScreenStart > iLastScreenRow) | |
4626 | iScreenStart = iLastScreenRow; | |
4627 | } | |
4628 | break; | |
4629 | ||
4630 | case KEY_HOME: | |
4631 | case '7': | |
4632 | iScreenStart = iSelectedRow = 0; | |
4633 | break; | |
4634 | ||
4635 | case KEY_END: | |
4636 | case '1': | |
4637 | iScreenStart = iLastScreenRow; | |
4638 | iSelectedRow = iScreenHeight - 1; | |
4639 | break; | |
4640 | ||
4641 | case 'v': | |
4642 | iMode = int (iScreenMode); | |
4643 | if (++iMode >= int (nSMend)) | |
4644 | iMode = 0; | |
4645 | iScreenMode = eSM (iMode); | |
4646 | break; | |
4647 | ||
4648 | case 's': | |
4649 | SortMenu(); | |
4650 | break; | |
4651 | ||
4652 | case 'O': | |
4653 | sTemp = vHistory [iSelectedAddress].sUser; | |
4654 | if (EnterUserHistory (sTemp)) | |
4655 | return true; | |
4656 | break; | |
4657 | ||
4658 | case 'h': | |
4659 | DisplayHelp(); | |
4660 | break; | |
4661 | ||
4662 | case 'r': | |
4663 | ViewHowTo(); | |
4664 | break; | |
4665 | ||
4666 | case 'm': | |
4667 | bUsersMonitorMode = !bUsersMonitorMode; | |
4668 | break; | |
4669 | ||
4670 | case 'd': | |
4671 | bAcceptDenies = !bAcceptDenies; | |
4672 | break; | |
4673 | ||
4674 | case 'z': | |
4675 | rUH.iPoints = rUH.iBytes = rUH.iRequests = rUH.iURLsize = 0; | |
4676 | // leave rUH.iLastTime alone | |
4677 | rUH.iGreatestURL = rUH.iLastURL = -1; | |
4678 | break; | |
4679 | ||
4680 | case 'Z': | |
4681 | ZeroAll(); | |
4682 | break; | |
4683 | ||
4684 | case 'q': | |
4685 | return false; | |
4686 | ||
4687 | case 24: // ctrl-x | |
4688 | return true; | |
4689 | } | |
4690 | } | |
4691 | } | |
4692 | ||
4693 | ||
4694 | void cUsersMode::DisplayPoints() | |
4695 | { | |
4696 | string sTemp; | |
4697 | int iIndex, iLine, iCount; | |
4698 | ||
4699 | erase(); | |
4700 | move (0, 0); | |
4701 | attron (A_REVERSE); | |
4702 | sTemp = "User"; | |
4703 | Columnize (sTemp, iUserNameLen); | |
4704 | con << sTemp << " "; | |
4705 | ||
4706 | DisplayHeading ("Points"); | |
4707 | DisplayHeading ("Bytes"); | |
4708 | DisplayHeading ("Requests"); | |
4709 | DisplayHeading ("URL size"); | |
4710 | DisplayHeading ("Idle"); | |
4711 | ||
4712 | iLine = 1; | |
4713 | iIndex = iScreenStart; | |
4714 | iCount = 0; | |
4715 | ||
4716 | for (;;) | |
4717 | { | |
4718 | if ((iIndex >= iTotalRows) || (iCount >= iScreenHeight)) | |
4719 | break; | |
4720 | move (iLine, 0); | |
4721 | if (iCount == iSelectedRow) | |
4722 | attron (A_REVERSE); | |
4723 | else | |
4724 | attroff (A_REVERSE); | |
4725 | rUserHistory& rEntry = vHistory [iIndex]; | |
4726 | con << LookupUser (rEntry) << " "; | |
4727 | DisplayData (rEntry.iPoints); | |
4728 | DisplayData (rEntry.iBytes); | |
4729 | DisplayData (rEntry.iRequests); | |
4730 | DisplayData (rEntry.iURLsize); | |
4731 | DisplayHeading (CalcIdle (rEntry.iLastTime)); | |
4732 | iIndex++; | |
4733 | iLine++; | |
4734 | iCount++; | |
4735 | } | |
4736 | } | |
4737 | ||
4738 | ||
4739 | void cUsersMode::DisplayFullNames() | |
4740 | { | |
4741 | string sLine; | |
4742 | int iIndex, iLine, iCount, iNameLength; | |
4743 | ||
4744 | erase(); | |
4745 | move (0, 0); | |
4746 | attron (A_REVERSE); | |
4747 | con << "Full Names"; | |
4748 | ||
4749 | iIndex = iScreenStart; | |
4750 | iLine = 1; | |
4751 | iCount = 0; | |
4752 | iNameLength = iUserNameLen; | |
4753 | if (iNameLength < 15) | |
4754 | iNameLength = 15; | |
4755 | ||
4756 | for (;;) | |
4757 | { | |
4758 | if ((iIndex >= iTotalRows) || (iCount >= iScreenHeight)) | |
4759 | break; | |
4760 | rUserHistory& rEntry = vHistory [iIndex]; | |
4761 | sLine = rEntry.sUser; | |
4762 | Columnize (sLine, iNameLength); | |
4763 | sLine = sLine + " " + rEntry.sFullName; | |
4764 | Columnize (sLine, COLS - 1); | |
4765 | move (iLine, 0); | |
4766 | if (iCount == iSelectedRow) | |
4767 | attron (A_REVERSE); | |
4768 | else | |
4769 | attroff (A_REVERSE); | |
4770 | con << sLine; | |
4771 | iIndex++; | |
4772 | iLine++; | |
4773 | iCount++; | |
4774 | } | |
4775 | } | |
4776 | ||
4777 | ||
4778 | void cUsersMode::DisplayGreatestURLs() | |
4779 | { | |
4780 | string sLine, sSize, sTemp; | |
4781 | int iColumns, iIndex, iLine, iCount; | |
4782 | ||
4783 | erase(); | |
4784 | move (0, 0); | |
4785 | attron (A_REVERSE); | |
4786 | con << "Greatest Hits"; | |
4787 | ||
4788 | iColumns = COLS; | |
4789 | iIndex = iScreenStart; | |
4790 | iLine = 1; | |
4791 | iCount = 0; | |
4792 | ||
4793 | for (;;) | |
4794 | { | |
4795 | if ((iIndex >= iTotalRows) || (iCount >= iScreenHeight)) | |
4796 | break; | |
4797 | rUserHistory& rEntry = vHistory [iIndex]; | |
4798 | sLine = LookupUser (rEntry); | |
4799 | sSize = ItoCommas (rEntry.iURLsize); | |
4800 | sTemp = ""; | |
4801 | Columnize (sTemp, nSizeCols); | |
4802 | ShowMsg (sTemp, sSize); | |
4803 | sLine = sLine + " " + sTemp; | |
4804 | if (GetLine (rEntry.iGreatestURL) > rEntry.iGreatestURL) | |
4805 | { | |
4806 | GetColumn (pcReqBuff, nTargetCol, sTemp); | |
4807 | RemoveSlashes (sTemp); | |
4808 | sLine += " " + sTemp; | |
4809 | } | |
4810 | KeepExtension (sLine, iColumns - 1); | |
4811 | Columnize (sLine, iColumns - 1); | |
4812 | move (iLine, 0); | |
4813 | if (iCount == iSelectedRow) | |
4814 | attron (A_REVERSE); | |
4815 | else | |
4816 | attroff (A_REVERSE); | |
4817 | con << sLine; | |
4818 | iIndex++; | |
4819 | iLine++; | |
4820 | iCount++; | |
4821 | } | |
4822 | } | |
4823 | ||
4824 | ||
4825 | void cUsersMode::DisplayLastURLs() | |
4826 | { | |
4827 | string sLine, sSize, sTemp; | |
4828 | int iColumns, iIndex, iLine, iCount; | |
4829 | ||
4830 | erase(); | |
4831 | move (0, 0); | |
4832 | attron (A_REVERSE); | |
4833 | con << "Last visited sites"; | |
4834 | ||
4835 | iColumns = COLS; | |
4836 | iIndex = iScreenStart; | |
4837 | iLine = 1; | |
4838 | iCount = 0; | |
4839 | ||
4840 | for (;;) | |
4841 | { | |
4842 | if ((iIndex >= iTotalRows) || (iCount >= iScreenHeight)) | |
4843 | break; | |
4844 | rUserHistory& rEntry = vHistory [iIndex]; | |
4845 | sLine = LookupUser (rEntry); | |
4846 | if (GetLine (rEntry.iLastURL) > rEntry.iLastURL) | |
4847 | { | |
4848 | GetColumn (pcReqBuff, nTargetCol, sTemp); | |
4849 | RemoveSlashes (sTemp); | |
4850 | sLine += " " + sTemp; | |
4851 | } | |
4852 | KeepExtension (sLine, iColumns - 1); | |
4853 | Columnize (sLine, iColumns - 1); | |
4854 | move (iLine, 0); | |
4855 | if (iCount == iSelectedRow) | |
4856 | attron (A_REVERSE); | |
4857 | else | |
4858 | attroff (A_REVERSE); | |
4859 | con << sLine; | |
4860 | iIndex++; | |
4861 | iLine++; | |
4862 | iCount++; | |
4863 | } | |
4864 | } | |
4865 | ||
4866 | ||
4867 | void cUsersMode::DisplayHeading (const string& sHeading) | |
4868 | { | |
4869 | string sTemp = ""; | |
4870 | ||
4871 | Columnize (sTemp, nSizeCols); | |
4872 | ShowMsg (sTemp, sHeading); | |
4873 | con << sTemp << " "; | |
4874 | } | |
4875 | ||
4876 | ||
4877 | void cUsersMode::DisplayData (int iData) | |
4878 | { | |
4879 | string sTemp, sData; | |
4880 | ||
4881 | sTemp = ""; | |
4882 | sData = ItoCommas (iData); | |
4883 | Columnize (sTemp, nSizeCols); | |
4884 | ShowMsg (sTemp, sData); | |
4885 | con << sTemp << " "; | |
4886 | } | |
4887 | ||
4888 | ||
4889 | void cUsersMode::DisplayHelp() | |
4890 | { | |
4891 | erase(); | |
4892 | move (0, 0); | |
4893 | attroff (A_REVERSE); | |
4894 | con << "All Users' Tally help\n\n" | |
4895 | "v. toggle {requests,user name,greatest hits,last site}" | |
4896 | " view mode\n" | |
4897 | "m. toggle monitor mode\n" | |
4898 | "d. toggle accept denies\n" | |
4899 | "s. sort menu\n" | |
4900 | "O. one user mode\n" | |
4901 | "z. zero this user\'s stats\n" | |
4902 | "Z. zero (wipe) tally\n" | |
4903 | "r. read howto\n" | |
4904 | "q. quit users mode\n" | |
4905 | "ctrl-x: quit squidview\n" | |
4906 | "\nPress any key or r: "; | |
4907 | if (getch() == 'r') | |
4908 | ViewHowTo(); | |
4909 | } | |
4910 | ||
4911 | ||
4912 | void cUsersMode::CalcScreen() | |
4913 | { | |
4914 | tFilePos iCurrent; | |
4915 | ||
4916 | iCurrent = GetFileSize (pszCurrentLog); | |
4917 | if (iCurrent < iUsersFileSize) | |
4918 | ZeroAll(); | |
4919 | iUsersFileSize = iCurrent; | |
4920 | iSelectedAddress = iScreenStart + iSelectedRow; | |
4921 | iScreenHeight = LINES - 2; | |
4922 | if (iScreenHeight > iTotalRows) | |
4923 | iScreenHeight = iTotalRows; | |
4924 | iLastScreenRow = iTotalRows - iScreenHeight; | |
4925 | if (iLastScreenRow < 0) | |
4926 | iLastScreenRow = 0; | |
4927 | FindFullNames(); | |
4928 | } | |
4929 | ||
4930 | ||
4931 | string cUsersMode::LookupUser (const rUserHistory& aUser) | |
4932 | { | |
4933 | string sTemp; | |
4934 | ||
4935 | sTemp = aUser.sUser; | |
4936 | if (int (sTemp.length()) > iUserNameLen) | |
4937 | sTemp = ChopOffNetwork (sTemp, iUserNameLen); | |
4938 | Columnize (sTemp, iUserNameLen); | |
4939 | return sTemp; | |
4940 | } | |
4941 | ||
4942 | ||
4943 | void cUsersMode::AddData (tFilePos iFrom, tFilePos iTo) | |
4944 | { | |
4945 | tFilePos iCurrent, iTempPos; | |
4946 | int iCount, iRequestSize, iThisEntry, iTemp; | |
4947 | time_t iTime; | |
4948 | string sUserName; | |
4949 | rUserHistory aEntry; | |
4950 | char cRequestFlag; | |
4951 | eSort iOriginalSort; | |
4952 | ||
4953 | iCurrent = iFrom; | |
4954 | iOriginalSort = iSortMode; | |
4955 | if (iOriginalSort == nSortN) | |
4956 | iOriginalSort = nSortP; | |
4957 | iSortMode = nSortR; | |
4958 | ||
4959 | CheckUpdate(); | |
4960 | GoForNoDelay(); | |
4961 | ||
4962 | for (;;) | |
4963 | { | |
4964 | if (iCurrent >= iTo) | |
4965 | break; | |
4966 | iTempPos = GetLine (iCurrent); | |
4967 | if ((iTempPos == 0) || (iTempPos == iCurrent)) | |
4968 | break; | |
4969 | ||
4970 | if (!NullText (pcReqBuff)) | |
4971 | { | |
4972 | iRequestSize = GetRequestSize (pcReqBuff); | |
4973 | sUserName = GetUserName (pcReqBuff, false); | |
4974 | ||
4975 | if (bAcceptDenies) | |
4976 | cRequestFlag = ' '; | |
4977 | else | |
4978 | GetRequestCacheHit (pcReqBuff, cRequestFlag, iTemp); | |
4979 | ||
4980 | if ((sUserName != "") && (cRequestFlag != 'd')) | |
4981 | { | |
4982 | iThisEntry = -1; | |
4983 | for (iCount = vHistory.size() - 1; iCount >= 0; iCount--) | |
4984 | { | |
4985 | if (sUserName == vHistory [iCount].sUser) | |
4986 | { | |
4987 | iThisEntry = iCount; | |
4988 | break; | |
4989 | } | |
4990 | } | |
4991 | if (iThisEntry == -1) | |
4992 | { | |
4993 | aEntry.Zero(); | |
4994 | aEntry.sUser = sUserName; | |
4995 | vHistory.push_back (aEntry); | |
4996 | iThisEntry = vHistory.size() - 1; | |
4997 | } | |
4998 | ||
4999 | iTime = GetTimeNumber (pcReqBuff); | |
5000 | if (iTime >= iNextAdjustTime) | |
5001 | { | |
5002 | if (iNextAdjustTime == 0) | |
5003 | { | |
5004 | iLastAdjustTime = CalcAeon (iTime); | |
5005 | iNextAdjustTime = iLastAdjustTime + iHistoryPeriod; | |
5006 | } | |
5007 | else | |
5008 | AgeData (iTime); | |
5009 | } | |
5010 | ||
5011 | rUserHistory& aIndex = vHistory [iThisEntry]; | |
5012 | aIndex.iBytes += iRequestSize; | |
5013 | aIndex.iRequests++; | |
5014 | if (iRequestSize > aIndex.iURLsize) | |
5015 | { | |
5016 | aIndex.iURLsize = iRequestSize; | |
5017 | aIndex.iGreatestURL = iCurrent; | |
5018 | } | |
5019 | aIndex.iPoints += int (iRequestSize * fEntryFactor); | |
5020 | aIndex.iLastTime = iTime; | |
5021 | aIndex.iLastURL = iCurrent; | |
5022 | } | |
5023 | } | |
5024 | ||
5025 | iCurrentLogPos = iTempPos; | |
5026 | ||
5027 | if (CheckInterrupt()) | |
5028 | { | |
5029 | bUsersMonitorMode = false; | |
5030 | break; | |
5031 | } | |
5032 | if (CheckTicker()) | |
5033 | { | |
5034 | SortData(); | |
5035 | UpdateTicker ("Users mode gathering", iCurrent - iFrom, iTo - iFrom); | |
5036 | } | |
5037 | iCurrent = iTempPos; | |
5038 | } | |
5039 | ||
5040 | if (wTemp) | |
5041 | nodelay (wTemp, false); | |
5042 | ||
5043 | iTotalRows = vHistory.size(); | |
5044 | iSortMode = iOriginalSort; | |
5045 | SortData(); | |
5046 | } | |
5047 | ||
5048 | ||
5049 | void cUsersMode::SortData() | |
5050 | { | |
5051 | bool bDone, bSwitch; | |
5052 | int iIndex; | |
5053 | rUserHistory rUH; | |
5054 | ||
5055 | iSortFlag = 312; | |
5056 | ||
5057 | for (;;) | |
5058 | { | |
5059 | bDone = true; | |
5060 | for (iIndex = vHistory.size() - 2; iIndex >= 0; iIndex--) | |
5061 | { | |
5062 | bSwitch = false; | |
5063 | rUserHistory& rUHleft = vHistory [iIndex]; | |
5064 | rUserHistory& rUHright = vHistory [iIndex + 1]; | |
5065 | switch (iSortMode) | |
5066 | { | |
5067 | case nSortU: | |
5068 | if (rUHleft.sUser > rUHright.sUser) | |
5069 | bSwitch = true; | |
5070 | break; | |
5071 | ||
5072 | case nSortP: | |
5073 | if (rUHleft.iPoints < rUHright.iPoints) | |
5074 | bSwitch = true; | |
5075 | break; | |
5076 | ||
5077 | case nSortB: | |
5078 | if (rUHleft.iBytes < rUHright.iBytes) | |
5079 | bSwitch = true; | |
5080 | break; | |
5081 | ||
5082 | case nSortR: | |
5083 | if (rUHleft.iRequests < rUHright.iRequests) | |
5084 | bSwitch = true; | |
5085 | break; | |
5086 | ||
5087 | case nSortURL: | |
5088 | if (rUHleft.iURLsize < rUHright.iURLsize) | |
5089 | bSwitch = true; | |
5090 | break; | |
5091 | ||
5092 | case nSortI: | |
5093 | if (rUHleft.iLastTime < rUHright.iLastTime) | |
5094 | bSwitch = true; | |
5095 | break; | |
5096 | ||
5097 | case nSortN: | |
5098 | break; | |
5099 | } | |
5100 | if (bSwitch) | |
5101 | { | |
5102 | bDone = false; | |
5103 | rUH = rUHleft; | |
5104 | rUHleft = rUHright; | |
5105 | rUHright = rUH; | |
5106 | } | |
5107 | } | |
5108 | if (bDone) | |
5109 | { | |
5110 | iSortFlag = 0; | |
5111 | return; | |
5112 | } | |
5113 | } | |
5114 | } | |
5115 | ||
5116 | ||
5117 | char* cUsersMode::SortMode() | |
5118 | { | |
5119 | switch (iSortMode) | |
5120 | { | |
5121 | case nSortU: | |
5122 | return "user name"; | |
5123 | ||
5124 | case nSortP: | |
5125 | return "points"; | |
5126 | ||
5127 | case nSortB: | |
5128 | return "bytes"; | |
5129 | ||
5130 | case nSortR: | |
5131 | return "requests"; | |
5132 | ||
5133 | case nSortURL: | |
5134 | return "URL size"; | |
5135 | ||
5136 | case nSortI: | |
5137 | return "idle"; | |
5138 | ||
5139 | case nSortN: | |
5140 | default: | |
5141 | return "unsorted"; | |
5142 | } | |
5143 | } | |
5144 | ||
5145 | ||
5146 | void cUsersMode::FindFullNames() | |
5147 | { | |
5148 | int iFile, iIndex, iRead; | |
5149 | string sLine, sTemp; | |
5150 | char cLetter; | |
5151 | ||
5152 | static int iLastTotal = -1; | |
5153 | ||
5154 | if (iTotalRows == iLastTotal) | |
5155 | return; | |
5156 | iLastTotal = iTotalRows; | |
5157 | ||
5158 | iFile = open (sUsersFile.c_str(), O_RDONLY); | |
5159 | if (iFile > 0) | |
5160 | { | |
5161 | sLine = ""; | |
5162 | for (;;) | |
5163 | { | |
5164 | iRead = read (iFile, &cLetter, 1); | |
5165 | if (iRead < 1) | |
5166 | break; | |
5167 | if ((cLetter == cEOL) || (cLetter == cCR)) | |
5168 | { | |
5169 | if (sLine != "") | |
5170 | { | |
5171 | GetColumn (sLine.c_str(), 1, sTemp); | |
5172 | for (iIndex = 0; iIndex < iTotalRows; iIndex++) | |
5173 | { | |
5174 | rUserHistory& rEntry = vHistory [iIndex]; | |
5175 | if (sTemp == rEntry.sUser) | |
5176 | { | |
5177 | sLine.replace (0, sTemp.length() + 1, ""); | |
5178 | rEntry.sFullName = sLine; | |
5179 | break; | |
5180 | } | |
5181 | } | |
5182 | sLine = ""; | |
5183 | } | |
5184 | } | |
5185 | else | |
5186 | sLine += cLetter; | |
5187 | } | |
5188 | close (iFile); | |
5189 | } | |
5190 | } | |
5191 | ||
5192 | ||
5193 | void cUsersMode::SortMenu() | |
5194 | { | |
5195 | int iKey; | |
5196 | ||
5197 | erase(); | |
5198 | move (0, 0); | |
5199 | attroff (A_REVERSE); | |
5200 | con << "Current sort method is: " << SortMode() | |
5201 | << "\n\nChange to:\n\n" | |
5202 | "1. user name\n" | |
5203 | "2. points\n" | |
5204 | "3. bytes\n" | |
5205 | "4. requests\n" | |
5206 | "5. URL size\n" | |
5207 | "6. idle time\n" | |
5208 | "\nAny other key to dismiss"; | |
5209 | iKey = getch(); | |
5210 | if ((iKey >= '1') && (iKey <= '6')) | |
5211 | { | |
5212 | con << "\n\nSorting..."; | |
5213 | refresh(); | |
5214 | iSortMode = enum cUsersMode::eSort ((iKey - '1') + nSortU); | |
5215 | SortData(); | |
5216 | iScreenStart = iSelectedRow = 0; | |
5217 | } | |
5218 | } | |
5219 | ||
5220 | ||
5221 | void cUsersMode::AgeData (int iCurrentTime) | |
5222 | { | |
5223 | int iAge, iIndex, iTotal; | |
5224 | float fFactor; | |
5225 | ||
5226 | iAge = (CalcAeon (iCurrentTime) - iLastAdjustTime) / iHistoryPeriod; | |
5227 | fFactor = pow (fFadeFactor, iAge); | |
5228 | iTotal = vHistory.size(); | |
5229 | for (iIndex = 0; iIndex < iTotal; iIndex++) | |
5230 | vHistory [iIndex].iPoints = int (vHistory [iIndex].iPoints * fFactor); | |
5231 | iLastAdjustTime = CalcAeon (iCurrentTime); | |
5232 | iNextAdjustTime = iLastAdjustTime + iHistoryPeriod; | |
5233 | } | |
5234 | ||
5235 | ||
5236 | void cUsersMode::ZeroAll() | |
5237 | { | |
5238 | while (!vHistory.empty()) | |
5239 | vHistory.pop_back(); | |
5240 | iTotalRows = 0; | |
5241 | iScreenStart = iSelectedRow = 0; | |
5242 | iCurrentLogPos = 0; | |
5243 | } | |
5244 | ||
5245 | ||
5246 | // list of keystrokes | |
5247 | void Help() | |
5248 | { | |
5249 | MyCls(); | |
5250 | con << PACKAGE << " " << VERSION << ": (c) " << "2001-2003" | |
5251 | << " Graeme Sheppard - GPL software\n" | |
5252 | << "www.rillion.net/squidview\n\n" << | |
5253 | "Keystrokes:-\n\n" | |
5254 | "Up/Down/PgUp/PgDn: browse\n" | |
5255 | "Home/End/g/j/J: goto certain location in log\n" | |
5256 | "Left/Right: search up/down\n" | |
5257 | "1-9: numlock and keypad strokes if necessary\n" | |
5258 | "f/F: find text\n" | |
5259 | "o: find options\n" | |
5260 | "v: verbose listing of selected line\n" | |
5261 | "p/s/t: primary / secondary / tertiary log file\n" | |
5262 | "m: toggle monitor mode\n" | |
5263 | "l: log a report\n" | |
5264 | "n: misc. log functions\n" | |
5265 | "c: common options\n" | |
5266 | "T: all users' tally mode\n" | |
5267 | "O: one user history mode\n" | |
5268 | "r: read the squidview howto with " << sViewer << "\n" | |
5269 | "ctrl-x: quit\n" | |
5270 | "\nPress q to quit this screen, r to read the howto."; | |
5271 | refresh(); | |
5272 | ||
5273 | for (;;) | |
5274 | { | |
5275 | switch (getch()) | |
5276 | { | |
5277 | case 'r': | |
5278 | ViewHowTo(); | |
5279 | case 'q': | |
5280 | return; | |
5281 | } | |
5282 | } | |
5283 | } | |
5284 | ||
5285 | ||
5286 | // the routine to draw the screen | |
5287 | void DrawMain() | |
5288 | { | |
5289 | string sLine, sFlags, sTarget, sSelectedTime, sTemp; | |
5290 | int iCount; | |
5291 | tFilePos iThis, iNext; | |
5292 | time_t iTime; | |
5293 | ||
5294 | iLinePos = 0; | |
5295 | iThis = iPagePos; | |
5296 | sSelectedTime = ""; | |
5297 | ||
5298 | for (iCount = 0; iCount < iMainLines; iCount++) | |
5299 | { | |
5300 | move (iCount, 0); | |
5301 | iNext = GetLine (iThis); | |
5302 | if (iNext > iThis) | |
5303 | { | |
5304 | GetPaddedUserName (pcReqBuff, sLine); | |
5305 | GetRequestFlags (pcReqBuff, sFlags); | |
5306 | GetColumn (pcReqBuff, nTargetCol, sTarget); | |
5307 | RemoveSlashes (sTarget); | |
5308 | sLine += " " + sFlags + " " + sTarget; | |
5309 | KeepExtension (sLine, COLS - 1); | |
5310 | Columnize (sLine, COLS - 1); | |
5311 | if (iCount == iLinesDown) | |
5312 | { | |
5313 | attron (A_REVERSE); | |
5314 | iLinePos = iThis; | |
5315 | iTime = GetTimeNumber (pcReqBuff); | |
5316 | CalcTime (iTime, sSelectedTime); | |
5317 | RemoveSeconds (sSelectedTime); | |
5318 | } | |
5319 | else | |
5320 | attroff (A_REVERSE); | |
5321 | con << sLine; | |
5322 | iThis = iNext; | |
5323 | } | |
5324 | else | |
5325 | { | |
5326 | sLine = ""; | |
5327 | Columnize (sLine, COLS - 1); | |
5328 | attroff (A_REVERSE); | |
5329 | con << sLine; | |
5330 | } | |
5331 | } | |
5332 | ||
5333 | CalcPercentage (iLinePos, iLastLinePos, sLine); | |
5334 | sLine += " " + sSelectedTime; | |
5335 | Columnize (sLine, COLS - 1); | |
5336 | if (iMonitorMode) | |
5337 | sTemp = "Mon "; | |
5338 | else | |
5339 | sTemp = " "; | |
5340 | sTemp += string (pszCurrentName) + " | h = help"; | |
5341 | ShowMsg (sLine, sTemp); | |
5342 | ||
5343 | if (sStatusMessage != "") | |
5344 | { | |
5345 | ShowHighLightMessage (sStatusMessage); | |
5346 | sStatusMessage = ""; | |
5347 | } | |
5348 | else | |
5349 | ShowHighLightMessage (sLine); | |
5350 | ||
5351 | refresh(); | |
5352 | } | |
5353 | ||
5354 | ||
5355 | // finish up | |
5356 | static void FinishSig (int iSig) | |
5357 | { | |
5358 | endwin(); | |
5359 | // system ("clear"); | |
5360 | exit (iSig); | |
5361 | } | |
5362 | ||
5363 | ||
5364 | // darn STL? | |
5365 | static void SegFaultSig (int iSig) | |
5366 | { | |
5367 | endwin(); | |
5368 | system ("reset -Q ; clear"); | |
5369 | if (iSortFlag >= 1000) | |
5370 | printf ("Squidview: fault during STL sort()\n" | |
5371 | "code = %d\n" | |
5372 | "Try:\n" | |
5373 | " 1. increasing iRepFast or making it 0\n" | |
5374 | " 2. using my sort routine\n" | |
5375 | "Refer to the BUGS file.\n" | |
5376 | "Sorry.\n", | |
5377 | iSortFlag); | |
5378 | else | |
5379 | printf ("Squidview: general fault\n" | |
5380 | "code = %d\n" | |
5381 | "Refer to the BUGS file.\n" | |
5382 | "Sorry.\n", | |
5383 | iSortFlag); | |
5384 | exit (iSig); | |
5385 | } | |
5386 | ||
5387 | ||
5388 | // is this the first run? | |
5389 | // if so create .squidview directory and make links | |
5390 | void CreateLinks() | |
5391 | { | |
5392 | struct stat sStatTable; | |
5393 | char* szTemp; | |
5394 | int iTemp; | |
5395 | string sLog1, sLog2, sLog3, sHowToFile; | |
5396 | ||
5397 | szTemp = getenv ("HOME"); | |
5398 | if (szTemp == 0) | |
5399 | { | |
5400 | printf ("squidview: can't get your home directory, exiting\n"); | |
5401 | exit (1); | |
5402 | } | |
5403 | sHomeDir = szTemp; | |
5404 | sPathToFiles = sHomeDir + "/" + szSquidHome; | |
5405 | ||
5406 | sLogFile1 = sPathToFiles + "/" + szLog1; | |
5407 | sLogFile2 = sPathToFiles + "/" + szLog2; | |
5408 | sLogFile3 = sPathToFiles + "/" + szLog3; | |
5409 | sWordFile = sPathToFiles + "/" + szWordFile; | |
5410 | sUsersFile = sPathToFiles + "/" + szUsersFile; | |
5411 | sAliasesFile = sPathToFiles + "/" + szAliasesFile; | |
5412 | sSetFileName = sPathToFiles + "/squidview.conf"; | |
5413 | sHowToLink = sPathToFiles + "/" + szHowToFile; | |
5414 | sHowToFile = string (SHAREDIR) + "/" + szHowToFile; | |
5415 | ||
5416 | iTemp = stat (sPathToFiles.c_str(), &sStatTable); | |
5417 | if (iTemp == 0) | |
5418 | return; | |
5419 | ||
5420 | printf ("Making .squidview directory and links....\n"); | |
5421 | iTemp = 0; | |
5422 | for (;;) | |
5423 | { | |
5424 | if (mkdir (sPathToFiles.c_str(), 0755)) break; | |
5425 | if (symlink (szMainLog, sLogFile1.c_str())) break; | |
5426 | if (symlink (szLog1, sLogFile2.c_str())) break; | |
5427 | if (symlink (szLog1, sLogFile3.c_str())) break; | |
5428 | if (symlink (sHowToFile.c_str(), sHowToLink.c_str())) break; | |
5429 | iTemp = 1; | |
5430 | break; | |
5431 | } | |
5432 | if (iTemp == 0) | |
5433 | { | |
5434 | printf ("Error encounted.\n"); | |
5435 | exit (1); | |
5436 | } | |
5437 | if (GetFileSize (sLogFile1) <= 0) | |
5438 | { | |
5439 | printf ("The squid log file doesn't exist or is of zero size.\n"); | |
5440 | printf ("You may need to manually adjust the symlinks in .squidview\n"); | |
5441 | exit (1); | |
5442 | } | |
5443 | } | |
5444 | ||
5445 | ||
5446 | // main is also the main loop | |
5447 | int main (int, char*[]) | |
5448 | { | |
5449 | int iKey, iCount; | |
5450 | SettingsIO cSettings; | |
5451 | GenerateReport cReport; | |
5452 | string sTemp; | |
5453 | bool bExit; | |
5454 | ||
5455 | CreateLinks(); // better put this here | |
5456 | ||
5457 | signal (SIGINT, FinishSig); | |
5458 | signal (SIGSEGV, SegFaultSig); | |
5459 | initscr(); | |
5460 | keypad (stdscr, TRUE); | |
5461 | nonl(); | |
5462 | cbreak(); | |
5463 | noecho(); | |
5464 | curs_set (0); | |
5465 | ||
5466 | iLogFileSize = 0; | |
5467 | cSettings.Load(); | |
5468 | ChangeLog (iCurrentLog); | |
5469 | sStatusMessage = ""; | |
5470 | LoadWords(); | |
5471 | LoadAliases(); | |
5472 | ||
5473 | CheckUpdate(); | |
5474 | ||
5475 | for (;;) | |
5476 | { | |
5477 | if (wTemp) | |
5478 | nodelay (wTemp, false); | |
5479 | CheckUpdate(); | |
5480 | DrawMain(); | |
5481 | ||
5482 | if (iMonitorMode == 0) | |
5483 | { | |
5484 | while ((iKey = getch()) == 0) {} | |
5485 | } | |
5486 | else | |
5487 | { | |
5488 | iKey = WaitKeyOrLog (iLogFileSize); | |
5489 | if (iKey == 0) | |
5490 | iKey = KEY_END; | |
5491 | } | |
5492 | ||
5493 | CheckUpdate(); | |
5494 | bExit = false; | |
5495 | ||
5496 | switch (iKey) | |
5497 | { | |
5498 | case KEY_UP: | |
5499 | case '8': | |
5500 | if (iLinesDown > 0) | |
5501 | iLinesDown--; | |
5502 | else | |
5503 | iPagePos = GetPrevLine (iPagePos); | |
5504 | break; | |
5505 | ||
5506 | case KEY_DOWN: | |
5507 | case '2': | |
5508 | if (iLinesDown < iMaxLinesDown) | |
5509 | iLinesDown++; | |
5510 | else | |
5511 | { | |
5512 | if (iPagePos < iLastPage) | |
5513 | iPagePos = GetLine (iPagePos); | |
5514 | } | |
5515 | break; | |
5516 | ||
5517 | case KEY_HOME: | |
5518 | case '7': | |
5519 | iPagePos = 0; | |
5520 | iLinesDown = 0; | |
5521 | break; | |
5522 | ||
5523 | case KEY_END: | |
5524 | case '1': | |
5525 | iPagePos = iLastPage; | |
5526 | iLinesDown = iMaxLinesDown; | |
5527 | break; | |
5528 | ||
5529 | case KEY_PPAGE: | |
5530 | case '9': | |
5531 | for (iCount = 0; iCount < iMainLines; iCount++) | |
5532 | iPagePos = GetPrevLine (iPagePos); | |
5533 | if (iPagePos == 0) | |
5534 | iLinesDown = 0; | |
5535 | break; | |
5536 | ||
5537 | case KEY_NPAGE: | |
5538 | case '3': | |
5539 | for (iCount = 0; iCount < iMainLines; iCount++) | |
5540 | iPagePos = GetLine (iPagePos); | |
5541 | if (iPagePos >= iLastPage) | |
5542 | { | |
5543 | iPagePos = iLastPage; | |
5544 | iLinesDown = iMaxLinesDown; | |
5545 | } | |
5546 | break; | |
5547 | ||
5548 | case KEY_LEFT: | |
5549 | case '4': | |
5550 | GoForNoDelay(); | |
5551 | SearchWords (-1); | |
5552 | break; | |
5553 | ||
5554 | case KEY_RIGHT: | |
5555 | case '6': | |
5556 | GoForNoDelay(); | |
5557 | SearchWords (1); | |
5558 | break; | |
5559 | ||
5560 | case 'g': | |
5561 | GotoPercentage(); | |
5562 | break; | |
5563 | ||
5564 | case 'j': | |
5565 | JumpToDayForward(); | |
5566 | break; | |
5567 | ||
5568 | case 'J': | |
5569 | JumpToDayBackward(); | |
5570 | break; | |
5571 | ||
5572 | case 'f': | |
5573 | PrependFindText(); | |
5574 | break; | |
5575 | ||
5576 | case 'F': | |
5577 | AppendFindText(); | |
5578 | break; | |
5579 | ||
5580 | case 'o': | |
5581 | SearchOptions(); | |
5582 | break; | |
5583 | ||
5584 | case 'c': | |
5585 | CommonOptions(); | |
5586 | break; | |
5587 | ||
5588 | case 'n': | |
5589 | MiscLogOptions(); | |
5590 | break; | |
5591 | ||
5592 | case 'm': | |
5593 | if (iMonitorMode == 0) | |
5594 | iMonitorMode = 1; | |
5595 | else | |
5596 | iMonitorMode = 0; | |
5597 | break; | |
5598 | ||
5599 | case 'l': | |
5600 | if (ReportOptions()) | |
5601 | cReport.Run(); | |
5602 | break; | |
5603 | ||
5604 | case 'p': | |
5605 | ChangeLog (1); | |
5606 | break; | |
5607 | ||
5608 | case 's': | |
5609 | ChangeLog (2); | |
5610 | break; | |
5611 | ||
5612 | case 't': | |
5613 | ChangeLog (3); | |
5614 | break; | |
5615 | ||
5616 | case 'v': | |
5617 | ViewSelectedLine (iLinePos); | |
5618 | break; | |
5619 | ||
5620 | case 'h': | |
5621 | Help(); | |
5622 | break; | |
5623 | ||
5624 | case 'r': | |
5625 | ViewHowTo(); | |
5626 | break; | |
5627 | ||
5628 | case ' ': | |
5629 | MyCls(); | |
5630 | DrawMain(); | |
5631 | break; | |
5632 | ||
5633 | case 'd': | |
5634 | MyCls(); | |
5635 | con << sDebugText; | |
5636 | getch(); | |
5637 | break; | |
5638 | ||
5639 | case 'O': | |
5640 | GetLine (iLinePos); | |
5641 | bExit = EnterUserHistory (GetUserName (pcReqBuff, false)); | |
5642 | break; | |
5643 | ||
5644 | case 'T': | |
5645 | bExit = aTally.Enter(); | |
5646 | break; | |
5647 | ||
5648 | case 24: // ctrl-x | |
5649 | bExit = true; | |
5650 | break; | |
5651 | } | |
5652 | ||
5653 | if (bExit) | |
5654 | { | |
5655 | cSettings.Save(); | |
5656 | FinishSig (0); | |
5657 | } | |
5658 | } | |
5659 | } |
0 | /* | |
1 | * This program is free software; you can redistribute it and/or modify | |
2 | * it under the terms of the GNU General Public License as published by | |
3 | * the Free Software Foundation; either version 2 of the License, or | |
4 | * (at your option) any later version. | |
5 | * | |
6 | * This program is distributed in the hope that it will be useful, | |
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
9 | * GNU Library General Public License for more details. | |
10 | * | |
11 | * You should have received a copy of the GNU General Public License | |
12 | * along with this program; if not, write to the Free Software | |
13 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
14 | ||
15 | squidview 0.51 | |
16 | ||
17 | A program to nicely browse your squid log | |
18 | ||
19 | (c) 2001, 2002, 2003 Graeme Sheppard | |
20 | ||
21 | */ | |
22 | ||
23 | #ifdef HAVE_CONFIG_H | |
24 | #include <config.h> | |
25 | #endif | |
26 | ||
27 | #include <curses.h> | |
28 | #include <time.h> | |
29 | #include <string> | |
30 | ||
31 | using namespace std; | |
32 | ||
33 | const string sProgYear = "2003"; | |
34 | ||
35 | #define nInputLen 80 | |
36 | #define nReadBuffer 2048 | |
37 | ||
38 | #define nTimeCol 1 // fields/columns of squid log lines | |
39 | #define nCacheHitCol 4 | |
40 | #define nSizeCol 5 | |
41 | #define nTargetCol 7 | |
42 | #define nUserCol_a 8 | |
43 | #define nIPCol_a 3 | |
44 | #define nUserCol_b 3 | |
45 | #define nIPCol_b 3 | |
46 | int iUserCol = nUserCol_a; | |
47 | int iIPCol = nIPCol_a; | |
48 | ||
49 | int iUserNameLen = 8; // maximum displayed width of a login name | |
50 | #define nSizeCols 11 // width given to display size of requests | |
51 | ||
52 | typedef long tFilePos; // positions in log file are of this type | |
53 | typedef long long int tByteTotal; // for summing bytes transferred | |
54 | typedef unsigned long tIPnum; // IP aliases only 32 bit at this stage | |
55 | ||
56 | const time_t nSecsInDay = 60 * 60 * 24; | |
57 | ||
58 | const char cEOL = 10; // End Of Line character | |
59 | const char cCR = 13; | |
60 | const char cSeperator = 10; | |
61 | ||
62 | string sHomeDir; | |
63 | const char szSquidHome[] = ".squidview"; | |
64 | string sPathToFiles; | |
65 | const char szMainLog[] = "/usr/local/squid/var/logs/access.log"; | |
66 | ||
67 | const char szLog1[] = "log1"; | |
68 | const char szLog2[] = "log2"; | |
69 | const char szLog3[] = "log3"; | |
70 | const char szLabel1[] = "Pri"; | |
71 | const char szLabel2[] = "Sec"; | |
72 | const char szLabel3[] = "Tri"; | |
73 | const char* pszCurrentLog; | |
74 | const char* pszCurrentName; | |
75 | const char szWordFile[] = "words"; // search words | |
76 | const char szUsersFile[] = "users"; // list of real names | |
77 | const char szAliasesFile[] = "aliases"; // map IPs to user names | |
78 | const char szHowToFile[] = "HOWTO"; // link name | |
79 | ||
80 | string sLogFile1, sLogFile2, sLogFile3; | |
81 | string sWordFile, sUsersFile, sAliasesFile, sSetFileName, sHowToLink; | |
82 | ||
83 | string sViewer = "less"; | |
84 | string sCurrentReport = ""; | |
85 | string sCurrentEmail = ""; | |
86 | const string sReportExt = ".txt"; | |
87 | ||
88 | char cDiskBuffer [nReadBuffer +8]; // buffer for log read | |
89 | char szEmpty = '\0'; // null string... | |
90 | char* pcEmpty = &szEmpty; // ...pointed to by this | |
91 | char* pcReqBuff = pcEmpty; // normally the start of the request | |
92 | // or above if the read op fails | |
93 | ||
94 | string sWords; | |
95 | string sStatusMessage = ""; | |
96 | ||
97 | int iSizeHitGrade = 0; | |
98 | int iSizeHitBytes = 0; | |
99 | string sSizeHits = "50000 250000 1000000 10000000"; | |
100 | ||
101 | WINDOW* wTemp = 0; // dummy window | |
102 | ||
103 | tFilePos iPagePos, // point in log file of top of current screen | |
104 | iLastPage, // " " " " " of last screen | |
105 | iLogFileSize, | |
106 | iLinePos, // where the current highlighted line is | |
107 | iLastLinePos; // the last line in log file | |
108 | ||
109 | int iMainLines, // no. of lines in main window | |
110 | iLinesDown, // which line the highlight bar is at | |
111 | iMaxLinesDown, // in the case of very small log files | |
112 | iMonitorMode = 1, // like the Unix command tail | |
113 | iCurrentLog = 1; // which log? | |
114 | ||
115 | class ct | |
116 | { | |
117 | public: | |
118 | ct& operator << (char); | |
119 | ct& operator << (bool); | |
120 | ct& operator << (const char*); | |
121 | ct& operator << (const string&); | |
122 | ct& operator << (int); | |
123 | }; | |
124 | ||
125 | string sDebugText = ""; | |
126 | ||
127 | enum eSearch {hit, miss, veto}; | |
128 | enum eFocus {no_focus, user, cache}; | |
129 | enum eWordHits {no_word, text, CSV}; | |
130 | enum eBandUserTotals {nBUT_none, nBUT_notveto, nBUT_all}; | |
131 | enum eBandDomainTotals {nBDT_none, nBDT_all, nBDT_user}; | |
132 | enum eBandDomainIncludes {nBDI_notveto, nBDI_all}; | |
133 | ||
134 | // log a report options | |
135 | ||
136 | tFilePos iRepStart = 0, // report from where | |
137 | iRepEnd = 0; // report to where | |
138 | int iRepColumns = 80, // columns of screen? | |
139 | iRepCSVcols = 100; // columns of CSV target | |
140 | bool bRepSplit = false, // split long lines | |
141 | bRepShowSize = false, // indent for request size | |
142 | bRepKeepExt = true, // remove innards to show .mp3 etc | |
143 | bRepCacheReport = true; | |
144 | string sRepFileName = "temp.txt", // report file name | |
145 | sRepFilter = "", // filter report | |
146 | sRepSeperator = "|", // for CSV | |
147 | sRepFocus = "", | |
148 | sRepBDTuser = "", | |
149 | sRepTitle = ""; | |
150 | int iRepWordHits = text, | |
151 | iRepBUT = nBUT_notveto, | |
152 | iRepBDT = nBDT_all, | |
153 | iRepBDI = nBDI_notveto, | |
154 | iRepFocus = no_focus; | |
155 | bool bLookupIP = true; | |
156 | bool bAliases = false; | |
157 | int iRepFast = 10000; | |
158 | bool bRepMySort = false; | |
159 | ||
160 | struct sRecordPointer | |
161 | { | |
162 | tByteTotal iBytes; | |
163 | int iHits; | |
164 | int iRecordNumber; | |
165 | ||
166 | sRecordPointer operator= (const sRecordPointer&); | |
167 | }; | |
168 | ||
169 | struct sListRecords | |
170 | { | |
171 | vector <sRecordPointer> vList; | |
172 | ||
173 | enum eSortType {nSortHits, nSortBytes}; | |
174 | ||
175 | void Sort (eSortType nSelect); | |
176 | void Empty(); | |
177 | }; | |
178 | ||
179 | struct sUserRecord | |
180 | { | |
181 | string sLoginName; | |
182 | string sFullName; | |
183 | }; | |
184 | ||
185 | struct sDomainRecord | |
186 | { | |
187 | string sDomainName; | |
188 | }; | |
189 | ||
190 | ||
191 | struct rUserTotal | |
192 | { | |
193 | tByteTotal iBytes; | |
194 | int iHits; | |
195 | string sLoginName; | |
196 | string sFullName; | |
197 | ||
198 | rUserTotal rUserTotal::operator= (const rUserTotal&); | |
199 | }; | |
200 | ||
201 | struct rDomainTotal | |
202 | { | |
203 | tByteTotal iBytes; | |
204 | int iHits; | |
205 | string sDomain; | |
206 | ||
207 | rDomainTotal rDomainTotal::operator= (const rDomainTotal&); | |
208 | }; | |
209 | ||
210 | ||
211 | struct rAliasRecord | |
212 | { | |
213 | tIPnum iIPnum; | |
214 | int iUserNum; | |
215 | }; | |
216 | ||
217 | vector <rAliasRecord> vAliasList; | |
218 | vector <string> vAliasUserName; | |
219 | ||
220 | int iSortFlag = 0; | |
221 | ||
222 | ||
223 | // story of recent activity by one user | |
224 | class cUserHistory | |
225 | { | |
226 | public: | |
227 | bool Run (const string&); | |
228 | void CalcScreen(); | |
229 | bool Browse(); | |
230 | void AddHistory(); | |
231 | int AddHistoryNorth(); | |
232 | int AddHistorySouth(); | |
233 | void DisplayHistory(); | |
234 | void DisplayHelp(); | |
235 | void ZeroAll(); | |
236 | ||
237 | string sUser; | |
238 | static const int nMaxRows = 200; | |
239 | static const int nMaxNorth = 1000; | |
240 | static const int nMaxSouth = 1000; | |
241 | vector <tFilePos> vRequests; | |
242 | tFilePos iOneUserFileSize, iNorthMark, iSouthMark, iSouthMarkEnd; | |
243 | int iTotalRows, iSelectedAddress; | |
244 | int iScreenHeight, iSelectedRow; | |
245 | int iScreenStart, iLastScreenRow; | |
246 | }; | |
247 | ||
248 | ||
249 | // tally of users' activity | |
250 | class cUsersMode | |
251 | { | |
252 | public: | |
253 | cUsersMode(); | |
254 | bool Enter(); | |
255 | bool Browse(); | |
256 | void DisplayPoints(); | |
257 | void DisplayFullNames(); | |
258 | void DisplayGreatestURLs(); | |
259 | void DisplayLastURLs(); | |
260 | void DisplayHeading (const string& sTitle); | |
261 | void DisplayData (int iData); | |
262 | void DisplayHelp(); | |
263 | void CalcScreen(); | |
264 | void AddData (tFilePos iFrom, tFilePos iTo); | |
265 | void SortData(); | |
266 | void SortMenu(); | |
267 | char* SortMode(); | |
268 | void AgeData (int iCurrentTime); | |
269 | void FindFullNames(); | |
270 | void ZeroAll(); | |
271 | ||
272 | struct rUserHistory | |
273 | { | |
274 | string sUser, sFullName; | |
275 | int iPoints, iBytes, iRequests, iURLsize; | |
276 | tFilePos iGreatestURL, iLastURL; | |
277 | time_t iLastTime; | |
278 | void Zero() | |
279 | { | |
280 | sUser = sFullName = ""; | |
281 | iPoints = iBytes = iRequests = iURLsize = iLastTime = 0; | |
282 | iGreatestURL = iLastURL = -1; | |
283 | } | |
284 | rUserHistory& operator= (const rUserHistory& aSrc) | |
285 | { | |
286 | sUser = aSrc.sUser; | |
287 | sFullName = aSrc.sFullName; | |
288 | iPoints = aSrc.iPoints; | |
289 | iBytes = aSrc.iBytes; | |
290 | iRequests = aSrc.iRequests; | |
291 | iURLsize = aSrc.iURLsize; | |
292 | iLastTime = aSrc.iLastTime; | |
293 | iGreatestURL = aSrc.iGreatestURL; | |
294 | iLastURL = aSrc.iLastURL; | |
295 | return *this; | |
296 | } | |
297 | }; | |
298 | string LookupUser (const rUserHistory& aUser); | |
299 | ||
300 | inline int CalcAeon (int iRough) | |
301 | { | |
302 | return int (iRough / iHistoryPeriod) * iHistoryPeriod; | |
303 | } | |
304 | ||
305 | enum eSM {nPoints = 0, nFullNames, nGreatest, nLast, nSMend} iScreenMode; | |
306 | enum eSort {nSortN, nSortU, nSortP, nSortB, nSortR, nSortURL, nSortI} | |
307 | iSortMode; | |
308 | int iScreenStart, iSelectedRow, iTotalRows; | |
309 | int iScreenHeight, iSelectedAddress, iLastScreenRow; | |
310 | vector <rUserHistory> vHistory; | |
311 | time_t iLastAdjustTime, iNextAdjustTime; | |
312 | int iHistoryPeriod; | |
313 | float fFadeFactor, fEntryFactor; | |
314 | tFilePos iCurrentLogPos, iUsersFileSize; | |
315 | bool bUsersMonitorMode; | |
316 | bool bAcceptDenies; | |
317 | }; | |
318 |
0 | timestamp |