xref: /dflybsd-src/contrib/libpcap/pcap/can_socketcan.h (revision 3a289941c307ff3d45415fd0d643fa7c8a113dff)
197a9217aSAntonio Huete Jimenez /*-
297a9217aSAntonio Huete Jimenez  * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
397a9217aSAntonio Huete Jimenez  *	The Regents of the University of California.  All rights reserved.
497a9217aSAntonio Huete Jimenez  *
597a9217aSAntonio Huete Jimenez  * This code is derived from the Stanford/CMU enet packet filter,
697a9217aSAntonio Huete Jimenez  * (net/enet.c) distributed as part of 4.3BSD, and code contributed
797a9217aSAntonio Huete Jimenez  * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence
897a9217aSAntonio Huete Jimenez  * Berkeley Laboratory.
997a9217aSAntonio Huete Jimenez  *
1097a9217aSAntonio Huete Jimenez  * Redistribution and use in source and binary forms, with or without
1197a9217aSAntonio Huete Jimenez  * modification, are permitted provided that the following conditions
1297a9217aSAntonio Huete Jimenez  * are met:
1397a9217aSAntonio Huete Jimenez  * 1. Redistributions of source code must retain the above copyright
1497a9217aSAntonio Huete Jimenez  *    notice, this list of conditions and the following disclaimer.
1597a9217aSAntonio Huete Jimenez  * 2. Redistributions in binary form must reproduce the above copyright
1697a9217aSAntonio Huete Jimenez  *    notice, this list of conditions and the following disclaimer in the
1797a9217aSAntonio Huete Jimenez  *    documentation and/or other materials provided with the distribution.
1897a9217aSAntonio Huete Jimenez  * 3. All advertising materials mentioning features or use of this software
1997a9217aSAntonio Huete Jimenez  *    must display the following acknowledgement:
2097a9217aSAntonio Huete Jimenez  *      This product includes software developed by the University of
2197a9217aSAntonio Huete Jimenez  *      California, Berkeley and its contributors.
2297a9217aSAntonio Huete Jimenez  * 4. Neither the name of the University nor the names of its contributors
2397a9217aSAntonio Huete Jimenez  *    may be used to endorse or promote products derived from this software
2497a9217aSAntonio Huete Jimenez  *    without specific prior written permission.
2597a9217aSAntonio Huete Jimenez  *
2697a9217aSAntonio Huete Jimenez  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2797a9217aSAntonio Huete Jimenez  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2897a9217aSAntonio Huete Jimenez  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2997a9217aSAntonio Huete Jimenez  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3097a9217aSAntonio Huete Jimenez  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3197a9217aSAntonio Huete Jimenez  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3297a9217aSAntonio Huete Jimenez  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3397a9217aSAntonio Huete Jimenez  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3497a9217aSAntonio Huete Jimenez  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3597a9217aSAntonio Huete Jimenez  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3697a9217aSAntonio Huete Jimenez  * SUCH DAMAGE.
3797a9217aSAntonio Huete Jimenez  */
3897a9217aSAntonio Huete Jimenez 
3997a9217aSAntonio Huete Jimenez #ifndef lib_pcap_can_socketcan_h
4097a9217aSAntonio Huete Jimenez #define lib_pcap_can_socketcan_h
4197a9217aSAntonio Huete Jimenez 
42*3a289941SAaron LI #include <pcap/pcap-inttypes.h>
43*3a289941SAaron LI 
4497a9217aSAntonio Huete Jimenez /*
4597a9217aSAntonio Huete Jimenez  * SocketCAN header, as per Documentation/networking/can.txt in the
4697a9217aSAntonio Huete Jimenez  * Linux source.
4797a9217aSAntonio Huete Jimenez  */
4897a9217aSAntonio Huete Jimenez typedef struct {
49*3a289941SAaron LI 	uint32_t can_id;
50*3a289941SAaron LI 	uint8_t payload_length;
51*3a289941SAaron LI 	uint8_t pad;
52*3a289941SAaron LI 	uint8_t reserved1;
53*3a289941SAaron LI 	uint8_t reserved2;
5497a9217aSAntonio Huete Jimenez } pcap_can_socketcan_hdr;
5597a9217aSAntonio Huete Jimenez 
5697a9217aSAntonio Huete Jimenez #endif
57