Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB.txt
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB.txt	(revision 39103)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB.txt	(working copy)
@@ -144,6 +144,9 @@
 --   orchMIB          OBJECT IDENTIFIER ::= { beijingArrayNetworks 35 }
 --                    Orchestrator STATS
 --
+--   eroute           OBJECT IDENTIFIER ::= { beijingArrayNetworks 36 }
+--                    E-route STATS
+--
 --   version          OBJECT IDENTIFIER ::= { beijingArrayNetworks 100 }
 --                    NO LONGER SUPPORTED
 --
@@ -6808,4 +6811,122 @@
                "The number of from_interface packets denied by the policy."
 	::= { policyStatsEntry 6 }
 -- End of orchestrator MIB
+---
+--- The information of beijingArrayNetworks's E-Route MIB.
+---
+eroute   OBJECT IDENTIFIER ::= { beijingArrayNetworks 36 }
+erouteStats             OBJECT IDENTIFIER ::= { eroute 1 }
+
+erouteCount       OBJECT-TYPE
+        SYNTAX          Integer32
+        MAX-ACCESS      read-only
+        STATUS          current
+        DESCRIPTION "The number of Eroutes."
+        ::= { erouteStats 1 }
+erouteStatsTable  OBJECT-TYPE
+        SYNTAX          SEQUENCE OF erouteStatsEntry
+        MAX-ACCESS      not-accessible
+        STATUS          current
+        DESCRIPTION "Eroute stats table."
+        ::= { erouteStats 2 }
+erouteStatsEntry  OBJECT-TYPE
+        SYNTAX          erouteStatsEntry
+        MAX-ACCESS      not-accessible
+        STATUS          current
+        DESCRIPTION "A erouteStatsTable entry containing status for one Eroute."
+        INDEX  { erouteIndex }
+        ::= { erouteStatsTable 1 }
+erouteStatsEntry       ::= SEQUENCE {
+        erouteIndex     Integer32,
+        erouteName      DisplayString,
+        erouteType      DisplayString,
+        eroutePriority  Integer32,
+        erouteSrcIP     DisplayString,
+        erouteSrcMask   DisplayString,
+        erouteSrcPort   DisplayString,
+        erouteDstIP     DisplayString,
+        erouteDstMask   DisplayString,
+        erouteDstPort   DisplayString,
+        erouteProtocol  DisplayString,
+        erouteGateway   DisplayString,
+        erouteHealth    DisplayString}
+
+erouteIndex       OBJECT-TYPE
+        SYNTAX         Integer32
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Reference index for each Eroute."
+        ::= { erouteStatsEntry 1 }
+erouteName        OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Eroute name."
+        ::= { erouteStatsEntry 2 }
+erouteType        OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Type of the eroute."
+        ::= { erouteStatsEntry 3 }
+eroutePriority    OBJECT-TYPE
+        SYNTAX         Integer32
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Priority of the eroute."
+        ::= { erouteStatsEntry 4 }
+erouteSrcIP       OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Source IP address of the eroute."
+        ::= { erouteStatsEntry 5 }
+erouteSrcMask     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Source IP address mask of the eroute."
+        ::= { erouteStatsEntry 6 }
+erouteSrcPort     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Source port of the eroute."
+        ::= { erouteStatsEntry 7 }
+erouteDstIP       OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Destination IP address of the eroute."
+        ::= { erouteStatsEntry 8 }
+erouteDstMask     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Destination IP address mask for the eroute."
+        ::= { erouteStatsEntry 9 }
+erouteDstPort     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Target port of the eroute."
+        ::= { erouteStatsEntry 10 }
+erouteProtocol    OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Protocol configured in the eroute."
+        ::= { erouteStatsEntry 11 }
+erouteGateway     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Gateway address of the eroute."
+        ::= { erouteStatsEntry 12 }
+erouteHealth      OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Health of the eroute."
+        ::= { erouteStatsEntry 13 }
 END
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_foreign.txt
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_foreign.txt	(revision 39103)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/CA-SNMP-MIB_foreign.txt	(working copy)
@@ -144,6 +144,9 @@
 --   orchMIB          OBJECT IDENTIFIER ::= { arrayNetworks 35 }
 --                    Orchestrator STATS
 --
+--   eroute           OBJECT IDENTIFIER ::= { arrayNetworks 36 }
+--                    E-route STATS
+--
 --   version          OBJECT IDENTIFIER ::= { arrayNetworks 100 }
 --                    NO LONGER SUPPORTED
 --
@@ -5221,6 +5224,7 @@
 --llbGeneral		OBJECT IDENTIFIER ::= { llb 1 } 
 llbStats		OBJECT IDENTIFIER ::= { llb 2 } 
 linkStats		OBJECT IDENTIFIER ::= { llbStats 1 }
+natStats                OBJECT IDENTIFIER ::= { llbStats 2 }
 
 linkCount	OBJECT-TYPE 
 		SYNTAX		Integer32 	
@@ -5347,6 +5351,84 @@
 		STATUS	       current
 		DESCRIPTION "Link route usage."
 		::= { linkStatsEntry 15 }
+
+natStatsCount   OBJECT-TYPE
+                SYNTAX          Integer32
+                MAX-ACCESS      read-only
+                STATUS          current
+                DESCRIPTION "The number of natted connections."
+                ::= { natStats 1 }
+natStatsTable   OBJECT-TYPE
+                SYNTAX          SEQUENCE OF natStatsEntry
+                MAX-ACCESS      not-accessible
+                STATUS          current
+                DESCRIPTION "NAT connection table."
+                ::= { natStats 2 }
+natStatsEntry  OBJECT-TYPE
+                SYNTAX          natStatsEntry
+                MAX-ACCESS      not-accessible
+                STATUS          current
+                DESCRIPTION "A natStatsTable entry containing information for one natted connection."
+                INDEX  { natIndex }
+                ::= { natStatsTable 1 }
+natStatsEntry       ::= SEQUENCE {
+                natIndex       Integer32,
+                natSourceIP    DisplayString,
+                natLocalIP     DisplayString,
+                natTargetIP    DisplayString,
+                natSourcePort  INTEGER,
+                natLocalPort   INTEGER,
+                natTargetPort  INTEGER}
+
+natIndex        OBJECT-TYPE
+                SYNTAX         Integer32
+                MAX-ACCESS     read-only
+                STATUS         current
+                DESCRIPTION "A unique value for each natted connection."
+                ::= { natStatsEntry 1 }
+
+natSourceIP     OBJECT-TYPE
+                SYNTAX         DisplayString
+                MAX-ACCESS     read-only
+                STATUS         current
+                DESCRIPTION "Source IP of this connection to be natted"
+                ::= { natStatsEntry 2 }
+
+natLocalIP      OBJECT-TYPE
+                SYNTAX         DisplayString
+                MAX-ACCESS     read-only
+                STATUS         current
+                DESCRIPTION "NAT IP of this connection"
+                ::= { natStatsEntry 3 }
+
+natTargetIP     OBJECT-TYPE
+                SYNTAX         DisplayString
+                MAX-ACCESS     read-only
+                STATUS         current
+                DESCRIPTION "Destination IP of this connection"
+                ::= { natStatsEntry 4 }
+
+natSourcePort   OBJECT-TYPE
+                SYNTAX              INTEGER(0..65535)
+                MAX-ACCESS          read-only
+                STATUS              current
+                DESCRIPTION "Source port of this connection to be natted"
+                ::= { natStatsEntry 5 }
+
+natLocalPort    OBJECT-TYPE
+                SYNTAX              INTEGER(0..65535)
+                MAX-ACCESS          read-only
+                STATUS              current
+                DESCRIPTION "NAT port of this connection"
+                ::= { natStatsEntry 6 }
+
+natTargetPort   OBJECT-TYPE
+                SYNTAX              INTEGER(0..65535)
+                MAX-ACCESS          read-only
+                STATUS              current
+                DESCRIPTION "Destination port of this connection"
+                ::= { natStatsEntry 7 }
+
 -- End of LLB MIB
 ---
 --- The statistics of arrayNetworks' orchestrator MIB
@@ -6727,4 +6809,122 @@
                "The number of from_interface packets denied by the policy."
 	::= { policyStatsEntry 6 }
 -- End of orchestrator MIB
+--
+--- The information of arrayNetworks's E-Route MIB.
+---
+eroute   OBJECT IDENTIFIER ::= { arrayNetworks 36 }
+erouteStats             OBJECT IDENTIFIER ::= { eroute 1 }
+
+erouteCount       OBJECT-TYPE
+        SYNTAX          Integer32
+        MAX-ACCESS      read-only
+        STATUS          current
+        DESCRIPTION "The number of Eroutes."
+        ::= { erouteStats 1 }
+erouteStatsTable  OBJECT-TYPE
+        SYNTAX          SEQUENCE OF erouteStatsEntry
+        MAX-ACCESS      not-accessible
+        STATUS          current
+        DESCRIPTION "Eroute stats table."
+        ::= { erouteStats 2 }
+erouteStatsEntry  OBJECT-TYPE
+        SYNTAX          erouteStatsEntry
+        MAX-ACCESS      not-accessible
+        STATUS          current
+        DESCRIPTION "A erouteStatsTable entry containing status for one Eroute."
+        INDEX  { erouteIndex }
+        ::= { erouteStatsTable 1 }
+erouteStatsEntry       ::= SEQUENCE {
+        erouteIndex     Integer32,
+        erouteName      DisplayString,
+        erouteType      DisplayString,
+        eroutePriority  Integer32,
+        erouteSrcIP     DisplayString,
+        erouteSrcMask   DisplayString,
+        erouteSrcPort   DisplayString,
+        erouteDstIP     DisplayString,
+        erouteDstMask   DisplayString,
+        erouteDstPort   DisplayString,
+        erouteProtocol  DisplayString,
+        erouteGateway   DisplayString,
+        erouteHealth    DisplayString}
+
+erouteIndex       OBJECT-TYPE
+        SYNTAX         Integer32
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Reference index for each Eroute."
+        ::= { erouteStatsEntry 1 }
+erouteName        OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Eroute name."
+        ::= { erouteStatsEntry 2 }
+erouteType        OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Type of the eroute."
+        ::= { erouteStatsEntry 3 }
+eroutePriority    OBJECT-TYPE
+        SYNTAX         Integer32
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Priority of the eroute."
+        ::= { erouteStatsEntry 4 }
+erouteSrcIP       OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Source IP address of the eroute."
+        ::= { erouteStatsEntry 5 }
+erouteSrcMask     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Source IP address mask of the eroute."
+        ::= { erouteStatsEntry 6 }
+erouteSrcPort     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Source port of the eroute."
+        ::= { erouteStatsEntry 7 }
+erouteDstIP       OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Destination IP address of the eroute."
+        ::= { erouteStatsEntry 8 }
+erouteDstMask     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Destination IP address mask for the eroute."
+        ::= { erouteStatsEntry 9 }
+erouteDstPort     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Target port of the eroute."
+        ::= { erouteStatsEntry 10 }
+erouteProtocol    OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Protocol configured in the eroute."
+        ::= { erouteStatsEntry 11 }
+erouteGateway     OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Gateway address of the eroute."
+        ::= { erouteStatsEntry 12 }
+erouteHealth      OBJECT-TYPE
+        SYNTAX         DisplayString
+        MAX-ACCESS     read-only
+        STATUS         current
+        DESCRIPTION "Health of the eroute."
+        ::= { erouteStatsEntry 13 }
 END
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/Makefile
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/Makefile	(revision 39103)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/Makefile	(working copy)
@@ -3,10 +3,10 @@
 LIB=	ca_snmp_mib
 SRCS=   init_ca_snmp_mib.c Memory.c SystemInfo.c caSyslog.c clickTcp.c compression.c \
 	healthCheck.c ifTraffic.c monitor.c performance.c revProxyCache.c sdns.c \
-	slbMIB.c sslMIB.c vipStats.c vrrp.c ha.c mapMIB.c llbMIB.c orchMIB.c
+	slbMIB.c sslMIB.c vipStats.c vrrp.c ha.c mapMIB.c llbMIB.c erouteMIB.c orchMIB.c
 INCS=	Memory.h SystemInfo.h caSyslog.h clickTcp.h compression.h healthCheck.h \
 	ifTraffic.h monitor.h netsnmp_common.h performance.h revProxyCache.h \
