*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: can | Section: 4 | Source: NetBSD | File: can.4
CAN(4) FreeBSD Kernel Interfaces Manual CAN(4) NAME CAN - CAN Protocol SYNOPSIS #include <sys/socket.h> #include <netcan/can.h> int socket(AF_CAN, SOCK_RAW, CAN_RAW); DESCRIPTION CAN is the network layer protocol used on top of CAN bus networks. At this time only the SOCK_RAW socket type is supported. This protocol layer is intended to be compatible with the Linux SocketCAN implementation. ADDRESSING A CAN frame consists of a 11 bits (standard frame format) or 29 bits (extended frame format) identifier, followed by up to 8 data bytes. The interpretation of the identifier is application-dependent, the CAN standard itself doesn't define an addressing. The CAN layer uses a 32bits identifier. The 3 upper bits are used as control flags. The extended frame format is selected by setting the CAN_EFF_FLAG control bit. The socket address is defined as struct sockaddr_can { u_int8_t can_len; sa_family_t can_family; int can_ifindex; union { /* transport protocol class address information */ struct { canid_t rx_id, tx_id; } tp; /* reserved for future CAN protocols address information */ } can_addr; }; For CAN raw sockets, the 32bits identifier is part of the message data. The can_addr field of the sockaddr structure is not used. MESSAGE Raw CAN sockets use fixed-length messages defined as follow: struct can_frame { canid_t can_id; /* ID + EFF/RTR/ERR flags */ uint8_t can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ uint8_t __pad; uint8_t __res0; uint8_t __res1; uint8_t data[CAN_MAX_DLEN] __aligned(8); }; The lower 11 bits (for standard frames) or 29 bits (for extended frames) are used as the on-wire identifier. The CAN_EFF_FLAG bit is set in can_id for extended frames. The CAN_RTR_FLAG bit is set in can_id for remote transmission request frames. SEE ALSO socket(2), canloop(4), netintro(4), canconfig(8), /usr/include/netcan/can.h SocketCAN - Wikipedia: https://en.wikipedia.org/wiki/SocketCAN Readme file for the Controller Area Network Protocol Family: https://www.kernel.org/doc/Documentation/networking/can.txt HISTORY The CAN protocol appeared in NetBSD 8.0. BUGS CANFD and error frames are not implemented. FreeBSD 14.1-RELEASE-p8 May 18, 2017 FreeBSD 14.1-RELEASE-p8

Navigation Options