ACE
6.2.2
|
This class is useful to perform ICMP echo checks (pinging) on the party of your interest. It may be used as well to check LAN-adapters against 3rd parties. More...
#include <Ping_Socket.h>
Public Types | |
enum | { PING_BUFFER_SIZE = (1024 * 2) } |
Public Member Functions | |
ACE_Ping_Socket (void) | |
Default constructor. More... | |
ACE_Ping_Socket (ACE_Addr const &local, int protocol=IPPROTO_ICMP, int reuse_addr=0) | |
~ACE_Ping_Socket (void) | |
Destructor. More... | |
int | open (ACE_Addr const &local=ACE_Addr::sap_any, int protocol=IPPROTO_ICMP, int reuse_addr=0) |
Wrapper around the BSD-style socket system call (no QoS). More... | |
int | send_echo_check (ACE_INET_Addr &remote_addr, bool to_connect=false) |
to_connect = true - makes connect to remote address More... | |
int | process_incoming_dgram (char *ptr, ssize_t len) |
int | make_echo_check (ACE_INET_Addr &remote_addr, bool to_connect=false, ACE_Time_Value const *timeout=&time_default_) |
to_connect = true - makes connect to remote address More... | |
char * | icmp_recv_buff (void) |
void | dump (void) const |
Dump the state of an object. More... | |
![]() | |
int | open (ACE_Addr const &local=ACE_Addr::sap_any, int protocol=IPPROTO_ICMP, int reuse_addr=0) |
Wrapper around the BSD-style socket system call (no QoS). More... | |
void | dump (void) const |
Dump the state of object. More... | |
ssize_t | send (void const *buf, size_t n, ACE_Addr const &addr, int flags=0) const |
ssize_t | recv (void *buf, size_t n, ACE_Addr &addr, int flags=0) const |
ssize_t | recv (void *buf, size_t n, int flags, ACE_Time_Value const *timeout) const |
TODO: comment. More... | |
![]() | |
int | set_option (int level, int option, void *optval, int optlen) const |
Wrapper around the setsockopt system call. More... | |
int | get_option (int level, int option, void *optval, int *optlen) const |
Wrapper around the getsockopt system call. More... | |
int | close (void) |
int | get_local_addr (ACE_Addr &) const |
int | get_remote_addr (ACE_Addr &) const |
void | dump (void) const |
Dump the state of an object. More... | |
int | open (int type, int protocol_family, int protocol, int reuse_addr) |
Wrapper around the BSD-style socket system call (no QoS). More... | |
int | open (int type, int protocol_family, int protocol, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags, int reuse_addr) |
Wrapper around the QoS-enabled WSASocket function. More... | |
![]() | |
int | control (int cmd, void *) const |
Interface for <ioctl>. More... | |
int | enable (int value) const |
int | disable (int value) const |
ACE_HANDLE | get_handle (void) const |
Get the underlying handle. More... | |
void | set_handle (ACE_HANDLE handle) |
Set the underlying handle. More... | |
void | dump (void) const |
Dump the state of an object. More... | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
![]() | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
![]() | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
![]() | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. More... | |
Static Public Attributes | |
static ACE_Time_Value const | time_default_ |
Private Types | |
typedef ACE_ICMP_Socket | inherited |
Private Member Functions | |
int | receive_echo_reply (ACE_Time_Value const *timeout) |
int | get_remote_addr (ACE_INET_Addr &addr) const |
Do not allow this function to percolate up to this interface. More... | |
Private Attributes | |
char | icmp_send_buff_ [PING_BUFFER_SIZE] |
char | icmp_recv_buff_ [PING_BUFFER_SIZE] |
ACE_UINT16 | sequence_number_ |
bool | connected_socket_ |
Additional Inherited Members | |
![]() | |
ACE_ICMP_Socket (void) | |
Default constructor. More... | |
ACE_ICMP_Socket (ACE_Addr const &local, int protocol=IPPROTO_ICMP, int reuse_addr=0) | |
Constructor that takes a local listening address. More... | |
int | shared_open (ACE_Addr const &local) |
Wrapper around BSD-style bind system call. More... | |
unsigned short | calculate_checksum (unsigned short *paddress, int len) |
Calculates check-sum. More... | |
This class is useful to perform ICMP echo checks (pinging) on the party of your interest. It may be used as well to check LAN-adapters against 3rd parties.
|
private |
ACE_Ping_Socket::ACE_Ping_Socket | ( | void | ) |
Default constructor.
ACE_Ping_Socket::ACE_Ping_Socket | ( | ACE_Addr const & | local, |
int | protocol = IPPROTO_ICMP , |
||
int | reuse_addr = 0 |
||
) |
ACE_Ping_Socket::~ACE_Ping_Socket | ( | void | ) |
Destructor.
void ACE_Ping_Socket::dump | ( | void | ) | const |
Dump the state of an object.
|
private |
Do not allow this function to percolate up to this interface.
|
inline |
int ACE_Ping_Socket::make_echo_check | ( | ACE_INET_Addr & | remote_addr, |
bool | to_connect = false , |
||
ACE_Time_Value const * | timeout = &time_default_ |
||
) |
to_connect = true - makes connect to remote address
int ACE_Ping_Socket::open | ( | ACE_Addr const & | local = ACE_Addr::sap_any , |
int | protocol = IPPROTO_ICMP , |
||
int | reuse_addr = 0 |
||
) |
Wrapper around the BSD-style socket
system call (no QoS).
int ACE_Ping_Socket::process_incoming_dgram | ( | char * | ptr, |
ssize_t | len | ||
) |
To receive ICMP_ECHOREPLY
. To be called after successfully sending ICMP_ECHO
.
|
private |
int ACE_Ping_Socket::send_echo_check | ( | ACE_INET_Addr & | remote_addr, |
bool | to_connect = false |
||
) |
to_connect = true - makes connect to remote address
ACE_Ping_Socket::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
|
private |
|
private |
|
private |
|
private |
|
static |