Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / ICMP_Socket.h
blobc4495fa226d639fae7cff640d67de34c059c4862
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file ICMP_Socket.h
7 * @author Robert S. Iakobashvili <coroberti@gmail.com> <coroberti@walla.co.il>
8 * @author Gonzalo A. Diethelm <gonzalo.diethelm@aditiva.com>
9 */
10 //=============================================================================
12 #ifndef ACE_ICMP_SOCKET_H
13 #define ACE_ICMP_SOCKET_H
15 #include /**/ "ace/pre.h"
17 #include /**/ "ace/ACE_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #if defined (ACE_HAS_ICMP_SUPPORT) && (ACE_HAS_ICMP_SUPPORT == 1)
25 #include "ace/SOCK.h"
26 #include "ace/Time_Value.h"
27 #include "ace/os_include/netinet/os_in.h"
29 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
31 /**
32 * @class ACE_ICMP_Socket
34 * @brief An abstract class that forms the basis for usage of the ICMP
35 * protocol (that is, support for things such as ping).
37 class ACE_Export ACE_ICMP_Socket : public ACE_SOCK
39 public:
40 /**
41 * @name Data transfer routines.
43 * Data transfer routines.
45 //@{
46 /// Send an @a n byte @a buf to the datagram socket (uses
47 /// @c sendto(3) ).
48 ssize_t send (void const * buf,
49 size_t n,
50 ACE_Addr const & addr,
51 int flags = 0) const;
53 /// Receive an @a n byte @a buf from the datagram socket
54 /// (uses @c recvfrom(3) ).
55 ssize_t recv (void * buf,
56 size_t n,
57 ACE_Addr & addr,
58 int flags = 0) const;
60 /// TODO: comment
61 ssize_t recv (void * buf,
62 size_t n,
63 int flags,
64 ACE_Time_Value const * timeout) const;
66 //@}
68 /// Wrapper around the BSD-style @c socket system call (no QoS).
69 int open (ACE_Addr const & local = ACE_Addr::sap_any,
70 int protocol = IPPROTO_ICMP,
71 int reuse_addr = 0);
73 /// Dump the state of object.
74 void dump () const;
76 /// Declare the dynamic allocation hooks.
77 ACE_ALLOC_HOOK_DECLARE;
79 protected:
80 // Protected constructors, so the class can only be derived from.
81 /// Default constructor.
82 ACE_ICMP_Socket ();
84 /// Constructor that takes a local listening address.
85 ACE_ICMP_Socket (ACE_Addr const & local,
86 int protocol = IPPROTO_ICMP,
87 int reuse_addr = 0);
89 /// Wrapper around BSD-style @c bind system call.
90 int shared_open (ACE_Addr const & local);
92 /// Calculates check-sum.
93 unsigned short calculate_checksum (unsigned short* paddress,
94 int len);
97 ACE_END_VERSIONED_NAMESPACE_DECL
99 #endif /* ACE_HAS_ICMP_SUPPORT == 1 */
101 #include /**/ "ace/post.h"
103 #endif /* ACE_ICMP_SOCKET_H */