-	sdns.h slbMIB.h sslMIB.h vipStats.h vrrp.h ha.h mapMIB.h llbMIB.h orchMIB.h
+	sdns.h slbMIB.h sslMIB.h vipStats.h vrrp.h ha.h mapMIB.h llbMIB.h erouteMIB.h orchMIB.h
 
 FILESGROUPS=CA_SNMP_MIB
 CA_SNMP_MIB=CA-SNMP-MIB.txt CA-SNMP-MIB_foreign.txt CA-SNMP-MIB_cn.txt
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/erouteMIB.h
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/erouteMIB.h	(revision 0)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/erouteMIB.h	(working copy)
@@ -0,0 +1,10 @@
+#ifndef EROUTEMIB_H
+#define EROUTEMIB_H
+
+/* function declarations */
+void init_erouteMIB(void);
+FindVarMethod var_erouteTableCount;
+FindVarMethod var_erouteTable;
+
+#endif /* EROUTEMIB_H */
+
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/erouteMIB.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/erouteMIB.c	(revision 0)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/erouteMIB.c	(working copy)
@@ -0,0 +1,327 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ *        $
+ */
+
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/util_funcs.h>
+#include "erouteMIB.h"
+
+#include <bsd/bsd.h>
+#include <netinet/in.h>
+#include <netinet/tcp_fsm.h>
+#include <click/app/kernelapi/kernelapi.h>
+#include <click/netinet/click_utils.h>
+#include <click/netinet/click_eroute.h>
+#include "netsnmp_common.h"
+
+/*
+ * erouteMIB_variables_oid:
+ *   this is the top level oid that we want to register under.  This
+ *   is essentially a prefix, with the suffix appearing in the
+ *   variable below.
+ */
+
+oid erouteMIB_variables_oid[] = { 1,3,6,1,4,1,ARRAY_COMPINFO_MIBOID,36 };
+
+/*
+ * variable7 erouteMIB_variables:
+ *   this variable defines function callbacks and type return information
+ *   for the erouteMIB mib section
+ */
+
+struct variable7 erouteMIB_variables[] = {
+/*  magic number, variable type , ro/rw , callback fn  , L, oidsuffix */
+/*  (L = length of the oidsuffix) */
+/* { 1 } eroute stats */
+
+#define ERCOUNT		1
+{ERCOUNT,  ASN_INTEGER,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTableCount, 3,  { 1,1,1 }},
+#define ERINDEX		1
+{ERINDEX,  ASN_INTEGER,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,1 }},
+#define ERNAME		2
+{ERNAME,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,2 }},
+#define ERTYPE          3
+{ERTYPE,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,3 }},
+#define ERPRIO          4
+{ERPRIO,  ASN_INTEGER,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,4 }},
+#define ERSRCIP		5
+{ERSRCIP,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,5 }},
+#define ERSRCMASK       6
+{ERSRCMASK,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,6 }},
+#define ERSRCPORT	7
+{ERSRCPORT,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,7 }},
+#define ERDSTIP         8
+{ERDSTIP,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,8 }},
+#define ERDSTMASK	9
+{ERDSTMASK,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,9 }},
+#define ERDSTPORT       10
+{ERDSTPORT,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,10 }},
+#define ERPROTO	        11
+{ERPROTO,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,11 }},
+#define ERGATEWAY       12
+{ERGATEWAY,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,12 }},
+#define ERHEALTH        13
+{ERHEALTH,  ASN_OCTET_STR,  NETSNMP_OLDAPI_RONLY,
+ var_erouteTable, 4,  { 1,2,1,13 }},
+};
+
+/** Initializes the erouteMIB module */
+void
+init_erouteMIB(void)
+{
+
+    DEBUGMSGTL(("erouteMIB", "Initializing\n"));
+
+    /* register ourselves with the agent to handle our mib tree */
+    REGISTER_MIB("erouteMIB", erouteMIB_variables, variable7,
+               erouteMIB_variables_oid);
+
+    /* place any other initialization junk you need here */
+}
+
+/*
+ * var_erouteTableCount():
+ *   This function is called every time the agent gets a request for
+ *   a scalar variable that might be found within your mib section
+ *   registered above.  It is up to you to do the right thing and
+ *   return the correct value.
+ *     You should also correct the value of "var_len" if necessary.
+ *
+ *   Please see the documentation for more information about writing
+ *   module extensions, and check out the examples in the examples
+ *   and mibII directories.
+ */
+unsigned char *
+var_erouteTableCount(struct variable *vp,
+                oid     *name,
+                size_t  *length,
+                int     exact,
+                size_t  *var_len,
+                WriteMethod **write_method)
+{
+    /* variables we may use later */
+    static long long_ret;
+    static u_long ulong_ret;
+    static unsigned char string[SPRINT_MAX_LEN];
+    static oid objid[MAX_OID_LEN];
+    static struct counter64 c64;
+
+    if (header_generic(vp,name,length,exact,var_len,write_method)
+                                  == MATCH_FAILED )
+    return NULL;
+
+    /*
+   * this is where we do the value assignments for the mib results.
+   */
+    switch(vp->magic) {
+    case ERCOUNT:
+		long_ret = get_eroute_count();
+		return (u_char *)&long_ret;
+    default:
+      ERROR_MSG("");
+    }
+    return NULL;
+}
+
+/*
+ * var_erouteTable():
+ *   Handle this table separately from the scalar value case.
+ *   The workings of this are basically the same as for var_erouteTableCount above.
+ */
+unsigned char *
+var_erouteTable(struct variable *vp,
+            oid     *name,
+            size_t  *length,
+            int     exact,
+            size_t  *var_len,
+            WriteMethod **write_method)
+{
+    /* variables we may use later */
+    static long long_ret;
+    static unsigned char result[SPRINT_MAX_LEN];
+    static oid objid[MAX_OID_LEN];
+    static struct counter64 c64;
+    int idx, lkcount;
+    char *detail=NULL;
+    /*
+   * This assumes that the table is a 'simple' table.
+   *	See the implementation documentation for the meaning of this.
+   *	You will need to provide the correct value for the TABLE_SIZE parameter
+   *
+   * If this table does not meet the requirements for a simple table,
+   *	you will need to provide the replacement code yourself.
+   *	Mib2c is not smart enough to write this for you.
+   *    Again, see the implementation documentation for what is required.
+   */
+
+    lkcount = get_eroute_count() ;
+    if (header_simple_table(vp,name,length,exact,var_len,write_method, lkcount)
+                                                == MATCH_FAILED )
+    return NULL;
+    int *priority_ptr = NULL;
+    static int priority;
+    idx = name[*length - 1];
+
+    /*
+   * this is where we do the value assignments for the mib results.
+   */
+    switch(vp->magic) {
+    case ERINDEX:
+        long_ret = idx;
+        return (u_char *)&long_ret;
+    case ERNAME:
+        get_eroute_general_config(idx, ER_NAME, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERTYPE:
+        get_eroute_stats(idx, ER_TYPE, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERPRIO:
+        get_eroute_general_config(idx, ER_PRIO, (void **)&priority_ptr, (int32_t *) var_len);
+        if (priority_ptr == NULL) {
+            return (u_char*)0;
+        } else {
+            priority = *priority_ptr;
+            free(priority_ptr);
+            priority_ptr = NULL;
+            return (u_char*)&priority;
+        }
+        return (u_char *)result;
+    case ERSRCIP:
+        get_eroute_src_config(idx, ER_SRC_IP, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERSRCMASK:
+        get_eroute_src_config(idx, ER_SRC_MASK, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERSRCPORT:
+        get_eroute_src_config(idx, ER_SRC_PORT, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERDSTIP:
+        get_eroute_dst_config(idx, ER_DST_IP, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERDSTMASK:
+        get_eroute_dst_config(idx, ER_DST_MASK, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERDSTPORT:
+        get_eroute_dst_config(idx, ER_DST_PORT, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERPROTO:
+        get_eroute_general_config(idx, ER_PROTO, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERGATEWAY:
+        get_eroute_general_config(idx, ER_GATEWAY, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    case ERHEALTH:
+        get_eroute_stats(idx, ER_HEALTH, &detail, (int32_t *) var_len);
+        if (detail == NULL) {
+            result[0] = '\0';
+            *var_len = 0;
+        } else {
+            strlcpy(result, detail, SPRINT_MAX_LEN);
+            free(detail);
+            detail = NULL;
+        }
+        return (u_char *)result;
+    default:
+      ERROR_MSG("");
+    }
+    return NULL;
+}
+
+
+
Index: /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/init_ca_snmp_mib.c
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/init_ca_snmp_mib.c	(revision 39103)
+++ /branches/rel_apv_10_7/usr/click/lib/libca_snmp_mib/init_ca_snmp_mib.c	(working copy)
@@ -16,6 +16,7 @@
 extern void init_vrrp(void);
 extern void init_ha(void);
 extern void init_llbMIB(void);
+extern void init_erouteMIB(void);
 extern void init_orchestratorMIB(void);
 
 #if defined(__linux__)
@@ -51,5 +52,6 @@
 	init_ha();
 	init_mapMIB();
 	init_llbMIB();
+        init_erouteMIB();
 	init_orchestratorMIB();
 }
Index: /branches/rel_apv_10_7/usr/click/lib/libkernelapi/addCommands.pm
===================================================================
--- /branches/rel_apv_10_7/usr/click/lib/libkernelapi/addCommands.pm	(revision 39103)
+++ /branches/rel_apv_10_7/usr/click/lib/libkernelapi/addCommands.pm	(working copy)
@@ -12500,9 +12500,49 @@
                 function_name => "clickpcb_show_nat_count",
                 function_args => [
         ],
+        },
+        {
+                cmd_attribute => "CMD_KERN_API|CMD_KAPI_NOLOCK",
+                function_name => "get_eroute_general_config",
+                function_args => [
+                        {type => "U32"},
+                        {type => "U32"},
+                        {type => "OUTDATA"},
+        ],
+        },
+        {
+                cmd_attribute => "CMD_KERN_API|CMD_KAPI_NOLOCK",
+                function_name => "get_eroute_src_config",
+                function_args => [
+                        {type => "U32"},
+                        {type => "U32"},
+                        {type => "OUTDATA"},
+        ],
+        },
+        {
+                cmd_attribute => "CMD_KERN_API|CMD_KAPI_NOLOCK",
+                function_name => "get_eroute_dst_config",
+                function_args => [
+                        {type => "U32"},
+                        {type => "U32"},
+                        {type => "OUTDATA"},
+        ],
+        },
+        {
+                cmd_attribute => "CMD_KERN_API|CMD_KAPI_NOLOCK",
+                function_name => "get_eroute_stats",
+                function_args => [
+                        {type => "U32"},
+                        {type => "U32"},
+                        {type => "OUTDATA"},
+        ],
+        },
+        {
+                cmd_attribute => "CMD_KERN_API|CMD_KAPI_NOLOCK",
+                function_name => "get_eroute_count",
+                function_args => [
+        ],
         }
-
-
 );
 
 # This method is required to expost the command table to the caller.
Index: /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_eroute.h
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_eroute.h	(revision 39103)
+++ /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_eroute.h	(working copy)
@@ -141,6 +141,30 @@
 	EV_V_MAX
 };/* VERSION*/
 
+typedef enum{
+        ER_NAME,
+        ER_PRIO,
+        ER_PROTO,
+        ER_GATEWAY
+} er_general_config;
+
+typedef enum{
+        ER_SRC_IP,
+        ER_SRC_MASK,
+        ER_SRC_PORT
+} er_src_config;
+
+typedef enum{
+        ER_DST_IP,
+        ER_DST_MASK,
+        ER_DST_PORT
+} er_dst_config;
+
+typedef enum{
+        ER_TYPE,
+        ER_HEALTH
+} er_stats;
+
 struct eroute_info {
 	uint32_t rule_id;
 	struct eroute_rule *rule;
Index: /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_eroute.c
===================================================================
--- /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_eroute.c	(revision 39103)
+++ /branches/rel_apv_10_7/usr/src/sys/click/netinet/click_eroute.c	(working copy)
@@ -18350,6 +18350,337 @@
 	
 	return EV_CLI_OK;
 }
-
 /* for segment - end*/
 
+int
+get_eroute_count(void *pcb)
+{
+        int v, j;
+        int count = 0;
+        struct ertentry *ert = NULL;
+        for (v = EV_V_V4; v < EV_V_MAX; v++){
+                for (j = 0; j < EROUTE_MAX; j++) {
+                        ert = &ERTENTRY_ZONE(v,j);
+                        if (ERT_NOCONF(*ert) || is_domain_eroute(ert->er_name)){
+                                continue;
+                        }
+                        count++;
+                }
+        }
+        return count;
+}
+static struct ertentry *
+get_ert_entry(int idx)
+{
+        struct ertentry *ert = NULL;
+        int v, j;
+        int count = 0;
+        for (v = EV_V_V4; v < EV_V_MAX; v++){
+                for (j = 0; j < EROUTE_MAX; j++) {
+                        ert = &ERTENTRY_ZONE(v,j);
+                        if (ERT_NOCONF(*ert) || is_domain_eroute(ert->er_name)){
+                                continue;
+                        }
+                        count++;
+                        if (count == idx) {
+                                return ert;
+                        }
+                }
+        }
+        return ert;
+}
+int
+get_eroute_general_config(void *pcb, uint32_t idx, uint32_t detailtype, void **buf, int* len)
+{
+        struct ertentry *ert;
+        *buf = NULL;
+        *len = 0;
+        ert = get_ert_entry(idx);
+        if (ert == NULL) {
+                return 0;
+        }
+        int *priority = NULL;
+        char *detail = NULL;
+        int isipv6 = ert->er_isipv6;
+        int str_len = 0;
+        struct in6_addr gwip_in6;
+        struct in_addr gwip;
+        int DEFAULT_NAME_LEN = 50;
+        if (detailtype == ER_PRIO) {
+                MALLOC(priority, int *, sizeof(int), M_TEMP, M_NOWAIT|M_ZERO);
+                if (priority == NULL) {
+                        return 0;
+                }
+                *priority = ert->er_prio;
+                *buf = priority;
+                *len = sizeof(int);
+                return 1;
+        } else if (detailtype == ER_PROTO) {
+                if (isipv6) {
+                        str_len = strlen(get_proto_str(ERT_TUPL6(ert).proto)) + 1;
+                        MALLOC(detail, char *, str_len, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        strlcpy(detail, get_proto_str(ERT_TUPL6(ert).proto), str_len);
+                }
+                else {
+                        str_len = strlen(get_proto_str(ERT_TUPL(ert).proto)) + 1;
+                        MALLOC(detail, char *, str_len, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        strlcpy(detail, get_proto_str(ERT_TUPL(ert).proto), str_len);
+                }
+        } else if (detailtype == ER_NAME) {
+                if (ert->er_name[0] != '"') {
+                        str_len = strlen(ert->er_name) + 1;
+                        MALLOC(detail, char *, str_len, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        strlcpy(detail, ert->er_name, str_len);
+                } else if (ERT_IPREGION(*ert)) {
+                        str_len = strlen(ert->er_name) + 1;
+                        MALLOC(detail, char *, str_len, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        strlcpy(detail, ert->er_name + strlen(PREFIX_IPREGION_ROUTE), str_len);
+                } else {
+                        MALLOC(detail, char *, DEFAULT_NAME_LEN, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        if (ert->er_prio == EROUTE_DEFAULT_PRIO) {
+                                strlcpy(detail, "default", DEFAULT_NAME_LEN);
+                        } else if (ert->er_prio == EROUTE_INTERFACE_PRIO) {
+                                strlcpy(detail, "interface",  DEFAULT_NAME_LEN);
+                        } else if (ert->er_prio == EROUTE_LLBLINK_PRIO) {
+                                strlcpy(detail, "llb link route", DEFAULT_NAME_LEN);
+                        } else if (ert->er_prio == EROUTE_MGMT_PRIO) {
+                                strlcpy(detail, "management", DEFAULT_NAME_LEN);
+                        } else {
+                                strlcpy(detail, "static", DEFAULT_NAME_LEN);
+                        }
+                }
+        } else if (detailtype == ER_GATEWAY) {
+                if (isipv6) {
+                        if (ert->er_gw == NULL){
+                                gwip_in6 = in6addr_any;
+                        } else {
+                                gwip_in6 = GW_INADDR6(ert->er_gw);
+                        }
+                        MALLOC(detail, char *, INET6_ADDRSTRLEN, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        inet_ntop(AF_INET6, &gwip_in6, detail, INET6_ADDRSTRLEN);
+                } else {
+                        if (ert->er_gw == NULL){
+                                gwip.s_addr = 0;
+                        } else{
+                                gwip = GW_INADDR(ert->er_gw);
+                        }
+                        MALLOC(detail, char *, INET6_ADDRSTRLEN, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                return 0;
+                        }
+                        snprintf(detail, INET6_ADDRSTRLEN, "%ip", INET_NTOA(gwip));
+                }
+        } else {
+                return 0;
+        }
+        *buf = detail;
+        *len = snprintf(NULL, 0, "%s", detail);
+        return 1;
+}
+
+int
+get_eroute_src_config(void *pcb, uint32_t idx, uint32_t detailtype, void **buf, int* len)
+{
+        struct ertentry *ert;
+        *buf = NULL;
+        *len=0;
+        ert = get_ert_entry(idx);
+        if(ert == NULL) {
+                return 0;
+        }
+        int isipv6 = ert->er_isipv6;
+        int str_len = 0;
+        int PORT_RANGE_LEN = 32;
+        uint16_t start_sport, end_sport;
+        char *detail;
+        if (detailtype == ER_SRC_IP) {
+                if (ert->src_grp) {
+                        str_len = strlen(ert->src_grp->name) + 1;
+                        MALLOC(detail, char *, str_len, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                 return 0;
+                        }
+                        strlcpy(detail, ert->src_grp->name, str_len);
+                } else {
+                        MALLOC(detail, char *, INET6_ADDRSTRLEN, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                 return 0;
+                        }
+                        if (isipv6) {
+                                inet_ntop(AF_INET6, &ERT_TUPL6(ert).sip6, detail, INET6_ADDRSTRLEN);
+                        }
+                        else {
+                                inet_ntop(AF_INET, &ERT_TUPL(ert).sip, detail, INET6_ADDRSTRLEN);
+                        }
+                }
+        } else if (detailtype == ER_SRC_PORT) {
+                MALLOC(detail, char *, PORT_RANGE_LEN, M_TEMP, M_NOWAIT | M_ZERO);
+                if (detail == NULL) {
+                         return 0;
+                }
+                if (isipv6 || ev_v4_enable) {
+                        start_sport = ert->er_src_start_port;
+                        end_sport = ert->er_src_end_port;
+                        if (PORT_RANGE_SINGLE_PORT(start_sport, end_sport) || PORT_RANGE_FULL_PORT(start_sport, end_sport)){
+                                snprintf(detail, PORT_RANGE_LEN, "%d", start_sport);
+                        } else{
+                                snprintf(detail, PORT_RANGE_LEN, "%d-%d", start_sport, end_sport);
+                        }
+                } else {
+                        snprintf(detail, PORT_RANGE_LEN, "%d", ntohs(ERT_TUPL(ert).sport));
+                }
+        } else if (detailtype == ER_SRC_MASK) {
+                MALLOC(detail, char *, INET6_ADDRSTRLEN, M_TEMP, M_NOWAIT | M_ZERO);
+                if (detail == NULL) {
+                         return 0;
+                }
+                if (isipv6) {
+                        snprintf(detail, INET6_ADDRSTRLEN, "%d", in6_mask2len(&ERT_TUPL6(ert).smask6, NULL));
+                } else {
+                        snprintf(detail, INET6_ADDRSTRLEN, "%ip", ERT_TUPL(ert).smask);
+                }
+        } else {
+                return 0;
+        }
+        *buf = detail;
+        *len = snprintf(NULL, 0, "%s", detail);
+        return 1;
+}
+
+int
+get_eroute_dst_config(void *pcb, uint32_t idx, uint32_t detailtype, void **buf, int* len)
+{
+        struct ertentry *ert;
+        *buf = NULL;
+        *len=0;
+        ert = get_ert_entry(idx);
+        if(ert == NULL){
+                return 0;
+        }
+        int isipv6 = ert->er_isipv6;
+        int str_len = 0;
+        int PORT_RANGE_LEN = 32;
+        uint16_t start_dport, end_dport;
+        char *detail;
+        if (detailtype == ER_DST_IP) {
+                if (ert->dst_grp) {
+                        str_len = strlen(get_ipgroup_name(ert->dst_grp)) + 1;
+                        MALLOC(detail, char *, str_len, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                 return 0;
+                        }
+                        strlcpy(detail, get_ipgroup_name(ert->dst_grp), str_len);
+                } else {
+                        MALLOC(detail, char *, INET6_ADDRSTRLEN, M_TEMP, M_NOWAIT | M_ZERO);
+                        if (detail == NULL) {
+                                 return 0;
+                        }
+                        if (isipv6) {
+                                inet_ntop(AF_INET6, &ERT_TUPL6(ert).dip6, detail, INET6_ADDRSTRLEN);
+                        } else {
+                                inet_ntop(AF_INET, &ERT_TUPL(ert).dip, detail, INET6_ADDRSTRLEN);
+                        }
+                }
+        } else if (detailtype == ER_DST_PORT) {
+                MALLOC(detail, char *, PORT_RANGE_LEN, M_TEMP, M_NOWAIT | M_ZERO);
+                if (detail == NULL) {
+                         return 0;
+                }
+                start_dport = ert->er_dst_start_port;
+                end_dport = ert->er_dst_end_port;
+                if (PORT_RANGE_SINGLE_PORT(start_dport, end_dport) || PORT_RANGE_FULL_PORT(start_dport, end_dport)) {
+                        snprintf(detail, PORT_RANGE_LEN, "%d", start_dport);
+                } else {
+                        snprintf(detail, PORT_RANGE_LEN, "%d-%d", start_dport, end_dport);
+                }
+        } else if (detailtype == ER_DST_MASK) {
+                MALLOC(detail, char *, INET6_ADDRSTRLEN, M_TEMP, M_NOWAIT | M_ZERO);
+                if (detail == NULL) {
+                         return 0;
+                }
+                if (isipv6) {
+                        snprintf(detail, INET6_ADDRSTRLEN, "%d", in6_mask2len(&ERT_TUPL6(ert).dmask6, NULL));
+                } else {
+                        snprintf(detail, INET6_ADDRSTRLEN, "%ip", ERT_TUPL(ert).dmask);
+                }
+        } else {
+                return 0;
+        }
+        *buf = detail;
+        *len = snprintf(NULL, 0, "%s", detail);
+        return 1;
+}
+int
+get_eroute_stats(void *pcb, uint32_t idx, uint32_t detailtype, void **buf, int* len)
+{
+        struct ertentry *ert;
+        *buf = NULL;
+        *len=0;
+        ert = get_ert_entry(idx);
+        if(ert == NULL) {
+                return 0;
+        }
+        int str_len = 0;
+        char *detail;
+        int MIN_TYPE_LEN = 50;
+        int gw_stats;
+        MALLOC(detail, char *, MIN_TYPE_LEN, M_TEMP, M_NOWAIT | M_ZERO);
+        if (detail == NULL) {
+                return 0;
+        }
+        if (detailtype == ER_TYPE) {
+                if (ert->er_name[0] != '"') {
+                        strlcpy(detail, "User Defined eroute", MIN_TYPE_LEN);
+                }
+                else if (ERT_IPREGION(*ert)) {
+                        strlcpy(detail, "IP region eroute", MIN_TYPE_LEN);
+                } else if (ert->er_prio == EROUTE_DEFAULT_PRIO) {
+                        strlcpy(detail, "Default eroute", MIN_TYPE_LEN);
+                } else if (ert->er_prio == EROUTE_INTERFACE_PRIO) {
+                        strlcpy(detail, "Interface eroute", MIN_TYPE_LEN);
+                } else if (ert->er_prio == EROUTE_LLBLINK_PRIO) {
+                        strlcpy(detail, "LLB link eroute", MIN_TYPE_LEN);
+                } else if (ert->er_prio == EROUTE_MGMT_PRIO) {
+                        strlcpy(detail, "Management eroute", MIN_TYPE_LEN);
+                } else {
+                        strlcpy(detail, "Static eroute", MIN_TYPE_LEN);
+                }
+        }
+        else if (detailtype == ER_HEALTH) {
+                gw_stats = get_gatewayth_stats(ert->er_gw);
+                if (gw_stats == GW_STATS_VALID) {
+                        strlcpy(detail, "Link is up", MIN_TYPE_LEN);
+                } else if (gw_stats == GW_STATS_HCDOWN) {
+                        strlcpy(detail, "Link health status down", MIN_TYPE_LEN);
+                } else if (gw_stats == GW_STATS_UNREACHABLE) {
+                        strlcpy(detail, "Link unreachable", MIN_TYPE_LEN);
+                } else {
+                        strlcpy(detail, "Link disabled", MIN_TYPE_LEN);
+                }
+        }
+        else {
+                return 0;
+        }
+        *buf = detail;
+        *len = snprintf(NULL, 0, "%s", detail);
+        return 1;
+}
+
