Qpid Proton C API  0.18.1
netaddr.h
Go to the documentation of this file.
1 #ifndef PROTON_NETADDR_H
2 #define PROTON_NETADDR_H
3 
4 /*
5  * Licensed to the Apache Software Foundation (ASF) under one
6  * or more contributor license agreements. See the NOTICE file
7  * distributed with this work for additional information
8  * regarding copyright ownership. The ASF licenses this file
9  * to you under the Apache License, Version 2.0 (the
10  * "License"); you may not use this file except in compliance
11  * with the License. You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing,
16  * software distributed under the License is distributed on an
17  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18  * KIND, either express or implied. See the License for the
19  * specific language governing permissions and limitations
20  * under the License.
21  */
22 
23 #include <proton/import_export.h>
24 #include <proton/types.h>
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
42 typedef struct pn_netaddr_t pn_netaddr_t;
43 
50 PNP_EXTERN int pn_netaddr_str(const pn_netaddr_t *addr, char *buf, size_t size);
51 
55 PNP_EXTERN const pn_netaddr_t *pn_netaddr_local(pn_transport_t *t);
56 
60 PNP_EXTERN const pn_netaddr_t *pn_netaddr_remote(pn_transport_t *t);
61 
62 struct sockaddr;
63 
68 PNP_EXTERN const struct sockaddr *pn_netaddr_sockaddr(const pn_netaddr_t *na);
69 
74 PNP_EXTERN size_t pn_netaddr_socklen(const pn_netaddr_t *na);
75 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* PROTON_NETADDR_H */
PNP_EXTERN int pn_netaddr_str(const pn_netaddr_t *addr, char *buf, size_t size)
Format a network address as a human-readable string in buf.
AMQP and API data types.
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition: types.h:431
PNP_EXTERN const pn_netaddr_t * pn_netaddr_local(pn_transport_t *t)
Get the local address of a transport.
PNP_EXTERN const pn_netaddr_t * pn_netaddr_remote(pn_transport_t *t)
Get the remote address of a transport.
struct pn_netaddr_t pn_netaddr_t
Unsettled API - The network address of a proactor transport.
Definition: netaddr.h:42
PNP_EXTERN const struct sockaddr * pn_netaddr_sockaddr(const pn_netaddr_t *na)
On POSIX or Windows, get the underlying struct sockaddr.
PNP_EXTERN size_t pn_netaddr_socklen(const pn_netaddr_t *na)
On POSIX or Windows, get the size of the underlying struct sockaddr.