Coder Social home page Coder Social logo

udpreplay's Introduction

udpreplay

License

udpreplay is a lightweight alternative to tcpreplay for replaying UDP unicast and multicast streams from a pcap file.

Usage

usage: udpreplay [-i iface] [-l] [-s speed] [-c millisec] [-r repeat] [-t ttl] pcap

  -i iface    interface to send packets through
  -l          enable loopback
  -c millisec constant milliseconds between packets
  -r repeat   number of times to loop data
  -s speed    replay speed relative to pcap timestamps
  -t ttl      packet ttl
  -b          enable broadcast (SO_BROADCAST)

Example

$ udpreplay -i eth0 example.pcap

Building & Installing

udpreplay requires CMake 3.5 or higher,
g++ and libpcap-dev to build and install.

Building on Debian/Ubuntu:

sudo apt install cmake libpcap-dev g++
cd udpreplay
mkdir build && cd build
cmake ..
make

Building on RHEL/CentOS:

sudo yum install cmake3 libpcap-devel gcc-c++
cd udpreplay
mkdir build && cd build
cmake3 ..
make

Installing:

$ sudo make install

About

This project was created by Erik Rigtorp <[email protected]>.

udpreplay's People

Contributors

glaslos avatar james-watson avatar juszak avatar maximkot avatar rigtorp avatar sobomax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

udpreplay's Issues

meet problems while building

I wonder if it could be built on MacOS. If so , when I make files it says
/udpreplay-master/src/udpreplay.cpp:173:40: error: unknown
type name 'iphdr'
auto ip = reinterpret_cast<const iphdr *>(p + sizeof(ether_header));
^
Like this, there are 6 errors. So I can't build it.

My CMake version is 3.12.4, the latest release is 3.14, is that's fault? I have already installed libpcap using pip.

make with errors on centos 7.8

$ cmake --version
cmake version 3.18.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ make --version
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ mkdir build && cd build
$ cmake3 ..
-- The CXX compiler identification is GNU 10.2.0
-- Check for working CXX compiler: /opt/gcc/10.2.0/gcc-10.2.0/bin/g++
-- Check for working CXX compiler: /opt/gcc/10.2.0/gcc-10.2.0/bin/g++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /TRAVAIL/udpreplay/build
$ make
Scanning dependencies of target udpreplay
[ 50%] Building CXX object CMakeFiles/udpreplay.dir/src/udpreplay.cpp.o
/TRAVAIL/udpreplay/src/udpreplay.cpp: In function 'int main(int, char**)':
/TRAVAIL/udpreplay/src/udpreplay.cpp:225:32: error: 'const struct udphdr' has no member named 'uh_ulen'
225 | ssize_t len = ntohs(udp->uh_ulen) - 8;
| ^~~~~~~
/TRAVAIL/udpreplay/src/udpreplay.cpp:232:28: error: 'const struct udphdr' has no member named 'uh_dport'
232 | addr.sin_port = udp->uh_dport;
| ^~~~~~~~
make[2]: *** [CMakeFiles/udpreplay.dir/build.make:83: CMakeFiles/udpreplay.dir/src/udpreplay.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/udpreplay.dir/all] Error 2
make: *** [Makefile:161: all] Error 2

I have the same issue on a redhat7 system..

Can you help me please

CI is broken

Travis build for clang 5.0 and 6.0 is broken:

https://travis-ci.org/rigtorp/udpreplay/builds/616401609
https://travis-ci.org/rigtorp/udpreplay/builds/616800378

The following packages have unmet dependencies:
clang-6.0 : Depends: libjsoncpp0 (>= 0.6.0~rc2) but it is not installable
E: Unable to correct problems, you have held broken packages.
apt-get.diagnostics
apt-get install failed
The command "sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install clang-6.0 libstdc++-7-dev libpcap-dev" failed and exited with 100 during .

P.S. The best way to capture this kind of errors is to enable "cron" builds on Travis. :)

Fragmentation issue

The library crashes when trying to send UDP packets fragmented at the IP level.

Error messages:
"sendto: message too long" or "sendto: Bad address"

Could you please support me and eventually release a patch?

Thanks,
Aleksey

how to replay can socket !

i use tcpdump to record the can-socket to a file, the file can be open rightly by wireshare and tcpdum,but can not played by udpreplay,please help me

udpreplay freezes

Resending RTP packets freezes when rtp timestamp from header is lower than previous rtp packet timestamp. Should not happen in perfect RTP stream but in general it's possible.
freezingPatch.zip

New release

Could you possibly be so kind and create a new release based on your latest changes? I am not requesting any changes just the most recent ones in a release 1.0.1 or something. This would make it easier including udpreplay in builds. Thanks!

udpreplay lost frame

i have use tcpdump -w to write a pcap file,
using udpreplay the pcap file ,and using tcpdump -w write another pcap file at the same time
but a lot's of frame has been lost

Add "play forever" option

If the user enters a repeat value of 0 or -1, then the program should be smart enough to replay the stream forever.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.