Commits

stingh711 committed a37be98

add interface type and port number

Comments (0)

Files changed (3)

config.properties

 topology.device.vender.1=dell
 topology.device.firmware.1=1.1
 topology.device.hardware.1=1.1
-topology.device.hostname.2=172.25.21.70
-topology.device.ip.2=172.25.21.70
-topology.device.mac.2=00:a0:c5:00:00:70
+topology.device.portnumber.1=0
+topology.device.hostname.2=172.25.21.71
+topology.device.ip.2=172.25.21.71
+topology.device.mac.2=00:a0:c5:00:00:71
 topology.device.type.2=host
 topology.device.model.2=host
 topology.device.vender.2=dell
 topology.device.firmware.2=1.1
 topology.device.hardware.2=1.1
+topology.device.portnumber.2=0
 
 topology.link.number=2
 topology.link.src.ip.1=172.25.21.69
 wan.interface.table.sent.2=3431234
 
 interface.table.number=3
-interface.table.index.1=0
+interface.table.index.1=1
 interface.table.name.1=wan1
 interface.table.description.1=wan1
 interface.table.type.1=2
-interface.table.index.2=1
+interface.table.iswan.1=1
+interface.table.index.2=2
 interface.table.name.2=wan2
 interface.table.description.2=wan2
 interface.table.type.2=2
-interface.table.index.3=2
+interface.table.iswan.2=1
+interface.table.index.3=3
 interface.table.name.3=wan3
 interface.table.description.3=wan3
 interface.table.type.3=2
+interface.table.iswan.3=1
 
 #data for current session
 session.number=5
 session.status.5=1
 
 #data for nsFlowEntry
-flow.number=4
+flow.number=3
 flow.interface.index.1=1
 flow.sent.1=4324
 flow.recv.1=432123
 flow.interface.index.2=2
 flow.sent.2=4324
 flow.recv.2=432123
-flow.interface.index.3=2
+flow.interface.index.3=3
 flow.sent.3=4324
 flow.recv.3=432123
-flow.interface.index.4=2
-flow.sent.4=4324
-flow.recv.4=432123
+#flow.interface.index.4=2
+#flow.sent.4=4324
+#flow.recv.4=432123
 
 #data for lan interfaces
 lan.interface.number=2

src/com/zyxel/enc/netbar/agent/generator/InterfaceTableGenerator.java

 
     @Override
     public MOColumn[] defineColumns() {
-        MOColumn[] columns = new MOColumn[4];
+        MOColumn[] columns = new MOColumn[5];
         columns[0] = new MOColumn(1, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
         columns[1] = new MOColumn(2, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
         columns[2] = new MOColumn(3, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
         columns[3] = new MOColumn(4, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
+        columns[4] = new MOColumn(5, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
         return columns;
     }
 
                 new Integer32(Integer.valueOf(Config.get("interface.table.index." + i))),
                 new OctetString(Config.get("interface.table.name." + i)),
                 new OctetString(Config.get("interface.table.description." + i)),
-                new Integer32(Integer.valueOf(Config.get("interface.table.type." + i)))
+                new Integer32(Integer.valueOf(Config.get("interface.table.type." + i))),
+                new Integer32(Integer.valueOf(Config.get("interface.table.iswan." + i)))
             };
             model.addRow(new DefaultMOMutableRow2PC(new OID(String.valueOf(i)), v));
         }

src/com/zyxel/enc/netbar/agent/generator/TopologyDeviceTableGenerator.java

 import org.snmp4j.agent.mo.MOAccessImpl;
 import org.snmp4j.agent.mo.MOColumn;
 import org.snmp4j.agent.mo.MOMutableTableModel;
+import org.snmp4j.smi.Integer32;
 import org.snmp4j.smi.IpAddress;
 import org.snmp4j.smi.OID;
 import org.snmp4j.smi.OctetString;
                 new OctetString(Config.get("topology.device.model." + i)),
                 new OctetString(Config.get("topology.device.vender." + i)),
                 new OctetString(Config.get("topology.device.firmware." + i)),
-                new OctetString(Config.get("topology.device.hardware." + i))
+                new OctetString(Config.get("topology.device.hardware." + i)),
+                new Integer32(Integer.valueOf(Config.get("topology.device.portnumber." + i)))
             };
             model.addRow(new DefaultMOMutableRow2PC(new OID(String.valueOf(i)), v));
         }
 
     @Override
     public MOColumn[] defineColumns() {
-        MOColumn[] columns = new MOColumn[8];
+        MOColumn[] columns = new MOColumn[9];
         columns[0] = new MOColumn(1, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
         columns[1] = new MOColumn(2, SMIConstants.SYNTAX_IPADDRESS, MOAccessImpl.ACCESS_READ_ONLY);
         columns[2] = new MOColumn(3, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
         columns[5] = new MOColumn(6, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
         columns[6] = new MOColumn(7, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
         columns[7] = new MOColumn(8, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
+        columns[8] = new MOColumn(9, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
 
         return columns;
     }