artdaq  v3_09_01
TCPConnect.hh
Go to the documentation of this file.
1 #ifndef TCPConnect_hh
2 #define TCPConnect_hh
3 #include <netinet/in.h>
4 
5 // This file (TCPConnect.hh) was created by Ron Rechenmacher <ron@fnal.gov> on
6 // Sep 15, 2016. "TERMS AND CONDITIONS" governing this file are in the README
7 // or COPYING file. If you do not have such a file, one can be obtained by
8 // contacting Ron or Fermi Lab in Batavia IL, 60510, phone: 630-840-3000.
9 // $RCSfile: .emacs.gnu,v $
10 // rev="$Revision: 1.30 $$Date: 2016/03/01 14:27:27 $";
11 
23 int ResolveHost(char const* host_in, in_addr& addr);
24 
31 int GetIPOfInterface(const std::string& interface_name, in_addr& addr);
44 int AutodetectPrivateInterface(in_addr& addr);
51 int GetInterfaceForNetwork(char const* host_in, in_addr& addr);
59 int ResolveHost(char const* host_in, int dflt_port, sockaddr_in& sin);
68 int TCPConnect(char const* host_in, int dflt_port, int64_t flags = 0, int sndbufsiz = 0);
69 
70 #endif // TCPConnect_hh
int ResolveHost(char const *host_in, in_addr &addr)
Convert a string hostname to a in_addr suitable for socket communication.
Definition: TCPConnect.cc:33
int GetIPOfInterface(const std::string &interface_name, in_addr &addr)
Get the IP address associated with a given interface name.
Definition: TCPConnect.cc:77
int TCPConnect(char const *host_in, int dflt_port, int64_t flags=0, int sndbufsiz=0)
Connect to a host on a given port.
Definition: TCPConnect.cc:376
int GetInterfaceForNetwork(char const *host_in, in_addr &addr)
Convert an IP address to the network address of the interface sharing the subnet mask.
Definition: TCPConnect.cc:223
int AutodetectPrivateInterface(in_addr &addr)
Pick a private IP address on this host.
Definition: TCPConnect.cc:131