Does anyone know how to perform IP multicast control operations (add/drop
membership, ttl, interface, loopback) in kernel mode via TDI?? I have
looked at PCAUSA’s sample code and although they have a function
KS_TCPSetInformation it doesn’t seem to work:
KS_ADDRESS ksAddress; //this is actually a parameter and has been
initialized
NTSTATUS status;
struct ip_mreq mreq;
memset(&mreq, 0, sizeof mreq);
mreq.imr_multiaddr.s_addr = ipaddr; //ipaddr is a parameter & is
initialized
mreq.imr_interface.s_addr = iface->ip_address; //iface is a parameter &
is initialized
status = KS_TCPSetInformation(
ksAddress.m_pFileObject, // Address File Object
CL_NL_ENTITY, // Connectionless Network layer
Entity
INFO_CLASS_PROTOCOL, // Class
INFO_TYPE_ADDRESS_OBJECT, // Type
AO_OPTION_ADD_MCAST, // Id (from smpletcp.h) - value
of 1
&mreq, // Value
sizeof(mreq) // ValueLength
);
This call returns STATUS_NOT_SUPPORTED.
Can anyone shed any light on this for me? That function calls
IoBuildDeviceIoControlRequest with IOCTL_TCP_SET_INFORMATION_EX and then
IoCallDriver.
I realise that I am after UDP whereas the IOCTL is for TCP, but being
unable to find any IOCTL’s for UDP I am hoping that both are part of the
same protocol suite and share the IOCTL. In any case, attempting to do the
same thing with CO_NL_ENTITY instead gets the same result.
Any help would be very appreciated.
Regards,
Joe.