safePcapStatus

fnPcapStatus safePcapStatus(int code, out int rawCode)

Safely converts an integer status code from libpcap into a PcapStatus.

If the value matches a known PcapStatus member it is returned directly. Otherwise a safe default (PcapStatus.ERROR) is returned and the raw value is noted in the optional rawCode output parameter.

Parameters

codeThe raw integer status code.
rawCodeReceives the original value if it does not match a known status.

Returns

The corresponding PcapStatus, or PcapStatus.ERROR for unknown codes.