This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SNMP and PPP update


Andrew,

The attached patch now displays the loopback interface
in addition to the PPP and ethernet interfaces.  I've
also re-written the change log.

Have a good weekend,
-- Matt

--- Andrew Lunn <andrew@lunn.ch> wrote:
> I think the loopback interface should be seen. It is
> an interface, has
> an IP address etc.  IFDESC knowns about it as well. 
> Could you produce
> another version of the patch which lists the
> loopback device as well
> as your eth0 and ppp0 device.
> 
>         Thanks
>                 Andrew
> 
> 



	
		
__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/
Index: ecos/packages/net/snmp/agent/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/snmp/agent/current/ChangeLog,v
retrieving revision 1.27
diff -u -r1.27 ChangeLog
--- ecos/packages/net/snmp/agent/current/ChangeLog	30 Oct 2003 19:11:35 -0000	1.27
+++ ecos/packages/net/snmp/agent/current/ChangeLog	14 May 2004 20:33:02 -0000
@@ -1,3 +1,13 @@
+2004-05-14	Matt Jerdonek	<maj1224@yahoo.com>
+
+	* src/mibgroup/mibII/helpers.c
+		Update cyg_snmp_num_interfaces() to return correct number
+		of interfaces including the loopback interface.
+		Update cyg_snmp_get_if() to increment the interface index
+		properly.
+	* src/mibgroup/mibII/interfaces.c
+		Add case for IFT_PPP.
+
 2003-10-09  Roland Cassebohm  <roland.cassebohm@visionsystems.de>
   
 	* src/mibgroup/mibII/dot3.c: Make sure the agent responses with
Index: ecos/packages/net/snmp/agent/current/src/mibgroup/mibII/helpers.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/snmp/agent/current/src/mibgroup/mibII/helpers.c,v
retrieving revision 1.2
diff -u -r1.2 helpers.c
--- ecos/packages/net/snmp/agent/current/src/mibgroup/mibII/helpers.c	23 Jun 2003 10:16:38 -0000	1.2
+++ ecos/packages/net/snmp/agent/current/src/mibgroup/mibII/helpers.c	14 May 2004 20:33:02 -0000
@@ -55,7 +55,7 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <net/if.h>
-#include <net/if.h>
+#include <net/if_types.h>
 
 /* How many interfaces are there? */
 
@@ -64,9 +64,9 @@
 
 long cyg_snmp_num_interfaces(void) {
   long long_ret=0;
-  int cnt = if_index;
+  int cnt = if_index - 1;
   
-  while (cnt > 0) {
+  while (cnt >= 0) {
     if (ifnet_addrs[cnt] != 0) {
       long_ret++;
     }
@@ -78,12 +78,15 @@
 struct ifnet *cyg_snmp_get_if(int if_num) {
   int index = 0;
   struct ifnet *ifp;
+  
   do {
     while(0 == ifnet_addrs[index])
       index++;
 
     ifp = ifnet_addrs[index]->ifa_ifp;
-    if_num--;
+    
+    if_num--;	    
+    index++;
   } while (if_num);
 
   return ifp;
Index: ecos/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/snmp/agent/current/src/mibgroup/mibII/interfaces.c,v
retrieving revision 1.8
diff -u -r1.8 interfaces.c
--- ecos/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c	28 Feb 2003 09:24:33 -0000	1.8
+++ ecos/packages/net/snmp/agent/current/src/mibgroup/mibII/interfaces.c	14 May 2004 20:33:02 -0000
@@ -371,6 +371,9 @@
         case IFT_PROPVIRTUAL:
             strcpy( string, "(Proprietary Virtual/Internal)" );
             break;
+        case IFT_PPP:
+        	strcpy( string, "(Point to point interface)" );
+        	break;
         default:
             strcpy( string, "Some shy network adaptor" );
             break;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]