Greetings.
I am a student who is studying SNMP on my own.
I would like to know about your ".tar" source codes I
downloaded.
I only wanted to test the "snmpd" agent with the
"snmpget" application.
I avoided to use the SESSION structure for a simpler
code form such as:
sockfd = socket (AF_INET, SOCK_DGRAM, 0);
memset (&servaddr, 0, sizeof(servaddr));
servaddr.sin_family = AF_INET;
servaddr.sin_port = htons(SNMP_PORT);
inet_aton(argv[4], &servaddr.sin_addr);
Then I used the SENDTO function and the RECVFROM, as
shown below:
sendto (sockfd, pdu, 1, 0, (SA*) &servaddr,
sizeof(servaddr));
n = recvfrom (sockfd, response, sizeof(response), 0,
NULL, NULL);
Even if I used the PDU and RESPONSE structures I
didn't receive anything from the agent.
Why?
Am I forced to use the SESSION structure? Isn't it
similar to the socket I wrote and does not the
"snmp_synch_response" function do the same thing as
"sento/recvfrom" does?
Thank you in advance.
Matthew (ryanalliance@xxxxxxxx)
______________________________________________________________________
Yahoo! Mail: 6MB di spazio gratuito, 30MB per i tuoi allegati, l'antivirus, il
filtro Anti-spam
http://it.yahoo.com/mail_it/foot/?http://it.mail.yahoo.com/
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
|