socsvn commit: r272635 - in soc2014/shonali/head/usr.sbin/bsnmpd/tools: bsnmptools libbsnmptools

shonali at FreeBSD.org shonali at FreeBSD.org
Mon Aug 18 18:32:22 UTC 2014


Author: shonali
Date: Mon Aug 18 18:32:21 2014
New Revision: 272635
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=272635

Log:
  Whitespace corrections in bsnmptools
  

Modified:
  soc2014/shonali/head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
  soc2014/shonali/head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c

Modified: soc2014/shonali/head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c
==============================================================================
--- soc2014/shonali/head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c	Mon Aug 18 18:18:19 2014	(r272634)
+++ soc2014/shonali/head/usr.sbin/bsnmpd/tools/bsnmptools/bsnmpget.c	Mon Aug 18 18:32:21 2014	(r272635)
@@ -603,22 +603,22 @@
 static int32_t
 parse_ip(struct snmp_value * value, char * val)
 {
-        uint32_t v;
-        int32_t i;
-        char *endptr, *str;
-
-        str = val;
-        for (i = 0; i < 4; i++) {
-        	v = strtoul(str, &endptr, 10);
-            	if (v > 0xff)
+	uint32_t v;
+	int32_t i;
+	char *endptr, *str;
+
+	str = val;
+	for (i = 0; i < 4; i++) {
+		v = strtoul(str, &endptr, 10);
+		if (v > 0xff)
 			return (-1);
-            	if (*endptr != '.' && *endptr != '\0' && i != 3)
+		if (*endptr != '.' && *endptr != '\0' && i != 3)
 			break;
-           	str = endptr + 1;
-            	value->v.ipaddress[i] = (uint8_t) v;
-        }
-        value->syntax = SNMP_SYNTAX_IPADDRESS;
-        return (0);
+		str = endptr + 1;
+		value->v.ipaddress[i] = (uint8_t) v;
+	}
+	value->syntax = SNMP_SYNTAX_IPADDRESS;
+	return (0);
 }
 
 static int32_t
@@ -635,10 +635,10 @@
 			break;
 		str = endptr + 1;
 		value->v.ipaddress6[i] = (uint8_t) v;
-        }
+	}
 
-        value->syntax = SNMP_SYNTAX_IP6ADDRESS;
-        return (0);
+	value->syntax = SNMP_SYNTAX_IP6ADDRESS;
+	return (0);
 }
 
 static int32_t
@@ -966,14 +966,14 @@
 static int32_t
 add_ip_syntax(struct snmp_value *dst, struct snmp_value *src)
 {
-        int8_t i;
+	int8_t i;
 
-        dst->syntax = SNMP_SYNTAX_IPADDRESS;
+	dst->syntax = SNMP_SYNTAX_IPADDRESS;
 		
-        for (i = 0; i < 4; i++)
-            dst->v.ipaddress[i] = src->v.ipaddress[i];
+	for (i = 0; i < 4; i++)
+		dst->v.ipaddress[i] = src->v.ipaddress[i];
 
-        return (1);
+	return (1);
 }
 
 static int32_t
@@ -984,7 +984,7 @@
         dst->syntax = SNMP_SYNTAX_IP6ADDRESS;
 
         for (i = 0; i < 16; i++)
-            dst->v.ipaddress6[i] = src->v.ipaddress6[i];
+		dst->v.ipaddress6[i] = src->v.ipaddress6[i];
 			
         return (1);
 } 

