diff options
Diffstat (limited to 'src/cadet/cadet.h')
-rw-r--r-- | src/cadet/cadet.h | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/src/cadet/cadet.h b/src/cadet/cadet.h index df0f02a22..61388bb15 100644 --- a/src/cadet/cadet.h +++ b/src/cadet/cadet.h | |||
@@ -63,22 +63,24 @@ extern "C" | |||
63 | 63 | ||
64 | GNUNET_NETWORK_STRUCT_BEGIN | 64 | GNUNET_NETWORK_STRUCT_BEGIN |
65 | 65 | ||
66 | |||
66 | /** | 67 | /** |
67 | * Message for a client to register to the service | 68 | * Message for a client to create and destroy channels. |
68 | */ | 69 | */ |
69 | struct GNUNET_CADET_ClientConnect | 70 | struct GNUNET_CADET_PortMessage |
70 | { | 71 | { |
71 | /** | 72 | /** |
72 | * Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_CONNECT | 73 | * Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_PORT_[OPEN|CLOSE] |
73 | * | 74 | * |
74 | * Size: sizeof(struct GNUNET_CADET_ClientConnect) + | 75 | * Size: sizeof(struct GNUNET_CADET_ChannelMessage) |
75 | * sizeof(CADET_ApplicationType) * applications + | ||
76 | * sizeof(uint16_t) * types | ||
77 | */ | 76 | */ |
78 | struct GNUNET_MessageHeader header; | 77 | struct GNUNET_MessageHeader header; |
79 | /* uint32_t list_ports[] */ | ||
80 | }; | ||
81 | 78 | ||
79 | /** | ||
80 | * Port to open/close. | ||
81 | */ | ||
82 | struct GNUNET_HashCode port GNUNET_PACKED; | ||
83 | }; | ||
82 | 84 | ||
83 | /** | 85 | /** |
84 | * Type for channel numbering. | 86 | * Type for channel numbering. |
@@ -90,14 +92,14 @@ typedef uint32_t CADET_ChannelNumber; | |||
90 | 92 | ||
91 | 93 | ||
92 | /** | 94 | /** |
93 | * Message for a client to create and destroy channels. | 95 | * Message for a client to create channels. |
94 | */ | 96 | */ |
95 | struct GNUNET_CADET_ChannelMessage | 97 | struct GNUNET_CADET_ChannelCreateMessage |
96 | { | 98 | { |
97 | /** | 99 | /** |
98 | * Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_[CREATE|DESTROY] | 100 | * Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_CREATE |
99 | * | 101 | * |
100 | * Size: sizeof(struct GNUNET_CADET_ChannelMessage) | 102 | * Size: sizeof(struct GNUNET_CADET_ChannelCreateMessage) |
101 | */ | 103 | */ |
102 | struct GNUNET_MessageHeader header; | 104 | struct GNUNET_MessageHeader header; |
103 | 105 | ||
@@ -114,7 +116,7 @@ struct GNUNET_CADET_ChannelMessage | |||
114 | /** | 116 | /** |
115 | * Port of the channel. | 117 | * Port of the channel. |
116 | */ | 118 | */ |
117 | uint32_t port GNUNET_PACKED; | 119 | struct GNUNET_HashCode port; |
118 | 120 | ||
119 | /** | 121 | /** |
120 | * Options. | 122 | * Options. |
@@ -124,6 +126,25 @@ struct GNUNET_CADET_ChannelMessage | |||
124 | 126 | ||
125 | 127 | ||
126 | /** | 128 | /** |
129 | * Message for a client to destroy channels. | ||
130 | */ | ||
131 | struct GNUNET_CADET_ChannelDestroyMessage | ||
132 | { | ||
133 | /** | ||
134 | * Type: GNUNET_MESSAGE_TYPE_CADET_LOCAL_TUNNEL_DESTROY | ||
135 | * | ||
136 | * Size: sizeof(struct GNUNET_CADET_ChannelDestroyMessage) | ||
137 | */ | ||
138 | struct GNUNET_MessageHeader header; | ||
139 | |||
140 | /** | ||
141 | * ID of a channel controlled by this client. | ||
142 | */ | ||
143 | CADET_ChannelNumber channel_id GNUNET_PACKED; | ||
144 | }; | ||
145 | |||
146 | |||
147 | /** | ||
127 | * Message for cadet data traffic. | 148 | * Message for cadet data traffic. |
128 | */ | 149 | */ |
129 | struct GNUNET_CADET_LocalData | 150 | struct GNUNET_CADET_LocalData |
@@ -262,7 +283,6 @@ struct GNUNET_CADET_LocalInfoTunnel | |||
262 | GNUNET_NETWORK_STRUCT_END | 283 | GNUNET_NETWORK_STRUCT_END |
263 | 284 | ||
264 | 285 | ||
265 | |||
266 | /** | 286 | /** |
267 | * @brief Translate a fwd variable into a string representation, for logging. | 287 | * @brief Translate a fwd variable into a string representation, for logging. |
268 | * | 288 | * |