Build-Depends libpcap-dev instead of libpcap0.8-dev.
[yaz-ziffy.git] / src / apdu.h
1 /*
2  * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
3  * apdu.h - 
4  *
5  * Copyright (c) 1998-2001 R. Carbone <rocco@tecsiel.it> - Finsiel S.p.A.
6  * -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21  */
22
23
24 extern unsigned long z3950_apduno;
25
26 extern int aflag;
27
28 extern int ethflag;
29 extern int ipflag;
30 extern int tcpflag;
31 extern int z3950flag;
32
33
34 extern struct timeval first_apdu;
35 extern struct timeval last_apdu;
36
37
38 /*
39  * The structure containing information about all the apdus
40  */
41 typedef struct
42 {
43   int tag;                   /* unique apdu tag identifier */
44   char * name;               /* user printable name of the apdu */
45   int minlen;                /* min length of bytes off wire (all optional fields absent) */
46   const struct timeval * t;  /* the time the apdu was captured */
47   char * calling;            /* source ip address */
48   int   srcport;             /* source port */
49   char * called;             /* destination ip address */
50   int   dstport;             /* source port */
51 } z3950apdu;
52
53
54 z3950apdu * parseable (unsigned char * apdu, int len);
55
56 char * srchost (void);
57 int    srcport (void);
58 char * dsthost (void);
59 int    dstport (void);
60
61
62 /*
63  * time stamp presentation formats
64  */
65 #define DELTA_FMT      1   /* the time since receiving the previous apdu */
66 #define ABS_FMT        2   /* the current time */
67 #define RELATIVE_FMT   3   /* the time relative to the first apdu received */
68
69
70 char * timestamp (const struct timeval * t, int fmt);