[Olsr-cvs] olsrd-current/src/linux apm.c, 1.17, 1.18 kernel_routes.c, 1.21, 1.22 link_layer.c, 1.12, 1.13 net.c, 1.33, 1.34
Bernd Petrovitsch
(spam-protected)
Thu Apr 26 00:08:20 CEST 2007
- Previous message: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.47,1.48
- Next message: [Olsr-cvs] olsrd-current/src/win32 apm.c, 1.10, 1.11 ifnet.c, 1.34, 1.35 kernel_routes.c, 1.18, 1.19 net.c, 1.20, 1.21
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/olsrd/olsrd-current/src/linux
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2640/src/linux
Modified Files:
apm.c kernel_routes.c link_layer.c net.c
Log Message:
* OLSR_PRINTF() is now a real C expression
* removed superflous type-casts
Index: apm.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/apm.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** apm.c 20 Apr 2007 13:46:05 -0000 1.17
--- apm.c 25 Apr 2007 22:08:17 -0000 1.18
***************
*** 129,133 ****
method = -1;
! OLSR_PRINTF(3, "Initializing APM\n")
if(((fd_index = acpi_probe()) >= 0) && apm_read_acpi(&ainfo))
--- 129,133 ----
method = -1;
! OLSR_PRINTF(3, "Initializing APM\n");
if(((fd_index = acpi_probe()) >= 0) && apm_read_acpi(&ainfo))
***************
*** 149,153 ****
ainfo->ac_line_status,
ainfo->battery_percentage,
! ainfo->battery_time_left)
}
--- 149,153 ----
ainfo->ac_line_status,
ainfo->battery_percentage,
! ainfo->battery_time_left);
}
Index: net.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/net.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** net.c 20 Apr 2007 13:46:05 -0000 1.33
--- net.c 25 Apr 2007 22:08:18 -0000 1.34
***************
*** 77,81 ****
*Bind to device using the SO_BINDTODEVICE flag
*/
! OLSR_PRINTF(3, "Binding socket %d to device %s\n", sock, dev_name)
return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name)+1);
}
--- 77,81 ----
*Bind to device using the SO_BINDTODEVICE flag
*/
! OLSR_PRINTF(3, "Binding socket %d to device %s\n", sock, dev_name);
return setsockopt(sock, SOL_SOCKET, SO_BINDTODEVICE, dev_name, strlen(dev_name)+1);
}
***************
*** 119,123 ****
if(orig_fwd_state == '1')
{
! OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n")
}
else
--- 119,123 ----
if(orig_fwd_state == '1')
{
! OLSR_PRINTF(3, "\nIP forwarding is enabled on this system\n");
}
else
***************
*** 261,265 ****
struct interface *ifs;
! OLSR_PRINTF(1, "Restoring network state\n")
/* Restore IP forwarding to "off" */
--- 261,265 ----
struct interface *ifs;
! OLSR_PRINTF(1, "Restoring network state\n");
/* Restore IP forwarding to "off" */
***************
*** 566,570 ****
#if !defined __FreeBSD__ && !defined __MacOSX__ && !defined __NetBSD__
! OLSR_PRINTF(3, "Interface %s joining multicast %s...", ifs->int_name, olsr_ip_to_string((union olsr_ip_addr *)&ifs->int6_multaddr.sin6_addr))
/* Send multicast */
if(setsockopt(sock,
--- 566,570 ----
#if !defined __FreeBSD__ && !defined __MacOSX__ && !defined __NetBSD__
! OLSR_PRINTF(3, "Interface %s joining multicast %s...", ifs->int_name, olsr_ip_to_string((union olsr_ip_addr *)&ifs->int6_multaddr.sin6_addr));
/* Send multicast */
if(setsockopt(sock,
***************
*** 617,621 ****
! OLSR_PRINTF(3, "OK\n")
return 0;
}
--- 617,621 ----
! OLSR_PRINTF(3, "OK\n");
return 0;
}
***************
*** 646,656 ****
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
! OLSR_PRINTF(5, "\tinet6 addr: %s\n", addr6)
! OLSR_PRINTF(5, "\tScope: %d\n", scope)
if(scope == scope_in)
{
OLSR_PRINTF(4, "Found addr: %s:%s:%s:%s:%s:%s:%s:%s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
! addr6p[4], addr6p[5], addr6p[6], addr6p[7])
inet_pton(AF_INET6,addr6,&tmp_sockaddr6);
memcpy(&saddr6->sin6_addr, &tmp_sockaddr6, sizeof(struct in6_addr));
--- 646,656 ----
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
! OLSR_PRINTF(5, "\tinet6 addr: %s\n", addr6);
! OLSR_PRINTF(5, "\tScope: %d\n", scope);
if(scope == scope_in)
{
OLSR_PRINTF(4, "Found addr: %s:%s:%s:%s:%s:%s:%s:%s\n",
addr6p[0], addr6p[1], addr6p[2], addr6p[3],
! addr6p[4], addr6p[5], addr6p[6], addr6p[7]);
inet_pton(AF_INET6,addr6,&tmp_sockaddr6);
memcpy(&saddr6->sin6_addr, &tmp_sockaddr6, sizeof(struct in6_addr));
***************
*** 781,789 ****
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWRATE, &ifr) < 0)
{
! OLSR_PRINTF(1, "Not able to find rate for WLAN interface %s\n", ifname)
return WEIGHT_WLAN_11MB;
}
! OLSR_PRINTF(1, "Bitrate %d\n", ifr.ifr_ifru.ifru_ivalue)
//WEIGHT_WLAN_LOW, /* <11Mb WLAN */
--- 781,789 ----
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWRATE, &ifr) < 0)
{
! OLSR_PRINTF(1, "Not able to find rate for WLAN interface %s\n", ifname);
return WEIGHT_WLAN_11MB;
}
! OLSR_PRINTF(1, "Bitrate %d\n", ifr.ifr_ifru.ifru_ivalue);
//WEIGHT_WLAN_LOW, /* <11Mb WLAN */
***************
*** 805,809 ****
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
! ifr.ifr_name, strerror(errno))
return WEIGHT_ETHERNET_DEFAULT;
}
--- 805,809 ----
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
! ifr.ifr_name, strerror(errno));
return WEIGHT_ETHERNET_DEFAULT;
}
***************
*** 812,816 ****
if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
! strerror(errno))
return WEIGHT_ETHERNET_DEFAULT;
}
--- 812,816 ----
if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
! strerror(errno));
return WEIGHT_ETHERNET_DEFAULT;
}
***************
*** 818,825 ****
! OLSR_PRINTF(1, "%s: ", ifr.ifr_name)
OLSR_PRINTF(1, "%s Mbit, %s duplex\n",
(bmcr & MII_BMCR_100MBIT) ? "100" : "10",
! (bmcr & MII_BMCR_DUPLEX) ? "full" : "half")
is_if_link_up(ifname);
--- 818,825 ----
! OLSR_PRINTF(1, "%s: ", ifr.ifr_name);
OLSR_PRINTF(1, "%s Mbit, %s duplex\n",
(bmcr & MII_BMCR_100MBIT) ? "100" : "10",
! (bmcr & MII_BMCR_DUPLEX) ? "full" : "half");
is_if_link_up(ifname);
***************
*** 855,859 ****
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
! ifr.ifr_name, strerror(errno))
return WEIGHT_ETHERNET_DEFAULT;
}
--- 855,859 ----
if (errno != ENODEV)
OLSR_PRINTF(1, "SIOCGMIIPHY on '%s' failed: %s\n",
! ifr.ifr_name, strerror(errno));
return WEIGHT_ETHERNET_DEFAULT;
}
***************
*** 861,871 ****
if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
! strerror(errno))
return WEIGHT_ETHERNET_DEFAULT;
}
bmsr = mii->val_out;
! OLSR_PRINTF(1, "%s: ", ifr.ifr_name)
! OLSR_PRINTF(1, "%s\n", (bmsr & MII_BMSR_LINK_VALID) ? "link ok " : "no link ")
return (bmsr & MII_BMSR_LINK_VALID);
--- 861,871 ----
if (ioctl(olsr_cnf->ioctl_s, SIOCGMIIREG, &ifr) < 0) {
OLSR_PRINTF(1, "SIOCGMIIREG on %s failed: %s\n", ifr.ifr_name,
! strerror(errno));
return WEIGHT_ETHERNET_DEFAULT;
}
bmsr = mii->val_out;
! OLSR_PRINTF(1, "%s: ", ifr.ifr_name);
! OLSR_PRINTF(1, "%s\n", (bmsr & MII_BMSR_LINK_VALID) ? "link ok " : "no link ");
return (bmsr & MII_BMSR_LINK_VALID);
Index: kernel_routes.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/kernel_routes.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** kernel_routes.c 20 Apr 2007 13:46:05 -0000 1.21
--- kernel_routes.c 25 Apr 2007 22:08:17 -0000 1.22
***************
*** 74,78 ****
OLSR_PRINTF(1, "(ioctl)Adding route with metric %d to %s/%s via %s/%s.\n",
destination->rt_metric, dst_str, mask_str, router_str,
! destination->rt_if->int_name)
memset(&kernel_route, 0, sizeof(struct rtentry));
--- 74,78 ----
OLSR_PRINTF(1, "(ioctl)Adding route with metric %d to %s/%s via %s/%s.\n",
destination->rt_metric, dst_str, mask_str, router_str,
! destination->rt_if->int_name);
memset(&kernel_route, 0, sizeof(struct rtentry));
***************
*** 171,175 ****
OLSR_PRINTF(2, "(ioctl)Adding route: %s(hopc %d)\n",
olsr_ip_to_string(&destination->rt_dst),
! destination->rt_metric + 1)
--- 171,175 ----
OLSR_PRINTF(2, "(ioctl)Adding route: %s(hopc %d)\n",
olsr_ip_to_string(&destination->rt_dst),
! destination->rt_metric + 1);
***************
*** 202,207 ****
! //OLSR_PRINTF(3, "Adding route to %s using gw ", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_dst))
! //OLSR_PRINTF(3, "%s\n", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_gateway))
if((tmp = ioctl(olsr_cnf->ioctl_s, SIOCADDRT, &kernel_route)) >= 0)
--- 202,207 ----
! //OLSR_PRINTF(3, "Adding route to %s using gw ", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_dst));
! //OLSR_PRINTF(3, "%s\n", olsr_ip_to_string((union olsr_ip_addr *)&kernel_route.rtmsg_gateway));
if((tmp = ioctl(olsr_cnf->ioctl_s, SIOCADDRT, &kernel_route)) >= 0)
***************
*** 242,246 ****
OLSR_PRINTF(1, "(ioctl)Deleting route with metric %d to %s/%s via %s.\n",
! destination->rt_metric, dst_str, mask_str, router_str)
memset(&kernel_route,0,sizeof(struct rtentry));
--- 242,246 ----
OLSR_PRINTF(1, "(ioctl)Deleting route with metric %d to %s/%s via %s.\n",
! destination->rt_metric, dst_str, mask_str, router_str);
memset(&kernel_route,0,sizeof(struct rtentry));
***************
*** 310,317 ****
OLSR_PRINTF(2, "(ioctl)Deleting route: %s(hopc %d)\n",
olsr_ip_to_string(&destination->rt_dst),
! destination->rt_metric)
! OLSR_PRINTF(1, "Deleting route: %s\n", olsr_ip_to_string(&tmp_addr))
memset(&kernel_route,0,sizeof(struct in6_rtmsg));
--- 310,317 ----
OLSR_PRINTF(2, "(ioctl)Deleting route: %s(hopc %d)\n",
olsr_ip_to_string(&destination->rt_dst),
! destination->rt_metric);
! OLSR_PRINTF(1, "Deleting route: %s\n", olsr_ip_to_string(&tmp_addr));
memset(&kernel_route,0,sizeof(struct in6_rtmsg));
***************
*** 354,358 ****
struct ifreq *ifr;
! OLSR_PRINTF(1, "Internet gateway detected...\nTrying to delete default gateways\n")
/* Get a socket */
--- 354,358 ----
struct ifreq *ifr;
! OLSR_PRINTF(1, "Internet gateway detected...\nTrying to delete default gateways\n");
/* Get a socket */
***************
*** 383,391 ****
if(strcmp(ifr->ifr_ifrn.ifrn_name, "lo") == 0)
{
! OLSR_PRINTF(1, "Skipping loopback...\n")
continue;
}
! OLSR_PRINTF(1, "Trying 0.0.0.0/0 %s...", ifr->ifr_ifrn.ifrn_name)
--- 383,391 ----
if(strcmp(ifr->ifr_ifrn.ifrn_name, "lo") == 0)
{
! OLSR_PRINTF(1, "Skipping loopback...\n");
continue;
}
! OLSR_PRINTF(1, "Trying 0.0.0.0/0 %s...", ifr->ifr_ifrn.ifrn_name);
***************
*** 419,425 ****
if((ioctl(s, SIOCDELRT, &kernel_route)) < 0)
! OLSR_PRINTF(1, "NO\n")
else
! OLSR_PRINTF(1, "YES\n")
--- 419,425 ----
if((ioctl(s, SIOCDELRT, &kernel_route)) < 0)
! OLSR_PRINTF(1, "NO\n");
else
! OLSR_PRINTF(1, "YES\n");
Index: link_layer.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/linux/link_layer.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** link_layer.c 10 Feb 2007 17:11:49 -0000 1.12
--- link_layer.c 25 Apr 2007 22:08:17 -0000 1.13
***************
*** 101,105 ****
struct interface *ifd;
! OLSR_PRINTF(1, "Initializing link-layer notification...\n")
--- 101,105 ----
struct interface *ifd;
! OLSR_PRINTF(1, "Initializing link-layer notification...\n");
***************
*** 130,134 ****
if(ioctl(olsr_cnf->ioctl_s, SIOCSIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "Could not clear spylist %s\n", strerror(errno))
return -1;
}
--- 130,134 ----
if(ioctl(olsr_cnf->ioctl_s, SIOCSIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "Could not clear spylist %s\n", strerror(errno));
return -1;
}
***************
*** 149,153 ****
sizeof(struct sockaddr)) * IW_MAX_SPY];
! OLSR_PRINTF(1, "Adding spynode!\n\n")
/* get all addresses already in the driver */
--- 149,153 ----
sizeof(struct sockaddr)) * IW_MAX_SPY];
! OLSR_PRINTF(1, "Adding spynode!\n\n");
/* get all addresses already in the driver */
***************
*** 161,165 ****
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "Could not get old spylist %s\n", strerror(errno))
return 0;
}
--- 161,165 ----
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "Could not get old spylist %s\n", strerror(errno));
return 0;
}
***************
*** 169,173 ****
memcpy(hw_address, buffer, nbr * sizeof(struct sockaddr));
! OLSR_PRINTF(1, "Old addresses: %d\n\n", nbr)
/* Check upper limit */
--- 169,173 ----
memcpy(hw_address, buffer, nbr * sizeof(struct sockaddr));
! OLSR_PRINTF(1, "Old addresses: %d\n\n", nbr);
/* Check upper limit */
***************
*** 194,198 ****
if(ioctl(olsr_cnf->ioctl_s, SIOCSIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "Could not clear spylist %s\n", strerror(errno))
return 0;
}
--- 194,198 ----
if(ioctl(olsr_cnf->ioctl_s, SIOCSIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "Could not clear spylist %s\n", strerror(errno));
return 0;
}
***************
*** 214,218 ****
OLSR_PRINTF(1, "\nARP conversion for %s interface %s\n",
olsr_ip_to_string(ip),
! interface)
tmp_sockaddr.sin_family = AF_INET;
--- 214,218 ----
OLSR_PRINTF(1, "\nARP conversion for %s interface %s\n",
olsr_ip_to_string(ip),
! interface);
tmp_sockaddr.sin_family = AF_INET;
***************
*** 231,235 ****
!(arp_query.arp_flags & ATF_COM)) /* ATF_COM - hw addr valid */
{
! OLSR_PRINTF(1, "Arp failed: (%s) - trying lookup\n", strerror(errno))
/* No address - create a thread that sends a PING */
--- 231,235 ----
!(arp_query.arp_flags & ATF_COM)) /* ATF_COM - hw addr valid */
{
! OLSR_PRINTF(1, "Arp failed: (%s) - trying lookup\n", strerror(errno));
/* No address - create a thread that sends a PING */
***************
*** 239,243 ****
}
! OLSR_PRINTF(1, "Arp success!\n")
memcpy(mac, &arp_query.arp_ha, sizeof(struct sockaddr));
--- 239,243 ----
}
! OLSR_PRINTF(1, "Arp success!\n");
memcpy(mac, &arp_query.arp_ha, sizeof(struct sockaddr));
***************
*** 271,279 ****
memcpy(&dst_in->sin_addr, ip, olsr_cnf->ipsize);
! OLSR_PRINTF(1, "pinging %s\n\n", olsr_ip_to_string(ip))
if ((ping_s = socket(AF_INET, SOCK_RAW, PF_INET)) < 0)
{
! OLSR_PRINTF(1, "Could not create RAW socket for ping!\n%s\n", strerror(errno))
return;
}
--- 271,279 ----
memcpy(&dst_in->sin_addr, ip, olsr_cnf->ipsize);
! OLSR_PRINTF(1, "pinging %s\n\n", olsr_ip_to_string(ip));
if ((ping_s = socket(AF_INET, SOCK_RAW, PF_INET)) < 0)
{
! OLSR_PRINTF(1, "Could not create RAW socket for ping!\n%s\n", strerror(errno));
return;
}
***************
*** 293,302 ****
MAXIPLEN + MAXICMPLEN + 8)
{
! OLSR_PRINTF(1, "Error PING: %s\n", strerror(errno))
}
/* Nevermind the pong ;-) */
! OLSR_PRINTF(1, "Ping complete...\n")
close(ping_s);
--- 293,302 ----
MAXIPLEN + MAXICMPLEN + 8)
{
! OLSR_PRINTF(1, "Error PING: %s\n", strerror(errno));
}
/* Nevermind the pong ;-) */
! OLSR_PRINTF(1, "Ping complete...\n");
close(ping_s);
***************
*** 320,324 ****
struct interface *iflist;
! //OLSR_PRINTF(1, "Polling link-layer notification...\n")
for(iflist = ifnet; iflist != NULL; iflist = iflist->int_next)
--- 320,324 ----
struct interface *iflist;
! //OLSR_PRINTF(1, "Polling link-layer notification...\n");
for(iflist = ifnet; iflist != NULL; iflist = iflist->int_next)
***************
*** 338,342 ****
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "%-8.16s Interface doesn't support wireless statistic collection\n\n", iflist->int_name)
return;
}
--- 338,342 ----
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWSPY, &wrq) < 0)
{
! OLSR_PRINTF(1, "%-8.16s Interface doesn't support wireless statistic collection\n\n", iflist->int_name);
return;
}
***************
*** 359,366 ****
/* Print stats for each address */
! OLSR_PRINTF(1, "MAC")
for(j = 0; j < 6; j++)
{
! OLSR_PRINTF(1, ":%02x", (hwa[i].sa_data[j] % 0xffffff00))
}
if(!has_range)
--- 359,366 ----
/* Print stats for each address */
! OLSR_PRINTF(1, "MAC");
for(j = 0; j < 6; j++)
{
! OLSR_PRINTF(1, ":%02x", (hwa[i].sa_data[j] % 0xffffff00));
}
if(!has_range)
***************
*** 368,372 ****
qual[i].qual,
qual[i].level - 0x100,
! qual[i].noise - 0x100)
else
OLSR_PRINTF(1, " : Quality:%d/%d Signal level:%d dBm Noise level:%d dBm",
--- 368,372 ----
qual[i].qual,
qual[i].level - 0x100,
! qual[i].noise - 0x100);
else
OLSR_PRINTF(1, " : Quality:%d/%d Signal level:%d dBm Noise level:%d dBm",
***************
*** 374,385 ****
range.max_qual.qual,
qual[i].level - 0x100,
! qual[i].noise - 0x100)
! OLSR_PRINTF(1, "\n")
}
}
! //OLSR_PRINTF(1, "\n")
return;
}
--- 374,385 ----
range.max_qual.qual,
qual[i].level - 0x100,
! qual[i].noise - 0x100);
! OLSR_PRINTF(1, "\n");
}
}
! //OLSR_PRINTF(1, "\n");
return;
}
***************
*** 412,416 ****
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWRANGE, &wrq) < 0)
{
! OLSR_PRINTF(1, "NO RANGE\n")
return -1;
}
--- 412,416 ----
if(ioctl(olsr_cnf->ioctl_s, SIOCGIWRANGE, &wrq) < 0)
{
! OLSR_PRINTF(1, "NO RANGE\n");
return -1;
}
- Previous message: [Olsr-cvs] olsrd-current/src/unix ifnet.c,1.47,1.48
- Next message: [Olsr-cvs] olsrd-current/src/win32 apm.c, 1.10, 1.11 ifnet.c, 1.34, 1.35 kernel_routes.c, 1.18, 1.19 net.c, 1.20, 1.21
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Olsr-cvs
mailing list