]>
git.ipfire.org Git - thirdparty/sarg.git/blob - report.c
2 * AUTHOR: Pedro Lineu Orso pedro.orso@gmail.com
4 * SARG Squid Analysis Report Generator http://sarg.sourceforge.net
7 * please look at http://sarg.sourceforge.net/donations.php
8 * ---------------------------------------------------------------------
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
26 #include "include/conf.h"
27 #include "include/defs.h"
29 static void maketmp ( const char * user
, const char * dirname
, int debug
, int indexonly
);
30 static void maketmp_hour ( const char * user
, const char * dirname
, int indexonly
);
31 static void gravatmp_hora ( const char * dirname
, const char * user
, const char * data
, const char * hora
, long long int elap
, long long int accbytes
, int indexonly
);
32 static void gravatmpf ( const char * oldaccuser
, const char * dirname
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
);
33 static void gravaporuser ( const char * user
, const char * dirname
, const char * url
, const char * ip
, const char * data
, const char * hora
, long long int tam
, long long int elap
, int indexonly
);
34 static void gravager ( FILE * fp_gen
, const char * user
, long long int nacc
, const char * url
, long long int nbytes
, const char * ip
, const char * hora
, const char * dia
, long long int nelap
, long long int incache
, long long int oucache
);
35 static void grava_SmartFilter ( const char * dirname
, const char * user
, const char * ip
, const char * data
, const char * hora
, const char * url
, const char * smart
);
43 char accdia
[ 11 ], acchora
[ 9 ], accuser
[ MAXLEN
], accip
[ MAXLEN
], accurl
[ MAXLEN
];
44 char oldaccdia
[ 11 ], oldacchora
[ 9 ], oldaccip
[ MAXLEN
];
45 char wdirname
[ MAXLEN
], oldurl
[ MAXLEN
], oldaccuser
[ MAXLEN
];
46 char olduser
[ MAXLEN
], oldmsg
[ 50 ], acccode
[ MAXLEN
/ 2 - 1 ], oldacccode
[ MAXLEN
/ 2 - 1 ], user
[ MAXLEN
];
47 char ipantes
[ MAXLEN
], nameantes
[ MAXLEN
];
48 char accsmart
[ MAXLEN
];
49 char crc2
[ MAXLEN
/ 2 - 1 ];
50 long long int nbytes
= 0 ;
51 long long int nelap
= 0 ;
53 long long int rtotal
= 0 ;
54 long long int incache
= 0 ;
55 long long int oucache
= 0 ;
56 long long int accbytes
, accelap
;
59 struct dirent
* direntp
;
60 const char logext
[]= ".log" ;
63 struct getwordstruct gwarea
;
69 sprintf ( dirname
, "%s%s" , outdir
, period
);
70 vrfydir ( period
, addr
, site
, us
, email
);
73 debugaz ( "dirname" , dirname
);
76 gperiod ( dirname
, period
);
78 if ( UserAgentLog
[ 0 ] != '\0' && email
[ 0 ] == '\0' ) useragent ();
80 sprintf ( wdirname
, "%s/sarg-general" , dirname
);
81 if (( fp_gen
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
82 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
87 strncat ( tmp
, "/sarg" , 5 );
90 while (( direntp
= readdir ( dirp
)) != NULL
) {
91 dlen
= strlen ( direntp
-> d_name
)-( sizeof ( logext
)- 1 );
93 if (( strcmp ( direntp
-> d_name
+ dlen
, logext
) != 0 ) ||
94 ( strncmp ( direntp
-> d_name
, "download.log" , 12 ) == 0 ) ||
95 ( strncmp ( direntp
-> d_name
, "denied.log" , 10 ) == 0 ) ||
96 ( strncmp ( direntp
-> d_name
, "authfail.log.unsort" , 19 ) == 0 ))
98 if ( snprintf ( tmp3
, sizeof ( tmp3
), "%s/%s" , tmp
, direntp
-> d_name
)>= sizeof ( tmp3
)) {
99 fprintf ( stderr
, "SARG: (report) directory entry too long: %s/%s \n " , tmp
, direntp
-> d_name
);
102 if (( fp_in
= MY_FOPEN ( tmp3
, "r" ))== NULL
){
103 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], tmp
);
108 if ( dlen
>= sizeof ( user
)) continue ;
109 strncpy ( user
, direntp
-> d_name
, dlen
);
115 strcpy ( wdirname
, dirname
);
116 maketmp ( user
, tmp
, debug
, indexonly
);
117 maketmp_hour ( user
, tmp
, indexonly
);
121 ip2name ( u2
, sizeof ( u2
));
122 get_usertab_name ( u2
, name
, sizeof ( name
));
124 if ( dotinuser
&& strchr ( name
, '_' )) {
125 subs ( name
, sizeof ( name
), "_" , "." );
129 bzero ( html_old
, MAXLEN
);
131 while ( fgets ( buf
, sizeof ( buf
), fp_in
)!= NULL
) {
132 getword_start (& gwarea
, buf
);
133 if ( getword ( accdia
, sizeof ( accdia
),& gwarea
, ' \t ' )< 0 || getword ( acchora
, sizeof ( acchora
),& gwarea
, ' \t ' )< 0 ||
134 getword ( accuser
, sizeof ( accuser
),& gwarea
, ' \t ' )< 0 || getword ( accip
, sizeof ( accip
),& gwarea
, ' \t ' )< 0 ||
135 getword ( accurl
, sizeof ( accurl
),& gwarea
, ' \t ' )< 0 || getword_atoll (& accbytes
,& gwarea
, ' \t ' )< 0 ||
136 getword ( acccode
, sizeof ( acccode
),& gwarea
, ' \t ' )< 0 ) {
137 printf ( "SARG: Maybe you have a broken record or garbage in your %s file (%d). \n " , tmp3
, __LINE__
);
140 if ( strncmp ( acccode
, "TCP_DENIED/407" , 14 ) == 0 ) continue ;
141 if ( getword_atoll (& accelap
,& gwarea
, ' \t ' )< 0 || getword_skip ( 20000 ,& gwarea
, ' \t ' )< 0 ) {
142 printf ( "SARG: Maybe you have a broken elapsed time in your %s file (%d). \n " , tmp3
, __LINE__
);
145 if ( getword ( accsmart
, sizeof ( accsmart
),& gwarea
, '"' )< 0 ) {
146 printf ( "SARG: Maybe you have a broken smart info in your %s file (%d). \n " , tmp3
, __LINE__
);
150 if ( accsmart
[ 0 ] != '\0' ) {
152 strcpy ( wdirname
, dirname
);
153 grava_SmartFilter ( wdirname
, accuser
, accip
, accdia
, acchora
, accurl
, accsmart
);
157 if ( strcmp ( accip
, ipantes
) != 0 ) {
158 strcpy ( ipantes
, accip
);
159 ip2name ( accip
, sizeof ( accip
));
160 strcpy ( nameantes
, accip
);
161 } else strcpy ( accip
, nameantes
);
164 strcpy ( wdirname
, dirname
);
165 gravatmp_hora ( wdirname
, accuser
, accdia
, acchora
, accelap
, accbytes
, indexonly
);
168 strcpy ( wdirname
, dirname
);
169 gravaporuser ( accuser
, wdirname
, accurl
, accip
, accdia
, acchora
, accbytes
, accelap
, indexonly
);
173 strcpy ( oldurl
, accurl
);
174 strcpy ( oldacccode
, acccode
);
175 strcpy ( oldaccuser
, accuser
);
176 strcpy ( oldaccip
, accip
);
177 strcpy ( oldaccdia
, accdia
);
178 strcpy ( oldacchora
, acchora
);
182 if ( site
[ 0 ] != '\0' ) {
183 if ( strcmp ( oldaccuser
, accuser
) != 0 ){
185 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
186 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
187 gravatmp ( oldaccuser
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
188 gravager ( fp_gen
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
196 if ( strcmp ( oldurl
, accurl
) != 0 || strcmp ( oldaccuser
, accuser
) != 0 ){
198 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
199 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
200 gravatmp ( oldaccuser
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
201 gravager ( fp_gen
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
207 if ( strcmp ( oldaccuser
, accuser
) != 0 )
215 if ( strstr ( ReportType
, "site_user_time_date" ) != 0 ) {
218 strcpy ( siteind
, accurl
);
219 for ( str
= siteind
; * str
; str
++) {
220 if (* str
== '?' || * str
== '-' || * str
== '.' || * str
== ':' || * str
== '/' || * str
== ' \\ ' || * str
== '*' ||
221 * str
== ' \' ' || * str
== ' \" ' || * str
== '$' )
224 sprintf ( arqtt
, "%s/%s" , dirname
, accuser
);
225 if ( access ( arqtt
, R_OK
) != 0 )
227 sprintf ( arqtt
, "%s/%s/tt%s-%s.html" , dirname
, accuser
, accuser
, siteind
);
228 if ( strlen ( arqtt
) > 255 ) {
231 if (( fp_tt
= fopen ( arqtt
, "w" )) == 0 ) {
232 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], arqtt
);
239 sprintf(httplink,"<font size=%s color=%s><href=http://%s>%s", \
240 FontSize,PrivacyStringColor,PrivacyString,PrivacyString);
242 sprintf(httplink,"<font size=%s><a href=\"http://%s\">%s</a>",FontSize,accurl,accurl);
245 sprintf ( ltext110
, "%s" , text
[ 110 ]);
246 for ( str
= ltext110
; * str
; ++ str
)
249 fprintf ( fp_tt
, "<!DOCTYPE HTML PUBLIC \" -//W3C//DTD HTML 4.01 Transitional//EN \" \" http://www.w3.org/TR/html4/loose.dtd \" > \n <html> \n <head> \n <meta http-equiv= \" Content-Type \" content= \" text/html; charset=%s \" > \n " , CharSet
);
251 fputs ( "</head> \n " , fp_tt
);
252 fprintf ( fp_tt
, "<body bgcolor= \" %s \" text= \" %s \" background= \" %s \" > \n " , BgColor
, TxColor
, BgImage
);
253 write_logo_image ( fp_tt
);
255 if ( strcmp ( IndexTree
, "date" ) == 0 )
256 show_sarg ( fp_tt
, "../../../.." );
258 show_sarg ( fp_tt
, "../.." );
260 fputs ( "<div align= \" center \" ><table cellpadding= \" 0 \" cellspacing= \" 0 \" > \n " , fp_tt
);
261 fprintf ( fp_tt
, "<tr><th class= \" title \" colspan= \" 2 \" >%s</th></tr> \n " , Title
);
263 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s</td></tr> \n " , text
[ 89 ], period
);
264 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s</td></tr> \n " , text
[ 90 ], name
);
265 fprintf ( fp_tt
, "<tr><td class= \" header \" colspan= \" 2 \" >%s: %s, %s</td></tr> \n " , text
[ 104 ], UserSortField
, UserSortOrder
);
266 fprintf ( fp_tt
, "<tr><th class= \" header3 \" colspan= \" 2 \" >%s</th></tr> \n " , text
[ 32 ]);
268 fputs ( "</table></div> \n " , fp_tt
);
269 fputs ( "<div align= \" center \" ><table cellpadding= \" 0 \" cellspacing= \" 2 \" > \n " , fp_tt
);
270 fputs ( "<tr><td></td><td></td></tr>" , fp_tt
);
272 strncpy ( tmp4
, text
[ 110 ], 4 );
273 fprintf ( fp_tt
, "<tr><th class= \" header \" >%s</th><th class= \" header \" >%s</th><th class= \" header \" >%s</th></tr> \n " , text
[ 91 ], tmp4
, text
[ 110 ]+ 5 );
276 sprintf ( html
, "<tr><td class= \" data \" >%s</td><td class= \" data \" >%s</td><td class= \" data \" >%s</td></tr> \n " , accurl
, accdia
, acchora
);
278 if ( strcmp ( html
, html_old
) != 0 )
280 strcpy ( html_old
, html
);
281 } else bzero ( ltext110
, 50 );
283 strcpy ( crc2
, acccode
);
284 str
= strchr ( crc2
, '/' );
287 if ( strstr ( crc2
, "MISS" ) != 0 )
289 else incache
+= accbytes
;
291 strcpy ( oldurl
, accurl
);
293 if ( strcmp ( accuser
, oldaccuser
) != 0 ) {
294 strcpy ( wdirname
, dirname
);
295 day_totalize ( tmp
, oldaccuser
, indexonly
);
298 strcpy ( oldaccuser
, accuser
);
299 strcpy ( oldacccode
, acccode
);
300 strcpy ( oldaccip
, accip
);
301 strcpy ( oldaccdia
, accdia
);
302 strcpy ( oldacchora
, acchora
);
312 if ( strstr ( oldacccode
, "DENIED" ) != 0 )
313 sprintf ( oldmsg
, "%s" , text
[ 46 ]);
314 strcpy ( wdirname
, dirname
);
315 if ( strlen ( oldaccuser
) == 0 )
316 strcpy ( oldaccuser
, accuser
);
317 gravatmpf ( oldaccuser
, wdirname
, oldurl
, nacc
, nbytes
, oldmsg
, nelap
, indexonly
, incache
, oucache
);
318 strcpy ( wdirname
, dirname
);
319 gravager ( fp_gen
, oldaccuser
, nacc
, oldurl
, nbytes
, oldaccip
, oldacchora
, oldaccdia
, nelap
, incache
, oucache
);
321 day_totalize ( tmp
, oldaccuser
, indexonly
);
325 strcpy ( wdirname
, dirname
);
326 totalger ( wdirname
, debug
, outdir
);
328 if ( email
[ 0 ] == '\0' ) {
329 if ( strstr ( ReportType
, "downloads" ) != 0 ) download_report ();
331 if ( strlen ( DansGuardianConf
) > 0 ) {
332 strcpy ( wdirname
, dirname
);
336 strcpy ( wdirname
, dirname
);
339 strcpy ( wdirname
, dirname
);
342 if ( strstr ( ReportType
, "topsites" ) != 0 ) topsites ();
344 if ( strstr ( ReportType
, "sites_users" ) != 0 ) siteuser ();
347 strcpy ( wdirname
, dirname
);
350 if ( smartfilter
) smartfilter_report ();
352 if ( strlen ( DansGuardianConf
) > 0 ) dansguardian_report ();
356 if ( strstr ( ReportType
, "users_sites" ) != 0 ) htmlrel ();
360 if ( SuccessfulMsg
) fprintf ( stderr
, "SARG: %s %s \n " , text
[ 47 ], dirname
);
362 strcpy ( wdirname
, dirname
);
363 geramail ( wdirname
, debug
, outdir
, userip
, email
, TempDir
);
365 if (( strcmp ( email
, "stdout" ) != 0 ) && SuccessfulMsg
)
366 fprintf ( stderr
, "SARG: %s %s \n " , text
[ 48 ], email
);
370 strcpy ( wdirname
, dirname
);
371 index_only ( wdirname
, debug
);
375 2009-10-13(Frederic) This piece of code is never called so it is commented out for good.
376 if(strlen(email) < 0)
383 static void maketmp ( const char * user
, const char * dirname
, int debug
, int indexonly
)
388 char wdirname
[ MAXLEN
];
390 if ( indexonly
) return ;
391 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
393 strcpy ( wdirname
, tmp
);
394 strcat ( wdirname
, "/" );
395 strcat ( wdirname
, user
);
398 debuga ( "%s: %s" , text
[ 49 ], wdirname
);
401 strcat ( wdirname
, ".utmp" );
402 if (( fp_ou
= fopen ( wdirname
, "w" ))== NULL
){
403 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
412 static void maketmp_hour ( const char * user
, const char * dirname
, int indexonly
)
417 char wdirname
[ MAXLEN
];
419 if ( indexonly
) return ;
420 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
422 strcpy ( wdirname
, tmp
);
423 strcat ( wdirname
, "/" );
424 strcat ( wdirname
, user
);
426 strcat ( wdirname
, ".htmp" );
427 if (( fp_ou
= fopen ( wdirname
, "w" ))== NULL
){
428 fprintf ( stderr
, "SARG: (report-1) %s: %s - %s \n " , text
[ 45 ], wdirname
, strerror ( errno
));
437 void gravatmp ( const char * oldaccuser
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
)
446 char wdirname
[ MAXLEN
];
448 if ( indexonly
) return ;
449 if ( strstr ( ReportType
, "users_sites" ) == 0 ) return ;
451 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.utmp" , tmp
, oldaccuser
)>= sizeof ( wdirname
)) {
452 fprintf ( stderr
, "SARG: Path too long %s/%s.utmp \n " , tmp
, oldaccuser
);
456 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
457 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
461 my_lltoa ( nacc
, val1
, 0 );
462 my_lltoa ( nbytes
, val2
, 0 );
463 my_lltoa ( nelap
, val3
, 0 );
464 my_lltoa ( incache
, val4
, 0 );
465 my_lltoa ( oucache
, val5
, 0 );
466 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \t %s \n " , val1
, val2
, oldurl
, oldmsg
, val3
, val4
, val5
);
472 fputs ( "</table> \n " , fp_tt
);
473 fputs ( "</body> \n </html> \n " , fp_tt
);
482 static void gravatmp_hora ( const char * dirname
, const char * user
, const char * data
, const char * hora
, long long int elap
, long long int bytes
, int indexonly
)
486 char wdirname
[ MAXLEN
];
488 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
490 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.htmp" , tmp
, user
)>= sizeof ( wdirname
)) {
491 fprintf ( stderr
, "SARG: Path too long %s/%s.htmp \n " , tmp
, user
);
495 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
496 fprintf ( stderr
, "SARG: (report-2) %s: %s - %s \n " , text
[ 45 ], wdirname
, strerror ( errno
));
500 if ( strcmp ( datetimeby
, "bytes" ) == 0 ) fprintf ( fp_ou
, "%s \t %s \t %lld \n " , data
, hora
, bytes
);
501 else fprintf ( fp_ou
, "%s \t %s \t %lld \n " , data
, hora
, elap
);
509 static void gravaporuser ( const char * user
, const char * dirname
, const char * url
, const char * ip
, const char * data
, const char * hora
, long long int tam
, long long int elap
, int indexonly
)
513 char wdirname
[ MAXLEN
];
515 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
517 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.ip" , tmp
, user
)>= sizeof ( wdirname
)) {
518 fprintf ( stderr
, "SARG: Path too long %s/%s.ip \n " , tmp
, user
);
522 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
523 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
527 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %lld \t %lld \n " , ip
, url
, data
, hora
, tam
, elap
);
536 static void gravatmpf ( const char * oldaccuser
, const char * dirname
, const char * oldurl
, long long int nacc
, long long int nbytes
, const char * oldmsg
, long long int nelap
, int indexonly
, long long int incache
, long long int oucache
)
540 char wdirname
[ MAXLEN
];
542 if ( indexonly
|| ( strstr ( ReportType
, "users_sites" ) == 0 )) return ;
544 if ( snprintf ( wdirname
, sizeof ( wdirname
), "%s/%s.utmp" , tmp
, oldaccuser
)>= sizeof ( wdirname
)) {
545 fprintf ( stderr
, "SARG: Path too long %s/%s.utmp \n " , tmp
, oldaccuser
);
549 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
550 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
554 my_lltoa ( nacc
, val1
, 0 );
555 my_lltoa ( nbytes
, val2
, 0 );
556 my_lltoa ( nelap
, val3
, 0 );
557 my_lltoa ( incache
, val4
, 0 );
558 my_lltoa ( oucache
, val5
, 0 );
559 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \t %s \n " , val1
, val2
, oldurl
, oldmsg
, val3
, val4
, val5
);
566 fputs ( "</table> \n " , fp_tt
);
567 fputs ( "</body> \n </html> \n " , fp_tt
);
576 static void gravager ( FILE * fp_gen
, const char * user
, long long int nacc
, const char * url
, long long int nbytes
, const char * ip
, const char * hora
, const char * dia
, long long int nelap
, long long int incache
, long long int oucache
)
578 my_lltoa ( nacc
, val1
, 0 );
579 my_lltoa ( nbytes
, val2
, 0 );
580 my_lltoa ( nelap
, val3
, 0 );
581 my_lltoa ( incache
, val4
, 0 );
582 my_lltoa ( oucache
, val5
, 0 );
583 fprintf ( fp_gen
, "%s \t %s \t %s \t %s \t %s \t %s \t %s \t %s \t %s \t %s \n " , user
, val1
, val2
, url
, ip
, hora
, dia
, val3
, val4
, val5
);
588 static void grava_SmartFilter ( const char * dirname
, const char * user
, const char * ip
, const char * data
, const char * hora
, const char * url
, const char * smart
)
592 char wdirname
[ MAXLEN
];
594 sprintf ( wdirname
, "%s/smartfilter.unsort" , dirname
);
596 if (( fp_ou
= MY_FOPEN ( wdirname
, "a" ))== NULL
){
597 fprintf ( stderr
, "SARG: (report) %s: %s \n " , text
[ 45 ], wdirname
);
601 fprintf ( fp_ou
, "%s \t %s \t %s \t %s \t %s \t %s \n " , user
, data
, hora
, ip
, url
, smart
);
602 fputs ( "</body> \n </html> \n " , fp_tt
);