From 562b33143ee9fa431a68ea6741e4feb3ba388f83 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 11 Mar 2011 16:58:27 +0000 Subject: changing heap remove node api to not pass heap; more fs hacking --- src/mesh/mesh.h | 130 +++++++++++++++++++++++++++++++++++++++------------- src/mesh/mesh_api.c | 2 +- 2 files changed, 100 insertions(+), 32 deletions(-) (limited to 'src/mesh') 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 @@ /** * @author Bartlomiej Polot * @file mesh/mesh.h + * + * TODO: + * - soft stateing (keep-alive (CHANGE?) / timeout / disconnect) -- not a message issue + * - error reporting (CREATE/CHANGE/ADD/DEL?) -- new message! + * - partial disconnect reporting -- same as error reporting? + * - add vs create? change vs. keep-alive? same msg or different ones? -- thinking... + * - speed requirement specification (change?) in mesh API -- API call + * + * - API messages! */ @@ -35,67 +44,130 @@ struct GNUNET_MESH_ManipulatePath { /** - * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD] + * Type: GNUNET_MESSAGE_TYPE_MESH_PATH_[CREATE|CHANGE|ADD|DEL] + * + * Size: sizeof(struct GNUNET_MESH_ManipulatePath) + path_length * sizeof (struct GNUNET_PeerIdentity) */ struct GNUNET_MessageHeader header; /** - * Id of the tunnel this path belongs to + * Id of the tunnel this path belongs to, unique in conjunction with the origin. */ - uint32_t tid; + uint32_t tid GNUNET_PACKED; /** - * Information about speed requirements + * Information about speed requirements. If the tunnel cannot sustain the + * minimum bandwidth, packets are to be dropped. */ - uint32_t speed_min; - uint32_t speed_max; + uint32_t speed_min GNUNET_PACKED; /** - * Number of hops in the path given below + * path_length structs defining the *whole* path from the origin [0] to the + * final destination [path_length-1]. */ - uint16_t path_length; + // struct GNUNET_PeerIdentity peers[path_length]; +}; +/** + * Message for mesh data traffic to all tunnel targets. + */ +struct GNUNET_MESH_OriginMulticast +{ /** - * path_length structs defining the *whole* path + * Type: GNUNET_MESSAGE_TYPE_DATA_MULTICAST + */ + struct GNUNET_MessageHeader header; + + /** + * TID of the tunnel + */ + uint32_t tid GNUNET_PACKED; + + /** + * OID of the tunnel + */ + struct GNUNET_PeerIdentity oid; + + /** + * FIXME: Some form of authentication + */ + // uint32_t token; + + /** + * Payload follows */ - struct GNUNET_PeerIdentity peers[]; }; + /** - * Message for mesh data traffic + * Message for mesh data traffic to a particular destination from origin. */ -struct GNUNET_MESH_Data +struct GNUNET_MESH_DataMessageFromOrigin { /** - * Type: GNUNET_MESSAGE_TYPE_DATA_[GO|BACK] + * Type: GNUNET_MESSAGE_TYPE_DATA_MESSAGE_FROM_ORIGIN */ struct GNUNET_MessageHeader header; + /** + * TID of the tunnel + */ + uint32_t tid GNUNET_PACKED; + /** * OID of the tunnel */ struct GNUNET_PeerIdentity oid; + /** + * Destination. + */ + struct GNUNET_PeerIdentity destination; + + /** + * FIXME: Some form of authentication + */ + // uint32_t token; + + /** + * Payload follows + */ +}; + + +/** + * Message for mesh data traffic from a tunnel participant to origin. + */ +struct GNUNET_MESH_DataMessageToOrigin +{ + /** + * Type: GNUNET_MESSAGE_TYPE_DATA_MESSAGE_TO_ORIGIN + */ + struct GNUNET_MessageHeader header; + /** * TID of the tunnel */ - uint32_t tid; + uint32_t tid GNUNET_PACKED; /** - * FIXME Some form of authentication + * OID of the tunnel */ - uint32_t token; + struct GNUNET_PeerIdentity oid; /** - * Size of payload - * FIXME uint16 enough? + * Sender of the message. */ - uint16_t size; + struct GNUNET_PeerIdentity sender; /** - * Payload + * FIXME: Some form of authentication + */ + // uint32_t token; + + /** + * Payload follows */ - uint8_t data[]; }; /** @@ -109,24 +181,20 @@ struct GNUNET_MESH_SpeedNotify struct GNUNET_MessageHeader header; /** - * OID of the tunnel + * TID of the tunnel */ - struct GNUNET_PeerIdentity oid; + uint32_t tid GNUNET_PACKED; /** - * TID of the tunnel + * OID of the tunnel */ - uint32_t tid; + struct GNUNET_PeerIdentity oid; /** - * Slowest link down the path + * Slowest link down the path (above minimum speed requirement). */ uint32_t speed_min; - /** - * Fastest link down the path - */ - uint32_t speed_max; }; -#endif \ No newline at end of file +#endif diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c index f539312cf..053449fbe 100644 --- a/src/mesh/mesh_api.c +++ b/src/mesh/mesh_api.c @@ -315,7 +315,7 @@ core_receive (void *cls, } return handler->callback (handle->cls, &tunnel->tunnel, - &tunnel->tunnel.ctx, rmessage, atsi); + &tunnel->tunnel.ctx, other, rmessage, atsi); } -- cgit v1.2.3