Lines Matching full:socket
13 socket API, the Linux network stack and implements the CAN device
14 drivers as network interfaces. The CAN socket API has been designed
22 Motivation / Why Using the Socket API
41 protocol family has been implemented which provides a socket interface
58 selects that protocol when opening the socket, and then can read and
67 socket(2) and using bind(2) to select a CAN interface and CAN ID, an
109 provide a socket interface to user space applications which builds
129 application opens a CAN RAW socket, the raw protocol module itself
176 separate socket. See sockopts from the CAN RAW sockets in :ref:`socketcan-raw-sockets`.
209 Like TCP/IP, you first need to open a socket for communicating over a
211 need to pass PF_CAN as the first argument to the socket(2) system
213 socket protocol and the broadcast manager (BCM). So to open a socket,
216 s = socket(PF_CAN, SOCK_RAW, CAN_RAW);
220 s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
222 respectively. After the successful creation of the socket, you would
223 normally use the bind(2) system call to bind the socket to a CAN
226 the socket, you can read(2) and write(2) from/to the socket or use
228 on the socket as usual. There are also CAN specific socket options
248 default. A read(2) system call on a CAN_RAW socket transfers a
252 PF_PACKET socket, that also binds to a specific interface:
276 s = socket(PF_CAN, SOCK_RAW, CAN_RAW);
288 To bind a socket to all(!) CAN interfaces the interface index must
289 be 0 (zero). In this case the socket receives CAN frames from every
292 on a socket that is bound to 'any' interface sendto(2) is needed to
295 Reading CAN frames from a bound CAN_RAW socket (see above) consists
305 perror("can raw socket read");
354 a message from the socket:
371 bytes of payload (struct can_frame) like the CAN_RAW socket. Therefore e.g.
372 the CAN_RAW socket supports a new socket option CAN_RAW_FD_FRAMES that
373 switches the socket into a mode that allows the handling of CAN FD frames
422 defaults are set at RAW socket binding time:
425 - The socket only receives valid data frames (=> no error message frames)
427 - The socket does not receive its own sent frames (in loopback mode)
429 These default settings may be changed before or after binding the socket.
430 To use the referenced definitions of the socket options for CAN_RAW
436 RAW socket option CAN_RAW_FILTER
440 by defining 0 .. n filters with the CAN_RAW_FILTER socket option.
461 receive filters for each open socket separately:
474 To disable the reception of CAN frames on the selected CAN_RAW socket:
481 data causes the raw socket to discard the received CAN frames. But
526 RAW Socket Option CAN_RAW_ERR_FILTER
545 RAW Socket Option CAN_RAW_LOOPBACK
551 functionality can be disabled (separately for each socket):
560 RAW socket option CAN_RAW_RECV_OWN_MSGS
566 needs. The reception of the CAN frames on the same socket that was
581 RAW Socket Option CAN_RAW_FD_FRAMES
584 CAN FD support in CAN_RAW sockets can be enabled with a new socket option
585 CAN_RAW_FD_FRAMES which is off by default. When the new socket option is
586 not supported by the CAN_RAW socket (e.g. on older kernels), switching the
591 when reading from the socket:
626 been received from the socket a legacy CAN frame has been read into the
636 socket option returns an error: No problem. You'll get legacy CAN frames
644 RAW socket option CAN_RAW_JOIN_FILTERS
647 The CAN_RAW socket can set multiple CAN identifier specific filters that
652 This socket option joines the given CAN filters in the way that only CAN
661 RAW Socket Returned Message Flags
670 set when the frame was sent via the socket it is received on.
691 A BCM socket is not intended for sending individual CAN frames using the
692 struct can_frame as known from the CAN_RAW socket. Instead a special BCM
715 Note a CAN_BCM socket must be connected instead of bound after socket
724 s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
736 The broadcast manager socket is able to handle any number of in flight
740 When the broadcast manager socket is bound to 'any' CAN interface (=> the
744 socket messages the originating CAN interface is provided in can_ifindex.
1058 - TX: Put the CAN frame from the socket buffer to the CAN controller.
1059 - RX: Put the CAN frame from the CAN controller to the socket buffer.
1078 The struct can_frame or struct canfd_frame is the payload of each socket
1107 to set different multiple filters for each socket separately.
1420 - Urs Thuermann (PF_CAN core, kernel integration, socket interfaces, raw, vcan)
1421 - Jan Kizka (RT-SocketCAN core, Socket-API reconciliation)
1422 - Wolfgang Grandegger (RT-SocketCAN core & drivers, Raw Socket-API reviews, CAN device driver inter…