![]() |
can-eth-gw-utils Utilities
0.1
A bidirectional CAN to Ethernet Gateway (Utilities)
|
Control Area Network - Ethernet - Gateway - Send (Utility) More...
#include <linux/version.h>#include <linux/if_ether.h>#include <getopt.h>#include <stdlib.h>#include "can.h"#include <string.h>#include <stdio.h>#include <sys/socket.h>#include <arpa/inet.h>#include <errno.h>#include <net/if.h>#include <sys/ioctl.h>#include <net/ethernet.h>#include <netpacket/packet.h>#include <assert.h>
Go to the source code of this file.
Functions | |
| void | convert_to_mac (const char *string1) |
| converts a string from the console to a MAC address More... | |
| static void | die (const char *msg) |
| It prints an error message in case of a failure and exits the program. More... | |
| static unsigned char | gethex (const char *s, char **end) |
| unsigned char * | convert_to_hex (const char *s, int *length) |
| int | main (int argc, char *argv[]) |
Variables | |
| char * | mac |
Control Area Network - Ethernet - Gateway - Send (Utility)
A Ethernet package is created here and sent to the Interface
Definition in file cegwsend.c.
| unsigned char* convert_to_hex | ( | const char * | s, |
| int * | length | ||
| ) |
Definition at line 91 of file cegwsend.c.
References gethex().
Referenced by main().


| void convert_to_mac | ( | const char * | string1 | ) |
converts a string from the console to a MAC address
| string1 | the string that should be converted to a MAC |
Definition at line 53 of file cegwsend.c.
References mac.
Referenced by main().

|
static |
It prints an error message in case of a failure and exits the program.
| msg | The error message which should be written on the console |
Definition at line 78 of file cegwsend.c.
Referenced by main().

|
static |
Definition at line 84 of file cegwsend.c.
Referenced by convert_to_hex().

| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 109 of file cegwsend.c.
References can_frame::can_dlc, can_frame::can_id, canfd_frame::can_id, CANFD_MAX_DLEN, convert_to_hex(), convert_to_mac(), die(), canfd_frame::flags, canfd_frame::len, and mac.

| char* mac |
Definition at line 45 of file cegwsend.c.
Referenced by convert_to_mac(), and main().