From 0e3319df9827ee05cec747d19138aa7c862fddc2 Mon Sep 17 00:00:00 2001 From: Luotao Fu Date: Mon, 23 Nov 2009 09:05:40 +0100 Subject: [PATCH] update copyright, remove obsolete prints Signed-off-by: Luotao Fu --- include/socketcan_netlink.h | 23 +++++++++++++++++++---- src/socketcan_netlink.c | 22 +++++++++++++++++++--- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/include/socketcan_netlink.h b/include/socketcan_netlink.h index e324bbb..fe6256b 100644 --- a/include/socketcan_netlink.h +++ b/include/socketcan_netlink.h @@ -1,10 +1,25 @@ -/* - * Header file for CAN netlink support +/* + * socketcan_netlink.h + * * (C) 2009 Luotao Fu + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the version 2 of the GNU General Public License + * as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef _NMS_H -#define _NMS_H + +#ifndef _SOCKETCAN_NETLINK_H +#define _SOCKETCAN_NETLINK_H #define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1) #define IF_UP 1 diff --git a/src/socketcan_netlink.c b/src/socketcan_netlink.c index 404e10e..078afc3 100644 --- a/src/socketcan_netlink.c +++ b/src/socketcan_netlink.c @@ -1,3 +1,22 @@ +/* + * socketcan_netlink.c + * + * (C) 2009 Luotao Fu + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the version 2 of the GNU General Public License + * as published by the Free Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include #include #include @@ -127,18 +146,15 @@ static int send_mod_request(int fd, struct nlmsghdr *n) perror("Cannot talk to rtnetlink"); return -1; } - //printf("stat sent: %d\n", status); iov.iov_base = buf; while (1) { iov.iov_len = sizeof(buf); status = recvmsg(fd, &msg, 0); - //printf("stat rcv: %d\n", status); for (h = (struct nlmsghdr *)buf; (size_t)status >= sizeof(*h);) { int len = h->nlmsg_len; int l = len - sizeof(*h); - //printf("msgtype: %d, len %d, l %d\n", h->nlmsg_type, len, l); if (l < 0 || len > status) { if (msg.msg_flags & MSG_TRUNC) { fprintf(stderr, "Truncated message\n");