Modified: soc2014/shonali/head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c
==============================================================================
--- soc2014/shonali/head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c	Mon Aug 18 18:18:19 2014	(r272634)
+++ soc2014/shonali/head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptools.c	Mon Aug 18 18:32:21 2014	(r272635)
@@ -1093,11 +1093,11 @@
 static char *
 snmp_ip2asn_oid(char *str, struct asn_oid *oid)
 {
-        uint32_t v;
-        int32_t i;
-        char *endptr, *ptr;
+	uint32_t v;
+	int32_t i;
+	char *endptr, *ptr;
 
-        ptr = str;
+	ptr = str;
 		
 	for (i = 0; i < 4; i++) {
 		v = strtoul(ptr, &endptr, 10);
@@ -1109,17 +1109,17 @@
 			return (NULL);
 		ptr = endptr + 1;
 	}
-        return (endptr);
+	return (endptr);
 }
 
 static char *
 snmp_ipv62asn_oid(char *str, struct asn_oid *oid)
 {
-        uint32_t v;
-        int32_t i;
-        char *endptr, *ptr;
+	uint32_t v;
+	int32_t i;
+	char *endptr, *ptr;
 
-        ptr = str;
+	ptr = str;
 
 	for (i = 0; i < 16; i++) {
 		v = strtoul(ptr, &endptr, 16);
@@ -1129,7 +1129,7 @@
 			return (NULL);
 		ptr = endptr + 1;
 	}
-        return (endptr);
+	return (endptr);
 }
 
 
@@ -1762,7 +1762,7 @@
 static void
 snmp_output_ipaddress(struct snmp_toolinfo *snmptoolctx, uint8_t *ip)
 {
-        if (GET_OUTPUT(snmptoolctx) == OUTPUT_VERBOSE)
+	if (GET_OUTPUT(snmptoolctx) == OUTPUT_VERBOSE)
 		fprintf(stdout, "%s : ", syntax_strings[SNMP_SYNTAX_IPADDRESS].str);
 	
 	fprintf(stdout, "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
@@ -1772,8 +1772,8 @@
 static void
 snmp_output_ip6address(struct snmp_toolinfo *snmptoolctx, uint8_t *ip)
 {
-        if (GET_OUTPUT(snmptoolctx) == OUTPUT_VERBOSE)
-                fprintf(stdout, "%s : ", syntax_strings[SNMP_SYNTAX_IP6ADDRESS].str);  
+	if (GET_OUTPUT(snmptoolctx) == OUTPUT_VERBOSE)
+		fprintf(stdout, "%s : ", syntax_strings[SNMP_SYNTAX_IP6ADDRESS].str);  
   
 	fprintf(stdout, "%u%u:%u%u:%u%u:%u%u:%u%u:%u%u:%u%u:%u%u", 
         	ip[0], ip[1], ip[2], ip[3], ip[4], ip[5], ip[6], ip[7], ip[8], 
@@ -1855,7 +1855,7 @@
 		snmp_output_ipaddress(snmptoolctx, val->v.ipaddress);
 		break;
  
-            case SNMP_SYNTAX_IP6ADDRESS:
+	    case SNMP_SYNTAX_IP6ADDRESS:
 		snmp_output_ip6address(snmptoolctx, val->v.ipaddress6);
 		break;
 
@@ -1935,7 +1935,7 @@
 snmp_output_index(struct snmp_toolinfo *snmptoolctx, struct index *stx,
     struct asn_oid *oid)
 {
-        uint8_t *ip;	
+	uint8_t *ip;	
 	uint32_t bytes = 1;
 	uint64_t cnt64;
 	struct asn_oid temp, out;
@@ -1980,15 +1980,15 @@
 		bytes = 4;
 		break;
 
-            case SNMP_SYNTAX_IP6ADDRESS:
-                if (temp.len < 16)
-                        return (-1);
+	    case SNMP_SYNTAX_IP6ADDRESS:
+		if (temp.len < 16)
+			return (-1);
 		ip = malloc(sizeof(u_int8_t)*16);
-                for (bytes = 0; bytes < 16; bytes++)
+		for (bytes = 0; bytes < 16; bytes++)
 			ip[bytes] = temp.subs[bytes];
 		snmp_output_ip6address(snmptoolctx, ip);
 		bytes = 16;
-                break;
+		break;
 
 	    case SNMP_SYNTAX_COUNTER:
 		snmp_output_counter(snmptoolctx, temp.subs[0]);


More information about the svn-soc-all mailing list