can-eth-gw-utils Utilities  0.1
A bidirectional CAN to Ethernet Gateway (Utilities)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
netlink.h File Reference

Control Area Network - Ethernet - Gateway - Netlink Header (Utility) More...

#include <stdint.h>
Include dependency graph for netlink.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define F_CAN_FD   0x00000001
 
#define TYPE_MAX   (__TYPE_MAX - 1)
 
#define CE_GW_C_MAX   (__CE_GW_C_MAX - 1)
 
enum  gw_type {
  TYPE_NONE, TYPE_ETH, TYPE_NET, TYPE_TCP,
  TYPE_UDP, __TYPE_MAX
}
 
enum  {
  CE_GW_C_UNSPEC, CE_GW_C_ECHO, CE_GW_C_ADD, CE_GW_C_DEL,
  CE_GW_C_LIST, __CE_GW_C_MAX
}
 
int ce_gw_add (char *dst_name, char *src_name, uint8_t type, uint32_t flags)
 add a virtual ethernet device or a route More...
 
int ce_gw_del (uint32_t id, char *dev_name)
 Deletes a device or a route in Kernel Module. More...
 
int ce_gw_list (uint32_t id)
 Print informations of actual active routes to stdout. More...
 
int ce_gw_echo (char *message)
 send a message and return the received message from Kernel. (for testing) More...
 
int nl_sk_fam_init (void)
 creakte socket and family and connect More...
 
void nl_sk_fam_exit (void)
 freeing the alloccated memory. The Function free the memory allocated by nl_sk_fam_init(). More...
 

Detailed Description

Control Area Network - Ethernet - Gateway - Netlink Header (Utility)

Author
Fabian Raab (fabia.nosp@m.n.ra.nosp@m.ab@tu.nosp@m.m.de)
Date
May, 2013

Definition in file netlink.h.

Macro Definition Documentation

#define CE_GW_C_MAX   (__CE_GW_C_MAX - 1)

Maximum Number of Commands

Definition at line 66 of file netlink.h.

#define F_CAN_FD   0x00000001

This Flags are also defind in kernel in ce_gw_dev.h

Definition at line 36 of file netlink.h.

Referenced by main().

#define TYPE_MAX   (__TYPE_MAX - 1)

Definition at line 51 of file netlink.h.

Referenced by nl_cb_list_entry().

Enumeration Type Documentation

anonymous enum
Enumerator
CE_GW_C_UNSPEC 

Only a Dummy to skip index 0.

CE_GW_C_ECHO 

Sends a message back. Calls ce_gw_nl_echo().

CE_GW_C_ADD 

Add a gateway. Calls ce_gw_netlink_add().

CE_GW_C_DEL 

Delate a gateway. Calls ce_gw_netlink_del().

CE_GW_C_LIST 

list active gateways. Calls ce_gw_netlink_list().

__CE_GW_C_MAX 

Maximum Number of Commands plus 1

Definition at line 58 of file netlink.h.

58  {
60  CE_GW_C_ECHO,
61  CE_GW_C_ADD,
62  CE_GW_C_DEL,
63  CE_GW_C_LIST,
65 };
enum gw_type
See Also
This enum are also defind in kernel in ce_gw_main.h
Enumerator
TYPE_NONE 

No Type. Schould normally not used.

TYPE_ETH 

Convert CAN Header to Ethernet Header

TYPE_NET 

Copy complete CAN Frame into Ethernet payload. e.g use CAN als Network Layer (Layer 3) Protocol.

TYPE_TCP 

Convert CAN Header into an IP/TCP Package

TYPE_UDP 

Convert CAN Header into an IP/UDP Package

__TYPE_MAX 

Maximum Type Number + 1

Definition at line 42 of file netlink.h.

42  {
43  TYPE_NONE,
44  TYPE_ETH,
45  TYPE_NET,
47  TYPE_TCP,
48  TYPE_UDP,
49  __TYPE_MAX,
50 };