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.h161
1 files changed, 138 insertions, 23 deletions
diff --git a/src/transport/transport.h b/src/transport/transport.h
index e68536bcc..423d3cefa 100644
--- a/src/transport/transport.h
+++ b/src/transport/transport.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/ 17*/
@@ -94,7 +94,7 @@ struct StartMessage
94 94
95 /** 95 /**
96 * 0: no options 96 * 0: no options
97 * 1: The 'self' field should be checked 97 * 1: The @e self field should be checked
98 * 2: this client is interested in payload traffic 98 * 2: this client is interested in payload traffic
99 */ 99 */
100 uint32_t options; 100 uint32_t options;
@@ -121,19 +121,14 @@ struct ConnectInfoMessage
121 struct GNUNET_MessageHeader header; 121 struct GNUNET_MessageHeader header;
122 122
123 /** 123 /**
124 * Identity of the new neighbour. 124 * Current outbound quota for this peer
125 */
126 struct GNUNET_PeerIdentity id;
127
128 /**
129 * Current inbound quota for this peer
130 */ 125 */
131 struct GNUNET_BANDWIDTH_Value32NBO quota_in; 126 struct GNUNET_BANDWIDTH_Value32NBO quota_out;
132 127
133 /** 128 /**
134 * Current outbound quota for this peer 129 * Identity of the new neighbour.
135 */ 130 */
136 struct GNUNET_BANDWIDTH_Value32NBO quota_out; 131 struct GNUNET_PeerIdentity id;
137}; 132};
138 133
139 134
@@ -404,6 +399,7 @@ struct ValidationIterateResponseMessage
404 struct GNUNET_TIME_AbsoluteNBO next_validation; 399 struct GNUNET_TIME_AbsoluteNBO next_validation;
405}; 400};
406 401
402
407/** 403/**
408 * Message from the library to the transport service 404 * Message from the library to the transport service
409 * asking for binary addresses known for a peer. 405 * asking for binary addresses known for a peer.
@@ -654,6 +650,22 @@ struct TransportPluginMonitorMessage
654/* *********************** TNG messages ***************** */ 650/* *********************** TNG messages ***************** */
655 651
656/** 652/**
653 * Communicator goes online. Note which addresses it can
654 * work with.
655 */
656struct GNUNET_TRANSPORT_CommunicatorAvailableMessage
657{
658
659 /**
660 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_NEW_COMMUNICATOR.
661 */
662 struct GNUNET_MessageHeader header;
663
664 /* Followed by the address prefix of the communicator */
665};
666
667
668/**
657 * Add address to the list. 669 * Add address to the list.
658 */ 670 */
659struct GNUNET_TRANSPORT_AddAddressMessage 671struct GNUNET_TRANSPORT_AddAddressMessage
@@ -678,7 +690,7 @@ struct GNUNET_TRANSPORT_AddAddressMessage
678 * An `enum GNUNET_ATS_Network_Type` in NBO. 690 * An `enum GNUNET_ATS_Network_Type` in NBO.
679 */ 691 */
680 uint32_t nt; 692 uint32_t nt;
681 693
682 /* followed by UTF-8 encoded, 0-terminated human-readable address */ 694 /* followed by UTF-8 encoded, 0-terminated human-readable address */
683}; 695};
684 696
@@ -717,12 +729,12 @@ struct GNUNET_TRANSPORT_IncomingMessage
717 * Do we use flow control or not? 729 * Do we use flow control or not?
718 */ 730 */
719 uint32_t fc_on GNUNET_PACKED; 731 uint32_t fc_on GNUNET_PACKED;
720 732
721 /** 733 /**
722 * 64-bit number to identify the matching ACK. 734 * 64-bit number to identify the matching ACK.
723 */ 735 */
724 uint64_t fc_id GNUNET_PACKED; 736 uint64_t fc_id GNUNET_PACKED;
725 737
726 /** 738 /**
727 * Sender identifier. 739 * Sender identifier.
728 */ 740 */
@@ -748,12 +760,12 @@ struct GNUNET_TRANSPORT_IncomingMessageAck
748 * Reserved (0) 760 * Reserved (0)
749 */ 761 */
750 uint32_t reserved GNUNET_PACKED; 762 uint32_t reserved GNUNET_PACKED;
751 763
752 /** 764 /**
753 * Which message is being ACKed? 765 * Which message is being ACKed?
754 */ 766 */
755 uint64_t fc_id GNUNET_PACKED; 767 uint64_t fc_id GNUNET_PACKED;
756 768
757 /** 769 /**
758 * Sender identifier of the original message. 770 * Sender identifier of the original message.
759 */ 771 */
@@ -769,7 +781,7 @@ struct GNUNET_TRANSPORT_AddQueueMessage
769{ 781{
770 782
771 /** 783 /**
772 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_ADD_QUEUE. 784 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_SETUP.
773 */ 785 */
774 struct GNUNET_MessageHeader header; 786 struct GNUNET_MessageHeader header;
775 787
@@ -787,7 +799,9 @@ struct GNUNET_TRANSPORT_AddQueueMessage
787 * An `enum GNUNET_ATS_Network_Type` in NBO. 799 * An `enum GNUNET_ATS_Network_Type` in NBO.
788 */ 800 */
789 uint32_t nt; 801 uint32_t nt;
790 802
803 // FIXME: add MTU?
804
791 /* followed by UTF-8 encoded, 0-terminated human-readable address */ 805 /* followed by UTF-8 encoded, 0-terminated human-readable address */
792}; 806};
793 807
@@ -799,7 +813,7 @@ struct GNUNET_TRANSPORT_DelQueueMessage
799{ 813{
800 814
801 /** 815 /**
802 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_DEL_QUEUE. 816 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_TEARDOWN.
803 */ 817 */
804 struct GNUNET_MessageHeader header; 818 struct GNUNET_MessageHeader header;
805 819
@@ -828,9 +842,9 @@ struct GNUNET_TRANSPORT_CreateQueue
828 struct GNUNET_MessageHeader header; 842 struct GNUNET_MessageHeader header;
829 843
830 /** 844 /**
831 * Always zero. 845 * Unique ID for the request.
832 */ 846 */
833 uint32_t reserved GNUNET_PACKED; 847 uint32_t request_id GNUNET_PACKED;
834 848
835 /** 849 /**
836 * Receiver that can be addressed via the queue. 850 * Receiver that can be addressed via the queue.
@@ -842,6 +856,24 @@ struct GNUNET_TRANSPORT_CreateQueue
842 856
843 857
844/** 858/**
859 * Transport tells communicator that it wants a new queue.
860 */
861struct GNUNET_TRANSPORT_CreateQueueResponse
862{
863
864 /**
865 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_OK or #GNUNET_MESSAGE_TYPE_TRANSPORT_QUEUE_CREATE_FAIL.
866 */
867 struct GNUNET_MessageHeader header;
868
869 /**
870 * Unique ID for the request.
871 */
872 uint32_t request_id GNUNET_PACKED;
873};
874
875
876/**
845 * Inform communicator about transport's desire to send a message. 877 * Inform communicator about transport's desire to send a message.
846 */ 878 */
847struct GNUNET_TRANSPORT_SendMessageTo 879struct GNUNET_TRANSPORT_SendMessageTo
@@ -861,7 +893,7 @@ struct GNUNET_TRANSPORT_SendMessageTo
861 * Message ID, used for flow control. 893 * Message ID, used for flow control.
862 */ 894 */
863 uint64_t mid GNUNET_PACKED; 895 uint64_t mid GNUNET_PACKED;
864 896
865 /** 897 /**
866 * Receiver identifier. 898 * Receiver identifier.
867 */ 899 */
@@ -891,7 +923,7 @@ struct GNUNET_TRANSPORT_SendMessageToAck
891 * Message ID of the original message. 923 * Message ID of the original message.
892 */ 924 */
893 uint64_t mid GNUNET_PACKED; 925 uint64_t mid GNUNET_PACKED;
894 926
895 /** 927 /**
896 * Receiver identifier. 928 * Receiver identifier.
897 */ 929 */
@@ -901,6 +933,89 @@ struct GNUNET_TRANSPORT_SendMessageToAck
901 933
902 934
903 935
936
937/**
938 * Request to start monitoring.
939 */
940struct GNUNET_TRANSPORT_MonitorStart
941{
942
943 /**
944 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_START.
945 */
946 struct GNUNET_MessageHeader header;
947
948 /**
949 * #GNUNET_YES for one-shot montoring, #GNUNET_NO for continuous monitoring.
950 */
951 uint32_t one_shot;
952
953 /**
954 * Target identifier to monitor, all zeros for "all peers".
955 */
956 struct GNUNET_PeerIdentity peer;
957
958};
959
960
961/**
962 * Monitoring data.
963 */
964struct GNUNET_TRANSPORT_MonitorData
965{
966
967 /**
968 * Type will be #GNUNET_MESSAGE_TYPE_TRANSPORT_MONITOR_DATA.
969 */
970 struct GNUNET_MessageHeader header;
971
972 /**
973 * Network type (an `enum GNUNET_ATS_Network_Type` in NBO).
974 */
975 uint32_t nt GNUNET_PACKED;
976
977 /**
978 * Target identifier.
979 */
980 struct GNUNET_PeerIdentity peer;
981
982 /**
983 * @deprecated To be discussed if we keep these...
984 */
985 struct GNUNET_TIME_AbsoluteNBO last_validation;
986 struct GNUNET_TIME_AbsoluteNBO valid_until;
987 struct GNUNET_TIME_AbsoluteNBO next_validation;
988
989 /**
990 * Current round-trip time estimate.
991 */
992 struct GNUNET_TIME_RelativeNBO rtt;
993
994 /**
995 * Is inbound (in NBO).
996 */
997 uint32_t is_inbound GNUNET_PACKED;
998
999 /**
1000 * Messages pending (in NBO).
1001 */
1002 uint32_t num_msg_pending GNUNET_PACKED;
1003
1004 /**
1005 * Bytes pending (in NBO).
1006 */
1007 uint32_t num_bytes_pending GNUNET_PACKED;
1008
1009 /* Followed by 0-terminated address of the peer
1010 (TODO: do we allow no address? If so,
1011 adjust transport_api2_monitor!) */
1012
1013};
1014
1015
1016
1017
1018
904GNUNET_NETWORK_STRUCT_END 1019GNUNET_NETWORK_STRUCT_END
905 1020
906/* end of transport.h */ 1021/* end of transport.h */