IP Multicast control using TDI

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.

Try CL_TL_ENTITY instead of CL_NL_ENTITY.

I can’t say that that is specifically your issue here but my notes show that
AO_OPTION_{ADD|DEL}_MCAST are processed by the Transport Layer Entity (UDP),
not the Network Layer Entity (IP).

Go find the NT4 DDK and look at the sample WSHSMPLE (which is where
SMPLTCP.H comes from). It might help you to have that handy.

Good Luck,
Dave Cattley
Consulting Engineer
Systems Software Development

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Thomas-Kerr
Sent: Wednesday, May 28, 2008 9:37 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] IP Multicast control using TDI

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.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer