SOCK_Dgram_Mcast.cpp File Reference

#include "ace/SOCK_Dgram_Mcast.h"
#include "ace/OS_Memory.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_errno.h"
#include "ace/os_include/net/os_if.h"
#include "ace/os_include/arpa/os_inet.h"
#include "ace/Log_Msg.h"
Include dependency graph for SOCK_Dgram_Mcast.cpp:

Go to the source code of this file.

Functions

 ACE_RCSID (ace, SOCK_Dgram_Mcast,"$Id: SOCK_Dgram_Mcast.cpp 85421 2009-05-22 11:12:30Z johnnyw $") 1class ACE_SDM_helpers

Function Documentation

ACE_RCSID ( ace  ,
SOCK_Dgram_Mcast  ,
"$Id: SOCK_Dgram_Mcast.cpp 85421 2009-05-22 11:12:30Z johnnyw $"   
)

Definition at line 23 of file SOCK_Dgram_Mcast.cpp.

00025                : SOCK_Dgram_Mcast.cpp 85421 2009-05-22 11:12:30Z johnnyw $")
00026 
00027 #include "ace/Log_Msg.h"
00028 
00029 // This is a workaround for platforms with non-standard
00030 // definitions of the ip_mreq structure
00031 #if ! defined (IMR_MULTIADDR)
00032 #define IMR_MULTIADDR imr_multiaddr
00033 #endif /* ! defined (IMR_MULTIADDR) */
00034 
00035 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00036 
00037 // Helper (inline) functions.
00038 class ACE_SDM_helpers
00039 {
00040 public:
00041   // Convert ACE_INET_Addr to string, using local formatting rules.
00042 
00043   static void addr_to_string (const ACE_INET_Addr &ip_addr,
00044                               ACE_TCHAR *ret_string,  // results here.
00045                               size_t len,
00046                               int clip_portnum)       // clip port# info?
00047     {
00048       if (ip_addr.addr_to_string (ret_string, len, 1) == -1)
00049         ACE_OS::strcpy (ret_string, ACE_TEXT ("<?>"));
00050       else
00051         {
00052           ACE_TCHAR *pc = ACE_OS::strrchr (ret_string, ACE_TEXT (':'));
00053           if (clip_portnum && pc)
00054             *pc = ACE_TEXT ('\0'); // clip port# info.
00055         }
00056     }
00057     // op== for ip_mreq structs.
00058     static int is_equal (const ip_mreq &m1, const ip_mreq &m2)
00059       {
00060         return m1.IMR_MULTIADDR.s_addr == m2.IMR_MULTIADDR.s_addr
00061           && m1.imr_interface.s_addr == m2.imr_interface.s_addr;
00062       }
00063 };

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Fri Nov 6 23:18:29 2009 for ACE by  doxygen 1.6.1