00001
00010 #ifndef TRADE_SIG_HA_H
00011 #define TRADE_SIG_HA_H
00012
00013 #include "net_helper.h"
00014 #include "chunkidset.h"
00015
00016 enum signaling_type {
00017 sig_offer, sig_accept, sig_request, sig_deliver, sig_send_buffermap, sig_request_buffermap
00018 };
00019
00028 int chunkSignalingInit(struct nodeID *myID);
00029
00044 int parseSignaling(uint8_t *buff, int buff_len, struct nodeID **owner_id,
00045 struct chunkID_set **cset, int *max_deliver, int *trans_id,
00046 enum signaling_type *sig_type);
00047
00060 int requestChunks(struct nodeID *to, const struct chunkID_set *cset, int max_deliver, int trans_id);
00061
00073 int deliverChunks(struct nodeID *to, struct chunkID_set *cset, int trans_id);
00074
00087 int offerChunks(struct nodeID *to, struct chunkID_set *cset, int max_deliver, int trans_id);
00088
00100 int acceptChunks(struct nodeID *to, struct chunkID_set *cset, int trans_id);
00101
00113 int sendBufferMap(struct nodeID *to, const struct nodeID *owner, struct chunkID_set *bmap, int trans_id);
00114
00125 int requestBufferMap(struct nodeID *to, const struct nodeID *owner, int trans_id);
00126
00127 #endif //TRADE_SIG_HA_H