Commits

stingh711 committed b0d84c0

update

Comments (0)

Files changed (5)

-agent.ip=172.25.21.16/161
+agent.ip=172.25.21.16
 
 mac=00:a0:c5:00:00:11
 cpu.usage=60
 
 #data for current session
 session.number=5
-session.application.1=qq
+session.application.1=1
 session.direction.1=1
 session.interface.1=wan1
-session.protocol.1=qq
+session.protocol.1=1
 session.src.ip.1=1.1.1.1
 session.src.port.1=34
 session.dst.ip.1=2.2.2.2
 session.sent.1=3434
 session.recv.1=32434
 session.status.1=1
-session.application.2=qq
+session.application.2=2
 session.direction.2=1
 session.interface.2=wan1
-session.protocol.2=qq
+session.protocol.2=2
 session.src.ip.2=1.1.1.1
 session.src.port.2=34
 session.dst.ip.2=2.2.2.2
 session.sent.2=3434
 session.recv.2=32434
 session.status.2=1
-session.application.3=qq
+session.application.3=3
 session.direction.3=1
 session.interface.3=wan1
-session.protocol.3=qq
+session.protocol.3=4
 session.src.ip.3=1.1.1.1
 session.src.port.3=34
 session.dst.ip.3=2.2.2.2
 session.sent.3=3434
 session.recv.3=32434
 session.status.3=1
-session.application.4=qq
+session.application.4=9805833
 session.direction.4=1
 session.interface.4=wan1
-session.protocol.4=qq
+session.protocol.4=0
 session.src.ip.4=1.1.1.1
 session.src.port.4=34
 session.dst.ip.4=2.2.2.2
 session.sent.4=3434
 session.recv.4=32434
 session.status.4=1
-session.application.5=qq
+session.application.5=9805834
 session.direction.5=1
 session.interface.5=wan1
-session.protocol.5=qq
+session.protocol.5=5
 session.src.ip.5=1.1.1.1
 session.src.port.5=34
 session.dst.ip.5=2.2.2.2

src/com/zyxel/enc/netbar/agent/Main.java

     }
 
     private static void startAgent() {
-        Agent agent = new Agent(Config.get("agent.ip"));
+        Agent agent = new Agent(Config.get("agent.ip") + "/161");
         agent.run();
     }
 }

src/com/zyxel/enc/netbar/agent/data/Interface.java

  */
 public class Interface {
     public static List<Interface> buildRouterInterfaces() {
+        String routerIp = Config.get("agent.ip");
+        String[] wanIps = new String[] {routerIp, "172.25.1.1", "172.25.2.1", "172.25.3.1"};
         List<Interface> result = new ArrayList<Interface>();
         for (int i = 1; i <= 4; i++) {
             //build wan interfaces
             in.gateway = "1.1.1.1";
             in.dns = "8.8.8.8";
             in.iswan = 1;
+            in.ipAndMask = wanIps[i-1] + "/255.255.255.0";
             result.add(in);
         }
         for (int i = 5; i <= 8; i++) {
             in.mtu = 1000;
             in.ip = "192.168.1." + i;
             in.iswan = 2;
+            in.enableNat = 1;
             result.add(in);
         }
         for (Interface in : result) {
     public int status;
     public int wanType;
     public String mask;
+    public String ipAndMask;
     public String gateway;
     public String dns;
     public int recv;

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

     @Override
     public MOColumn[] defineColumns() {
         MOColumn[] columns = new MOColumn[11];
-        columns[0] = new MOColumn(1, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
+        columns[0] = new MOColumn(1, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
         columns[1] = new MOColumn(2, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
         columns[2] = new MOColumn(3, SMIConstants.SYNTAX_OCTET_STRING, MOAccessImpl.ACCESS_READ_ONLY);
-        columns[3] = new MOColumn(4, 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_IPADDRESS, MOAccessImpl.ACCESS_READ_ONLY);
         columns[5] = new MOColumn(6, SMIConstants.SYNTAX_INTEGER, MOAccessImpl.ACCESS_READ_ONLY);
         columns[6] = new MOColumn(7, SMIConstants.SYNTAX_IPADDRESS, MOAccessImpl.ACCESS_READ_ONLY);
 
         for (int i = 1; i <= number; i++) {
             Variable[] v = new Variable[]{
-                new OctetString(Config.get("session.application." + i)),
+                new Integer32(Config.getInt("session.application." + i)),
                 new Integer32(Integer.valueOf(Config.get("session.direction." + i))),
                 new OctetString(Config.get("session.interface." + i)),
-                new OctetString(Config.get("session.protocol." + i)),
+                new Integer32(Config.getInt("session.protocol." + i)),
                 new IpAddress(Config.get("session.src.ip." + i)),
                 new Integer32(Integer.valueOf(Config.get("session.src.port." + i))),
                 new IpAddress(Config.get("session.dst.ip." + i)),

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

                 new OctetString(in.name),
                 new Integer32(in.status),
                 new Integer32(in.wanType),
-                new OctetString(in.mask),
+                new OctetString(in.ipAndMask),
                 new IpAddress(in.gateway),
                 new OctetString(in.dns),
                 new Counter32(in.recv),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.