can_eth_gw Gateway Module
0.1
A bidirectional CAN to Ethernet Gateway (Kernel Module)
|
Control Area Network - Ethernet - Gateway - Haeder. More...
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/types.h>
#include <linux/skbuff.h>
#include "ce_gw_dev.h"
#include "ce_gw_netlink.h"
#include <uapi/linux/can.h>
#include <uapi/linux/if_arp.h>
#include <linux/can/core.h>
#include <linux/can/error.h>
#include <linux/slab.h>
#include <linux/if_ether.h>
#include <linux/netdevice.h>
Go to the source code of this file.
Data Structures | |
struct | ce_gw_job |
#define | CE_GW_F_CAN_FD 0x00000001 |
#define | CE_GW_TYPE_MAX (__CE_GW_TYPE_MAX - 1) |
enum | ce_gw_type { CE_GW_TYPE_NONE, CE_GW_TYPE_ETH, CE_GW_TYPE_NET, CE_GW_TYPE_TCP, CE_GW_TYPE_UDP, __CE_GW_TYPE_MAX } |
Type of the Gateway. More... | |
struct hlist_head * | ce_gw_get_job_list (void) |
getter for HLIST_HEAD(ce_gw_job_list) More... | |
struct can_frame * | ce_gw_alloc_can_frame (void) |
allocates memory for the can frame More... | |
void | ce_gw_free_can_frame (struct can_frame *memory) |
frees memory allocated for can_frame More... | |
struct canfd_frame * | ce_gw_alloc_canfd_frame (void) |
allocates memory for a canfd frame More... | |
void | ce_gw_free_canfd_frame (struct canfd_frame *memory) |
frees memory allocated for can_frame More... | |
struct can_frame * | ce_gw_get_header_can (canid_t can_id, __u8 can_dlc, __u8 *payload) |
builds a can header in SFF (standart frame format) or EFF (extended frame formate) with the given information More... | |
struct canfd_frame * | ce_gw_get_header_canfd (canid_t id, __u8 len, __u8 flags, __u8 res0, __u8 res1, __u8 *data) |
struct sk_buff * | ce_gw_can_to_eth (unsigned char *dest, unsigned char *source, __be16 type, struct sk_buff *can_buffer, struct net_device *net) |
converts sk buffer including can frame into sk buffer including ethernet_frame More... | |
struct sk_buff * | ce_gw_canfd_to_eth (unsigned char *dest, unsigned char *source, __be16 type, struct sk_buff *canfd_skb, struct net_device *net) |
converts sk buffer including canfd frame into sk buffer including ethernet frame More... | |
struct sk_buff * | ce_gw_eth_to_can (canid_t id, struct sk_buff *eth_buff, struct net_device *net) |
converst sk_buffer including an ethernet frame to sk_buffer including a can_frame More... | |
struct sk_buff * | ce_gw_eth_to_canfd (canid_t id, __u8 flags, __u8 res0, __u8 res1, struct sk_buff *eth_skb, struct net_device *net) |
converst sk buffer including an ethernet frame to sk buffer including a canfd frame More... | |
void | ce_gw_can_rcv (struct sk_buff *can_skb, void *data) |
The gateway function for incoming CAN frames Receive CAN frame –> process –> send to ETH dev (skbuffer, struct receiver->data) More... | |
void | ce_gw_eth_rcv (struct sk_buff *eth_skb, void *data) |
The gateway function for incoming ETH frames Receive skb from ETH dev –> process –> send to CAN bus. More... | |
int | ce_gw_create_route (int src_ifindex, int dst_ifindex, enum ce_gw_type rt_type, u32 flags) |
int | ce_gw_remove_route (u32 id) |
Control Area Network - Ethernet - Gateway - Haeder.
Definition in file ce_gw_main.h.
#define CE_GW_F_CAN_FD 0x00000001 |
ce_gw_job.flags: is Gateway CANfd compatible
Definition at line 49 of file ce_gw_main.h.
Referenced by ce_gw_dev_setup(), and ce_gw_has_min_mtu().
#define CE_GW_TYPE_MAX (__CE_GW_TYPE_MAX - 1) |
Maximum Type Number
Definition at line 65 of file ce_gw_main.h.
enum ce_gw_type |
Type of the Gateway.
Definition at line 55 of file ce_gw_main.h.
int ce_gw_create_route | ( | int | src_ifindex, |
int | dst_ifindex, | ||
enum ce_gw_type | rt_type, | ||
u32 | flags | ||
) |
Definition at line 916 of file ce_gw_main.c.
References ce_gw_job::can_rcv_filter, ce_gw_has_min_mtu(), ce_gw_is_registered_dev(), ce_gw_register_can_src(), ce_gw_register_eth_src(), ce_gw_job::dev, ce_gw_job::dropped_frames, ce_gw_job::dst, ce_gw_job::flags, ce_gw_job::handled_frames, ce_gw_job::id, job_count, ce_gw_job::list, ce_gw_job::src, and ce_gw_job::type.
Referenced by ce_gw_netlink_add().
|
read |
Definition at line 201 of file ce_gw_main.c.
References ce_gw_alloc_canfd_frame().
|
read |
getter for HLIST_HEAD(ce_gw_job_list)
Definition at line 157 of file ce_gw_main.c.
Referenced by ce_gw_netlink_list().
int ce_gw_remove_route | ( | u32 | id | ) |
Definition at line 982 of file ce_gw_main.c.
References ce_gw_job::can_rcv_filter, ce_gw_unregister_can_src(), ce_gw_unregister_eth_src(), ce_gw_job::dev, ce_gw_job::dst, ce_gw_job::id, ce_gw_job::list, and ce_gw_job::src.
Referenced by ce_gw_cleanup(), ce_gw_dev_unregister(), and ce_gw_netlink_del().