public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* IP_PKTINFO in cygwin
@ 2009-01-13  4:28 Bill Florac
  2009-01-13 12:23 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Florac @ 2009-01-13  4:28 UTC (permalink / raw)
  To: cygwin

Does cygwin support the setsockopt() - IP_PKTINFO to retreive the destination 
address of a incomming UDP packet received via recvmsg()?  I have made 
numberous attempts but CMSG_FIRSTHDR() always returns NULL. The same code 
works find under linux.  I'm guessing that cygwin is using winsock underneath 
and I beleive this would only be available under winsock 2.2.  Is there a 
means to build cygwin to complile with this version of winsock?

Bill


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: IP_PKTINFO in cygwin
  2009-01-13  4:28 IP_PKTINFO in cygwin Bill Florac
@ 2009-01-13 12:23 ` Corinna Vinschen
  2009-01-13 19:28   ` Bill Florac
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2009-01-13 12:23 UTC (permalink / raw)
  To: cygwin

On Jan 13 02:26, Bill Florac wrote:
> Does cygwin support the setsockopt() - IP_PKTINFO to retreive the destination 
> address of a incomming UDP packet received via recvmsg()?  I have made 
> numberous attempts but CMSG_FIRSTHDR() always returns NULL. The same code 
> works find under linux.  I'm guessing that cygwin is using winsock underneath 

That's right.

> and I beleive this would only be available under winsock 2.2.  Is there a 
> means to build cygwin to complile with this version of winsock?

No, that's not possible, since it doesn't work that way.   Cygwin is
using OS functions to emulate POSIX functionality, so calling Cygwin's
recvmsg is not just a direct call to the equivalent Winsock function
WSARecvMsg.  WSARecvMsg is only available starting with Windows XP.
Earlier systems only have WSARecvFrom, so that's what Cygwin is using
under the hood to support older OS versions as well.  The
sendmsg/recvmsg control data functionality wasn't that important so far.

In theory, that can be changed for Cygwin 1.7 so that WSARecvMsg is used
on XP and later, but that requires more work than just replacing
WSARecvFrom with WSARecvMsg.  I'm not even sure our header files are
sufficient for that.  I'm rather reluctant to change that right now,
but that's certainly something to consider for a later release.

Final note:  http://cygwin.com/acronyms/#PTC


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: IP_PKTINFO in cygwin
  2009-01-13 12:23 ` Corinna Vinschen
@ 2009-01-13 19:28   ` Bill Florac
  0 siblings, 0 replies; 3+ messages in thread
From: Bill Florac @ 2009-01-13 19:28 UTC (permalink / raw)
  To: cygwin

Corinna Vinschen <corinna-cygwin <at> cygwin.com> writes:

> 
> On Jan 13 02:26, Bill Florac wrote:
> > Does cygwin support the setsockopt() - IP_PKTINFO to retreive the 
destination 
> > address of a incomming UDP packet received via recvmsg()?  I have made 
> > numberous attempts but CMSG_FIRSTHDR() always returns NULL. The same code 
> > works find under linux.  I'm guessing that cygwin is using winsock 
underneath 
> 
> That's right.
> 
> > and I beleive this would only be available under winsock 2.2.  Is there a 
> > means to build cygwin to complile with this version of winsock?
> 
> No, that's not possible, since it doesn't work that way.   Cygwin is
> using OS functions to emulate POSIX functionality, so calling Cygwin's
> recvmsg is not just a direct call to the equivalent Winsock function
> WSARecvMsg.  WSARecvMsg is only available starting with Windows XP.
> Earlier systems only have WSARecvFrom, so that's what Cygwin is using
> under the hood to support older OS versions as well.  The
> sendmsg/recvmsg control data functionality wasn't that important so far.
> 
> In theory, that can be changed for Cygwin 1.7 so that WSARecvMsg is used
> on XP and later, but that requires more work than just replacing
> WSARecvFrom with WSARecvMsg.  I'm not even sure our header files are
> sufficient for that.  I'm rather reluctant to change that right now,
> but that's certainly something to consider for a later release.
> 
> Final note:  http://cygwin.com/acronyms/#PTC
> 
> Corinna
> 

So recvmsg() maps to WSARecvFrom() :( I suppose it should also return fail if 
the setsockopt() is called with an option that requires recvmsg() to get? And, 
perhaps recmsg() should also not be supported forcing users to use recvfrom()?

Well, what I need is a means to get the UDP (multicast) destination address. 
While it would be possible to make some other new function for this it seem to 
make the most since to use what currently exists (yet a bit obscure). It would 
also make the code more portable.

Bill





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-13 19:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-13  4:28 IP_PKTINFO in cygwin Bill Florac
2009-01-13 12:23 ` Corinna Vinschen
2009-01-13 19:28   ` Bill Florac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).