pp-port-statistics

Synopsis

(pp-port-statistics port)

Parameters

  • port

Description

This procedure returns the port statistics of a specific port as a dotted pair of two numbers, the car component reports the number of packets received, the cdr component the number of packets reported to be dropped. On macOS the number of dropped packets is absolute, whereas on Linux the number of dropped packets is reset to 0 after each retrieval.

Side Effects

On Linux the counters are reset.

Return Value

A dotted pair of two exact numbers.

See Also

Example

$ ./scheme
Inlab Scheme 5.1.44
macOS 12.6.5 Darwin 21.6.0 x86_64 2023-05-01 17:09:30
> (pp-connect-nic 0 "en1" 2)
ok
2023-05-01 17:11:23 NTC BPF device /dev/bpf2 opened successfully
2023-05-01 17:11:23 NTC BPF buffer length 4096 for interface en1 accepted
2023-05-01 17:11:23 NTC promiscuous mode on interface en1 activated
2023-05-01 17:11:23 NTC file descriptor 3 ready for interface en1
2023-05-01 17:11:23 NTC NIC collector thread (BPF) started port=0 fd=3
2023-05-01 17:11:23 NTC NIC collector thread (BPF) started port=0 fd=3
> (pp-port-statistics 0)
(227541 . 0)
>