]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/misc-progs/getconntracktable.c
1 /* IPFire helper program - getconntracktable
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
6 * The kernel's connection tracking table is not readable by
7 * non-root users. So this helper will just read and output it.
18 FILE *fp
= fopen("/proc/net/nf_conntrack", "r");
23 /* Read content line by line and write it to stdout. */
24 char linebuf
[STRING_SIZE
];
25 while (fgets(linebuf
, STRING_SIZE
, fp
)) {
26 printf("%s", linebuf
);