Lines Matching refs:socket
11 2 Motivation / Why using the socket API
20 4.1.1 RAW socket option CAN_RAW_FILTER
21 4.1.2 RAW socket option CAN_RAW_ERR_FILTER
22 4.1.3 RAW socket option CAN_RAW_LOOPBACK
23 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS
24 4.1.5 RAW socket option CAN_RAW_FD_FRAMES
25 4.1.6 RAW socket option CAN_RAW_JOIN_FILTERS
26 4.1.7 RAW socket returned message flags
68 socket API, the Linux network stack and implements the CAN device
69 drivers as network interfaces. The CAN socket API has been designed
74 2. Motivation / Why using the socket API
93 protocol family has been implemented which provides a socket interface
110 selects that protocol when opening the socket, and then can read and
119 socket(2) and using bind(2) to select a CAN interface and CAN ID, an
158 provide a socket interface to user space applications which builds
174 application opens a CAN RAW socket, the raw protocol module itself
215 separate socket. See sockopts from the CAN RAW sockets in chapter 4.1.
243 Like TCP/IP, you first need to open a socket for communicating over a
245 need to pass PF_CAN as the first argument to the socket(2) system
247 socket protocol and the broadcast manager (BCM). So to open a socket,
250 s = socket(PF_CAN, SOCK_RAW, CAN_RAW);
254 s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
256 respectively. After the successful creation of the socket, you would
257 normally use the bind(2) system call to bind the socket to a CAN
260 the socket, you can read(2) and write(2) from/to the socket or use
262 on the socket as usual. There are also CAN specific socket options
277 default. A read(2) system call on a CAN_RAW socket transfers a
281 PF_PACKET socket, that also binds to a specific interface:
301 s = socket(PF_CAN, SOCK_RAW, CAN_RAW);
313 To bind a socket to all(!) CAN interfaces the interface index must
314 be 0 (zero). In this case the socket receives CAN frames from every
317 on a socket that is bound to 'any' interface sendto(2) is needed to
320 Reading CAN frames from a bound CAN_RAW socket (see above) consists
328 perror("can raw socket read");
379 bytes of payload (struct can_frame) like the CAN_RAW socket. Therefore e.g.
380 the CAN_RAW socket supports a new socket option CAN_RAW_FD_FRAMES that
381 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
433 4.1.1 RAW socket option CAN_RAW_FILTER
436 by defining 0 .. n filters with the CAN_RAW_FILTER socket option.
453 receive filters for each open socket separately:
464 To disable the reception of CAN frames on the selected CAN_RAW socket:
469 data causes the raw socket to discard the received CAN frames. But
508 4.1.2 RAW socket option CAN_RAW_ERR_FILTER
523 4.1.3 RAW socket option CAN_RAW_LOOPBACK
528 functionality can be disabled (separately for each socket):
534 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS
539 needs. The reception of the CAN frames on the same socket that was
549 4.1.5 RAW socket option CAN_RAW_FD_FRAMES
551 CAN FD support in CAN_RAW sockets can be enabled with a new socket option
552 CAN_RAW_FD_FRAMES which is off by default. When the new socket option is
553 not supported by the CAN_RAW socket (e.g. on older kernels), switching the
558 when reading from the socket.
588 been received from the socket a legacy CAN frame has been read into the
598 socket option returns an error: No problem. You'll get legacy CAN frames
605 4.1.6 RAW socket option CAN_RAW_JOIN_FILTERS
607 The CAN_RAW socket can set multiple CAN identifier specific filters that
612 This socket option joines the given CAN filters in the way that only CAN
620 4.1.7 RAW socket returned message flags
626 MSG_CONFIRM: set when the frame was sent via the socket it is received on.
644 A BCM socket is not intended for sending individual CAN frames using the
645 struct can_frame as known from the CAN_RAW socket. Instead a special BCM
666 Note a CAN_BCM socket must be connected instead of bound after socket
673 s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
685 The broadcast manager socket is able to handle any number of in flight
689 When the broadcast manager socket is bound to 'any' CAN interface (=> the
693 socket messages the originating CAN interface is provided in can_ifindex.
921 - TX: Put the CAN frame from the socket buffer to the CAN controller.
922 - RX: Put the CAN frame from the CAN controller to the socket buffer.
937 The struct can_frame or struct canfd_frame is the payload of each socket
960 to set different multiple filters for each socket separately.
1198 Urs Thuermann (PF_CAN core, kernel integration, socket interfaces, raw, vcan)