/* This file is part of Lcrzo.
*/

int lcrzo_priv_wait_sniff_read(lcrzo_sniff *psniff)
#if LCRZODEF_LIBPCAPINSTALLED==1
{ lcrzo_data data;
  lcrzo_int32 datasize;
  int ret;

  /*parameters verification*/
  if (psniff==NULL) return(LCRZO_ERR_PANULLPTR);

  /* just for the compiler warning */
  data=NULL;
  datasize=0;

  switch(psniff->snifftype)
  { case LCRZO_SNIFF_TYPE_NORMAL :
      lcrzo_er(lcrzo_priv_sniff_nextmnormal(psniff, &data, &datasize));
      break;
    case LCRZO_SNIFF_TYPE_IPREAS :
      lcrzo_er(lcrzo_priv_sniff_nextmreasip(psniff, &data, &datasize));
      break;
    case LCRZO_SNIFF_TYPE_TCPREOR :
      lcrzo_er(lcrzo_priv_sniff_nextmreortcp(psniff, &data, &datasize));
      break;
  }
  lcrzo_err_purge();

  /* store it */
  ret=lcrzo_priv_storeddata_append(data, datasize,
				   &(psniff->storeddata), 
				   &(psniff->storeddatasize));
  lcrzo_data_free(data);

  return(ret);
}
#else
{ return (LCRZO_ERR_IEUNIMPLEMENTED);
  /* just for the compiler warning */
  psniff=psniff;
}
#endif
