Xenomai  3.1
Driver to driver services

Inter-driver interface. More...

Collaboration diagram for Driver to driver services:

Functions

int rtdm_open (const char *path, int oflag,...)
 
Open a device More...
 
int rtdm_socket (int protocol_family, int socket_type, int protocol)
 
Create a socket More...
 
int rtdm_close (int fd)
 
Close a device or socket More...
 
int rtdm_ioctl (int fd, int request,...)
 
Issue an IOCTL More...
 
ssize_t rtdm_read (int fd, void *buf, size_t nbyte)
 
Read from device More...
 
ssize_t rtdm_write (int fd, const void *buf, size_t nbyte)
 
Write to device More...
 
ssize_t rtdm_recvmsg (int fd, struct user_msghdr *msg, int flags)
 
Receive message from socket More...
 
ssize_t rtdm_recvfrom (int fd, void *buf, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen)
 
Receive message from socket More...
 
ssize_t rtdm_recv (int fd, void *buf, size_t len, int flags)
 
Receive message from socket More...
 
ssize_t rtdm_sendmsg (int fd, const struct user_msghdr *msg, int flags)
 
Transmit message to socket More...
 
ssize_t rtdm_sendto (int fd, const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen)
 
Transmit message to socket More...
 
ssize_t rtdm_send (int fd, const void *buf, size_t len, int flags)
 
Transmit message to socket More...
 
int rtdm_bind (int fd, const struct sockaddr *my_addr, socklen_t addrlen)
 
Bind to local address More...
 
int rtdm_connect (int fd, const struct sockaddr *serv_addr, socklen_t addrlen)
 
Connect to remote address More...
 
int rtdm_listen (int fd, int backlog)
 
Listen to incoming connection requests More...
 
int rtdm_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
 
Accept a connection request More...
 
int rtdm_shutdown (int fd, int how)
 
Shut down parts of a connection More...
 
int rtdm_getsockopt (int fd, int level, int optname, void *optval, socklen_t *optlen)
 
Get socket option More...
 
int rtdm_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen)
 
Set socket option More...
 
int rtdm_getsockname (int fd, struct sockaddr *name, socklen_t *namelen)
 
Get local socket address More...
 
int rtdm_getpeername (int fd, struct sockaddr *name, socklen_t *namelen)
 
Get socket destination address More...
 

Detailed Description

Inter-driver interface.

Function Documentation

◆ rtdm_accept()

int rtdm_accept ( int  fd,
struct sockaddr *  addr,
socklen_t *  addrlen 
)


Accept a connection request


Accept connection requests

Refer to rtdm_accept() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[out]addrBuffer for remote address
[in,out]addrlenAddress buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
accept() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_bind()

int rtdm_bind ( int  fd,
const struct sockaddr *  my_addr,
socklen_t  addrlen 
)


Bind to local address

Refer to rtdm_bind() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]my_addrAddress buffer
[in]addrlenAddress buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
bind() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_close()

int rtdm_close ( int  fd)


Close a device or socket

Refer to rtdm_close() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
secondary-only, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_open() or rtdm_socket()
Returns
0 on success, otherwise a negative error code.
Note
If the matching rtdm_open() or rtdm_socket() call took place in non-real-time context, rtdm_close() must be issued within non-real-time as well. Otherwise, the call will fail.

Action depends on driver implementation, see Device Profiles.

See also
close() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
secondary-only, might-switch

◆ rtdm_connect()

int rtdm_connect ( int  fd,
const struct sockaddr *  serv_addr,
socklen_t  addrlen 
)


Connect to remote address

Refer to rtdm_connect() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]serv_addrAddress buffer
[in]addrlenAddress buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
connect() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_getpeername()

int rtdm_getpeername ( int  fd,
struct sockaddr *  name,
socklen_t *  namelen 
)


Get socket destination address

Refer to rtdm_getpeername() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[out]nameAddress buffer
[in,out]namelenAddress buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
getpeername() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
task-unrestricted, might-switch

◆ rtdm_getsockname()

int rtdm_getsockname ( int  fd,
struct sockaddr *  name,
socklen_t *  namelen 
)


Get local socket address

Refer to rtdm_getsockname() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[out]nameAddress buffer
[in,out]namelenAddress buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
getsockname() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
task-unrestricted, might-switch

◆ rtdm_getsockopt()

int rtdm_getsockopt ( int  fd,
int  level,
int  optname,
void *  optval,
socklen_t *  optlen 
)


Get socket option

Refer to rtdm_getsockopt() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]levelAddressed stack level
[in]optnameOption name ID
[out]optvalValue buffer
[in,out]optlenValue buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
getsockopt() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
task-unrestricted, might-switch

◆ rtdm_ioctl()

int rtdm_ioctl ( int  fd,
int  request,
  ... 
)


Issue an IOCTL

Refer to rtdm_ioctl() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_open() or rtdm_socket()
[in]requestIOCTL code
...Optional third argument, depending on IOCTL function (void * or unsigned long)
Returns
Positiv value on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
ioctl() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
task-unrestricted, might-switch

◆ rtdm_listen()

