Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vsnet_socketflags.cpp
Go to the documentation of this file.
1 #include <config.h>
2 
3 #include "vsnet_headers.h"
4 #if !defined (_WIN32) || defined (__CYGWIN__)
5 #include <sys/ioctl.h>
6 #endif
7 
8 #include "vsnet_socketflags.h"
9 
10 using std::ostream;
11 using std::hex;
12 
13 /***********************************************************************
14 * PCKTFLAGS
15 ***********************************************************************/
16 
17 ostream& operator<<( ostream &ostr, PCKTFLAGS f )
18 {
19  int flags = f;
20  if (flags == 0) ostr<<"NONE";
21  return ostr;
22  if (flags&SENDANDFORGET) ostr<<"SENDANDFORGET ";
23  if (flags&SENT) ostr<<"SENT ";
24  if (flags&RESENT) ostr<<"RESENT ";
25  if (flags&ACKED) ostr<<"ACKED ";
26  if (flags&SENDRELIABLE) ostr<<"SENDRELIABLE ";
27  if (flags&LOPRI) ostr<<"LOPRI ";
28  if (flags&HIPRI) ostr<<"HIPRI ";
29  if (flags&COMPRESSED) ostr<<"COMPRESSED ";
30  flags &= ~0x101f;
31  if (flags != 0) ostr<<hex<<flags;
32  return ostr;
33 }
34