forked from zeromq/libzmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtipc_address.hpp
49 lines (36 loc) · 925 Bytes
/
tipc_address.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_TIPC_ADDRESS_HPP_INCLUDED__
#define __ZMQ_TIPC_ADDRESS_HPP_INCLUDED__
#include <string>
#include "platform.hpp"
#if defined ZMQ_HAVE_TIPC
#include <sys/socket.h>
#if defined ZMQ_HAVE_VXWORKS
#include <tipc/tipc.h>
#else
#include <linux/tipc.h>
#endif
namespace zmq
{
class tipc_address_t
{
public:
tipc_address_t ();
tipc_address_t (const sockaddr *sa, socklen_t sa_len);
// This function sets up the address "{type, lower, upper}" for TIPC transport
int resolve (const char *name);
// The opposite to resolve()
int to_string (std::string &addr_) const;
// Handling different TIPC address types
bool is_service () const;
bool is_random () const;
void set_random ();
const sockaddr *addr () const;
socklen_t addrlen () const;
private:
bool _random;
struct sockaddr_tipc address;
};
}
#endif
#endif