[Xenomai] Raw Ethernet socket in Xenomai 3.0.3

Philippe Gerum rpm at xenomai.org
Sun Mar 12 18:13:02 CET 2017

On 03/11/2017 08:58 PM, Ed Hannigan wrote:
> I have a Xenomai 2.6.1 userspace app that uses RTNet 0.9.13 and I can
> send/receive raw Ethernet packets with calls rt_dev_send and rt_dev_recv.
> I am trying to migrate to Xenomai 3.0.3 but receiving a negative error
> code from the following line:
> s = rt_dev_socket(AF_PACKET, SOCK_RAW, MY_PROTOCOL);
> rtifconfig shows rteth0 as UP and receives packets so my
> 8139 works.  The eth_p_all demo appears to only show packets received
> from non-realtime cards.  Looking on the web I've seen that maybe I should
> use rtdm_socket, rtdm_send, etc

No, these services belong to the inter-driver RTDM API in kernel space:

.  If I try doing this then I run into linker
> errors with the Cobalt core.  I need help with setup and sending/receiving
> of raw Ethernet packets from in user-space.

You can either:

- convert your code from the legacy rt_dev_* API in user-space to the
regular socket API (preferred option), which requires to enable symbol
wrapping, so that socket/sendmsg/recvmsg/... are pulled from libcobalt
instead of libc. See

- enable the compatibility mode for building your app, by passing the
"--rtdm --compat" switches to xeno-config when retrieving the CFLAGS or
LDFLAGS (xeno-config --cflags/--ldflags ...).


More information about the Xenomai mailing list