Hi All,
             I am trying to bind the port "162" receive the inform response form server(PACT Server).
but it is failing in snmpUDPDomain.c at the below line :
client_socket = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
                                              NETSNMP_DS_LIB_CLIENT_ADDR);

Basically I am getting the NULL as "client_socket".

Code for reference:
====================================================================================================
client_socket = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
                                              NETSNMP_DS_LIB_CLIENT_ADDR);
 if (client_socket) {
            struct sockaddr_in client_addr;
            netsnmp_sockaddr_in2(&client_addr, client_socket, NULL);
            addr_pair.local_addr = client_addr.sin_addr;
            /* client_addr.sin_port = 0;*/
                        client_addr.sin_port = htons(SNMP_TRAP_PORT);   /* This is modified to bind the trap port*/
            rc = bind(t->sock, (struct sockaddr *)&client_addr,
                  sizeof(struct sockaddr));
            if ( rc != 0 ) {
                DEBUGMSGTL(("netsnmp_udp", "failed to bind for clientaddr: %d %s\n",
                            errno, strerror(errno)));
                netsnmp_udp_close(t);
                netsnmp_transport_free(t);
                return NULL;
            }
        }

======================================================================
Could somebody help me to understand the concept of "function family" "netsnmp_ds_get_string".
When does we need to set the required combination as above ?????
Or we need to set some other combination to bind the "SNMP_TRAP_PORT" ???

Thanks and Regards,
Sanjay


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to