Re: listen for multicast traps
th exterit <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Ah, looks like it's just a case of doing afterwards:
struct ip_mreq multicast_request;
multicast_request.imr_multiaddr.s_addr = inet_addr("239.255.255.255");
multicast_request.imr_interface.s_addr = htonl(INADDR_ANY);
if(setsockopt(transport->sock, IPPROTO_IP, IP_ADD_MEMBERSHIP,
(void*)&multicast_request, sizeof(multicast_request))<0){
perror("setsockopt");
exit(1);
}
On Thu, Feb 17, 2011 at 2:22 PM, th exterit <[email protected]> wrote:
> Hi there. I'm writing a trap listener and using netsnmp, obviously.
>
> I want to be able to join a multicast group before I bind the socket in
> order to receive multicast traps.
>
> When I call 'netsnmp_transport_open_server("snmptrapd", "udp:162")' is
> there any option I set prior to this or can I modify the "udp:162" string to
> specify multicast and the multicast address?
>
> Thanks,
> Tom
>
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users