libsocketcan
v0.0.5
|
Functions | |
static int | send_mod_request (int fd, struct nlmsghdr *n) |
send_mod_request - send a linkinfo modification request More... | |
static int | send_dump_request (int fd, const char *name, int family, int type) |
send_dump_request - send a dump linkinfo request More... | |
static int | open_nl_sock () |
open_nl_sock - open a netlink socket More... | |
static int | do_get_nl_link (int fd, __u8 acquire, const char *name, void *res) |
do_get_nl_link - get linkinfo More... | |
static int | get_link (const char *name, __u8 acquire, void *res) |
get_link - get linkinfo More... | |
static int | do_set_nl_link (int fd, __u8 if_state, const char *name, struct req_info *req_info) |
do_set_nl_link - setup linkinfo More... | |
static int | set_link (const char *name, __u8 if_state, struct req_info *req_info) |
set_link - open a netlink socket and setup linkinfo More... | |
|
static |
do_get_nl_link - get linkinfo
fd | socket file descriptor to a priorly opened netlink socket |
acquire | which parameter we want to get |
name | name of the can device. This is the netdev name, as ifconfig -a shows in your system. usually it contains prefix "can" and the numer of the can line. e.g. "can0" |
res | pointer to store the result |
This callback send a dump request into the netlink layer, collect the packet containing the linkinfo and fill the pointer res points to depending on the acquire mode set in param acquire.
Referenced by get_link().
|
static |
do_set_nl_link - setup linkinfo
fd | socket file descriptor to a priorly opened netlink socket |
if_state | state of the interface we want to put the device into. this parameter is only set if you want to use the callback to driver up/down the device |
name | name of the can device. This is the netdev name, as ifconfig -a shows in your system. usually it contains prefix "can" and the numer of the can line. e.g. "can0" |
req_info | request parameters |
This callback can do two different tasks:
Referenced by set_link().
|
static |
get_link - get linkinfo
name | name of the can device. This is the netdev name, as ifconfig -a shows in your system. usually it contains prefix "can" and the numer of the can line. e.g. "can0" |
acquire | which parameter we want to get |
res | pointer to store the result |
This is a wrapper for do_get_nl_link
References do_get_nl_link(), and open_nl_sock().
Referenced by can_get_berr_counter(), can_get_bittiming(), can_get_bittiming_const(), can_get_clock(), can_get_ctrlmode(), can_get_device_stats(), can_get_link_stats(), can_get_restart_ms(), and can_get_state().
|
static |
open_nl_sock - open a netlink socket
opens a netlink socket and returns the socket descriptor
Referenced by get_link(), and set_link().
|
static |
send_dump_request - send a dump linkinfo request
fd | decriptor to a priorly opened netlink socket |
name | network interface name, null means all interfaces |
family | rt_gen message family |
type | netlink message header type |
|
static |
send_mod_request - send a linkinfo modification request
fd | decriptor to a priorly opened netlink socket |
n | netlink message containing the request |
sends a request to setup the the linkinfo to netlink layer and awaits the status.
|
static |
set_link - open a netlink socket and setup linkinfo
name | name of the can device. This is the netdev name, as ifconfig -a shows in your system. usually it contains prefix "can" and the numer of the can line. e.g. "can0" |
if_state | state of the interface we want to put the device into. this parameter is only set if you want to use the callback to driver up/down the device |
req_info | request parameters |
This is a wrapper for do_set_nl_link. It opens a netlink socket and sends down the requests.
References do_set_nl_link(), and open_nl_sock().
Referenced by can_do_restart(), can_do_start(), can_do_stop(), can_set_bittiming(), can_set_ctrlmode(), and can_set_restart_ms().