[SNMP4J] Set operation on Table column, not correct index

gao weihua angela.gwh at gmail.com
Fri Dec 22 14:58:29 CET 2006


Hi, all,
I am making development based  on snmp4j-agent to manage device. but I have
a problem when send "set" to snmp4j-agent.

As we all know, when we add new row to Table, it actually stored in sortmap,
with format<index, value>, here "index" is created by new OID("xx"), xx is
an integer.
when we want a row, we use TableModel.getrow(index), if i not make a
mistake, here index equals to index in <index, value>. but when I make a try
to modify a column by set command, the index here will not be obtained
correctly, which is done in DefaultMoTable.java
 public void prepare(SubRequest request) {
    OID cellOID = request.getVariableBinding().getOid();
    MOTableCellInfo cell = getCellInfo(cellOID);
    if (cell.getIndex() == null) {
      request.getStatus().setErrorStatus(PDU.inconsistentName);
      return;
    }
......
}

I debug it in eclipse, the index is obtained in line MOTableCellInfo cell =
getCellInfo(cellOID); but not got the right value.

For eg, Table entry oid : x.x.x.2.2.1, with column x.x.x.2.2.1.1,
x.x.x.2.2.1.2,  x.x.x.2.2.1.3, The table has only one row, by addrow(new
OID("1"), varailbe[] ). I try to set new value to x.x.x.2.2.1.2, but the
index caculated in MOTableCellInfo cell = getCellInfo(cellOID) always be 0,
but the actual value is 1.

Here anybody know what I said above is the truth of snmp4j-agent?
or I just have make some mis-understand of snmp4j-agent?

best regards
Angela



More information about the SNMP4J mailing list