diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-03 11:59:41 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-03 11:59:41 +0000 |
commit | b1181407c587a10e4e42318e6189876d4587eca4 (patch) | |
tree | 643e45cb5ced2b96372fc233944e1720f1cceeae /src/conversation | |
parent | 5b32925c7b708c8f63645387d1e85d023481ec0a (diff) | |
download | gnunet-b1181407c587a10e4e42318e6189876d4587eca4.tar.gz gnunet-b1181407c587a10e4e42318e6189876d4587eca4.zip |
-ipc message design
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/conversation.h | 224 |
1 files changed, 223 insertions, 1 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h index 12a62c1f7..f15c48b9a 100644 --- a/src/conversation/conversation.h +++ b/src/conversation/conversation.h | |||
@@ -386,9 +386,10 @@ struct TestMessage | |||
386 | struct GNUNET_MessageHeader header; | 386 | struct GNUNET_MessageHeader header; |
387 | }; | 387 | }; |
388 | 388 | ||
389 | //////////////////////////////////////////////////////////// | ||
389 | 390 | ||
390 | /** | 391 | /** |
391 | * Message to transmit the audio | 392 | * Message to transmit the audio (between client and helpers). |
392 | */ | 393 | */ |
393 | struct AudioMessage | 394 | struct AudioMessage |
394 | { | 395 | { |
@@ -402,6 +403,227 @@ struct AudioMessage | |||
402 | }; | 403 | }; |
403 | 404 | ||
404 | 405 | ||
406 | /** | ||
407 | * Client -> Service message to register a phone. | ||
408 | */ | ||
409 | struct ClientPhoneRegisterMessage | ||
410 | { | ||
411 | /** | ||
412 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER | ||
413 | */ | ||
414 | struct GNUNET_MessageHeader header; | ||
415 | |||
416 | /** | ||
417 | * Phone line to register. | ||
418 | */ | ||
419 | uint32_t line GNUNET_PACKED; | ||
420 | }; | ||
421 | |||
422 | |||
423 | /** | ||
424 | * Service -> Client message for phone is ringing. | ||
425 | */ | ||
426 | struct ClientPhoneRingMessage | ||
427 | { | ||
428 | /** | ||
429 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING | ||
430 | */ | ||
431 | struct GNUNET_MessageHeader header; | ||
432 | |||
433 | /** | ||
434 | * Always zero. | ||
435 | */ | ||
436 | uint32_t reserved GNUNET_PACKED; | ||
437 | |||
438 | /** | ||
439 | * Who is calling us? | ||
440 | */ | ||
441 | struct GNUNET_CRYPTO_EccPublicSignKey caller_id; | ||
442 | |||
443 | }; | ||
444 | |||
445 | |||
446 | /** | ||
447 | * Client -> Service pick up phone that is ringing. | ||
448 | */ | ||
449 | struct ClientPhonePickupMessage | ||
450 | { | ||
451 | /** | ||
452 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP | ||
453 | */ | ||
454 | struct GNUNET_MessageHeader header; | ||
455 | |||
456 | /* followed by variable length 0-terminated string with meta data */ | ||
457 | |||
458 | }; | ||
459 | |||
460 | |||
461 | /** | ||
462 | * Client -> Service hang up phone that may or may not be ringing. | ||
463 | * Also sent in response to a (failed) `struct ClientCallMessage`. | ||
464 | */ | ||
465 | struct ClientPhoneHangupMessage | ||
466 | { | ||
467 | /** | ||
468 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP | ||
469 | */ | ||
470 | struct GNUNET_MessageHeader header; | ||
471 | |||
472 | /* followed by variable length 0-terminated string with meta data */ | ||
473 | |||
474 | }; | ||
475 | |||
476 | |||
477 | /** | ||
478 | * Message Client <->Service to transmit the audio. | ||
479 | */ | ||
480 | struct ClientAudioMessage | ||
481 | { | ||
482 | /** | ||
483 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO | ||
484 | */ | ||
485 | struct GNUNET_MessageHeader header; | ||
486 | |||
487 | /* followed by audio data */ | ||
488 | |||
489 | }; | ||
490 | |||
491 | |||
492 | /** | ||
493 | * Client -> Service message to call a phone. | ||
494 | */ | ||
495 | struct ClientCallMessage | ||
496 | { | ||
497 | /** | ||
498 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_REGISTER | ||
499 | */ | ||
500 | struct GNUNET_MessageHeader header; | ||
501 | |||
502 | /** | ||
503 | * Which phone line to call at the peer? | ||
504 | */ | ||
505 | uint32_t line GNUNET_PACKED; | ||
506 | |||
507 | /** | ||
508 | * Which peer is hosting the line? | ||
509 | */ | ||
510 | struct GNUNET_PeerIdentity target; | ||
511 | |||
512 | /** | ||
513 | * Identity of the caller. | ||
514 | */ | ||
515 | struct GNUNET_CRYPTO_EccPrivateKey caller_id; | ||
516 | }; | ||
517 | |||
518 | |||
519 | /** | ||
520 | * Service -> Client: other peer has picked up the phone, we are | ||
521 | * now talking. | ||
522 | */ | ||
523 | struct ClientPhoneHangupMessage | ||
524 | { | ||
525 | /** | ||
526 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_ESTABLISHED | ||
527 | */ | ||
528 | struct GNUNET_MessageHeader header; | ||
529 | |||
530 | /* followed by variable length 0-terminated string with meta data */ | ||
531 | |||
532 | }; | ||
533 | |||
534 | |||
535 | /** | ||
536 | * Mesh message for phone is ringing. | ||
537 | */ | ||
538 | struct MeshPhoneRingMessage | ||
539 | { | ||
540 | /** | ||
541 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING | ||
542 | */ | ||
543 | struct GNUNET_MessageHeader header; | ||
544 | |||
545 | /** | ||
546 | * Desired target line. | ||
547 | */ | ||
548 | uint32_t line GNUNET_PACKED; | ||
549 | |||
550 | /** | ||
551 | * Purpose for the signature. | ||
552 | */ | ||
553 | struct GNUNET_CRYPTO_EccSignaturePurpose purpose; | ||
554 | |||
555 | /** | ||
556 | * Who is calling us? (also who is signing). | ||
557 | */ | ||
558 | struct GNUNET_CRYPTO_EccPublicSignKey caller_id; | ||
559 | |||
560 | /** | ||
561 | * Who are we calling? | ||
562 | */ | ||
563 | struct GNUNET_PeerIdentity target; | ||
564 | |||
565 | /** | ||
566 | * From where are we calling? | ||
567 | */ | ||
568 | struct GNUNET_PeerIdentity source; | ||
569 | |||
570 | /** | ||
571 | * When does the signature expire? | ||
572 | */ | ||
573 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | ||
574 | |||
575 | /** | ||
576 | * Signature on the above. | ||
577 | */ | ||
578 | struct GNUNET_CRYPTO_EccSignature signature; | ||
579 | |||
580 | }; | ||
581 | |||
582 | |||
583 | /** | ||
584 | * Mesh message for hanging up. | ||
585 | */ | ||
586 | struct MeshPhoneHangupMessage | ||
587 | { | ||
588 | /** | ||
589 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP | ||
590 | */ | ||
591 | struct GNUNET_MessageHeader header; | ||
592 | |||
593 | /* followed by variable-size 0-terminated reason string */ | ||
594 | }; | ||
595 | |||
596 | |||
597 | /** | ||
598 | * Mesh message for picking up. | ||
599 | */ | ||
600 | struct MeshPhonePickupMessage | ||
601 | { | ||
602 | /** | ||
603 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP | ||
604 | */ | ||
605 | struct GNUNET_MessageHeader header; | ||
606 | |||
607 | /* followed by variable-size 0-terminated metadata string */ | ||
608 | }; | ||
609 | |||
610 | |||
611 | /** | ||
612 | * Mesh message to transmit the audio. | ||
613 | */ | ||
614 | struct MeshAudioMessage | ||
615 | { | ||
616 | /** | ||
617 | * Type is #GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO | ||
618 | */ | ||
619 | struct GNUNET_MessageHeader header; | ||
620 | |||
621 | /* followed by audio data */ | ||
622 | |||
623 | }; | ||
624 | |||
625 | |||
626 | |||
405 | #if 0 /* keep Emacsens' auto-indent happy */ | 627 | #if 0 /* keep Emacsens' auto-indent happy */ |
406 | { | 628 | { |
407 | #endif | 629 | #endif |