1 /*
2     ettercap -- diplay the connection list
3 
4     Copyright (C) ALoR & NaGA
5 
6     This program is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10 
11     This program is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15 
16     You should have received a copy of the GNU General Public License
17     along with this program; if not, write to the Free Software
18     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 
20 */
21 
22 #include <ec.h>
23 #include <ec_threads.h>
24 #include <ec_interfaces.h>
25 #include <ec_conntrack.h>
26 #include <ec_inet.h>
27 #include <ec_proto.h>
28 
29 /* globals */
30 
31 /* proto */
32 
33 void text_connections(void);
34 
35 /*******************************************/
36 
text_connections(void)37 void text_connections(void)
38 {
39    void *list;
40    char *desc;
41 
42    SAFE_CALLOC(desc, 160, sizeof(char));
43 
44    /* retrieve the first element */
45    list = conntrack_print(0, NULL, NULL, 0);
46 
47    fprintf(stdout, "\nConnections list:\n\n");
48 
49    /* walk the connection list */
50    while(list) {
51       /* get the next element */
52       list = conntrack_print(+1, list, &desc, 159);
53       fprintf(stdout, "%s\n", desc);
54    }
55 
56    fprintf(stdout, "\n");
57 
58    SAFE_FREE(desc);
59 }
60 
61 
62 /* EOF */
63 
64 // vim:ts=3:expandtab
65 
66