Operating System - OpenVMS
1753505 Members
4744 Online
108794 Solutions
New Discussion юеВ

Reading Multicast UDP Packets Using C and Systems Services

 
john weed
Occasional Advisor

Reading Multicast UDP Packets Using C and Systems Services

Does anyone have a fast and dirty example of the code sequence to establish the socket and read multicast UDP packets? I can't seem to get my code to work with the IO$SETMODE calls, itemlists, etc. I'm trying to do the REUSEADDR and TCPIP$C_IP_ADD_MEMBERSHIP options in one call... argh. Please help. The documentation says it can be done, but none of it has an example using system services. (help)
4 REPLIES 4
Robert Gezelter
Honored Contributor

Re: Reading Multicast UDP Packets Using C and Systems Services

John,

Some details would be of great help here.

Which OS version, which IP stack (and version), and a small sample reproducer of the problem.

Otherwise, we are forced to guess which of the (infinitely) possible ways in which the code may not be correct. Create a small (approximately 50-75 line) example of how the code in question is attempting to read multicast UDP packets and what error codes are returned on the QIO (both as the function return in R0; and in the IOSB for the request if the function return is SS$_NORMAL, e.g. 1).

- Bob Gezelter, http://www.rlgsc.com
john weed
Occasional Advisor

Re: Reading Multicast UDP Packets Using C and Systems Services

First, thank you very much for the reply.
I am heading back to Iraq, and unfortunately do not have access to the code snippet that was causing me grey hair.

However, to isolate the problem, I reduced the issue to trying to modify the UDP Server programming example E-10, in the "Compaq TCP/IP Services for OpenVMS Sockets API and System Services Programming" to do what I needed, which is to read multicast UDP.

I am currently on OpenVMS 7.3-2, using either V5.3 or 5.4 (don't remember right now) and IPv4.

In that programing example, I added a second itemlist to this section in the example:

reuseaddr_itemlst.length = sizeof( one );
reuseaddr_itemlst.type = TCPIP$C_REUSEADDR;
reuseaddr_itemlst.address = &one;

/*
* init sockopt's item-list descriptor
*/

sockopt_itemlst.length = sizeof( reuseaddr_itemlst );
sockopt_itemlst.type = TCPIP$C_SOCKOPT;
sockopt_itemlst.address = &reuseaddr_itemlst;

That item list had the TCPIP$C_IP_ADD_MEMBERSHIP, multicast address group and TCPIP$C_INADDR_ANY.

Thre were no errors, just that it never read any of the multicast traffic, that we verified was there.

If someone could modify that example in the manner necessary with sample address it wold help. I'd then relay back home where to look and what to recompile.

Again, sorry for the lack of evidence.
john weed
Occasional Advisor

Re: Reading Multicast UDP Packets Using C and Systems Services


You know, as it occurs to me, even that example (E-10) in the manual is overkill for what I'm trying to understand. Just a simple (like me) client-style socket to read multicast UDP, OpenVMS 7.3-2, IPv4 and TCPIP V5.3/4.

Section 2.10 of the "HP TCP/IP Services for
OpenVMS" document is what I'm trying to get working with system services.

Wish I could start this thread all over.
john weed
Occasional Advisor

Re: Reading Multicast UDP Packets Using C and Systems Services

I'm not able to provide enough information to make the conversation/thread useful.