netaddr.h
Go to the documentation of this file.
#ifndef PROTON_NETADDR_H
#define PROTON_NETADDR_H
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
#include <proton/import_export.h>
#include <proton/types.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct pn_netaddr_t pn_netaddr_t;
PNP_EXTERN int pn_netaddr_str(const pn_netaddr_t *addr, char *buf, size_t size);
PNP_EXTERN const pn_netaddr_t *pn_transport_local_addr(pn_transport_t *t);
PNP_EXTERN const pn_netaddr_t *pn_transport_remote_addr(pn_transport_t *t);
PNP_EXTERN const pn_netaddr_t *pn_listener_addr(pn_listener_t *l);
PNP_EXTERN const pn_netaddr_t *pn_netaddr_next(const pn_netaddr_t *na);
struct sockaddr;
PNP_EXTERN const struct sockaddr *pn_netaddr_sockaddr(const pn_netaddr_t *na);
PNP_EXTERN size_t pn_netaddr_socklen(const pn_netaddr_t *na);
PNP_EXTERN int pn_netaddr_host_port(const pn_netaddr_t* na, char *host, size_t hlen, char *port, size_t plen);
/* These function names will be deprecated in a future release of proton */
/* PN_DEPRECATED("use pn_transport_local_addr") */
PNP_EXTERN const pn_netaddr_t *pn_netaddr_local(pn_transport_t *t);
/* PN_DEPRECATED("use pn_transport_remote_addr()") */
PNP_EXTERN const pn_netaddr_t *pn_netaddr_remote(pn_transport_t *t);
/* PN_DEPRECATED("use pn_listener_addr()") */
PNP_EXTERN const pn_netaddr_t *pn_netaddr_listening(pn_listener_t *l);
#ifdef __cplusplus
}
#endif
#endif /* PROTON_NETADDR_H */
pn_listener_t
struct pn_listener_t pn_listener_t
A listener for incoming connections.
Definition: types.h:420
pn_netaddr_str
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.
types.h
pn_transport_local_addr
const PNP_EXTERN pn_netaddr_t * pn_transport_local_addr(pn_transport_t *t)
Get the local address of a transport.
pn_netaddr_host_port
PNP_EXTERN int pn_netaddr_host_port(const pn_netaddr_t *na, char *host, size_t hlen, char *port, size_t plen)
Get the host and port name from na as separate strings.
pn_transport_remote_addr
const PNP_EXTERN pn_netaddr_t * pn_transport_remote_addr(pn_transport_t *t)
Get the local address of a transport.
pn_transport_t
struct pn_transport_t pn_transport_t
A network channel supporting an AMQP connection.
Definition: types.h:431
pn_netaddr_next
const PNP_EXTERN pn_netaddr_t * pn_netaddr_next(const pn_netaddr_t *na)
pn_netaddr_local
const PNP_EXTERN pn_netaddr_t * pn_netaddr_local(pn_transport_t *t)
pn_listener_addr
const PNP_EXTERN pn_netaddr_t * pn_listener_addr(pn_listener_t *l)
Get the listening addresses of a listener.
pn_netaddr_sockaddr
PNP_EXTERN const struct sockaddr * pn_netaddr_sockaddr(const pn_netaddr_t *na)
On POSIX or Windows, get the underlying struct sockaddr.
pn_netaddr_socklen
PNP_EXTERN size_t pn_netaddr_socklen(const pn_netaddr_t *na)
On POSIX or Windows, get the size of the underlying struct sockaddr.
pn_netaddr_t
struct pn_netaddr_t pn_netaddr_t
Unsettled API - The network address of a proactor transport.
Definition: netaddr.h:42