can-j1939: add libj1939

libj1939 provides a parser for struct sockaddr_can with j1939 info

Signed-off-by: Kurt Van Dijck <kurt.van.dijck@eia.be>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
Kurt Van Dijck
2018-01-18 11:04:15 +01:00
committed by Marc Kleine-Budde
parent 19ee95491a
commit 1d3f8a1893
4 changed files with 201 additions and 2 deletions
+19
View File
@@ -0,0 +1,19 @@
#include <sys/socket.h>
#include <linux/can.h>
#include <linux/can/j1939.h>
#ifndef J1939_LIB_H
#define J1939_LIB_H
#ifdef __cplusplus
extern "C" {
#endif
extern int libj1939_str2addr(const char *str, char **endp, struct sockaddr_can *can);
extern const char *libj1939_addr2str(const struct sockaddr_can *can);
#ifdef __cplusplus
}
#endif
#endif