Hello all.
I have the following problem: When I'm trying to retreive the custom table from my SNMP agent the NULL is returned.
The code:
static int show_dgw_proto_sip_table(scli_interp_t *interp, int argc, char **argv) { sss_dgw_mib_sipProxyTableEntry_t **table=NULL; g_return_val_if_fail(interp, SCLI_ERROR);
if (argc != 2) return SCLI_SYNTAX; if (scli_interp_dry(interp)) return SCLI_OK;
sss_dgw_mib_get_protocolSIPProxyTable(interp->peer, &table, 0); if (interp->peer->error_status) return SCLI_SNMP; ....
After this step I have no errors, but the table is NULL
Any suggestions?
Best regards, Ruslan.
Additional information: scli version: current glib version: 2.16.3 gnet version: 2.0.8 gsnmp version: 0.2.0 smidump version: 0.4.8 (But I've compared the generated source with included in scli and I'm sure, the differences are not the case)
snort dump for request and agent responce is attached. The table definition from MIB (Base OID for the table is: 1.3.6.1.4.1.20379.2.1.3.2.3):
protocolSIPProxyTable OBJECT-TYPE SYNTAX SEQUENCE OF SIPProxyTableEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "" ::= { protocolSIP 3 }
sipProxyTableEntry OBJECT-TYPE SYNTAX SIPProxyTableEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "" INDEX { sipProxyTableIndex } ::= { protocolSIPProxyTable 1}
SIPProxyTableEntry ::= SEQUENCE { sipProxyTableIndex INTEGER, sipProxyTableSynch INTEGER, sipProxyTableName OCTET STRING, sipProxyTableOutAddr IpAddress, sipProxyTableAlwaysOut INTEGER, sipProxyTableUserName OCTET STRING, sipProxyTablePassword OCTET STRING, sipProxyTableSubstitute OCTET STRING, sipProxyTableRegister INTEGER, sipProxyTableRegistrator OCTET STRING, sipProxyTableRegistratorIP IpAddress, sipProxyTableUsersList OCTET STRING, sipProxyTableReregisterInterval INTEGER, sipProxyTableCallerDomain OCTET STRING, sipProxyTableCalledDomain OCTET STRING, sipProxyTableSubstituteFrom OCTET STRING, sipProxyTableSubstituteIp IpAddress, sipProxyTableFastStart INTEGER }
On Tue, Jun 24, 2008 at 11:25:33AM +0400, rbondar@rich-logic.com wrote:
I have the following problem: When I'm trying to retreive the custom table from my SNMP agent the NULL is returned.
The code:
static int show_dgw_proto_sip_table(scli_interp_t *interp, int argc, char **argv) { sss_dgw_mib_sipProxyTableEntry_t **table=NULL; g_return_val_if_fail(interp, SCLI_ERROR);
if (argc != 2) return SCLI_SYNTAX; if (scli_interp_dry(interp)) return SCLI_OK; sss_dgw_mib_get_protocolSIPProxyTable(interp->peer, &table, 0); if (interp->peer->error_status) return SCLI_SNMP;
....
After this step I have no errors, but the table is NULL
Any suggestions?
This can happen if the table is empty so you have to check whether table is actually not NULL.
snort dump for request and agent responce is attached.
Since I have no tools to decipher snort dumps, I suggest you run things through tcpdump -s 0 -v -v -v (or tethereal with appropriate options) to see what has been going on. Or you privately send me the packets in question in pcap format.
/js
On Tue, 24 Jun 2008 09:56:58 +0200, Juergen Schoenwaelder j.schoenwaelder@jacobs-university.de wrote:
On Tue, Jun 24, 2008 at 11:25:33AM +0400, rbondar@rich-logic.com wrote:
I have the following problem: When I'm trying to retreive the custom table from my SNMP agent the NULL
is
returned.
The code:
static int show_dgw_proto_sip_table(scli_interp_t *interp, int argc, char **argv) { sss_dgw_mib_sipProxyTableEntry_t **table=NULL; g_return_val_if_fail(interp, SCLI_ERROR);
if (argc != 2) return SCLI_SYNTAX; if (scli_interp_dry(interp)) return SCLI_OK; sss_dgw_mib_get_protocolSIPProxyTable(interp->peer, &table, 0); if (interp->peer->error_status) return SCLI_SNMP;
....
After this step I have no errors, but the table is NULL
Any suggestions?
This can happen if the table is empty so you have to check whether table is actually not NULL.
snort dump for request and agent responce is attached.
Since I have no tools to decipher snort dumps, I suggest you run things through tcpdump -s 0 -v -v -v (or tethereal with appropriate options) to see what has been going on. Or you privately send me the packets in question in pcap format.
/js
-- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1, 28759 Bremen, Germany Fax: +49 421 200 3103 http://www.jacobs-university.de/
Hello, Juergen.
I'll send you the tcpdump log tommorow, when I'll be able to retreive it. But I can say. The table has 2 rows... It was checked with other tools. Also the SNMP agent is under development (author is me too), so I'm not fully sure the bug is in scli. But as far as I can understand the snort log the data is transmitted from agent to scli. This bug may lay near gsnmp, not scli. Because the gdb shows that the gsnmp is unable to retreive the data, and it returns the NULL value. And I suggested to write to the scli list because I think - it all linked together.
Thanks, Ruslan.
On Tue, 24 Jun 2008 23:06:20 +0400, rbondar@rich-logic.com wrote:
On Tue, 24 Jun 2008 09:56:58 +0200, Juergen Schoenwaelder j.schoenwaelder@jacobs-university.de wrote:
On Tue, Jun 24, 2008 at 11:25:33AM +0400, rbondar@rich-logic.com wrote:
I have the following problem: When I'm trying to retreive the custom table from my SNMP agent the
NULL
is
returned.
The code:
static int show_dgw_proto_sip_table(scli_interp_t *interp, int argc, char **argv) { sss_dgw_mib_sipProxyTableEntry_t **table=NULL; g_return_val_if_fail(interp, SCLI_ERROR);
if (argc != 2) return SCLI_SYNTAX; if (scli_interp_dry(interp)) return SCLI_OK; sss_dgw_mib_get_protocolSIPProxyTable(interp->peer, &table, 0); if (interp->peer->error_status) return SCLI_SNMP;
....
After this step I have no errors, but the table is NULL
Any suggestions?
This can happen if the table is empty so you have to check whether table is actually not NULL.
snort dump for request and agent responce is attached.
Since I have no tools to decipher snort dumps, I suggest you run things through tcpdump -s 0 -v -v -v (or tethereal with appropriate options) to see what has been going on. Or you privately send me the packets in question in pcap format.
/js
-- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1, 28759 Bremen, Germany Fax: +49 421 200 3103 http://www.jacobs-university.de/
Hello, Juergen.
I'll send you the tcpdump log tommorow, when I'll be able to retreive it. But I can say. The table has 2 rows... It was checked with other tools. Also the SNMP agent is under development (author is me too), so I'm not fully sure the bug is in scli. But as far as I can understand the snort log the data is transmitted from agent to scli. This bug may lay near gsnmp, not scli. Because the gdb shows that the gsnmp is unable to retreive the data, and it returns the NULL value. And I suggested to write to the scli list because I think - it all linked together.
Thanks, Ruslan.
-- !! This message is brought to you via the `scli' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to scli-request@ibr.cs.tu-bs.de !! or look at https://mail.ibr.cs.tu-bs.de/mailman/listinfo/scli.
Here is requested tcpdump result. As you can see the only one row is requested, while the table contains 2 rows.
13:03:05.755075 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 420) localhost.35686 > localhost.snmp: [bad udp cksum 20e!] {
SNMPv2c { GetNextRequest(373) R=1804289386 E:20379.2.1.3.2.3.1.2 E:20379.2.1.3.2.3.1.3 E:20379.2.1.3.2.3.1.4 E:20379.2.1.3.2.3.1.5 E:20379.2.1.3.2.3.1.6 E:20379.2.1.3.2.3.1.7 E:20379.2.1.3.2.3.1.8 E:20379.2.1.3.2.3.1.9 E:20379.2.1.3.2.3.1.10 E:20379.2.1.3.2.3.1.11 E:20379.2.1.3.2.3.1.12 E:20379.2.1.3.2.3.1.13 E:20379.2.1.3.2.3.1.14 E:20379.2.1.3.2.3.1.15 E:20379.2.1.3.2.3.1.16 E:20379.2.1.3.2.3.1.17 E:20379.2.1.3.2.3.1.18 } } 13:03:05.757430 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 499) localhost.snmp > localhost.35686: [bad udp cksum 20d2!] { SNMPv2c { GetResponse(452) R=1804289386 E:20379.2.1.3.2.3.1.2=1 E:20379.2.1.3.2.3.1.3="proxy0" E:20379.2.1.3.2.3.1.4=192.168.1.1 E:20379.2.1.3.2.3.1.5=1 E:20379.2.1.3.2.3.1.6="guest" E:20379.2.1.3.2.3.1.7="guest" E:20379.2.1.3.2.3.1.8="guest" E:20379.2.1.3.2.3.1.9=1 E:20379.2.1.3.2.3.1.10="sipnet.ru" E:20379.2.1.3.2.3.1.11=212.53.40.40 E:20379.2.1.3.2.3.1.12="1212" E:20379.2.1.3.2.3.1.13=180 E:20379.2.1.3.2.3.1.14="localdomain" E:20379.2.1.3.2.3.1.15="remotedomain" E:20379.2.1.3.2.3.1.16="1212" E:20379.2.1.3.2.3.1.17=213.24.20.202 E:20379.2.1.3.2.3.1.18=1 } }
Best regards, Ruslan.
On Wed, Jun 25, 2008 at 01:08:00PM +0400, rbondar@rich-logic.com wrote:
Here is requested tcpdump result. As you can see the only one row is requested, while the table contains 2 rows.
13:03:05.755075 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 420) localhost.35686 > localhost.snmp: [bad udp cksum 20e!] {
SNMPv2c { GetNextRequest(373) R=1804289386 E:20379.2.1.3.2.3.1.2 E:20379.2.1.3.2.3.1.3 E:20379.2.1.3.2.3.1.4 E:20379.2.1.3.2.3.1.5 E:20379.2.1.3.2.3.1.6 E:20379.2.1.3.2.3.1.7 E:20379.2.1.3.2.3.1.8 E:20379.2.1.3.2.3.1.9 E:20379.2.1.3.2.3.1.10 E:20379.2.1.3.2.3.1.11 E:20379.2.1.3.2.3.1.12 E:20379.2.1.3.2.3.1.13 E:20379.2.1.3.2.3.1.14 E:20379.2.1.3.2.3.1.15 E:20379.2.1.3.2.3.1.16 E:20379.2.1.3.2.3.1.17 E:20379.2.1.3.2.3.1.18 } } 13:03:05.757430 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 499) localhost.snmp > localhost.35686: [bad udp cksum 20d2!] { SNMPv2c { GetResponse(452) R=1804289386 E:20379.2.1.3.2.3.1.2=1 E:20379.2.1.3.2.3.1.3="proxy0" E:20379.2.1.3.2.3.1.4=192.168.1.1 E:20379.2.1.3.2.3.1.5=1 E:20379.2.1.3.2.3.1.6="guest" E:20379.2.1.3.2.3.1.7="guest" E:20379.2.1.3.2.3.1.8="guest" E:20379.2.1.3.2.3.1.9=1 E:20379.2.1.3.2.3.1.10="sipnet.ru" E:20379.2.1.3.2.3.1.11=212.53.40.40 E:20379.2.1.3.2.3.1.12="1212" E:20379.2.1.3.2.3.1.13=180 E:20379.2.1.3.2.3.1.14="localdomain" E:20379.2.1.3.2.3.1.15="remotedomain" E:20379.2.1.3.2.3.1.16="1212" E:20379.2.1.3.2.3.1.17=213.24.20.202 E:20379.2.1.3.2.3.1.18=1 } }
The getnext processing of the agent seems to be broken. The request asks for the next of { 20379.2.1.3.2.3.1.2, ... } and you return the same OIDs, namely { 20379.2.1.3.2.3.1.2, ... } and that violates the specifications and scli likely drops the bogus response and indicates that the table is empty.
/js
On Wed, 25 Jun 2008 11:12:40 +0200, Juergen Schoenwaelder j.schoenwaelder@jacobs-university.de wrote:
On Wed, Jun 25, 2008 at 01:08:00PM +0400, rbondar@rich-logic.com wrote:
Here is requested tcpdump result. As you can see the only one row is requested, while the table contains 2 rows.
13:03:05.755075 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto
UDP
(17), length 420) localhost.35686 > localhost.snmp: [bad udp cksum 20e!]
{
SNMPv2c { GetNextRequest(373) R=1804289386 E:20379.2.1.3.2.3.1.2 E:20379.2.1.3.2.3.1.3 E:20379.2.1.3.2.3.1.4 E:20379.2.1.3.2.3.1.5 E:20379.2.1.3.2.3.1.6 E:20379.2.1.3.2.3.1.7 E:20379.2.1.3.2.3.1.8 E:20379.2.1.3.2.3.1.9 E:20379.2.1.3.2.3.1.10 E:20379.2.1.3.2.3.1.11 E:20379.2.1.3.2.3.1.12 E:20379.2.1.3.2.3.1.13 E:20379.2.1.3.2.3.1.14 E:20379.2.1.3.2.3.1.15 E:20379.2.1.3.2.3.1.16 E:20379.2.1.3.2.3.1.17 E:20379.2.1.3.2.3.1.18 } } 13:03:05.757430 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto
UDP
(17), length 499) localhost.snmp > localhost.35686: [bad udp cksum
20d2!]
{ SNMPv2c { GetResponse(452) R=1804289386 E:20379.2.1.3.2.3.1.2=1 E:20379.2.1.3.2.3.1.3="proxy0" E:20379.2.1.3.2.3.1.4=192.168.1.1 E:20379.2.1.3.2.3.1.5=1 E:20379.2.1.3.2.3.1.6="guest" E:20379.2.1.3.2.3.1.7="guest" E:20379.2.1.3.2.3.1.8="guest" E:20379.2.1.3.2.3.1.9=1 E:20379.2.1.3.2.3.1.10="sipnet.ru" E:20379.2.1.3.2.3.1.11=212.53.40.40 E:20379.2.1.3.2.3.1.12="1212" E:20379.2.1.3.2.3.1.13=180 E:20379.2.1.3.2.3.1.14="localdomain" E:20379.2.1.3.2.3.1.15="remotedomain" E:20379.2.1.3.2.3.1.16="1212" E:20379.2.1.3.2.3.1.17=213.24.20.202 E:20379.2.1.3.2.3.1.18=1 } }
The getnext processing of the agent seems to be broken. The request asks for the next of { 20379.2.1.3.2.3.1.2, ... } and you return the same OIDs, namely { 20379.2.1.3.2.3.1.2, ... } and that violates the specifications and scli likely drops the bogus response and indicates that the table is empty.
/js
-- Juergen Schoenwaelder Jacobs University Bremen gGmbH Phone: +49 421 200 3587 Campus Ring 1, 28759 Bremen, Germany Fax: +49 421 200 3103 http://www.jacobs-university.de/
Hello again. I've fixed my agent. But scli still thinks the table is empty. Tcp dump follows: 17:32:46.323955 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 420) localhost.52925 > localhost.snmp: [bad udp cksum aaaf!] { SNMPv2c { GetNextRequest(373) R=1804289413 E:20379.2.1.3.2.3.1.2 E:20379.2.1.3.2.3.1.3 E:20379.2.1.3.2.3.1.4 E:20379.2.1.3.2.3.1.5 E:20379.2.1.3.2.3.1.6 E:20379.2.1.3.2.3.1.7 E:20379.2.1.3.2.3.1.8 E:20379.2.1.3.2.3.1.9 E:20379.2.1.3.2.3.1.10 E:20379.2.1.3.2.3.1.11 E:20379.2.1.3.2.3.1.12 E:20379.2.1.3.2.3.1.13 E:20379.2.1.3.2.3.1.14 E:20379.2.1.3.2.3.1.15 E:20379.2.1.3.2.3.1.16 E:20379.2.1.3.2.3.1.17 E:20379.2.1.3.2.3.1.18 } } 17:32:46.325952 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 471) localhost.snmp > localhost.52925: [bad udp cksum 7863!] { SNMPv2c { GetResponse(424) R=1804289413 E:20379.2.1.3.2.3.2.2=1 E:20379.2.1.3.2.3.2.3="proxy1" E:20379.2.1.3.2.3.2.4=192.168.1.2 E:20379.2.1.3.2.3.2.5=1 E:20379.2.1.3.2.3.2.6="gg" E:20379.2.1.3.2.3.2.7="gg" E:20379.2.1.3.2.3.2.8="gg" E:20379.2.1.3.2.3.2.9=1 E:20379.2.1.3.2.3.2.10="ya.ru" E:20379.2.1.3.2.3.2.11=213.24.20.202 E:20379.2.1.3.2.3.2.12="1313" E:20379.2.1.3.2.3.2.13=360 E:20379.2.1.3.2.3.2.14="ldom" E:20379.2.1.3.2.3.2.15="rdom" E:20379.2.1.3.2.3.2.16="1313" E:20379.2.1.3.2.3.2.17=213.24.20.202 E:20379.2.1.3.2.3.2.18=1 } }
On Mon, Jun 30, 2008 at 05:35:41PM +0400, rbondar@rich-logic.com wrote:
I've fixed my agent. But scli still thinks the table is empty. Tcp dump follows: 17:32:46.323955 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 420) localhost.52925 > localhost.snmp: [bad udp cksum aaaf!] { SNMPv2c { GetNextRequest(373) R=1804289413 E:20379.2.1.3.2.3.1.2 E:20379.2.1.3.2.3.1.3 E:20379.2.1.3.2.3.1.4 E:20379.2.1.3.2.3.1.5 E:20379.2.1.3.2.3.1.6 E:20379.2.1.3.2.3.1.7 E:20379.2.1.3.2.3.1.8 E:20379.2.1.3.2.3.1.9 E:20379.2.1.3.2.3.1.10 E:20379.2.1.3.2.3.1.11 E:20379.2.1.3.2.3.1.12 E:20379.2.1.3.2.3.1.13 E:20379.2.1.3.2.3.1.14 E:20379.2.1.3.2.3.1.15 E:20379.2.1.3.2.3.1.16 E:20379.2.1.3.2.3.1.17 E:20379.2.1.3.2.3.1.18 } } 17:32:46.325952 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto UDP (17), length 471) localhost.snmp > localhost.52925: [bad udp cksum 7863!] { SNMPv2c { GetResponse(424) R=1804289413 E:20379.2.1.3.2.3.2.2=1 E:20379.2.1.3.2.3.2.3="proxy1" E:20379.2.1.3.2.3.2.4=192.168.1.2 E:20379.2.1.3.2.3.2.5=1 E:20379.2.1.3.2.3.2.6="gg" E:20379.2.1.3.2.3.2.7="gg" E:20379.2.1.3.2.3.2.8="gg" E:20379.2.1.3.2.3.2.9=1 E:20379.2.1.3.2.3.2.10="ya.ru" E:20379.2.1.3.2.3.2.11=213.24.20.202 E:20379.2.1.3.2.3.2.12="1313" E:20379.2.1.3.2.3.2.13=360 E:20379.2.1.3.2.3.2.14="ldom" E:20379.2.1.3.2.3.2.15="rdom" E:20379.2.1.3.2.3.2.16="1313" E:20379.2.1.3.2.3.2.17=213.24.20.202 E:20379.2.1.3.2.3.2.18=1 } }
Please double check your instance identifiers. Assuming E:20379.2.1.3.2.3.1 is the *Entry node, then the instance identifiers of the table columns should be of the form E:20379.2.1.3.2.3.1.c.x where c is the column number and x is the instance number (in case the table is indexed by a simple integer value).
/js
participants (2)
-
Juergen Schoenwaelder
-
rbondar@rich-logic.com