aboutsummaryrefslogtreecommitdiff
path: root/networking/interface.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 02:12:07 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-22 02:12:07 +0000
commitaad4999eea8f6795b5297cffb628fc65469c3fa4 (patch)
treefc6e578461a84b0775a04cc6b1be6a68a26676a5 /networking/interface.c
parent428f7ae6e2817ea438551afc25ce166a175f6c09 (diff)
downloadbusybox-w32-aad4999eea8f6795b5297cffb628fc65469c3fa4.tar.gz
busybox-w32-aad4999eea8f6795b5297cffb628fc65469c3fa4.tar.bz2
busybox-w32-aad4999eea8f6795b5297cffb628fc65469c3fa4.zip
#if HAVE_AFINET6 -> #ifdef HAVE_AFINET6
Diffstat (limited to 'networking/interface.c')
-rw-r--r--networking/interface.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/networking/interface.c b/networking/interface.c
index 25ff30bac..5f54fd9e5 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -55,7 +55,7 @@
55#define _PATH_PROCNET_DEV "/proc/net/dev" 55#define _PATH_PROCNET_DEV "/proc/net/dev"
56#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" 56#define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
57 57
58#if HAVE_AFINET6 58#ifdef HAVE_AFINET6
59 59
60#ifndef _LINUX_IN6_H 60#ifndef _LINUX_IN6_H
61/* 61/*
@@ -70,7 +70,7 @@ struct in6_ifreq {
70 70
71#endif 71#endif
72 72
73#endif /* HAVE_AFINET6 */ 73#endif /* HAVE_AFINET6 */
74 74
75/* Defines for glibc2.0 users. */ 75/* Defines for glibc2.0 users. */
76#ifndef SIOCSIFTXQLEN 76#ifndef SIOCSIFTXQLEN
@@ -121,9 +121,9 @@ static char *INET_sprint(struct sockaddr *sap, int numeric)
121 121
122 if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap, 122 if (INET_rresolve(buff, sizeof(buff), (struct sockaddr_in *) sap,
123 numeric, 0xffffff00) != 0) 123 numeric, 0xffffff00) != 0)
124 return (NULL); 124 return NULL;
125 125
126 return (buff); 126 return buff;
127} 127}
128 128
129static struct aftype inet_aftype = { 129static struct aftype inet_aftype = {
@@ -135,7 +135,7 @@ static struct aftype inet_aftype = {
135 .fd = -1 135 .fd = -1
136}; 136};
137 137
138#if HAVE_AFINET6 138#ifdef HAVE_AFINET6
139 139
140/* Display an Internet socket address. */ 140/* Display an Internet socket address. */
141/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */ 141/* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */
@@ -148,7 +148,7 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric)
148 if (INET6_rresolve 148 if (INET6_rresolve
149 (buff, sizeof(buff), (struct sockaddr_in6 *) sap, numeric) != 0) 149 (buff, sizeof(buff), (struct sockaddr_in6 *) sap, numeric) != 0)
150 return safe_strncpy(buff, "[UNKNOWN]", sizeof(buff)); 150 return safe_strncpy(buff, "[UNKNOWN]", sizeof(buff));
151 return (buff); 151 return buff;
152} 152}
153 153
154static struct aftype inet6_aftype = { 154static struct aftype inet6_aftype = {
@@ -160,7 +160,7 @@ static struct aftype inet6_aftype = {
160 .fd = -1 160 .fd = -1
161}; 161};
162 162
163#endif /* HAVE_AFINET6 */ 163#endif /* HAVE_AFINET6 */
164 164
165/* Display an UNSPEC address. */ 165/* Display an UNSPEC address. */
166static char *UNSPEC_print(unsigned char *ptr) 166static char *UNSPEC_print(unsigned char *ptr)
@@ -177,7 +177,7 @@ static char *UNSPEC_print(unsigned char *ptr)
177 } 177 }
178 /* Erase trailing "-". Works as long as sizeof(struct sockaddr) != 0 */ 178 /* Erase trailing "-". Works as long as sizeof(struct sockaddr) != 0 */
179 *--pos = '\0'; 179 *--pos = '\0';
180 return (buff); 180 return buff;
181} 181}
182 182
183/* Display an UNSPEC socket address. */ 183/* Display an UNSPEC socket address. */
@@ -187,7 +187,7 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
187 187
188 if (sap->sa_family == 0xFFFF || sap->sa_family == 0) 188 if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
189 return safe_strncpy(buf, "[NONE SET]", sizeof(buf)); 189 return safe_strncpy(buf, "[NONE SET]", sizeof(buf));
190 return (UNSPEC_print((unsigned char *)sap->sa_data)); 190 return UNSPEC_print((unsigned char *)sap->sa_data);
191} 191}
192 192
193static struct aftype unspec_aftype = { 193static struct aftype unspec_aftype = {
@@ -198,7 +198,7 @@ static struct aftype unspec_aftype = {
198 198
199static struct aftype * const aftypes[] = { 199static struct aftype * const aftypes[] = {
200 &inet_aftype, 200 &inet_aftype,
201#if HAVE_AFINET6 201#ifdef HAVE_AFINET6
202 &inet6_aftype, 202 &inet6_aftype,
203#endif 203#endif
204 &unspec_aftype, 204 &unspec_aftype,
@@ -213,10 +213,10 @@ static struct aftype *get_afntype(int af)
213 afp = aftypes; 213 afp = aftypes;
214 while (*afp != NULL) { 214 while (*afp != NULL) {
215 if ((*afp)->af == af) 215 if ((*afp)->af == af)
216 return (*afp); 216 return *afp;
217 afp++; 217 afp++;
218 } 218 }
219 return (NULL); 219 return NULL;
220} 220}
221 221
222/* Check our protocol family table for this family and return its socket */ 222/* Check our protocol family table for this family and return its socket */
@@ -619,7 +619,7 @@ static int if_fetch(struct interface *ife)
619 619
620 strcpy(ifr.ifr_name, ifname); 620 strcpy(ifr.ifr_name, ifname);
621 if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0) 621 if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0)
622 return (-1); 622 return -1;
623 ife->flags = ifr.ifr_flags; 623 ife->flags = ifr.ifr_flags;
624 624
625 strcpy(ifr.ifr_name, ifname); 625 strcpy(ifr.ifr_name, ifname);
@@ -753,7 +753,7 @@ static char *pr_ether(unsigned char *ptr)
753 (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377), 753 (ptr[0] & 0377), (ptr[1] & 0377), (ptr[2] & 0377),
754 (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377) 754 (ptr[3] & 0377), (ptr[4] & 0377), (ptr[5] & 0377)
755 ); 755 );
756 return (buff); 756 return buff;
757} 757}
758 758
759static const struct hwtype ether_hwtype = { 759static const struct hwtype ether_hwtype = {
@@ -815,10 +815,10 @@ static const struct hwtype *get_hwntype(int type)
815 hwp = hwtypes; 815 hwp = hwtypes;
816 while (*hwp != NULL) { 816 while (*hwp != NULL) {
817 if ((*hwp)->type == type) 817 if ((*hwp)->type == type)
818 return (*hwp); 818 return *hwp;
819 hwp++; 819 hwp++;
820 } 820 }
821 return (NULL); 821 return NULL;
822} 822}
823 823
824/* return 1 if address is all zeros */ 824/* return 1 if address is all zeros */
@@ -904,7 +904,7 @@ static void ife_print(struct interface *ptr)
904 int hf; 904 int hf;
905 int can_compress = 0; 905 int can_compress = 0;
906 906
907#if HAVE_AFINET6 907#ifdef HAVE_AFINET6
908 FILE *f; 908 FILE *f;
909 char addr6[40], devname[20]; 909 char addr6[40], devname[20];
910 struct sockaddr_in6 sap; 910 struct sockaddr_in6 sap;
@@ -952,7 +952,7 @@ static void ife_print(struct interface *ptr)
952 printf(" Mask:%s\n", ap->sprint(&ptr->netmask, 1)); 952 printf(" Mask:%s\n", ap->sprint(&ptr->netmask, 1));
953 } 953 }
954 954
955#if HAVE_AFINET6 955#ifdef HAVE_AFINET6
956 956
957#define IPV6_ADDR_ANY 0x0000U 957#define IPV6_ADDR_ANY 0x0000U
958 958