diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-04-05 11:59:03 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-04-05 11:59:03 +0000 |
commit | c4dec31821271d83e8895de9df11beaeb7154266 (patch) | |
tree | b32577e58b9a20ce977349fd4b432f2d7555960a /src/mesh/mesh.h | |
parent | e8b673fb299c01668f6c0ed4a4af3d2781d3895e (diff) | |
download | gnunet-c4dec31821271d83e8895de9df11beaeb7154266.tar.gz gnunet-c4dec31821271d83e8895de9df11beaeb7154266.zip |
Added local mesh messages
Diffstat (limited to 'src/mesh/mesh.h')
-rw-r--r-- | src/mesh/mesh.h | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/src/mesh/mesh.h b/src/mesh/mesh.h index dda3e2fcc..5d404c88d 100644 --- a/src/mesh/mesh.h +++ b/src/mesh/mesh.h | |||
@@ -21,14 +21,13 @@ | |||
21 | /** | 21 | /** |
22 | * @author Bartlomiej Polot | 22 | * @author Bartlomiej Polot |
23 | * @file mesh/mesh.h | 23 | * @file mesh/mesh.h |
24 | * | ||
25 | * TODO: | ||
26 | * - API messages! | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | #ifndef MESH_H_ | 26 | #ifndef MESH_H_ |
30 | #define MESH_H_ | 27 | #define MESH_H_ |
31 | #include <stdint.h> | 28 | #include <stdint.h> |
29 | |||
30 | #include <gnunet_mesh_service.h> | ||
32 | #include "gnunet_common.h" | 31 | #include "gnunet_common.h" |
33 | 32 | ||
34 | /******************************************************************************/ | 33 | /******************************************************************************/ |
@@ -36,38 +35,30 @@ | |||
36 | /******************************************************************************/ | 35 | /******************************************************************************/ |
37 | /* API CALL MESSAGE USED | 36 | /* API CALL MESSAGE USED |
38 | * -------- ------------ | 37 | * -------- ------------ |
39 | * connect GNUNET_MESH_Connect / Server_connect? FIXME | 38 | * connect GNUNET_MESH_Connect |
40 | * disconnect GNUNET_MESH_Disconnect / Server_disconnect? FIXME | 39 | * disconnect Server_disconnect |
41 | * | 40 | * |
42 | * peer_request_connect_any GNUNET_MESH_ConnectPeer | 41 | * peer_request_connect_any GNUNET_MESH_ConnectPeer |
43 | * peer_request_connect_all GNUNET_MESH_ConnectPeer | 42 | * peer_request_connect_all GNUNET_MESH_ConnectPeer |
44 | * peer_request_connect_add GNUNET_MESH_ConnectPeer | 43 | * peer_request_connect_add GNUNET_MESH_ConnectPeer |
45 | * peer_request_connect_del GNUNET_MESH_ConnectPeer | 44 | * peer_request_connect_del GNUNET_MESH_ConnectPeer |
46 | * peer_request_connect_by_type GNUNET_MESH_ConnectPeerByType | 45 | * peer_request_connect_by_type GNUNET_MESH_ConnectPeerByType |
47 | * peer_request_connect_cancel GNUNET_MESH_Control | 46 | * peer_request_connect_cancel GNUNET_MESH_Control |
48 | * | 47 | * |
49 | * notify_tranmit_ready GNUNET_MESH_Control? FIXME | 48 | * notify_transmit_ready GNUNET_MESH_Control |
50 | * notify_tranmit_ready_cancel GNUNET_MESH_Control? FIXME | 49 | * notify_transmit_ready_cancel None |
51 | */ | 50 | */ |
52 | 51 | ||
53 | // struct GNUNET_MESH_Connect { | 52 | struct GNUNET_MESH_Connect { |
54 | // /** | 53 | /** |
55 | // * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT | 54 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT |
56 | // * | 55 | * |
57 | // * Size: sizeof(struct GNUNET_MESH_Connect) + messages_subscribed * sizeof (message_type) | 56 | * Size: sizeof(struct GNUNET_MESH_Connect) + messages_subscribed * sizeof (message_type) |
58 | // */ | 57 | */ |
59 | // struct GNUNET_MessageHeader header; | 58 | struct GNUNET_MessageHeader header; |
60 | // | 59 | |
61 | // /* uint16_t messages_subscribed[] */ | 60 | /* uint16_t messages_subscribed[] */ |
62 | // }; | 61 | }; |
63 | // | ||
64 | // struct GNUNET_MESH_Disconnect { | ||
65 | // /** | ||
66 | // * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_DISCONNECT | ||
67 | // */ | ||
68 | // struct GNUNET_MessageHeader header; | ||
69 | // | ||
70 | // }; | ||
71 | 62 | ||
72 | struct GNUNET_MESH_ConnectPeer { | 63 | struct GNUNET_MESH_ConnectPeer { |
73 | /** | 64 | /** |
@@ -86,19 +77,19 @@ struct GNUNET_MESH_ConnectPeerByType { | |||
86 | */ | 77 | */ |
87 | struct GNUNET_MessageHeader header; | 78 | struct GNUNET_MessageHeader header; |
88 | 79 | ||
89 | /* FIXME Type specification */ | 80 | /* Type specification */ |
90 | uint32_t type; | 81 | GNUNET_MESH_ApplicationType type; |
91 | }; | 82 | }; |
92 | 83 | ||
93 | struct GNUNET_MESH_Control { | 84 | struct GNUNET_MESH_Control { |
94 | /** | 85 | /** |
95 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_CANCEL | 86 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_CONNECT_PEER_CANCEL |
96 | * more? transmit_ready? | 87 | * GNUNET_MESSAGE_TYPE_MESH_LOCAL_TRANSMIT_READY |
97 | */ | 88 | */ |
98 | struct GNUNET_MessageHeader header; | 89 | struct GNUNET_MessageHeader header; |
99 | 90 | ||
100 | uint32_t tunnel_id GNUNET_PACKED; | 91 | uint32_t tunnel_id GNUNET_PACKED; |
101 | uint32_t variable GNUNET_PACKED; /* Size of data to transmit? */ | 92 | uint32_t variable GNUNET_PACKED; /* Size of data / connection ID */ |
102 | }; | 93 | }; |
103 | 94 | ||
104 | struct GNUNET_MESH_TunnelEvent { | 95 | struct GNUNET_MESH_TunnelEvent { |
@@ -121,11 +112,22 @@ struct GNUNET_MESH_Data { | |||
121 | 112 | ||
122 | uint32_t tunnel_id GNUNET_PACKED; | 113 | uint32_t tunnel_id GNUNET_PACKED; |
123 | 114 | ||
124 | /* FIXME: Broadcast? New Type / NULL destination ? */ | ||
125 | /* FIXME: Reverese order for alignment? 1st ID, 2nd t_id? */ | ||
126 | struct GNUNET_PeerIdentity destination GNUNET_PACKED; | 115 | struct GNUNET_PeerIdentity destination GNUNET_PACKED; |
127 | 116 | ||
128 | /* uint8_t data[] */ | 117 | /* uint8_t data[] */ |
129 | }; | 118 | }; |
130 | 119 | ||
120 | struct GNUNET_MESH_DataBroadcast { | ||
121 | /** | ||
122 | * Type: GNUNET_MESSAGE_TYPE_MESH_LOCAL_DATA_BROADCAST | ||
123 | * | ||
124 | * Size: sizeof(struct GNUNET_MESH_DataBroadcast) + sizeof (data) | ||
125 | */ | ||
126 | struct GNUNET_MessageHeader header; | ||
127 | |||
128 | uint32_t tunnel_id GNUNET_PACKED; | ||
129 | |||
130 | /* uint8_t data[] */ | ||
131 | }; | ||
132 | |||
131 | #endif | 133 | #endif |