can_eth_gw Gateway Module
0.1
A bidirectional CAN to Ethernet Gateway (Kernel Module)
|
static struct nla_policy | ce_gw_genl_policy [CE_GW_A_MAX+1] |
Netlink Policy - Defines the Type for the Netlink Attributes. More... | |
static struct genl_family | ce_gw_genl_family |
Generic Netlink Family. More... | |
struct genl_ops | ce_gw_genl_ops_echo |
details of ce_gw_netlink_echo() More... | |
struct genl_ops | ce_gw_genl_ops_add |
details of ce_gw_netlink_add() More... | |
struct genl_ops | ce_gw_genl_ops_del |
details of ce_gw_netlink_del() More... | |
struct genl_ops | ce_gw_genl_ops_list |
details of ce_gw_netlink_list() More... | |
int | ce_gw_netlink_echo (struct sk_buff *skb_info, struct genl_info *info) |
Generic Netlink Command - Sends a massage back. More... | |
int | ce_gw_netlink_add (struct sk_buff *skb_info, struct genl_info *info) |
add a virtual ethernet device or a route More... | |
int | ce_gw_netlink_del (struct sk_buff *skb_info, struct genl_info *info) |
Deletes a device by name or a route by ID. More... | |
int | ce_gw_netlink_list (struct sk_buff *skb_info, struct genl_info *info) |
Send informations of one or more routes to userspace. More... | |
int | ce_gw_netlink_init (void) |
Must called once at module init. More... | |
void | ce_gw_netlink_exit (void) |
Must called once at module exit. More... | |
int ce_gw_netlink_add | ( | struct sk_buff * | skb_info, |
struct genl_info * | info | ||
) |
add a virtual ethernet device or a route
skb_info | Netlink Socket Buffer with Message |
info | Additional Netlink Information will be called by ce_gw_add() in userspace in cegwctl. |
Has multiple netlink Attributes.
0 | on success |
<0 | on failure |
Definition at line 216 of file ce_gw_netlink.c.
References CE_GW_A_DST, CE_GW_A_FLAGS, CE_GW_A_SRC, CE_GW_A_TYPE, ce_gw_create_route(), ce_gw_dev_create(), ce_gw_dev_free(), and ce_gw_dev_register().
int ce_gw_netlink_del | ( | struct sk_buff * | skb_info, |
struct genl_info * | info | ||
) |
Deletes a device by name or a route by ID.
skb_info | Netlink Socket Buffer with Message |
info | Additional Netlink Information |
will be called by ce_gw_add() in userspace in cegwctl.
Has multiple netlink Attributes:
0 | on success |
<0 | on failure |
Definition at line 333 of file ce_gw_netlink.c.
References CE_GW_A_DST, CE_GW_A_ID, ce_gw_dev_free(), ce_gw_dev_unregister(), and ce_gw_remove_route().
int ce_gw_netlink_echo | ( | struct sk_buff * | skb_info, |
struct genl_info * | info | ||
) |
Generic Netlink Command - Sends a massage back.
skb_info | Netlink Socket Buffer with Message |
info | Additional Netlink Information |
0 | if parsing is finished |
Definition at line 127 of file ce_gw_netlink.c.
References CE_GW_A_DATA, CE_GW_C_ECHO, ce_gw_genl_family, and CE_GW_NO_FLAG.
static void ce_gw_netlink_exit | ( | void | ) |
Must called once at module exit.
During exit of module this function must called. It unregisters the family and its operations.
Definition at line 640 of file ce_gw_netlink.c.
References ce_gw_genl_family.
Referenced by ce_gw_cleanup().
int ce_gw_netlink_init | ( | void | ) |
Must called once at module init.
During init of module this function must called. It registers the family and its operations.
0 | when init successful |
<0 | if an error occurred. |
Definition at line 581 of file ce_gw_netlink.c.
References ce_gw_genl_family.
Referenced by ce_gw_init_module().
int ce_gw_netlink_list | ( | struct sk_buff * | skb_info, |
struct genl_info * | info | ||
) |
Send informations of one or more routes to userspace.
skb_info | Netlink Socket Buffer with Message |
info | Additional Netlink Information |
will be called by ce_gw_list() in userspace in cegwctl.
get Netlink Attribute:
Send multiple netlink Attributes back:
0 | on success |
<0 | on failure |
Definition at line 401 of file ce_gw_netlink.c.
References CE_GW_A_DROP, CE_GW_A_DST, CE_GW_A_FLAGS, CE_GW_A_HNDL, CE_GW_A_ID, CE_GW_A_SRC, CE_GW_A_TYPE, CE_GW_C_ECHO, ce_gw_genl_family, ce_gw_get_job_list(), CE_GW_NO_FLAG, 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, ce_gw_job::src, and ce_gw_job::type.
|
static |
Generic Netlink Family.
Definition at line 91 of file ce_gw_netlink.c.
Referenced by ce_gw_netlink_echo(), ce_gw_netlink_exit(), ce_gw_netlink_init(), and ce_gw_netlink_list().
struct genl_ops ce_gw_genl_ops_add |
details of ce_gw_netlink_add()
Definition at line 542 of file ce_gw_netlink.c.
struct genl_ops ce_gw_genl_ops_del |
details of ce_gw_netlink_del()
Definition at line 556 of file ce_gw_netlink.c.
struct genl_ops ce_gw_genl_ops_echo |
details of ce_gw_netlink_echo()
Definition at line 528 of file ce_gw_netlink.c.
struct genl_ops ce_gw_genl_ops_list |
details of ce_gw_netlink_list()
Definition at line 570 of file ce_gw_netlink.c.
|
static |
Netlink Policy - Defines the Type for the Netlink Attributes.
Definition at line 76 of file ce_gw_netlink.c.