Deleted Added
full compact
pfctl_table.c (126354) pfctl_table.c (126355)
1/* $FreeBSD: head/contrib/pf/pfctl/pfctl_table.c 126355 2004-02-28 17:32:53Z mlaier $ */
1/* $OpenBSD: pfctl_table.c,v 1.50 2003/08/29 21:47:36 cedric Exp $ */
2
3/*
4 * Copyright (c) 2002 Cedric Berger
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 34 unchanged lines hidden (view full) ---

43#include <errno.h>
44#include <netdb.h>
45#include <stdarg.h>
46#include <stdio.h>
47#include <stdlib.h>
48#include <string.h>
49#include <time.h>
50
2/* $OpenBSD: pfctl_table.c,v 1.50 2003/08/29 21:47:36 cedric Exp $ */
3
4/*
5 * Copyright (c) 2002 Cedric Berger
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

--- 34 unchanged lines hidden (view full) ---

44#include <errno.h>
45#include <netdb.h>
46#include <stdarg.h>
47#include <stdio.h>
48#include <stdlib.h>
49#include <string.h>
50#include <time.h>
51
52#if defined(__FreeBSD__)
53#include <inttypes.h>
54#else
55#define PRIu64 "llu"
56#endif
57
51#include "pfctl_parser.h"
52#include "pfctl.h"
53
54extern void usage(void);
55static int pfctl_table(int, char *[], char *, const char *, char *,
56 const char *, const char *, int);
57static void print_table(struct pfr_table *, int, int);
58static void print_tstats(struct pfr_tstats *, int);

--- 283 unchanged lines hidden (view full) ---

342 if (!debug && !(ts->pfrts_flags & PFR_TFLAG_ACTIVE))
343 return;
344 print_table(&ts->pfrts_t, 1, debug);
345 printf("\tAddresses: %d\n", ts->pfrts_cnt);
346 printf("\tCleared: %s", ctime(&time));
347 printf("\tReferences: [ Anchors: %-18d Rules: %-18d ]\n",
348 ts->pfrts_refcnt[PFR_REFCNT_ANCHOR],
349 ts->pfrts_refcnt[PFR_REFCNT_RULE]);
58#include "pfctl_parser.h"
59#include "pfctl.h"
60
61extern void usage(void);
62static int pfctl_table(int, char *[], char *, const char *, char *,
63 const char *, const char *, int);
64static void print_table(struct pfr_table *, int, int);
65static void print_tstats(struct pfr_tstats *, int);

--- 283 unchanged lines hidden (view full) ---

349 if (!debug && !(ts->pfrts_flags & PFR_TFLAG_ACTIVE))
350 return;
351 print_table(&ts->pfrts_t, 1, debug);
352 printf("\tAddresses: %d\n", ts->pfrts_cnt);
353 printf("\tCleared: %s", ctime(&time));
354 printf("\tReferences: [ Anchors: %-18d Rules: %-18d ]\n",
355 ts->pfrts_refcnt[PFR_REFCNT_ANCHOR],
356 ts->pfrts_refcnt[PFR_REFCNT_RULE]);
350 printf("\tEvaluations: [ NoMatch: %-18llu Match: %-18llu ]\n",
357 printf("\tEvaluations: [ NoMatch: %-18"PRIu64" Match: %-18"PRIu64" ]\n",
351 ts->pfrts_nomatch, ts->pfrts_match);
352 for (dir = 0; dir < PFR_DIR_MAX; dir++)
353 for (op = 0; op < PFR_OP_TABLE_MAX; op++)
358 ts->pfrts_nomatch, ts->pfrts_match);
359 for (dir = 0; dir < PFR_DIR_MAX; dir++)
360 for (op = 0; op < PFR_OP_TABLE_MAX; op++)
354 printf("\t%-12s [ Packets: %-18llu Bytes: %-18llu ]\n",
361 printf("\t%-12s [ Packets: %-18"PRIu64" Bytes: %-18"PRIu64" ]\n",
355 stats_text[dir][op],
356 ts->pfrts_packets[dir][op],
357 ts->pfrts_bytes[dir][op]);
358}
359
360int
361load_addr(struct pfr_buffer *b, int argc, char *argv[], char *file,
362 int nonetwork)

--- 61 unchanged lines hidden (view full) ---

424{
425 time_t time = as->pfras_tzero;
426 int dir, op;
427
428 print_addrx(&as->pfras_a, NULL, dns);
429 printf("\tCleared: %s", ctime(&time));
430 for (dir = 0; dir < PFR_DIR_MAX; dir++)
431 for (op = 0; op < PFR_OP_ADDR_MAX; op++)
362 stats_text[dir][op],
363 ts->pfrts_packets[dir][op],
364 ts->pfrts_bytes[dir][op]);
365}
366
367int
368load_addr(struct pfr_buffer *b, int argc, char *argv[], char *file,
369 int nonetwork)

--- 61 unchanged lines hidden (view full) ---

431{
432 time_t time = as->pfras_tzero;
433 int dir, op;
434
435 print_addrx(&as->pfras_a, NULL, dns);
436 printf("\tCleared: %s", ctime(&time));
437 for (dir = 0; dir < PFR_DIR_MAX; dir++)
438 for (op = 0; op < PFR_OP_ADDR_MAX; op++)
432 printf("\t%-12s [ Packets: %-18llu Bytes: %-18llu ]\n",
439 printf("\t%-12s [ Packets: %-18"PRIu64" Bytes: %-18"PRIu64" ]\n",
433 stats_text[dir][op],
434 as->pfras_packets[dir][op],
435 as->pfras_bytes[dir][op]);
436}
437
438void
439radix_perror(void)
440{

--- 84 unchanged lines hidden ---
440 stats_text[dir][op],
441 as->pfras_packets[dir][op],
442 as->pfras_bytes[dir][op]);
443}
444
445void
446radix_perror(void)
447{

--- 84 unchanged lines hidden ---