This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IP_PKTINFO in 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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]