aboutsummaryrefslogtreecommitdiff
path: root/src/transport/transport.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/transport.h')
-rw-r--r--src/transport/transport.h257
1 files changed, 257 insertions, 0 deletions
diff --git a/src/transport/transport.h b/src/transport/transport.h
index 75726e462..e68536bcc 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -644,6 +644,263 @@ struct TransportPluginMonitorMessage
644}; 644};
645 645
646 646
647
648
649
650
651
652
653
654/* *********************** TNG messages ***************** */
655
656/**
657 * Add address to the list.
658 */
659struct GNUNET_TRANSPORT_AddAddressMessage
660{
661
662 /**
663 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_ADDRESS.
664 */
665 struct GNUNET_MessageHeader header;
666
667 /**
668 * Address identifier (used during deletion).
669 */
670 uint32_t aid GNUNET_PACKED;
671
672 /**
673 * When does the address expire?
674 */
675 struct GNUNET_TIME_RelativeNBO expiration;
676
677 /**
678 * An `enum GNUNET_ATS_Network_Type` in NBO.
679 */
680 uint32_t nt;
681
682 /* followed by UTF-8 encoded, 0-terminated human-readable address */
683};
684
685
686/**
687 * Remove address from the list.
688 */
689struct GNUNET_TRANSPORT_DelAddressMessage
690{
691
692 /**
693 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_ADDRESS.
694 */
695 struct GNUNET_MessageHeader header;
696
697 /**
698 * Address identifier.
699 */
700 uint32_t aid GNUNET_PACKED;
701
702};
703
704
705/**
706 * Inform transport about an incoming message.
707 */
708struct GNUNET_TRANSPORT_IncomingMessage
709{
710
711 /**
712 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG.
713 */
714 struct GNUNET_MessageHeader header;
715
716 /**
717 * Do we use flow control or not?
718 */
719 uint32_t fc_on GNUNET_PACKED;
720
721 /**
722 * 64-bit number to identify the matching ACK.
723 */
724 uint64_t fc_id GNUNET_PACKED;
725
726 /**
727 * Sender identifier.
728 */
729 struct GNUNET_PeerIdentity sender;
730
731 /* followed by the message */
732};
733
734
735/**
736 * Transport informs us about being done with an incoming message.
737 * (only sent if fc_on was set).
738 */
739struct GNUNET_TRANSPORT_IncomingMessageAck
740{
741
742 /**
743 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_INCOMING_MSG_ACK.
744 */
745 struct GNUNET_MessageHeader header;
746
747 /**
748 * Reserved (0)
749 */
750 uint32_t reserved GNUNET_PACKED;
751
752 /**
753 * Which message is being ACKed?
754 */
755 uint64_t fc_id GNUNET_PACKED;
756
757 /**
758 * Sender identifier of the original message.
759 */
760 struct GNUNET_PeerIdentity sender;
761
762};
763
764
765/**
766 * Add queue to the transport
767 */
768struct GNUNET_TRANSPORT_AddQueueMessage
769{
770
771 /**
772 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_QUEUE.
773 */
774 struct GNUNET_MessageHeader header;
775
776 /**
777 * Queue identifier (used to identify the queue).
778 */
779 uint32_t qid GNUNET_PACKED;
780
781 /**
782 * Receiver that can be addressed via the queue.
783 */
784 struct GNUNET_PeerIdentity receiver;
785
786 /**
787 * An `enum GNUNET_ATS_Network_Type` in NBO.
788 */
789 uint32_t nt;
790
791 /* followed by UTF-8 encoded, 0-terminated human-readable address */
792};
793
794
795/**
796 * Remove queue, it is no longer available.
797 */
798struct GNUNET_TRANSPORT_DelQueueMessage
799{
800
801 /**
802 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_QUEUE.
803 */
804 struct GNUNET_MessageHeader header;
805
806 /**
807 * Address identifier.
808 */
809 uint32_t qid GNUNET_PACKED;
810
811 /**
812 * Receiver that can be addressed via the queue.
813 */
814 struct GNUNET_PeerIdentity receiver;
815
816};
817
818
819/**
820 * Transport tells communicator that it wants a new queue.
821 */
822struct GNUNET_TRANSPORT_CreateQueue
823{
824
825 /**
826 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE.
827 */
828 struct GNUNET_MessageHeader header;
829
830 /**
831 * Always zero.
832 */
833 uint32_t reserved GNUNET_PACKED;
834
835 /**
836 * Receiver that can be addressed via the queue.
837 */
838 struct GNUNET_PeerIdentity receiver;
839
840 /* followed by UTF-8 encoded, 0-terminated human-readable address */
841};
842
843
844/**
845 * Inform communicator about transport's desire to send a message.
846 */
847struct GNUNET_TRANSPORT_SendMessageTo
848{
849
850 /**
851 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG.
852 */
853 struct GNUNET_MessageHeader header;
854
855 /**
856 * Which queue should we use?
857 */
858 uint32_t qid GNUNET_PACKED;
859
860 /**
861 * Message ID, used for flow control.
862 */
863 uint64_t mid GNUNET_PACKED;
864
865 /**
866 * Receiver identifier.
867 */
868 struct GNUNET_PeerIdentity receiver;
869
870 /* followed by the message */
871};
872
873
874/**
875 * Inform transport that message was sent.
876 */
877struct GNUNET_TRANSPORT_SendMessageToAck
878{
879
880 /**
881 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_SEND_MSG_ACK.
882 */
883 struct GNUNET_MessageHeader header;
884
885 /**
886 * Success (#GNUNET_OK), failure (#GNUNET_SYSERR).
887 */
888 uint32_t status GNUNET_PACKED;
889
890 /**
891 * Message ID of the original message.
892 */
893 uint64_t mid GNUNET_PACKED;
894
895 /**
896 * Receiver identifier.
897 */
898 struct GNUNET_PeerIdentity receiver;
899
900};
901
902
903
647GNUNET_NETWORK_STRUCT_END 904GNUNET_NETWORK_STRUCT_END
648 905
649/* end of transport.h */ 906/* end of transport.h */