aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/mesh.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-03-11 16:58:27 +0000
committerChristian Grothoff <christian@grothoff.org>2011-03-11 16:58:27 +0000
commit562b33143ee9fa431a68ea6741e4feb3ba388f83 (patch)
tree6318eb2c56ff76730708a4791804842c63cf1f81 /src/mesh/mesh.h
parent64821d4ae43b03b30de3dd136137598c0d5a2ab2 (diff)
downloadgnunet-562b33143ee9fa431a68ea6741e4feb3ba388f83.tar.gz
gnunet-562b33143ee9fa431a68ea6741e4feb3ba388f83.zip
changing heap remove node api to not pass heap; more fs hacking
Diffstat (limited to 'src/mesh/mesh.h')
-rw-r--r--src/mesh/mesh.h130
1 files changed, 99 insertions, 31 deletions
diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h
index 085f3ef4d..e51b0c890 100644
--- a/src/mesh/mesh.h
+++ b/src/mesh/mesh.h
@@ -21,6 +21,15 @@
21/** 21/**
22 * @author Bartlomiej Polot 22 * @author Bartlomiej Polot
23 * @file mesh/mesh.h 23 * @file mesh/mesh.h
24 *
25 * TODO:
26 * - soft stateing (keep-alive (CHANGE?) / timeout / disconnect) -- not a message issue
27 * - error reporting (CREATE/CHANGE/ADD/DEL?) -- new message!
28 * - partial disconnect reporting -- same as error reporting?
29 * - add vs create? change vs. keep-alive? same msg or different ones? -- thinking...
30 * - speed requirement specification (change?) in mesh API -- API call
31 *
32 * - API messages!
24 */ 33 */
25 34
26 35
@@ -35,67 +44,130 @@
35struct GNUNET_MESH_ManipulatePath 44struct GNUNET_MESH_ManipulatePath
36{ 45{
37 /** 46 /**
38 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD] 47 * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD|DEL]
48 *
49 * Size: sizeof(struct GNUNET_MESH_ManipulatePath) + path_length * sizeof (struct GNUNET_PeerIdentity)
39 */ 50 */
40 struct GNUNET_MessageHeader header; 51 struct GNUNET_MessageHeader header;
41 52
42 /** 53 /**
43 * Id of the tunnel this path belongs to 54 * Id of the tunnel this path belongs to, unique in conjunction with the origin.
44 */ 55 */
45 uint32_t tid; 56 uint32_t tid GNUNET_PACKED;
46 57
47 /** 58 /**
48 * Information about speed requirements 59 * Information about speed requirements. If the tunnel cannot sustain the
60 * minimum bandwidth, packets are to be dropped.
49 */ 61 */
50 uint32_t speed_min; 62 uint32_t speed_min GNUNET_PACKED;
51 uint32_t speed_max;
52 63
53 /** 64 /**
54 * Number of hops in the path given below 65 * path_length structs defining the *whole* path from the origin [0] to the
66 * final destination [path_length-1].
55 */ 67 */
56 uint16_t path_length; 68 // struct GNUNET_PeerIdentity peers[path_length];
69};
57 70
71/**
72 * Message for mesh data traffic to all tunnel targets.
73 */
74struct GNUNET_MESH_OriginMulticast
75{
58 /** 76 /**
59 * path_length structs defining the *whole* path 77 * Type: GNUNET_MESSAGE_TYPE_DATA_MULTICAST
78 */
79 struct GNUNET_MessageHeader header;
80
81 /**
82 * TID of the tunnel
83 */
84 uint32_t tid GNUNET_PACKED;
85
86 /**
87 * OID of the tunnel
88 */
89 struct GNUNET_PeerIdentity oid;
90
91 /**
92 * FIXME: Some form of authentication
93 */
94 // uint32_t token;
95
96 /**
97 * Payload follows
60 */ 98 */
61 struct GNUNET_PeerIdentity peers[];
62}; 99};
63 100
101
64/** 102/**
65 * Message for mesh data traffic 103 * Message for mesh data traffic to a particular destination from origin.
66 */ 104 */
67struct GNUNET_MESH_Data 105struct GNUNET_MESH_DataMessageFromOrigin
68{ 106{
69 /** 107 /**
70 * Type: GNUNET_MESSAGE_TYPE_DATA_[GO|BACK] 108 * Type: GNUNET_MESSAGE_TYPE_DATA_MESSAGE_FROM_ORIGIN
71 */ 109 */
72 struct GNUNET_MessageHeader header; 110 struct GNUNET_MessageHeader header;
73 111
74 /** 112 /**
113 * TID of the tunnel
114 */
115 uint32_t tid GNUNET_PACKED;
116
117 /**
75 * OID of the tunnel 118 * OID of the tunnel
76 */ 119 */
77 struct GNUNET_PeerIdentity oid; 120 struct GNUNET_PeerIdentity oid;
78 121
79 /** 122 /**
123 * Destination.
124 */
125 struct GNUNET_PeerIdentity destination;
126
127 /**
128 * FIXME: Some form of authentication
129 */
130 // uint32_t token;
131
132 /**
133 * Payload follows
134 */
135};
136
137
138/**
139 * Message for mesh data traffic from a tunnel participant to origin.
140 */
141struct GNUNET_MESH_DataMessageToOrigin
142{
143 /**
144 * Type: GNUNET_MESSAGE_TYPE_DATA_MESSAGE_TO_ORIGIN
145 */
146 struct GNUNET_MessageHeader header;
147
148 /**
80 * TID of the tunnel 149 * TID of the tunnel
81 */ 150 */
82 uint32_t tid; 151 uint32_t tid GNUNET_PACKED;
83 152
84 /** 153 /**
85 * FIXME Some form of authentication 154 * OID of the tunnel
86 */ 155 */
87 uint32_t token; 156 struct GNUNET_PeerIdentity oid;
88 157
89 /** 158 /**
90 * Size of payload 159 * Sender of the message.
91 * FIXME uint16 enough?
92 */ 160 */
93 uint16_t size; 161 struct GNUNET_PeerIdentity sender;
94 162
95 /** 163 /**
96 * Payload 164 * FIXME: Some form of authentication
165 */
166 // uint32_t token;
167
168 /**
169 * Payload follows
97 */ 170 */
98 uint8_t data[];
99}; 171};
100 172
101/** 173/**
@@ -109,24 +181,20 @@ struct GNUNET_MESH_SpeedNotify
109 struct GNUNET_MessageHeader header; 181 struct GNUNET_MessageHeader header;
110 182
111 /** 183 /**
112 * OID of the tunnel 184 * TID of the tunnel
113 */ 185 */
114 struct GNUNET_PeerIdentity oid; 186 uint32_t tid GNUNET_PACKED;
115 187
116 /** 188 /**
117 * TID of the tunnel 189 * OID of the tunnel
118 */ 190 */
119 uint32_t tid; 191 struct GNUNET_PeerIdentity oid;
120 192
121 /** 193 /**
122 * Slowest link down the path 194 * Slowest link down the path (above minimum speed requirement).
123 */ 195 */
124 uint32_t speed_min; 196 uint32_t speed_min;
125 197
126 /**
127 * Fastest link down the path
128 */
129 uint32_t speed_max;
130}; 198};
131 199
132#endif \ No newline at end of file 200#endif