Changeset View
Changeset View
Standalone View
Standalone View
head/tools/tools/crypto/ubsecstats.c
Show All 19 Lines | |||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#include <stdio.h> | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/sysctl.h> | |||||
#include <err.h> | |||||
#include <stdio.h> | |||||
#include "../../../sys/dev/ubsec/ubsecvar.h" | #include "../../../sys/dev/ubsec/ubsecvar.h" | ||||
/* | /* | ||||
* Little program to dump the statistics block for the ubsec driver. | * Little program to dump the statistics block for the ubsec driver. | ||||
*/ | */ | ||||
int | int | ||||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | ||||
{ | { | ||||
struct ubsec_stats stats; | struct ubsec_stats stats; | ||||
size_t slen; | size_t slen; | ||||
slen = sizeof (stats); | slen = sizeof (stats); | ||||
if (sysctlbyname("hw.ubsec.stats", &stats, &slen, NULL, NULL) < 0) | if (sysctlbyname("hw.ubsec.stats", &stats, &slen, NULL, 0) < 0) | ||||
err(1, "kern.ubsec_stats"); | err(1, "kern.ubsec_stats"); | ||||
printf("input %llu bytes %u packets\n", | printf("input %llu bytes %u packets\n", | ||||
stats.hst_ibytes, stats.hst_ipackets); | stats.hst_ibytes, stats.hst_ipackets); | ||||
printf("output %llu bytes %u packets\n", | printf("output %llu bytes %u packets\n", | ||||
stats.hst_obytes, stats.hst_opackets); | stats.hst_obytes, stats.hst_opackets); | ||||
printf("invalid %u badsession %u badflags %u\n", | printf("invalid %u badsession %u badflags %u\n", | ||||
stats.hst_invalid, stats.hst_badsession, stats.hst_badflags); | stats.hst_invalid, stats.hst_badsession, stats.hst_badflags); | ||||
Show All 19 Lines |