30#include <Padico/Puk.h>
31#include <Padico/PadicoTM.h>
32#include <Padico/PM2.h>
33#include <Padico/Topology.h>
34#include <Padico/PSP.h>
35#include <Padico/VLink-internals.h>
56#define AF_PADICO_VOPW AF_PADICO_MAGIC('V', 'O', 'P', 'W')
82#define VOPW_IBOX_DATA 0x01
83#define VOPW_IBOX_RENDEZVOUS 0x02
84#define VOPW_IBOX_OKTOSEND 0x04
85#define VOPW_IBOX_PACKET 0x08
86#define VOPW_IBOX_EOS 0x10
91#define VOPW_BUF_MEMTOBUFFER(BUF, MEM, SIZ) \
92 { memcpy((BUF).data+(BUF).size, (MEM), (SIZ)); \
93 (BUF).size += (SIZ); }
95#define VOPW_BUF_PUMPTOBUFFER(BUF, SIZ, TOKEN, PUMP) \
96 { (*(PUMP))((TOKEN), ((BUF).data +(BUF).size), (SIZ)); \
97 (BUF).size += (SIZ); }
99#define VOPW_BUF_BUFFERTOMEM(MEM, BUF, SIZ) \
100 { memcpy(MEM, (BUF).data+(BUF).offset, SIZ); \
101 (BUF).offset += SIZ; }
103#define VOPW_BUF_ALLOC(BUF, SIZ) \
104 { (BUF).data=padico_malloc(SIZ); \
107 (BUF).total_size=(SIZ); }
109#define VOPW_BUF_CURRENTSIZE(BUF) \
110 ((BUF).size-(BUF).offset)
112#define VOPW_BUF_FREE(BUF) \
113 padico_free((BUF).data)
120#define VOPW_VNODES_MAX PUK_ABI_FD_MAX
122#define VOPW_VNODES_MAX 256
124#define VOPW_TAG_NOTAG -1
125#define VOPW_TAG_ANY 0
126#define VOPW_TAG_FIRST 1
127#define VOPW_TAG_LAST (VOPW_VNODES_MAX-1)
128#define VOPW_TAG_NEXT(T) (((T)==VOPW_TAG_LAST)?(VOPW_TAG_FIRST):((T)+1))
153#define VOPW_OP_NONE 0x00
155#define VOPW_OP_CONNECT 0x01
166#define VOPW_OP_CONNREFUSED 0x02
168#define VOPW_OP_ACCEPTED 0x03
175#define VOPW_OP_CLOSE 0x04
177#define VOPW_OP_EOS 0x05
179#define VOPW_OP_GET_TAG 0x06
187#define VOPW_OP_GIVE_TAG 0x07
196#define VOPW_OP_DATA 0x11
204#define VOPW_OP_RENDEZVOUS 0x12
211#define VOPW_OP_OKTOSEND 0x14
217#define VOPW_OP_PACKET 0x15
vopw_ibox
incoming buffering box for Madeleine wrapper
padico_topo_node_t node_from
uint16_t port
originating port number ('host' byte order)
struct vopw_deferred_req_s __attribute__
struct vopw_buffer_s buffer
raw data received by copy
typdef struct vopw_dynres_vect_s * vopw_dynres_vect_t
size_t rendezvous_size
size of the rendez-vous, if present
int what
rendezvous or buffer (VOPW_IBOX_* defines)
#define PADICO_TOPO_UUID_SIZE
virtual node descriptor, common to any file type
Serialized form of a vopw_address_s (in network byte order)
Address for a VLink_Packet endpoint.
uint16_t tag
tag which uniquely identifies the virtual socket
padico_topo_node_t na_node
node descriptor
automatic buffers with sliding pointers
size_t total_size
size of the 'data' buffer
char * data
beginning of the data buffer
Structure to describe deferred operations to be executed in a different thread than the receiving one...
padico_topo_node_t dest_node
Dynamic address resolution manager.
vopw_dynres_vect_t cache
cache of known addresses
pthread_mutex_t lock
lock for the cache access
pthread_cond_t cond
monitor events in the cache
uint32_t my_addr
IP address of the server.
uint16_t my_tag
tag for the newly created socket
uint16_t my_tag
tag of the client side
uint16_t domain
domain of the virtual socket.
uint16_t type
SOCK_STREAM, SOCK_DGRAM.
uint32_t my_addr
IP address of the client side.
uint16_t your_tag
tag of the server socket
char data[4]
place holder for a pointer- actually, more space is used
uint32_t len
length of data (including data in header)
uint32_t tlen
length of data in message body
uint16_t your_port
port number requested
uint16_t type
SOCK_STREAM, SOCK_DGRAM.
uint32_t accepted_len
accepted_len <= proposed_len - DATA_IN_HEADER
uint16_t port
port from where the packet is sent
char data[4]
place-holder for actual data
uint32_t len
length of data (including data in header)
uint32_t proposed_len
length of the data ready to be sent
Header for all outgoing messages through VSock/Madeleine wrapper.
union vopw_hdr_s::vopw_hdr_info_u info
variable part of the header
uint16_t tag
destination MAD tag
struct vopw_hdr_info_data_s DATA
struct vopw_hdr_info_oktosend_s OKTOSEND
struct vopw_hdr_info_connect_s CONNECT
struct vopw_hdr_info_givetag_s GIVETAG
struct vopw_hdr_info_gettag_s GETTAG
struct vopw_hdr_info_packet_s PACKET
struct vopw_hdr_info_rendezvous_s RENDEZVOUS
struct vopw_hdr_info_accepted_s ACCEPTED