From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Umair Ali <ali.umair@tut.fi>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai] Pcap replay tool for xenomai
Date: Tue, 3 Nov 2015 12:47:17 +0100 [thread overview]
Message-ID: <20151103114717.GA26720@hermes.click-hack.org> (raw)
In-Reply-To: <2396B4D2166B62479FBBE370D4A7C1F30A705D34@mb2010-3.intra.tut.fi>
On Tue, Nov 03, 2015 at 10:49:14AM +0000, Umair Ali wrote:
> Hello,
>
> I am working on the project of playing back the pcap files in real
> time using xenomai patch on vanilla kernel. The main idea is to
> open the pcap file, read the file packet by packet and then send
> on the network as raw Ethernet packet.
To send raw ethernet packets, see "man 7 packet", here for instance:
http://man7.org/linux/man-pages/man7/packet.7.html
You should call socket(AF_PACKET, SOCK_RAW, 0);
Then send packets with sendto, using a sockaddr_ll structure for the
destination. The important part of the sockaddr_ll is the
ifr_ifindex member, the interface index (at least for RTnet, because
this is what allows to find the interface to use to send the packet).
The same code should work with RTnet "rtpacket" module. Only the
compilation process is different.
A rapid google search gives this result:
https://gist.github.com/austinmarton/1922600
In your case, of course, you would simply take the data from the
pcap file instead of filling the ethernet header and writing
0xdeadbeef as a payload.
> (...)
> I am also new to real time linux kernel.
> Moreover I tried to install the RTnet over the xenoami but most of
> the time my pc hangs up and I need to do the brutal restart.
> (...)
You do not tell us much about your setup, so it is difficult to help
you here. Maybe have a look here:
http://xenomai.org/troubleshooting-a-dual-kernel-configuration/#Kernel_OOPSes
Regards.
--
Gilles.
https://click-hack.org
next prev parent reply other threads:[~2015-11-03 11:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 10:49 [Xenomai] Pcap replay tool for xenomai Umair Ali
2015-11-03 11:47 ` Gilles Chanteperdrix [this message]
[not found] ` <2396B4D2166B62479FBBE370D4A7C1F30A705DA6@mb2010-3.intra.tut.fi>
2015-11-03 14:46 ` Gilles Chanteperdrix
2015-11-05 15:17 ` Umair Ali
2015-11-05 21:33 ` Gilles Chanteperdrix
2015-11-11 11:16 ` Umair Ali
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151103114717.GA26720@hermes.click-hack.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=ali.umair@tut.fi \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.