Internal structures definition for VLink – This is not the public API. More...
#include <Padico/Puk.h>#include <Padico/PadicoTM.h>#include <Padico/PM2.h>#include <Padico/Topology.h>#include <Padico/PadicoControl.h>#include <Padico/NetSelector.h>#include <unistd.h>#include <stdlib.h>#include <errno.h>#include <assert.h>#include <fcntl.h>#include <netdb.h>#include <netinet/in.h>#include <arpa/inet.h>#include <sys/un.h>#include <sys/types.h>#include <sys/socket.h>#include <sys/wait.h>#include <sys/time.h>#include <sys/stat.h>#include <sys/mman.h>#include "VLink-API.h"#include "VLink-debug.h"

Go to the source code of this file.
Macros | |
| #define | VLINK_CREATE_SPECIFIC_ACCESSORS(NAME) |
| This macro creates accessors functions for component-specific status. | |
| #define | vnode_activate(VNODE, FIELD) (VNODE)->content.FIELD = 1 |
| #define | vnode_deactivate(VNODE, FIELD) (VNODE)->content.FIELD = 0 |
Variables | |
| const struct puk_component_driver_s | padico_vnode_component_driver |
Detailed Description
Internal structures definition for VLink – This is not the public API.
Definition in file VLink-internals.h.
Macro Definition Documentation
◆ VLINK_CREATE_SPECIFIC_ACCESSORS
This macro creates accessors functions for component-specific status.
For component 'foo', the following functions and types are created: vlink_foo_specific_t vnode_is_foo() vnode_foo_check() vnode_foo_activate() vnode_foo_deactivate() vnode_foo()
Definition at line 72 of file VLink-internals.h.
◆ vnode_activate
| #define vnode_activate | ( | VNODE, | |
| FIELD | |||
| ) | (VNODE)->content.FIELD = 1 |
for use within components
Definition at line 95 of file VLink-internals.h.
◆ vnode_deactivate
| #define vnode_deactivate | ( | VNODE, | |
| FIELD | |||
| ) | (VNODE)->content.FIELD = 0 |
Definition at line 96 of file VLink-internals.h.
Function Documentation
◆ padico_vio_abi_init()
Definition at line 38 of file vio-abi.c.
References done, padico_vio_accept(), padico_vio_bind(), padico_vio_close(), padico_vio_connect(), padico_vio_creat(), padico_vio_fcntl(), padico_vio_fstat(), padico_vio_fsync(), padico_vio_ftruncate(), padico_vio_getpeername(), padico_vio_getsockname(), padico_vio_getsockopt(), padico_vio_ioctl(), padico_vio_listen(), padico_vio_lseek(), padico_vio_mmap(), padico_vio_open(), padico_vio_pipe(), padico_vio_poll(), padico_vio_read(), padico_vio_readv(), padico_vio_recv(), padico_vio_recvfrom(), padico_vio_recvmsg(), padico_vio_select(), padico_vio_send(), padico_vio_sendmsg(), padico_vio_sendto(), padico_vio_setsockopt(), padico_vio_shutdown(), padico_vio_socket(), padico_vio_write(), padico_vio_writev(), puk_abi_set_virtual, puk_spinlock_acquire(), puk_spinlock_release(), recv, send, and shutdown.
Referenced by vio_mod_init().
◆ padico_vio_init()
Definition at line 260 of file vio.c.
References done, i, NULL, PADICO_VIO_MAX_DESC, and vio.
Referenced by vio_mod_init().
◆ padico_viostat_init()
Definition at line 260 of file vio-stat.c.
References vlink_statistics_s::bytes_recv_by_copy, vlink_statistics_s::bytes_recv_zero_copy, vlink_statistics_s::debug, done, vlink_statistics_s::misaligned_receive, vlink_statistics_s::misaligned_send, vlink_statistics_s::no_rbox, vlink_statistics_s::num_fd, vlink_statistics_s::num_hfd_force_synchro, vlink_statistics_s::num_immediate_read, vlink_statistics_s::num_immediate_write, vlink_statistics_s::num_read, vlink_statistics_s::num_recv_by_copy, vlink_statistics_s::num_recv_zero_copy, vlink_statistics_s::num_write, vlink_statistics_s::open_sockets, padico_module_attr_debug_getvalue(), padico_timing_profiler_new(), vlink_statistics_s::rbox_too_small, vlink_statistics_s::rendezvous_zero_copy, vlink_debug_s::show_vlink_assembly, viodumpvfd_action, viostat_action, and vlink_stat.
Referenced by vio_mod_init().
◆ padico_vnode_component_acceptor()
|
inlinestatic |
Clones the given instance to make a new incoming connection, from the bottom-most component.
Definition at line 147 of file VLink-internals.h.
References done, instance, NULL, padico_vnode_get_self_instance(), and vnode.
Referenced by vlink_ps_callback_acceptor(), vlink_sf_accept_finalizer(), and vsock_vopw_listen().
◆ padico_vnode_component_name()
|
inlinestatic |
Definition at line 116 of file VLink-internals.h.
References padico_vnode_s::assembly_stuff, vnode_assembly_stuff_s::context, done, instance, vnode_assembly_stuff_s::instance, name, and vnode.
Referenced by padico_vio_dumpvnode(), padico_vsock_active_connect(), padico_vsock_bind(), padico_vsock_create(), padico_vsock_fullshutdown(), padico_vsock_passive_connect(), and vlink_fwd_init().
◆ padico_vnode_get_context()
|
inlinestatic |
Definition at line 111 of file VLink-internals.h.
References padico_vnode_s::assembly_stuff, vnode_assembly_stuff_s::context, done, and vnode.
Referenced by vlink_fwd_init(), and vlink_ps_init().
◆ padico_vnode_get_self_instance()
|
inlinestatic |
returns the instance for the given vnode.
Definition at line 126 of file VLink-internals.h.
References padico_vnode_s::assembly_stuff, assert(), done, instance, vnode_assembly_stuff_s::instance, and vnode.
Referenced by padico_vnode_component_acceptor(), vlink_id_init(), vlink_id_make_new_vnode(), vlink_sf_create(), vpf_init(), vpf_make_new_vnode(), and vsock_vopw_create().
◆ padico_vnode_get_vlink_driver()
|
inlinestatic |
Definition at line 106 of file VLink-internals.h.
References padico_vnode_s::assembly_stuff, driver, vnode_assembly_stuff_s::vlink_driver, and vnode.
Referenced by padico_vio_dumpvnode(), padico_vnode_close(), padico_vnode_read_post(), padico_vnode_write_post(), padico_vsock_active_connect(), padico_vsock_bind(), padico_vsock_create(), padico_vsock_fullshutdown(), padico_vsock_passive_connect(), and vlink_selector_close().
◆ padico_vnode_instantiate_entry()
|
inlinestatic |
auto-instantiate a vnode- forcibly hooks an component to a vnode (without using NetSelector)
Definition at line 136 of file VLink-internals.h.
References component, done, instance, NULL, puk_instance_indirect_VLink(), r, and vnode.
Referenced by gw_status_new(), vlink_fwd_connect_handler(), vlink_fwd_init(), and vlink_fwd_listen_handler().
◆ padico_vsock_acceptor_finalize()
| void padico_vsock_acceptor_finalize | ( | padico_vnode_t | vnode, |
| padico_vnode_t | server_vnode, | ||
| const struct sockaddr * | addr, | ||
| int | addrlen | ||
| ) |
Adapters call this function to notify that an incoming connection has been accepted.
The selector promotes the 'selected' component to connected component in charge of the 'remote' field, and shutdowns every other components not selected.
- Parameters
-
vnode the newly created socket selected the component which created this socket (thus promoted to connected component) addr address of the remote peer addrlen length in bytes of 'addr'
Definition at line 272 of file vsock.c.
References vobs_attr_remote_s::can_recv, vobs_attr_remote_s::can_send, vobs_attr_status_s::connecting, done, vobs_attr_remote_s::established, padico_vnode_s::remote, vobs_attr_remote_s::remote_addr, vobs_attr_remote_s::remote_addrlen, padico_vnode_s::status, vnode, vnode_activate, vnode_lock(), vnode_set_error(), vnode_unlock(), vobs_attr_listener, and vobs_signal().
Referenced by vlink_id_make_new_vnode(), vlink_ps_callback_acceptor(), vlink_sf_accept_finalizer(), vopw_acceptor(), and vpf_make_new_vnode().
◆ padico_vsock_connector_finalize()
| void padico_vsock_connector_finalize | ( | padico_vnode_t | vnode | ) |
Adapters call this function to notify the VLink_selector that an outgoing connection has been accepted.
The selector then promotes the currently tried component to connected component in charge of the 'remote' field of the vnode, and shutdowns every other components.
- Parameters
-
vnode the successfully connected vnode
Definition at line 250 of file vsock.c.
References vobs_attr_remote_s::can_recv, vobs_attr_remote_s::can_send, vobs_attr_status_s::connecting, done, vobs_attr_remote_s::established, padico_vnode_s::remote, padico_vnode_s::status, vnode, vnode_check, vnode_set_error(), vobs_attr_remote, and vobs_signal().
Referenced by vlink_ps_connect(), vlink_sf_connect_finalizer(), and vopw_psp_callback_ACCEPTED().
◆ vnode_hfd_close()
| int vnode_hfd_close | ( | padico_vnode_t | vnode | ) |
Definition at line 152 of file vnode_hfd.c.
References padico_vnode_s::content, done, fd, vnode_hfd_s::fd, padico_vnode_content_t::hfd, padico_vnode_s::hfd, vnode_hfd_s::io_read, vnode_hfd_s::io_write, NULL, vobs_attr_status_s::opened, padico_io_deactivate(), padico_io_t, padico_io_unregister(), PUK_ABI_FSYS_WRAP, rc, padico_vnode_s::status, vnode, and vnode_unlock().
Referenced by padico_vnode_close(), and vlink_sf_close().
◆ vnode_hfd_create()
| void vnode_hfd_create | ( | padico_vnode_t | vnode, |
| int | fd, | ||
| int | flags | ||
| ) |
flags: O_RDONLY | O_WRONLY | O_RDWR
< the fildes is readable
< the fildes is writable
Definition at line 47 of file vnode_hfd.c.
References done, fd, vnode_hfd_s::fd, padico_vnode_s::hfd, vnode_hfd_s::io_read, vnode_hfd_s::io_write, mode, NULL, padico_io_activate(), PADICO_IO_EVENT_READ, PADICO_IO_EVENT_WRITE, padico_io_register(), vnode, vnode_activate, vnode_hfd_callback_reader(), and vnode_hfd_callback_writer().
Referenced by padico_vio_inotify_init(), vfile_open(), vlink_sf_accept_finalizer(), and vlink_sf_connect_finalizer().
◆ vnode_hfd_fcntl()
| int vnode_hfd_fcntl | ( | padico_vnode_t | vnode, |
| int | cmd, | ||
| void * | arg | ||
| ) |
Definition at line 183 of file vnode_hfd.c.
References __puk_abi_wrap__errno, arg, done, vnode_hfd_s::fd, padico_vnode_s::hfd, PUK_ABI_FSYS_WRAP, rc, vnode, and vnode_set_error().
Referenced by padico_vio_fcntl().
◆ vnode_hfd_read_post()
| void vnode_hfd_read_post | ( | padico_vnode_t | vnode | ) |
Definition at line 75 of file vnode_hfd.c.
References done, vnode_hfd_s::fd, padico_vnode_s::hfd, vnode_hfd_s::io_read, vlink_statistics_s::num_hfd_force_synchro, vlink_statistics_s::num_immediate_read, padico_io_activate(), padico_sysio_refresh(), padico_vnode_s::rbox, vobs_attr_rbox_s::read_done, vobs_attr_rbox_s::read_posted, vobs_attr_status_s::readable, padico_vnode_s::status, vlink_stat, vlink_sysio_reader_worker(), vnode, vnode_check, vnode_lock(), vnode_unlock(), and vobs_wait().
◆ vnode_hfd_write_post()
| void vnode_hfd_write_post | ( | padico_vnode_t | vnode | ) |
Definition at line 119 of file vnode_hfd.c.
References done, padico_vnode_s::hfd, vnode_hfd_s::io_write, vlink_statistics_s::num_hfd_force_synchro, vlink_statistics_s::num_immediate_write, padico_io_activate(), padico_sysio_refresh(), padico_vnode_s::status, vlink_stat, VLINK_SYSIO_DIRECT_SEND_THRESHOLD, vlink_sysio_writer_worker(), vnode, vnode_check, vnode_lock(), vnode_unlock(), padico_vnode_s::wbox, vobs_attr_status_s::writable, vobs_attr_wbox_s::write_done, and vobs_attr_wbox_s::write_posted.
◆ vsock_madio_recvfrom()
| ssize_t vsock_madio_recvfrom | ( | padico_vnode_t | vnode, |
| void * | buf, | ||
| size_t | len | ||
| ) |
Definition at line 763 of file vlink-packet.c.
References assert(), done, vobs_attr_rbox_s::from, vobs_attr_rbox_s::fromlen, len, NULL, padico_vnode_s::rbox, rc, vobs_attr_rbox_s::read_done, vobs_attr_status_s::readable, padico_vnode_s::status, vnode, vnode_check, vopw_dynres_reverse_lookup(), and VOPW_IBOX_PACKET.
Referenced by padico_vsock_recvfrom().
◆ vsock_madio_sendto()
| ssize_t vsock_madio_sendto | ( | padico_vnode_t | vnode, |
| const void * | buf, | ||
| size_t | len, | ||
| padico_topo_node_t | node, | ||
| int | port | ||
| ) |
Definition at line 684 of file vlink-packet.c.
References assert(), padico_vnode_s::binding, vlink_vopw_specific_s::config, padico_vnode_s::content, done, vobs_attr_rbox_s::from, vobs_attr_rbox_s::fromlen, len, node, NULL, padico_topo_getlocalnode(), padico_topo_host_getaddr(), padico_topo_node_gethost(), port, vobs_attr_binding_s::primary, padico_vnode_content_t::rbox, padico_vnode_s::rbox, rc, vobs_attr_rbox_s::read_buffer, vobs_attr_rbox_s::read_done, vobs_attr_rbox_s::read_posted, tag, vlink_packet_new_message(), vlink_packet_send(), vnode, vnode_lock(), vnode_unlock(), vobs_attr_rbox, vobs_signal(), vopw_dynres_resolve(), vopw_dynres_reverse_lookup(), VOPW_IBOX_PACKET, VOPW_OP_PACKET, and vopw_vnode_lookup().
Referenced by padico_vsock_sendto().
Variable Documentation
◆ padico_vnode_component_driver
|
extern |
Definition at line 96 of file vnode.c.
Referenced by padico_vlink_packet_init(), padico_vlink_selector_init(), padico_vpipe_init(), vlink_fwd_module_init(), vlink_ps_module_init(), and vlink_socketfactory_module_init().