mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
Moved kernel parsing of netlink attributes into can_can_parse_attr().
Added functionalitiy to remove formerly created CAN GW jobs.
This commit is contained in:
@@ -50,6 +50,7 @@
|
|||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <linux/netlink.h>
|
#include <linux/netlink.h>
|
||||||
@@ -305,10 +306,15 @@ int main(int argc, char **argv)
|
|||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
|
|
||||||
case ADD:
|
case ADD:
|
||||||
req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
|
req.n.nlmsg_flags = NLM_F_REQUEST;
|
||||||
req.n.nlmsg_type = RTM_NEWROUTE;
|
req.n.nlmsg_type = RTM_NEWROUTE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case DEL:
|
||||||
|
req.n.nlmsg_flags = NLM_F_REQUEST;
|
||||||
|
req.n.nlmsg_type = RTM_DELROUTE;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
printf("This function is not yet implemented.\n");
|
printf("This function is not yet implemented.\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user