send_packets.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* $Id$ */
  2. /*
  3. * Copyright (c) 2001-2010 Aaron Turner <aturner at synfin dot net>
  4. * Copyright (c) 2013-2024 Fred Klassen <tcpreplay at appneta dot com> - AppNeta
  5. *
  6. * The Tcpreplay Suite of tools is free software: you can redistribute it
  7. * and/or modify it under the terms of the GNU General Public License as
  8. * published by the Free Software Foundation, either version 3 of the
  9. * License, or with the authors permission any later version.
  10. *
  11. * The Tcpreplay Suite is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with the Tcpreplay Suite. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #pragma once
  20. #include "tcpreplay_api.h"
  21. #include <pcap.h>
  22. void send_packets(tcpreplay_t *ctx, pcap_t *pcap, int idx);
  23. void send_dual_packets(tcpreplay_t *ctx, pcap_t *pcap1, int idx1, pcap_t *pcap2, int idx2);
  24. void *cache_mode(tcpreplay_t *ctx, char *cachedata, COUNTER packet_num);
  25. void preload_pcap_file(tcpreplay_t *ctx, int idx);
  26. #ifdef HAVE_LIBXDP
  27. void prepare_remaining_elements_of_batch(tcpreplay_t *ctx,
  28. COUNTER *packetnum,
  29. bool *read_next_packet,
  30. pcap_t *pcap,
  31. int *idx,
  32. struct pcap_pkthdr pkthdr,
  33. packet_cache_t **prev_packet);
  34. void prepare_first_element_of_batch(tcpreplay_t *ctx, COUNTER *packetnum, u_char *pktdata, u_int32_t len);
  35. void fill_umem_with_data_and_set_xdp_desc(sendpacket_t *sp, int tx_idx, COUNTER umem_index, u_char *pktdata, int len);
  36. #endif