Use the PCAP_ERROR #define rather than a raw -1 in all cases where an error message has been constructed, to make it clearer when that's happening. Use the PCAP_ERROR_BREAK #define rather than a raw -2.