forked from zeromq/libzmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvmci_address.hpp
47 lines (35 loc) · 921 Bytes
/
vmci_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
/* SPDX-License-Identifier: MPL-2.0 */
#ifndef __ZMQ_VMCI_ADDRESS_HPP_INCLUDED__
#define __ZMQ_VMCI_ADDRESS_HPP_INCLUDED__
#include <string>
#include "platform.hpp"
#include "ctx.hpp"
#if defined(ZMQ_HAVE_VMCI)
#include <vmci_sockets.h>
namespace zmq
{
class vmci_address_t
{
public:
vmci_address_t ();
vmci_address_t (ctx_t *parent_);
vmci_address_t (const sockaddr *sa, socklen_t sa_len, ctx_t *parent_);
// This function sets up the address for VMCI transport.
int resolve (const char *path_);
// The opposite to resolve()
int to_string (std::string &addr_) const;
#if defined ZMQ_HAVE_WINDOWS
unsigned short family () const;
#else
sa_family_t family () const;
#endif
const sockaddr *addr () const;
socklen_t addrlen () const;
private:
struct sockaddr_vm address;
ctx_t *parent;
ZMQ_NON_COPYABLE_NOR_MOVABLE (vmci_address_t)
};
}
#endif
#endif