int32_t scap_start_dropping_mode(scap_t* handle, uint32_t sampling_ratio) { #if !defined(HAS_CAPTURE) snprintf(handle->m_lasterr, SCAP_LASTERR_SIZE, "live capture not supported on %s", PLATFORM_NAME); return SCAP_FAILURE; #else return scap_set_dropping_mode(handle, PPM_IOCTL_ENABLE_DROPPING_MODE, sampling_ratio); #endif }
int32_t scap_start_dropping_mode(scap_t* handle, uint32_t sampling_ratio) { #ifdef _WIN32 snprintf(handle->m_lasterr, SCAP_LASTERR_SIZE, "live capture not supported on windows"); return SCAP_FAILURE; #elif defined(__APPLE__) snprintf(handle->m_lasterr, SCAP_LASTERR_SIZE, "live capture not supported on OSX"); return SCAP_FAILURE; #else return scap_set_dropping_mode(handle, PPM_IOCTL_ENABLE_DROPPING_MODE, sampling_ratio); #endif }