Endpoint_Check
Endpoint_Check()
_RETRY_STATE10%
#define _RETRY_STATE _avail_retries
RETRY_STATE_INIT20%
#define RETRY_STATE_INIT int _RETRY_STATE = CONFIG_SYSCALL_RETRY
LIMITED_RETRY70%
LIMITED_RETRY()
UNLIMITED_RETRY
UNLIMITED_RETRY()
X_EAI_ERRORS300%
X_EAI_ERRORS()
X_EAI
#define X_EAI(X) \
case X: \
return(#X); \
break;
PYTHON_TYPES20%
PYTHON_TYPES()
nw_select_endpoints
#define nw_select_endpoints nw_select_endpoints_gai
nw_select_interfaces
#define nw_select_interfaces nw_select_interfaces_gai
PyMethod_Id
#define PyMethod_Id(N) nw_##N
MODULE_FUNCTIONS
MODULE_FUNCTIONS()
ID
#define ID(NAME) \
if (PyType_Ready((PyTypeObject *) &( NAME##Type ))) \
goto error; \
Py_INCREF((PyObj) &( NAME##Type )); \
if (PyModule_AddObject(module, #NAME, (PyObj) &( NAME##Type )) < 0) \
{ Py_DECREF((PyObj) &( NAME##Type )); goto error; }
error_name_gai60%const char *
error_name_gai(code)
Lookup the name of the EAI define that is associated with the given error code.
error_name_gaiParameters
error_name_gaiReturns
Constant string pointer.
construct_error180%PyObj
construct_error(code)
nw_getaddrinfo560%PyObj
nw_getaddrinfo(stream_type, namestr, servicestr, socktype, flags)
addrinfo10%
nw_select_endpoints_gai180%PyObj
nw_select_endpoints_gai(mod, args)
Resolve transport selectors for the given host and service.
nw_select_interfaces_gai200%PyObj
nw_select_interfaces_gai(mod, args)
Find service interfaces using GAI.
bind_sequence160%kport_t
bind_sequence(ep)
nw_bind_endpoint100%PyObj
nw_bind_endpoint(ep)
service_sequence200%kport_t
service_sequence(ep, backlog)
nw_service_endpoint100%PyObj
nw_service_endpoint(ep, backlog)
i_connect210%int
i_connect(fd, addr, addrlen)
connect_sequence160%kport_t
connect_sequence(ep)
nw_connect_endpoint100%PyObj
nw_connect_endpoint(ep)
nw_connect110%PyObj
nw_connect(module, args, kw)
Python interface to POSIX connect.
nw_service110%PyObj
nw_service(module, args, kw)
Python interface to POSIX bind and listen.
nw_bind110%PyObj
nw_bind(module, args, kw)
Python interface to POSIX bind.
nw_transmit_endpoint130%PyObj
nw_transmit_endpoint(module, fileno)
nw_receive_endpoint190%PyObj
nw_receive_endpoint(module, fileno)
interpret_native_integer
interpret_native_integer()
A
#define A(AF) \
case AF##_pf: { \
AF##_casted(afdata, ss); \
AF##_port(dst, dstlen, afdata); } \
return(AF##_port_kind);
#define A(AF) \
case AF##_pf: { \
AF##_casted(afdata, ss); \
AF##_str(dst, dstlen, afdata); \
} break;
#define A(AF) static PyObj endpoint_new_##AF(PyTypeObject *, PyObj, PyObj);
#define A(AF) \
{"from_" #AF, \
(PyCFunction) endpoint_new_##AF , \
METH_VARARGS|METH_KEYWORDS|METH_CLASS, NULL \
},
#define A(AF) \
case AF##_pf: \
return(PyUnicode_FromString(AF##_name)); \
break;
#define A(DOMAIN) \
static PyObj \
endpoint_new_internal_##DOMAIN(PyTypeObject *subtype, PyObj rep) \
{ \
const int addrlen = sizeof(DOMAIN##_addr_t); \
int r; \
\
PyObj rob; \
Endpoint E; \
\
r = addrlen / subtype->tp_itemsize; \
if (r * subtype->tp_itemsize <= addrlen) \
++r; \
\
rob = subtype->tp_alloc(subtype, r); \
if (rob == NULL) \
return(NULL); \
E = (Endpoint) rob; \
E->type = -1; \
E->transport = -1; \
\
if (! (DOMAIN##_from_object(rep, (DOMAIN##_addr_t *) Endpoint_GetAddress(E)))) \
{ \
Py_DECREF(rob); \
return(NULL); \
} \
E->len = addrlen; \
\
return(rob); \
} \
\
static PyObj \
endpoint_new_##DOMAIN(PyTypeObject *subtype, PyObj args, PyObj kw) \
{ \
PyObj address, transport = NULL, type = NULL; \
static char *kwlist[] = {"address", "transport", "type", NULL}; \
Endpoint E; \
\
if (!PyArg_ParseTupleAndKeywords(args, kw, "O|OO", kwlist, &address, &transport, &type)) \
return(NULL); \
\
E = (Endpoint) endpoint_new_internal_##DOMAIN(subtype, address); \
if (E == NULL) \
return(NULL); \
if (interpret_transport(transport, &(E->transport))) \
goto error; \
if (interpret_type(type, &(E->type))) \
goto error; \
\
return((PyObj) E); \
error: \
{ \
Py_DECREF(E); \
return(NULL); \
} \
}
#define A(DOMAIN) \
else if (strcmp(domain, #DOMAIN) == 0) \
rob = endpoint_new_internal_##DOMAIN(subtype, address);
endpoint_alloc
#define endpoint_alloc(x) EndpointType.tp_alloc(&EndpointType, x)
transport_type_string10%const char *
transport_type_string(socktype)
Retrieve the string identifier of the given socket type code, socktype.
transport_type_stringParameters
transport_type_stringReturns
A constant string used by the Python interfaces to select a socket type.
nw_socket_type330%int
nw_socket_type(identifier)
Identify the socket type code that is being referred to by the given string, identifier.
interpret_transport230%int
interpret_transport(ob, out)
protoent40%
interpret_type230%int
interpret_type(ob, out)
inet6_from_pyint10%int
inet6_from_pyint(out, ob)
inet4_from_pyint10%int
inet4_from_pyint(out, ob)
get_port110%aport_kind_t
get_port(ss, dst, dstlen)
get_address120%void
get_address(ss, dst, dstlen)
Convert the address referenced by ss into a string written into dst.
get_addressParameters
dstlenint
Length of dst string.
get_addressReturns
The ss parameter is the destination of the address described in dst.
ip4_from_object320%int
ip4_from_object(ob, out)
ParseTuple converter for IPv4 addresses.
ip6_from_object400%int
ip6_from_object(ob, out)
ParseTuple converter for IPv6 addresses.
local_port_index60%int
local_port_index(buf)
local_str100%void
local_str(dst, dstsize, addr)
local_port110%void
local_port(port, dstsize, addr)
local_from_object400%int
local_from_object(ob, out)
ParseTuple converter for local file system sockets.
endpoint_copy100%PyObj
endpoint_copy(endpoint)
endpoint_replace940%PyObj
endpoint_replace(self, args, kw)
endpoint_get_protocol_family20%PyObj
endpoint_get_protocol_family(self, _)
endpoint_get_address_type150%PyObj
endpoint_get_address_type(self, _)
endpoint_get_address20%PyObj
endpoint_get_address(self, _)
endpoint_get_port100%PyObj
endpoint_get_port(self, _)
endpoint_get_pair100%PyObj
endpoint_get_pair(self, _)
endpoint_richcompare340%PyObj
endpoint_richcompare(self, x, op)
endpoint_str80%PyObj
endpoint_str(self)
String representation suitable for text based displays.
endpoint_repr80%PyObj
endpoint_repr(self)
endpoint_create120%Endpoint
endpoint_create(type, transport, addr, addrlen)
endpoint_new360%PyObj
endpoint_new(subtype, args, kw)