network8980%system.extension
fault.system

Endpoint_Check
macro

Endpoint_Check()

_RETRY_STATE10%
define

#define _RETRY_STATE _avail_retries

RETRY_STATE_INIT20%
define

#define RETRY_STATE_INIT int _RETRY_STATE = CONFIG_SYSCALL_RETRY

LIMITED_RETRY70%
macro

LIMITED_RETRY()

UNLIMITED_RETRY
macro

UNLIMITED_RETRY()

X_EAI_ERRORS300%
macro

X_EAI_ERRORS()

X_EAI
define

#define X_EAI(X) \
	case X: \
		return(#X); \
	break;

PYTHON_TYPES20%
macro

PYTHON_TYPES()

nw_select_endpoints
define

#define nw_select_endpoints nw_select_endpoints_gai

nw_select_interfaces
define

#define nw_select_interfaces nw_select_interfaces_gai

PyMethod_Id
define

#define PyMethod_Id(N) nw_##N

MODULE_FUNCTIONS
macro

MODULE_FUNCTIONS()

ID
define

#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%
function
const char *

error_name_gai(code)

Lookup the name of the EAI define that is associated with the given error code.

error_name_gaiParameters

code
  • int

The EAI error.

error_name_gaiReturns

Constant string pointer.

construct_error180%
function
PyObj

construct_error(code)

nw_getaddrinfo560%
function
PyObj

nw_getaddrinfo(stream_type, namestr, servicestr, socktype, flags)

addrinfo10%
structure

nw_select_endpoints_gai180%
function
PyObj

nw_select_endpoints_gai(mod, args)

Resolve transport selectors for the given host and service.

nw_select_interfaces_gai200%
function
PyObj

nw_select_interfaces_gai(mod, args)

Find service interfaces using GAI.

bind_sequence160%
function
kport_t

bind_sequence(ep)

nw_bind_endpoint100%
function
PyObj

nw_bind_endpoint(ep)

service_sequence200%
function
kport_t

service_sequence(ep, backlog)

nw_service_endpoint100%
function
PyObj

nw_service_endpoint(ep, backlog)

i_connect210%
function
int

i_connect(fd, addr, addrlen)

connect_sequence160%
function
kport_t

connect_sequence(ep)

nw_connect_endpoint100%
function
PyObj

nw_connect_endpoint(ep)

nw_connect110%
function
PyObj

nw_connect(module, args, kw)

Python interface to POSIX connect.

nw_service110%
function
PyObj

nw_service(module, args, kw)

Python interface to POSIX bind and listen.

nw_bind110%
function
PyObj

nw_bind(module, args, kw)

Python interface to POSIX bind.

nw_transmit_endpoint130%
function
PyObj

nw_transmit_endpoint(module, fileno)

nw_receive_endpoint190%
function
PyObj

nw_receive_endpoint(module, fileno)

interpret_native_integer
macro

interpret_native_integer()

A
define

#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

#define endpoint_alloc(x) EndpointType.tp_alloc(&EndpointType, x)

transport_type_string10%
function
const char *

transport_type_string(socktype)

Retrieve the string identifier of the given socket type code, socktype.

transport_type_stringParameters

socktype
  • int

The integer code of the socket type to resolve.

transport_type_stringReturns

A constant string used by the Python interfaces to select a socket type.

nw_socket_type330%
function
int

nw_socket_type(identifier)

Identify the socket type code that is being referred to by the given string, identifier.

interpret_transport230%
function
int

interpret_transport(ob, out)

protoent40%
structure

interpret_type230%
function
int

interpret_type(ob, out)

inet6_from_pyint10%
function
int

inet6_from_pyint(out, ob)

inet4_from_pyint10%
function
int

inet4_from_pyint(out, ob)

get_port110%
function
aport_kind_t

get_port(ss, dst, dstlen)

get_address120%
function
void

get_address(ss, dst, dstlen)

Convert the address referenced by ss into a string written into dst.

get_addressParameters

ss
  • any_addr_t *

Source address structure.

dst
  • char *

Destination memory buffer for the address string to be written to.

dstlen
  • int

Length of dst string.

get_addressReturns

The ss parameter is the destination of the address described in dst.

ip4_from_object320%
function
int

ip4_from_object(ob, out)

ParseTuple converter for IPv4 addresses.

ip6_from_object400%
function
int

ip6_from_object(ob, out)

ParseTuple converter for IPv6 addresses.

local_port_index60%
function
int

local_port_index(buf)

local_str100%
function
void

local_str(dst, dstsize, addr)

local_port110%
function
void

local_port(port, dstsize, addr)

local_from_object400%
function
int

local_from_object(ob, out)

ParseTuple converter for local file system sockets.

endpoint_copy100%
function
PyObj

endpoint_copy(endpoint)

endpoint_replace940%
function
PyObj

endpoint_replace(self, args, kw)

endpoint_get_protocol_family20%
function
PyObj

endpoint_get_protocol_family(self, _)

endpoint_get_address_type150%
function
PyObj

endpoint_get_address_type(self, _)

endpoint_get_address20%
function
PyObj

endpoint_get_address(self, _)

endpoint_get_port100%
function
PyObj

endpoint_get_port(self, _)

endpoint_get_pair100%
function
PyObj

endpoint_get_pair(self, _)

endpoint_richcompare340%
function
PyObj

endpoint_richcompare(self, x, op)

endpoint_str80%
function
PyObj

endpoint_str(self)

String representation suitable for text based displays.

endpoint_repr80%
function
PyObj

endpoint_repr(self)

endpoint_create120%
function
Endpoint

endpoint_create(type, transport, addr, addrlen)

endpoint_new360%
function
PyObj

endpoint_new(subtype, args, kw)