Defines | Functions

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.

Defines

#define IMR_MULTIADDR   imr_multiaddr

Functions

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

Define Documentation

#define IMR_MULTIADDR   imr_multiaddr

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.

               : SOCK_Dgram_Mcast.cpp 85421 2009-05-22 11:12:30Z johnnyw $")

#include "ace/Log_Msg.h"

// This is a workaround for platforms with non-standard
// definitions of the ip_mreq structure
#if ! defined (IMR_MULTIADDR)
#define IMR_MULTIADDR imr_multiaddr
#endif /* ! defined (IMR_MULTIADDR) */

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

// Helper (inline) functions.
class ACE_SDM_helpers
{
public:
  // Convert ACE_INET_Addr to string, using local formatting rules.

  static void addr_to_string (const ACE_INET_Addr &ip_addr,
                              ACE_TCHAR *ret_string,  // results here.
                              size_t len,
                              int clip_portnum)       // clip port# info?
    {
      if (ip_addr.addr_to_string (ret_string, len, 1) == -1)
        ACE_OS::strcpy (ret_string, ACE_TEXT ("<?>"));
      else
        {
          ACE_TCHAR *pc = ACE_OS::strrchr (ret_string, ACE_TEXT (':'));
          if (clip_portnum && pc)
            *pc = ACE_TEXT ('\0'); // clip port# info.
        }
    }
    // op== for ip_mreq structs.
    static int is_equal (const ip_mreq &m1, const ip_mreq &m2)
      {
        return m1.IMR_MULTIADDR.s_addr == m2.IMR_MULTIADDR.s_addr
          && m1.imr_interface.s_addr == m2.imr_interface.s_addr;
      }
};

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines