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
280 default. A read(2) system call on a CAN_RAW socket transfers a
284 PF_PACKET socket, that also binds to a specific interface:
304 s = socket(PF_CAN, SOCK_RAW, CAN_RAW);
316 To bind a socket to all(!) CAN interfaces the interface index must
317 be 0 (zero). In this case the socket receives CAN frames from every
320 on a socket that is bound to 'any' interface sendto(2) is needed to
323 Reading CAN frames from a bound CAN_RAW socket (see above) consists
331 perror("can raw socket read");
382 bytes of payload (struct can_frame) like the CAN_RAW socket. Therefore e.g.
383 the CAN_RAW socket supports a new socket option CAN_RAW_FD_FRAMES that
384 switches the socket into a mode that allows the handling of CAN FD frames
425 defaults are set at RAW socket binding time:
428 - The socket only receives valid data frames (=> no error message frames)
430 - The socket does not receive its own sent frames (in loopback mode)
432 These default settings may be changed before or after binding the socket.
433 To use the referenced definitions of the socket options for CAN_RAW
436 4.1.1 RAW socket option CAN_RAW_FILTER
439 by defining 0 .. n filters with the CAN_RAW_FILTER socket option.
456 receive filters for each open socket separately:
467 To disable the reception of CAN frames on the selected CAN_RAW socket:
472 data causes the raw socket to discard the received CAN frames. But
511 4.1.2 RAW socket option CAN_RAW_ERR_FILTER
526 4.1.3 RAW socket option CAN_RAW_LOOPBACK
531 functionality can be disabled (separately for each socket):
537 4.1.4 RAW socket option CAN_RAW_RECV_OWN_MSGS
542 needs. The reception of the CAN frames on the same socket that was
552 4.1.5 RAW socket option CAN_RAW_FD_FRAMES
554 CAN FD support in CAN_RAW sockets can be enabled with a new socket option
555 CAN_RAW_FD_FRAMES which is off by default. When the new socket option is
556 not supported by the CAN_RAW socket (e.g. on older kernels), switching the
561 when reading from the socket.
591 been received from the socket a legacy CAN frame has been read into the
601 socket option returns an error: No problem. You'll get legacy CAN frames
608 4.1.6 RAW socket option CAN_RAW_JOIN_FILTERS
610 The CAN_RAW socket can set multiple CAN identifier specific filters that
615 This socket option joines the given CAN filters in the way that only CAN
623 4.1.7 RAW socket returned message flags
629 MSG_CONFIRM: set when the frame was sent via the socket it is received on.
647 A BCM socket is not intended for sending individual CAN frames using the
648 struct can_frame as known from the CAN_RAW socket. Instead a special BCM
669 Note a CAN_BCM socket must be connected instead of bound after socket
676 s = socket(PF_CAN, SOCK_DGRAM, CAN_BCM);
688 The broadcast manager socket is able to handle any number of in flight
692 When the broadcast manager socket is bound to 'any' CAN interface (=> the
696 socket messages the originating CAN interface is provided in can_ifindex.
924 - TX: Put the CAN frame from the socket buffer to the CAN controller.
925 - RX: Put the CAN frame from the CAN controller to the socket buffer.
940 The struct can_frame or struct canfd_frame is the payload of each socket
963 to set different multiple filters for each socket separately.
1258 Urs Thuermann (PF_CAN core, kernel integration, socket interfaces, raw, vcan)