int rtdm_listen ( int  fd,
int  backlog 
)


Listen to incoming connection requests


Listen for incomming connection requests

Refer to rtdm_listen() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]backlogMaximum queue length
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
listen() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
task-unrestricted, might-switch

◆ rtdm_open()

int rtdm_open ( const char *  path,
int  oflag,
  ... 
)


Open a device

Refer to rtdm_open() for parameters and return values

Tags
secondary-only, might-switch
Parameters
[in]pathDevice name
[in]oflagOpen flags
...Further parameters will be ignored.
Returns
Positive file descriptor value on success, otherwise a negative error code.

Action depends on driver implementation, see Device Profiles.

See also
open() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
secondary-only, might-switch

◆ rtdm_read()

ssize_t rtdm_read ( int  fd,
void *  buf,
size_t  nbyte 
)


Read from device

Refer to rtdm_read() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_open()
[out]bufInput buffer
[in]nbyteNumber of bytes to read
Returns
Number of bytes read, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
read() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_recv()

ssize_t rtdm_recv ( int  fd,
void *  buf,
size_t  len,
int  flags 
)


Receive message from socket

Refer to rtdm_recv() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[out]bufMessage buffer
[in]lenMessage buffer size
[in]flagsMessage flags
Returns
Number of bytes received, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
recv() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_recvfrom()

ssize_t rtdm_recvfrom ( int  fd,
void *  buf,
size_t  len,
int  flags,
struct sockaddr *  from,
socklen_t *  fromlen 
)


Receive message from socket

Refer to rtdm_recvfrom() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[out]bufMessage buffer
[in]lenMessage buffer size
[in]flagsMessage flags
[out]fromBuffer for message sender address
[in,out]fromlenAddress buffer size
Returns
Number of bytes received, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
recvfrom() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_recvmsg()

ssize_t rtdm_recvmsg ( int  fd,
struct user_msghdr *  msg,
int  flags 
)


Receive message from socket

Refer to rtdm_recvmsg() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in,out]msgMessage descriptor
[in]flagsMessage flags
Returns
Number of bytes received, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
recvmsg() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_send()

ssize_t rtdm_send ( int  fd,
const void *  buf,
size_t  len,
int  flags 
)


Transmit message to socket

Refer to rtdm_send() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]bufMessage buffer
[in]lenMessage buffer size
[in]flagsMessage flags
Returns
Number of bytes sent, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
send() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_sendmsg()

ssize_t rtdm_sendmsg ( int  fd,
const struct user_msghdr *  msg,
int  flags 
)


Transmit message to socket

Refer to rtdm_sendmsg() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]msgMessage descriptor
[in]flagsMessage flags
Returns
Number of bytes sent, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
sendmsg() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_sendto()

ssize_t rtdm_sendto ( int  fd,
const void *  buf,
size_t  len,
int  flags,
const struct sockaddr *  to,
socklen_t  tolen 
)


Transmit message to socket

Refer to rtdm_sendto() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]bufMessage buffer
[in]lenMessage buffer size
[in]flagsMessage flags
[in]toBuffer for message destination address
[in]tolenAddress buffer size
Returns
Number of bytes sent, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
sendto() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch

◆ rtdm_setsockopt()

int rtdm_setsockopt ( int  fd,
int  level,
int  optname,
const void *  optval,
socklen_t  optlen 
)


Set socket option

Refer to rtdm_setsockopt() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
task-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]levelAddressed stack level
[in]optnameOption name ID
[in]optvalValue buffer
[in]optlenValue buffer size
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
setsockopt() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
task-unrestricted, might-switch

◆ rtdm_shutdown()

int rtdm_shutdown ( int  fd,
int  how 
)


Shut down parts of a connection

Refer to rtdm_shutdown() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
secondary-only, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_socket()
[in]howSpecifies the part to be shut down (SHUT_xxx)
Returns
0 on success, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
shutdown() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
secondary-only, might-switch

◆ rtdm_socket()

int rtdm_socket ( int  protocol_family,
int  socket_type,
int  protocol 
)


Create a socket

Refer to rtdm_socket() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
secondary-only, might-switch
Parameters
[in]protocol_familyProtocol family (PF_xxx)
[in]socket_typeSocket type (SOCK_xxx)
[in]protocolProtocol ID, 0 for default
Returns
Positive file descriptor value on success, otherwise a negative error code.

Action depends on driver implementation, see Device Profiles.

See also
socket() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
secondary-only, might-switch

◆ rtdm_write()

ssize_t rtdm_write ( int  fd,
const void *  buf,
size_t  nbyte 
)


Write to device

Refer to rtdm_write() for parameters and return values. Action depends on driver implementation, see Device Profiles.

Tags
mode-unrestricted, might-switch
Parameters
[in]fdFile descriptor as returned by rtdm_open()
[in]bufOutput buffer
[in]nbyteNumber of bytes to write
Returns
Number of bytes written, otherwise negative error code

Action depends on driver implementation, see Device Profiles.

See also
write() in IEEE Std 1003.1, http://www.opengroup.org/onlinepubs/009695399
Tags
mode-unrestricted, might-switch