PadicoTM

Documentation

« back to PM2 home.
vlink-fwd.c
Go to the documentation of this file.
1/*
2 * Padico -- a High Performance Parallel and Distributed Computing Environment
3 * Copyright (c) 2002-2025 INRIA and the University of Rennes 1
4 * Alexandre DENIS <Alexandre.Denis@inria.fr>
5 * Christian PEREZ <Christian.Perez@inria.fr>
6 *
7 * The software has been registered at the Agency for the Protection of
8 * Programs (APP) under the number IDDN.FR.001.260013.000.S.P.2002.000.10000.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
28#include <Padico/Puk.h>
29#include <Padico/VLink-internals.h>
30#include <Padico/Module.h>
31#include <Padico/Topology.h>
32
33static int vlink_fwd_module_init(void);
34static void vlink_fwd_module_finalize(void);
35
37
38/* VLink_fwd Vlink-driver functions */
39static void vlink_fwd_init (padico_vnode_t);
40
48
54
55#define AF_PADICO_VLFW AF_PADICO_MAGIC('V', 'L', 'F', 'W')
56
60{
62 .bind = &vlink_fwd_bind,
63 .listen = &vlink_fwd_listen,
64 .connect = &vlink_fwd_connect,
65 .fullshutdown = &vlink_fwd_fullshutdown,
66 .close = NULL,
67 .send_post = &vlink_fwd_send_post,
68 .recv_post = &vlink_fwd_recv_post,
69 .dumpstat = NULL
70};
71
82
92
100
101static uint32_t vlink_hash(const struct vlink_lookup_s*);
102static int vlink_eq(const struct vlink_lookup_s*, const struct vlink_lookup_s*);
103
104PUK_HASHTABLE_TYPE(vlink_fwd_status, struct vlink_lookup_s*, struct vlink_fwd_specific_s*,
106
110
112
116
120
121static void vlink_status_register(void*);
122static void*vlink_status_lookup(const char*, int);
123
124/* ********************************************************* */
125
126static int vlink_fwd_module_init(void)
127{
128 padico_out(30,"VLink-Fwd initialisation\n");
129
133
135 puk_component_declare("VLink_fwd",
136 puk_component_provides("VLink", "vlink", &vlink_fwd_driver),
137 puk_component_provides("PadicoComponent", "component", &padico_vnode_component_driver),
138 puk_component_attr("gateway_nodename", NULL));
140 .xml_tag = "VLink_fwd:Connect",
141 .start_handler = NULL,
142 .end_handler = &vlink_fwd_connect_handler,
143 .required_level = PUK_TRUST_CONTROL
144 });
146 .xml_tag = "VLink_fwd:GwListen",
147 .start_handler = NULL,
148 .end_handler = &vlink_fwd_gwlisten_handler,
149 .required_level = PUK_TRUST_CONTROL
150 });
152 .xml_tag = "VLink_fwd:Listen",
153 .start_handler = NULL,
154 .end_handler = &vlink_fwd_listen_handler,
155 .required_level = PUK_TRUST_CONTROL
156 });
157 return 0;
158}
159
164
165/* ********************************************************* */
166
167static uint32_t vlink_hash(const struct vlink_lookup_s*key)
168{
169 return puk_hash_default(key, sizeof(int)+sizeof(char)*(PADICO_TOPO_UUID_SIZE+1));
170}
171
172static int vlink_eq(const struct vlink_lookup_s*key1, const struct vlink_lookup_s*key2)
173{
174 return ((key1->id == key2->id) &&
175 (strcmp(key1->uuid, key2->uuid) == 0));
176}
177
184
185static void*vlink_status_lookup(const char*uuid, int id)
186{
187 void*status = NULL;
188 struct vlink_lookup_s tmp;
189 tmp.id = id;
190 strcpy((tmp.uuid), uuid);
194 return status;
195}
196
197static int status_num_count = 0;
198
200{
201 /* Generate a local status number */
202 int ret = -1;
206 return ret;
207}
208
209/* ********************************************************** */
210
212{
213 /* Tracks changes to our attributes done by the user */
214 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
215 padico_out(30,"Commit:%d\n", attr);
216 switch(attr)
217 {
218 case vobs_attr_rbox:
219 padico_print("RECV-COMMIT !\n");
220 status->vnode->content.rbox = vnode->content.rbox;
221 status->vnode->rbox = vnode->rbox;
222 vobs_commit(status->vnode, attr);
223 break;
224 case vobs_attr_wbox:
225 padico_print("SEND-COMMIT !\n");
226 status->vnode->content.rbox = vnode->content.rbox;
227 status->vnode->wbox = vnode->wbox;
228 vobs_commit(status->vnode, attr);
229 break;
230 default:
231 padico_fatal("Unexpected attribute (%d) in vlink_fwd_commit\n", attr);
232 break;
233 }
234}
235
237{
238 /* Tracks changes in sub-vnode's attributes */
239 // We're on dest or source node
241 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
242
243 padico_print("Notifier:%d\n", attr);
244
245 switch(attr)
246 {
247 case vobs_attr_status:
248 vnode->status = status->vnode->status;
250 break;
251 case vobs_attr_remote:
252 // i'm connected to Gw, warn the upper Vnode
253 vnode->status = sub->status;
254 vnode->content.remote = sub->content.remote;
255 vnode->remote = sub->remote;
256 vnode->content.binding = sub->content.binding;
257 vnode->binding = sub->binding;
258 padico_out(30, "vnode=%p; sub=%p vnode.established=%d sub.established=%d\n",
259 vnode, sub, vnode->remote.established, sub->remote.established);
261 break;
263 // Gw connected to us
264 vnode->status = sub->status;
265 if(!padico_vnode_queue_empty(sub->listener.backlog))
266 {
267 padico_vnode_t new_vnode = padico_vnode_queue_retrieve(sub->listener.backlog);
268 status->vnode = new_vnode;
269 padico_vsock_init(new_vnode,
271 sub->socket.so_type,
272 sub->socket.so_protocol);
273 vnode_lock(new_vnode);
274 vnode_activate(new_vnode, binding);
275 vnode_activate(new_vnode, remote);
276 vnode_set_error(new_vnode, 0);
277 new_vnode->status.connecting = 0;
278 new_vnode->remote.established = 1;
279 new_vnode->remote.can_recv = 1;
280 new_vnode->remote.can_send = 1;
283 vnode_unlock(new_vnode);
285 }
286 else
287 {
288 padico_warning("Empty backlog in VLink_fwd notifier\n");
289 }
290 break;
291 case vobs_attr_rbox:
292 padico_print("RECEIVED !\n");
293 vnode->rbox = sub->rbox;
295 break;
296 case vobs_attr_wbox:
297 padico_print("SENT !\n");
298 vnode->wbox = sub->wbox;
299 // vobs_signal(vnode, attr);
300 break;
301 default:
302 padico_fatal("Unexpected attribute (%d) in vlink_fwd_notifier\n", attr);
303 break;
304 }
305}
306
308{
311};
312
313static void*comm_thread(void*arg)
314{
315 struct thread_arg*args = arg;
316 int read = 0;
317
318 padico_out(30,"Communication thread started.\n");
319
320 // Wait until connexion is ready
321 marcel_mutex_lock(args->read->mutex);
322 while(!*(args->read->condition))
323 {
324 marcel_cond_wait(args->read->cond, args->read->mutex);
325 }
326 *(args->read->condition) = 0;
327 marcel_mutex_unlock(args->read->mutex);
328
329 // Make comms progress
330 while(1)
331 {
332 char buffer[1024];
333 read = padico_vnode_read_post(args->read->vnode, buffer, 1024*sizeof(char));
334 if( read > 0)
335 {
336 padico_print("Read done:%d\n", read);
337 size_t rc = 0;
338 while(read)
339 {
340 rc = padico_vnode_write_post(args->write->vnode, buffer+rc, read);
341 read -= rc;
342 }
343 padico_print("Transmitted.\n");
344 padico_vnode_read_clear(args->read->vnode);
345 } else {
346 marcel_cond_wait(args->read->cond, args->read->mutex);
347 }
348 }
349 return NULL;
350}
351
352static void begin_comm_thread(struct gw_half_s*read, struct gw_half_s*write)
353{
354 struct thread_arg*args = padico_malloc(sizeof(struct thread_arg));
355 assert(read && write);
356 args->read = read;
357 args->write = write;
359
360 return;
361}
362
364{
365 /* Tracks changes in to_gw_vnode's or from_gw_vnode's attributes */
366 // We're on Gateway
367 struct gw_status_s*gw_status = (struct gw_status_s*)key;
368
369 padico_print("GwNotifier:%d\n", attr);
370
371 switch(attr)
372 {
373 case vobs_attr_status:
374 // Do nothing: change of status in a underlying VLink
376 {
377 if(vnode == gw_status->to_gw->vnode)
378 {
379 marcel_mutex_lock(gw_status->to_gw->mutex);
380 *gw_status->to_gw->condition = 1;
381 marcel_mutex_unlock(gw_status->to_gw->mutex);
382 marcel_cond_signal(gw_status->to_gw->cond);
383 } else {
384 assert(vnode == gw_status->from_gw->vnode);
385 marcel_mutex_lock(gw_status->from_gw->mutex);
386 *gw_status->from_gw->condition = 1;
387 marcel_mutex_unlock(gw_status->from_gw->mutex);
388 marcel_cond_signal(gw_status->from_gw->cond);
389 }
390 }
391 break;
392 case vobs_attr_remote:
393 assert(vnode == gw_status->from_gw->vnode);
394 // Do nothing: i'm connected to dest node
395 break;
398 {
399 padico_vnode_t serv_vnode = gw_status->to_gw->vnode;
401 gw_status->to_gw->vnode = new_vnode;
402 padico_vsock_init(new_vnode,
406 vnode_lock(new_vnode);
407 vnode_activate(new_vnode, binding);
408 vnode_activate(new_vnode, remote);
409 vnode_set_error(new_vnode, 0);
410 new_vnode->status.connecting = 0;
411 new_vnode->remote.established = 1;
412 new_vnode->remote.can_recv = 1;
413 new_vnode->remote.can_send = 1;
414 padico_vnode_queue_append(serv_vnode->listener.backlog, new_vnode);
416 vnode_unlock(new_vnode);
417 }
418 else
419 {
420 padico_warning("Empty backlog in VLink_fwd notifier\n");
421 }
422 break;
423 case vobs_attr_rbox:
424 assert(gw_status->to_gw->vnode != NULL && gw_status->from_gw->vnode != NULL);
425 // We already posted a recv.
426 if(vnode == gw_status->to_gw->vnode)
427 {
428 marcel_cond_signal(gw_status->to_gw->cond);
429 } else {
430 marcel_cond_signal(gw_status->from_gw->cond);
431 }
432 break;
433 case vobs_attr_wbox:
434 assert(gw_status->to_gw->vnode != NULL && gw_status->from_gw->vnode != NULL);
435 // We already posted a send.
436 if(vnode == gw_status->to_gw->vnode)
437 {
438 marcel_cond_signal(gw_status->to_gw->cond);
439 } else {
440 marcel_cond_signal(gw_status->from_gw->cond);
441 }
442 break;
443 default:
444 padico_fatal("Unexpected attribute (%d) in vlink_fwd_gw_notifier\n", attr);
445 break;
446 }
447}
448
449/* ********************************************************** */
450
452{
454 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
455
456 // Get a local ID
457 status->lookup.id = generate_status_num();
459 strcpy(status->lookup.uuid, (char*)uuid);
460
461 // Get a reference on Gateway
463 const char*gateway_nodename = puk_context_getattr(context, "gateway_nodename");
465
466 // Create the underlying vnode
468 padico_ns_serial_selector(status->gw, "default", puk_iface_VLink());
471 padico_out(30,"Vnode created: %s\n", padico_vnode_component_name(status->vnode));
472
473 // Set commit function
475}
476
478{
479 return 0;
480}
481
487
489{
491 // Prepare the vnode
492 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
493 vlink_status_register(status);
494
495 // Prepare the AF_PADICO Address
496 struct sockaddr_pa*addr = padico_malloc(sizeof(struct sockaddr_pa));
497 socklen_t addrlen = sizeof(struct sockaddr_pa);
500 padico_sockaddr_init(addr, &addrlen, AF_PADICO_VLFW);
501
502 addr_fwd->idl = status->lookup.id;
504 strcpy(addr_fwd->uuid, (char*)uuid);
505
506 vnode->binding.primary = (struct sockaddr*)addr;
507 vnode->binding.primary_len = addrlen;
508
509 // Do bind underlying node
510 // Create
511 int rc = padico_vsock_create(status->vnode, AF_INET, SOCK_STREAM, 0);
512 if(rc >= 0)
513 return padico_vsock_autobind(status->vnode);
514 else return rc;
515
516 padico_free(addr);
517
518 //dead end
519 return -1;
520}
521
523{
524 /* Dest node don't connect */
525 // First time initialisation
527 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
528
529 // Check arriving address
530 vnode_check(vnode, remote);
531 const struct sockaddr_pa*paddr = (struct sockaddr_pa*)vnode->remote.remote_addr;
532 const struct sockaddr_vlink_fwd *addr =
534
535 status->lookup.id = addr->idl;
536 strcpy(status->lookup.uuid, addr->uuid);
537 vlink_status_register(status);
538
539 // Create
541
544 // Switch depending on interoperability
545 if(((struct sockaddr*)paddr)->sa_family == AF_PADICO)
546 {
547 /* AF_PADICO case. Dest is a PADICO node */
548 padico_string_catf(s_launch, "<VLink_fwd:Connect Uuid=\"%s\" Idl=\"%d\" MyUuid=\"%s\" />",
549 addr->uuid, addr->idl, (char*)uuid);
550 } else {
551 /* AF_INET case. Dest ask for socket interoperability */
552 assert(((struct sockaddr*)paddr)->sa_family == AF_INET);
553 const uint16_t port = ((struct sockaddr_in*) (vnode->binding).primary)->sin_port;
554 padico_string_catf(s_launch, "<VLink_fwd:Connect Uuid=\"%s\" Idl=\"%d\" MyUuid=\"%s\" Dport=\"%d\" />",
555 addr->uuid, addr->idl, (char*)uuid, port);
556 }
557
558 // Send the message to Gw
563
565 if(err != 0)
566 {
567 padico_warning("Error: Message \"Connect\" not arrived: %s.\n",
569 err = -1;
570 }
572
573 return err;
574}
575
576struct gw_status_s*gw_status_new(char*s_uuid, char*s_srcuuid, int id)
577{
578 // Init
579 struct gw_status_s*status = padico_malloc(sizeof(struct gw_status_s));
580 status->id = id;
581 strcpy(status->uuid, (char*)s_uuid);
582
583 status->to_gw = padico_malloc(sizeof(struct gw_half_s));
584 status->from_gw = padico_malloc(sizeof(struct gw_half_s));
585 status->to_gw->mutex = padico_malloc(sizeof(marcel_mutex_t));
586 status->from_gw->mutex = padico_malloc(sizeof(marcel_mutex_t));
589 status->to_gw->cond = padico_malloc(sizeof(marcel_cond_t));
590 status->from_gw->cond = padico_malloc(sizeof(marcel_cond_t));
591 marcel_cond_init(status->to_gw->cond, NULL);
593 status->to_gw->vnode = NULL;
594 status->from_gw->vnode = NULL;
595 status->to_gw->condition = padico_malloc(sizeof(int));
596 status->from_gw->condition = padico_malloc(sizeof(int));
597 *status->to_gw->condition = 0;
598 *status->from_gw->condition = 0;
599
600 // Prepare dest_node
602 status->from_gw->node = dest_node;
603 assert(status->from_gw->node);
604 vlink_status_register(status);
605
606 // Instanciation (source side)
607 if(s_srcuuid)
608 {
610 status->to_gw->node = src_node;
615 }
616
617 // Return
618 return status;
619}
620
622{
623 const char*s_uuid = puk_parse_getattr(e, "Uuid");
624 const char*s_srcuuid = puk_parse_getattr(e, "MyUuid");
625 const char*s_idl = puk_parse_getattr(e, "Idl");
626 const char*s_port = puk_parse_getattr(e, "Dport");
628
629 // Prepare structures
631 if(gw_status == NULL)
632 gw_status = gw_status_new((char*)s_uuid, (char*)s_srcuuid, atoi(s_idl));
633 else { // Instanciate source side...
635 gw_status->to_gw->node = src_node;
640 }
641
642 // Start comm threads
643 begin_comm_thread(gw_status->to_gw, gw_status->from_gw);
644 begin_comm_thread(gw_status->from_gw, gw_status->to_gw);
645
646 // Listen
647 int rc = padico_vsock_create(gw_status->to_gw->vnode, AF_INET, SOCK_STREAM, 0);
648 if(rc != 0)
649 { padico_warning("Create error on Gw\n"); }
650 rc = padico_vsock_autobind(gw_status->to_gw->vnode);
651 if(rc >= 0)
652 {
653 struct sockaddr*addr;
654 addr = padico_malloc(sizeof(struct sockaddr));
655 struct sockaddr_in*addr_in = (struct sockaddr_in*)addr;
656 addr_in->sin_family = AF_INET;
657 addr_in->sin_port = ((struct sockaddr_in*)gw_status->to_gw->vnode->binding.primary)->sin_port;
659
660 const padico_vaddr_t src_addr =
661 padico_vaddr_new(addr, sizeof(struct sockaddr), 0);
662 padico_out(30,"Listen to src_node...\n");
663 padico_vsock_passive_connect(gw_status->to_gw->vnode, 2, src_addr);
664 padico_free(addr);
665 padico_out(30,"Connected.\n");
666 }
667
668 // Send a message to src_node
671 padico_string_catf(s_launch,"<VLink_fwd:GwListen Uuid=\"%s\" Idl=\"%d\" Port=\"%d\" />",
672 gw_status->uuid, gw_status->id,
673 ((struct sockaddr_in*)gw_status->to_gw->vnode->binding.primary)->sin_port);
677
679 if(err != 0)
680 { padico_warning("Message \"GwListen\" not arrived: %s\n", padico_rc_gettext(padico_rc)); }
682
683 // Connect the third node
684 if(!s_port)
685 {
686 /* Dest is a PADICO node */
687 padico_out(30,"Dest is a Padico Node. Waiting for \"Listen\" message.\n");
688 // Do nothing. He will contact us
689 } else {
690 /* AF_INET case. Dest ask for socket interoperability */
691 // Do the connect to designated port
692 padico_out(30,"Dest is not a Padico Node. Connecting...\n");
693
694 struct sockaddr*addr;
695 addr = padico_malloc(sizeof(struct sockaddr));
696 struct sockaddr_in*addr_in = (struct sockaddr_in*)addr;
697 addr_in->sin_family = AF_INET;
698 addr_in->sin_port = atoi(s_port);
700
701 padico_vsock_active_connect(gw_status->from_gw->vnode, addr, sizeof(struct sockaddr));
702 padico_free(addr);
703 }
704}
705
707{
708 /* Source node don't listen */
709 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
710
711 // Send message to Gw to connect
714 padico_string_catf(s_launch,"<VLink_fwd:Listen Uuid=\"%s\" Idl=\"%d\" Port=\"%d\" />",
715 status->lookup.uuid, status->lookup.id,
716 ((struct sockaddr_in*)status->vnode->binding.primary)->sin_port);
718
719 // Do listen
720 struct sockaddr*addr;
721 addr = padico_malloc(sizeof(struct sockaddr));
722 struct sockaddr_in*addr_in = (struct sockaddr_in*)addr;
723 addr_in->sin_family = AF_INET;
724 addr_in->sin_port = ((struct sockaddr_in*)status->vnode->binding.primary)->sin_port;
726
727 const padico_vaddr_t src_addr =
728 padico_vaddr_new(addr, sizeof(struct sockaddr), 0);
729
730 padico_out(30,"Listen for src_node(%p)...\n", addr);
731 int rc = padico_vsock_passive_connect(status->vnode, 2, src_addr);
732 if(rc < 0)
733 { padico_warning("Listen error on dest node.\n"); }
734 padico_out(30,"Connected.\n");
735 padico_free(addr);
736
740 if(err != 0)
741 { padico_warning("Message \"Listen\" not arrived: %s\n", padico_rc_gettext(padico_rc)); }
743
744 return rc;
745}
746
748{
749 const char*s_uuid = puk_parse_getattr(e, "Uuid");
750 const char*s_idl = puk_parse_getattr(e, "Idl");
751 const char*s_port = puk_parse_getattr(e, "Port");
752 assert(s_idl && s_uuid && s_port);
753
754 // Get Status
755 int idl = atoi(s_idl);
756 int port = atoi(s_port);
757 struct vlink_fwd_specific_s*status = vlink_status_lookup(s_uuid, idl);
758
759 // Prepare adress
760 struct sockaddr*addr;
761 addr = padico_malloc(sizeof(struct sockaddr));
762 struct sockaddr_in*addr_in = (struct sockaddr_in*)addr;
763 addr_in->sin_family = AF_INET;
764 addr_in->sin_port = port;
766
767 // Connect
768 padico_out(30,"Connecting to Gateway(%p)...\n", addr);
769 padico_vsock_active_connect(status->vnode, addr, sizeof(struct sockaddr));
770 padico_free(addr);
771 padico_out(30,"Connected.\n");
772}
773
775{
776 const char*s_uuid = puk_parse_getattr(e, "Uuid");
777 const char*s_idl = puk_parse_getattr(e, "Idl");
778 const char*s_port = puk_parse_getattr(e, "Port");
779 assert(s_idl && s_uuid && s_port);
780
781 // Get status
783 if(gw_status == NULL)
785
786 // Instanciate the way to dest node
788 padico_ns_serial_selector(gw_status->from_gw->node, "default", puk_iface_VLink());
791
792 int rc = padico_vsock_create(gw_status->from_gw->vnode, AF_INET, SOCK_STREAM, 0);
793 if(rc != 0)
794 padico_warning("Create error.\n");
795
796 struct sockaddr*addr;
797 addr = padico_malloc(sizeof(struct sockaddr));
798 struct sockaddr_in*addr_in = (struct sockaddr_in*)addr;
799 addr_in->sin_family = AF_INET;
800 addr_in->sin_port = atoi(s_port);
802
803 padico_out(30,"Connecting to dest_node(%p)...\n", addr);
804 padico_vsock_active_connect(gw_status->from_gw->vnode, addr, sizeof(struct sockaddr));
805 padico_free(addr);
806 padico_out(30,"Connected.\n");
807}
808
810{
811 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
812 padico_print("SEND !\n");
816 vnode->status = status->vnode->status;
817}
818
820{
821 struct vlink_fwd_specific_s*status = vobs_fwd(vnode);
822 padico_print("RECV !\n");
826 vnode->status = status->vnode->status;
827}
828
assert(slab_size > 0)
struct ns_rulebucket_hash_entry_s * e
const const struct ns_rule_bucket_s * key
return NULL
Definition Shm.h:88
padico_topo_host_t const char * uuid
static char * buffer
static int done
Definition console-mod.c:49
puk_component_t padico_ns_serial_selector(padico_topo_node_t node, const char *profile, puk_iface_t iface)
static padico_req_t padico_control_send(padico_topo_node_t node, const char *cmd)
Send a blocking request on the control channel.
padico_req_id_t id
Definition PadicoTM.h:144
padico_rc_t padico_tm_req_wait(padico_req_t req)
void * arg
Definition PadicoTM.h:167
padico_rc_t rc
Definition PadicoTM.h:146
void padico_sockaddr_init(struct sockaddr_pa *addr, socklen_t *addrlen, int magic)
Definition topology.c:329
static padico_vaddr_t padico_vaddr_new(struct sockaddr *addr, socklen_t addrlen, int proto)
Definition Topology.h:474
padico_topo_node_t padico_topo_getlocalnode(void)
Definition topology.c:1891
#define PADICO_TOPO_UUID_SIZE
Definition Topology.h:73
padico_topo_host_t padico_topo_node_gethost(padico_topo_node_t node)
Get the host hosting a node.
Definition topology.c:1927
#define padico_sockaddr_payload(TYPE, ADDRESS)
Definition Topology.h:441
const struct in_addr * padico_topo_host_getaddr(padico_topo_host_t host)
Get the canonical IP address of a host.
Definition topology.c:1977
padico_topo_uuid_t padico_topo_node_getuuid(padico_topo_node_t node)
Get the UUID of a node.
Definition topology.c:1912
padico_topo_node_t padico_topo_getnodebyname(const char *nodename)
node lookup, by node name
Definition topology.c:2389
padico_topo_node_t padico_topo_getnodebyuuid(padico_topo_uuid_t uuid)
node lookup, by UUID
Definition topology.c:2407
#define AF_PADICO
Definition Topology.h:409
mx_request_t req
Definition psp-mx.c:103
padico_vnode_t vnode
Definition vlink-fwd.c:85
pthread_mutex_t * mutex
Definition vlink-fwd.c:88
pthread_cond_t * cond
Definition vlink-fwd.c:89
padico_topo_node_t node
Definition vlink-fwd.c:86
pthread_t thread
Definition vlink-fwd.c:90
int * condition
Definition vlink-fwd.c:87
char uuid[32+1]
Definition vlink-fwd.c:96
struct gw_half_s * from_gw
Definition vlink-fwd.c:98
struct gw_half_s * to_gw
Definition vlink-fwd.c:97
virtual node descriptor, common to any file type
Definition VLink-API.h:383
struct vobs_attr_binding_s binding
Definition VLink-API.h:400
struct vobs_attr_wbox_s wbox
Definition VLink-API.h:395
struct vobs_attr_socket_s socket
Definition VLink-API.h:398
struct vobs_attr_remote_s remote
Definition VLink-API.h:399
struct padico_vnode_content_t content
Definition VLink-API.h:392
struct vobs_attr_rbox_s rbox
Definition VLink-API.h:394
struct vobs_attr_listener_s listener
Definition VLink-API.h:401
volatile struct vobs_attr_status_s status
Definition VLink-API.h:393
struct gw_half_s * write
Definition vlink-fwd.c:310
struct gw_half_s * read
Definition vlink-fwd.c:309
Node UUID, in plain text (hex encoding)
socklen_t primary_len
Definition VLink-API.h:212
struct sockaddr * primary
Definition VLink-API.h:211
padico_vnode_queue_t backlog
incoming connections queue.
Definition VLink-API.h:223
ssize_t read_posted
Definition VLink-API.h:243
unsigned established
Definition VLink-API.h:234
struct sockaddr * remote_addr
Definition VLink-API.h:232
int so_protocol
specific protocol
Definition VLink-API.h:204
int so_type
protocol type (SOCK_STREAM, SOCK_DGRAM,...)
Definition VLink-API.h:203
int so_family
network family (AF_INET,...)
Definition VLink-API.h:202
unsigned readable
immediate 'read' will not block
Definition VLink-API.h:155
unsigned connecting
we are in the connection phase
Definition VLink-API.h:158
ssize_t write_posted
Definition VLink-API.h:256
void * write_buffer
Definition VLink-API.h:258
static int port
Definition vrp-test.c:15