[AGENT++] missing getRowIndicesCloned() function

Frank Fock fock at agentpp.com
Tue Aug 16 20:44:31 CEST 2011


Hi Klaus,

This is indeed a good convenience function.
Have you attached the code to the email for
Jochen?
We can add it then to the Apache License
release of AGENT++ (which is terribly late,
I know, but will be released this year -
promised).

Best regards,
Frank

On 15.08.2011 23:22, Claus Klein wrote:
> Hi Jochen,
>
> i have missed a function to get the different MibTableRow subindices.
>
> Without such a function, it is really hard to get the 3. index of a
> MibTable like the IP-FORWARD-MIB::inetCidrRouteTable.
>
> ./apps/snmptable -Cibw 123 -m ALL -v3 -u claus -l noAuthNoPriv
> 'tcp6:[::1]:161' inetCidrRouteTable
> SNMP table: IP-FORWARD-MIB::inetCidrRouteTable
>
> index IfIndex
> ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:01".128.3.0.0.2.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"
> 1
> ipv6."fe:80:00:00:00:00:00:00:02:23:6c:ff:fe:8c:45:b1".128.3.0.0.3.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"
> 1
> ipv6."ff:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00".8.3.0.0.4.ipv6."00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00"
> 3
>
> SNMP table IP-FORWARD-MIB::inetCidrRouteTable, part 2
> ...
>
>
> I have prepared a prototype of the missing function and an example
> program to show its usage:
>
> /**
> * Return the all sub index values for the current table row index given.
> *
> * @note Return all sub indices as a list of pointers to the
> * corresponding Oidx values of the current MibTableRow index.
> *
> * @param index - the MibTableRow index
> * @return
> * a pointer to a cloned array of the rows indices.
> **/
> Array<Oidx>* MibTable::getRowIndicesCloned(const Oidx& index) const;
>
>
> # usage:
> Agentpp::Array<Agentpp::Oidx>* indices = getRowIndicesCloned(index);
>
> Agentpp::Oidx* first = indices->getNth(0); // I want to get only the
> first subindex
>
> Agentpp::Oidx* second = indices->getNth(1); // I want to get only the
> second subindex
>
> Agentpp::Oidx* third = indices->getNth(2); // I want to get only the
> third. subindex
>
> Agentpp::Oidx* fourth = indices->getNth(3); // I want to get only the
> fourth subindex
>
> ...
>
> Agentpp::Oidx* oid = indices->getNth(n-1); // I want to get only the
> last subindex
>
>
> What do you meen about it?
>
> With regards,
> Claus
>
>
>
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list