aboutsummaryrefslogtreecommitdiff
path: root/networking/interface.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-06-04 07:59:51 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-06-04 07:59:51 +0000
commit3b162ecdf6955e9610ec051e21b91a3efe48a030 (patch)
treeb2b3e75e8dfb4e32fc4d67af5682ed4ea8b800bd /networking/interface.c
parent630a7f75e836b2d8669e571af9c5aa5b180c6ca8 (diff)
downloadbusybox-w32-3b162ecdf6955e9610ec051e21b91a3efe48a030.tar.gz
busybox-w32-3b162ecdf6955e9610ec051e21b91a3efe48a030.tar.bz2
busybox-w32-3b162ecdf6955e9610ec051e21b91a3efe48a030.zip
networking/interface.c: fix indentation
Diffstat (limited to 'networking/interface.c')
-rw-r--r--networking/interface.c100
1 files changed, 49 insertions, 51 deletions
diff --git a/networking/interface.c b/networking/interface.c
index abd58b582..efae03bf3 100644
--- a/networking/interface.c
+++ b/networking/interface.c
@@ -680,7 +680,6 @@ static int if_fetch(struct interface *ife)
680 return 0; 680 return 0;
681} 681}
682 682
683
684static int do_if_fetch(struct interface *ife) 683static int do_if_fetch(struct interface *ife)
685{ 684{
686 if (if_fetch(ife) < 0) { 685 if (if_fetch(ife) < 0) {
@@ -1217,63 +1216,62 @@ static int if_print(char *ifname)
1217/* Input an Infiniband address and convert to binary. */ 1216/* Input an Infiniband address and convert to binary. */
1218int in_ib(const char *bufp, struct sockaddr *sap) 1217int in_ib(const char *bufp, struct sockaddr *sap)
1219{ 1218{
1220 unsigned char *ptr; 1219 unsigned char *ptr;
1221 char c; 1220 char c;
1222 const char *orig; 1221 const char *orig;
1223 int i; 1222 int i;
1224 unsigned val; 1223 unsigned val;
1225 1224
1226 sap->sa_family = ib_hwtype.type; 1225 sap->sa_family = ib_hwtype.type;
1227 ptr = (unsigned char *) sap->sa_data; 1226 ptr = (unsigned char *) sap->sa_data;
1228 1227
1229 i = 0; 1228 i = 0;
1230 orig = bufp; 1229 orig = bufp;
1231 while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) { 1230 while ((*bufp != '\0') && (i < INFINIBAND_ALEN)) {
1232 val = 0; 1231 val = 0;
1233 c = *bufp++; 1232 c = *bufp++;
1234 if (isdigit(c)) 1233 if (isdigit(c))
1235 val = c - '0'; 1234 val = c - '0';
1236 else if (c >= 'a' && c <= 'f') 1235 else if (c >= 'a' && c <= 'f')
1237 val = c - 'a' + 10; 1236 val = c - 'a' + 10;
1238 else if (c >= 'A' && c <= 'F') 1237 else if (c >= 'A' && c <= 'F')
1239 val = c - 'A' + 10; 1238 val = c - 'A' + 10;
1240 else { 1239 else {
1241 errno = EINVAL; 1240 errno = EINVAL;
1242 return (-1); 1241 return -1;
1243 } 1242 }
1244 val <<= 4; 1243 val <<= 4;
1245 c = *bufp; 1244 c = *bufp;
1246 if (isdigit(c)) 1245 if (isdigit(c))
1247 val |= c - '0'; 1246 val |= c - '0';
1248 else if (c >= 'a' && c <= 'f') 1247 else if (c >= 'a' && c <= 'f')
1249 val |= c - 'a' + 10; 1248 val |= c - 'a' + 10;
1250 else if (c >= 'A' && c <= 'F') 1249 else if (c >= 'A' && c <= 'F')
1251 val |= c - 'A' + 10; 1250 val |= c - 'A' + 10;
1252 else if (c == ':' || c == 0) 1251 else if (c == ':' || c == 0)
1253 val >>= 4; 1252 val >>= 4;
1254 else { 1253 else {
1255 errno = EINVAL; 1254 errno = EINVAL;
1256 return (-1); 1255 return -1;
1257 } 1256 }
1258 if (c != 0) 1257 if (c != 0)
1259 bufp++; 1258 bufp++;
1260 *ptr++ = (unsigned char) (val & 0377); 1259 *ptr++ = (unsigned char) (val & 0377);
1261 i++; 1260 i++;
1262 1261
1263 /* We might get a semicolon here - not required. */ 1262 /* We might get a semicolon here - not required. */
1264 if (*bufp == ':') { 1263 if (*bufp == ':') {
1265 bufp++; 1264 bufp++;
1265 }
1266 } 1266 }
1267 }
1268#ifdef DEBUG 1267#ifdef DEBUG
1269fprintf(stderr, "in_ib(%s): %s\n", orig, UNSPEC_print(sap->sa_data)); 1268 fprintf(stderr, "in_ib(%s): %s\n", orig, UNSPEC_print(sap->sa_data));
1270#endif 1269#endif
1271 return (0); 1270 return 0;
1272} 1271}
1273#endif 1272#endif
1274 1273
1275 1274
1276
1277int display_interfaces(char *ifname) 1275int display_interfaces(char *ifname)
1278{ 1276{
1279 int status; 1277 int status;