File: ntop-3.2-snmp_plugin_ipv6.diff

package info (click to toggle)
ntop 3:3.3-11
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 12,772 kB
  • ctags: 7,534
  • sloc: ansic: 71,427; sh: 16,772; awk: 1,504; perl: 792; makefile: 782; php: 123; python: 23; sql: 13; sed: 11
file content (71 lines) | stat: -rw-r--r-- 1,622 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- plugins/snmpPlugin.c.orig	2006-02-05 14:31:57.000000000 +0300
+++ plugins/snmpPlugin.c	2006-02-05 14:32:04.000000000 +0300
@@ -201,7 +201,9 @@
 
 static oid* encodeEth(HostTraffic* el);
 static oid* encodeIpv4(HostTraffic* el);
+#ifdef INET6
 static oid* encodeIpv6(HostTraffic* el);
+#endif
 static oid* encodeFc(HostTraffic* el);
 #endif /* HAVE_SNMP */
 
@@ -467,7 +469,8 @@
       addrput (AF_INET, &(serial->value.ipSerial.ipAddress), &mod_value);
 
       break;
-
+      
+#ifdef INET6
     case SERIAL_IPV6:
       if (octet_data_length != 16)
 	return -1;
@@ -484,6 +487,7 @@
       addrput (AF_INET, &(serial->value.ipSerial.ipAddress), &mod_value);
 
       break;
+#endif
 
     case SERIAL_FC:
       return -1;
@@ -601,9 +605,11 @@
   case SERIAL_IPV4:
     tmp = encodeIpv4(el);
     break;
+#ifdef INET6
   case SERIAL_IPV6:
     tmp = encodeIpv6(el);
     break;
+#endif
   case SERIAL_FC:
     tmp = encodeFc(el);
     break;
@@ -693,6 +699,7 @@
   return tmpoid;
 }
 
+#ifdef INET6
 static oid* encodeIpv6(HostTraffic* el){
   oid* tmpoid = malloc(sizeof(oid)*17);
   int i,j;
@@ -708,6 +715,7 @@
   }
   return tmpoid;
 }
+#endif
 
 static oid* encodeEth(HostTraffic* el){
   oid* tmpoid = malloc(sizeof(oid)*7);
@@ -850,10 +858,12 @@
 	      cp = (char *)&traffic->hostSerial.value.ipSerial.ipAddress.Ip4Address.s_addr;
 	      size = 4;
 	      break;
+#ifdef INET6
 	    case SERIAL_IPV6:
 	      cp =(char *)&traffic->hostSerial.value.ipSerial.ipAddress.Ip6Address.s6_addr;
 	      size = 16;
 	      break;
+#endif
 	    case SERIAL_FC:
 	      /*TODO*/
 	      size = LEN_FC_ADDRESS_DISPLAY;