ipsec.c (175061) | ipsec.c (199946) |
---|---|
1/* $KAME: ipsec.c,v 1.33 2003/07/25 09:54:32 itojun Exp $ */ 2 3/*- 4 * Copyright (c) 2005 NTT Multimedia Communications Laboratories, Inc. 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 --- 79 unchanged lines hidden (view full) --- 88 89#if 0 90#ifndef lint 91static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95"; 92#endif /* not lint */ 93#endif 94 95#include <sys/cdefs.h> | 1/* $KAME: ipsec.c,v 1.33 2003/07/25 09:54:32 itojun Exp $ */ 2 3/*- 4 * Copyright (c) 2005 NTT Multimedia Communications Laboratories, Inc. 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 --- 79 unchanged lines hidden (view full) --- 88 89#if 0 90#ifndef lint 91static char sccsid[] = "@(#)inet.c 8.5 (Berkeley) 5/24/95"; 92#endif /* not lint */ 93#endif 94 95#include <sys/cdefs.h> |
96__FBSDID("$FreeBSD: head/usr.bin/netstat/ipsec.c 175061 2008-01-02 23:26:11Z obrien $"); | 96__FBSDID("$FreeBSD: head/usr.bin/netstat/ipsec.c 199946 2009-11-29 20:37:30Z bz $"); |
97 98#include <sys/param.h> 99#include <sys/queue.h> 100#include <sys/socket.h> 101#include <sys/socketvar.h> 102 103#include <netinet/in.h> 104 --- 308 unchanged lines hidden (view full) --- 413 kread(off, (char *)&espstat, sizeof(espstat)); 414 415 print_espstats(&espstat); 416} 417 418static void 419print_ipcompstats(const struct ipcompstat *ipcompstat) 420{ | 97 98#include <sys/param.h> 99#include <sys/queue.h> 100#include <sys/socket.h> 101#include <sys/socketvar.h> 102 103#include <netinet/in.h> 104 --- 308 unchanged lines hidden (view full) --- 413 kread(off, (char *)&espstat, sizeof(espstat)); 414 415 print_espstats(&espstat); 416} 417 418static void 419print_ipcompstats(const struct ipcompstat *ipcompstat) 420{ |
421 uint32_t version; |
|
421#define p32(f, m) if (ipcompstat->f || sflag <= 1) \ 422 printf("\t%u" m, (unsigned int)ipcompstat->f, plural(ipcompstat->f)) 423#define p64(f, m) if (ipcompstat->f || sflag <= 1) \ 424 printf("\t%ju" m, (uintmax_t)ipcompstat->f, plural(ipcompstat->f)) 425#define hist(f, n, t) \ 426 ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t)); 427 | 422#define p32(f, m) if (ipcompstat->f || sflag <= 1) \ 423 printf("\t%u" m, (unsigned int)ipcompstat->f, plural(ipcompstat->f)) 424#define p64(f, m) if (ipcompstat->f || sflag <= 1) \ 425 printf("\t%ju" m, (uintmax_t)ipcompstat->f, plural(ipcompstat->f)) 426#define hist(f, n, t) \ 427 ipsec_hist_new((f), sizeof(f)/sizeof(f[0]), (n), (t)); 428 |
429#ifndef IPCOMPSTAT_VERSION 430 version = 0; 431#else 432 version = ipcompstat->version; 433#endif |
|
428 p32(ipcomps_hdrops, " packet%s shorter than header shows\n"); 429 p32(ipcomps_nopf, " packet%s dropped; protocol family not supported\n"); 430 p32(ipcomps_notdb, " packet%s dropped; no TDB\n"); 431 p32(ipcomps_badkcr, " packet%s dropped; bad KCR\n"); 432 p32(ipcomps_qfull, " packet%s dropped; queue full\n"); 433 p32(ipcomps_noxform, " packet%s dropped; no transform\n"); 434 p32(ipcomps_wrap, " replay counter wrap%s\n"); 435 p32(ipcomps_input, " packet%s in\n"); 436 p32(ipcomps_output, " packet%s out\n"); 437 p32(ipcomps_invalid, " packet%s dropped; invalid TDB\n"); 438 p64(ipcomps_ibytes, " byte%s in\n"); 439 p64(ipcomps_obytes, " byte%s out\n"); 440 p32(ipcomps_toobig, " packet%s dropped; larger than IP_MAXPACKET\n"); 441 p32(ipcomps_pdrops, " packet%s blocked due to policy\n"); 442 p32(ipcomps_crypto, " crypto processing failure%s\n"); 443 hist(ipcompstat->ipcomps_hist, ipsec_compnames, "COMP output"); | 434 p32(ipcomps_hdrops, " packet%s shorter than header shows\n"); 435 p32(ipcomps_nopf, " packet%s dropped; protocol family not supported\n"); 436 p32(ipcomps_notdb, " packet%s dropped; no TDB\n"); 437 p32(ipcomps_badkcr, " packet%s dropped; bad KCR\n"); 438 p32(ipcomps_qfull, " packet%s dropped; queue full\n"); 439 p32(ipcomps_noxform, " packet%s dropped; no transform\n"); 440 p32(ipcomps_wrap, " replay counter wrap%s\n"); 441 p32(ipcomps_input, " packet%s in\n"); 442 p32(ipcomps_output, " packet%s out\n"); 443 p32(ipcomps_invalid, " packet%s dropped; invalid TDB\n"); 444 p64(ipcomps_ibytes, " byte%s in\n"); 445 p64(ipcomps_obytes, " byte%s out\n"); 446 p32(ipcomps_toobig, " packet%s dropped; larger than IP_MAXPACKET\n"); 447 p32(ipcomps_pdrops, " packet%s blocked due to policy\n"); 448 p32(ipcomps_crypto, " crypto processing failure%s\n"); 449 hist(ipcompstat->ipcomps_hist, ipsec_compnames, "COMP output"); |
450 if (version >= 1) { 451 p32(ipcomps_threshold, " packet%s sent uncompressed; size < compr. algo. threshold\n"); 452 p32(ipcomps_uncompr, " packet%s sent uncompressed; compression was useless\n"); 453 } |
|
444 445#undef p32 446#undef p64 447#undef hist 448} 449 450void 451ipcomp_stats(u_long off, const char *name, int family __unused, --- 13 unchanged lines hidden --- | 454 455#undef p32 456#undef p64 457#undef hist 458} 459 460void 461ipcomp_stats(u_long off, const char *name, int family __unused, --- 13 unchanged lines hidden --- |