Revision 77947fd5

View differences:

include/trade_sig_ha.h
42 42
 * @return 1 on success, <0 on error.
43 43
 */
44 44
int parseSignaling(uint8_t *buff, int buff_len, struct nodeID **owner_id,
45
                   struct chunkID_set **cset, int *max_deliver, int *trans_id,
45
                   struct chunkID_set **cset, int *max_deliver, uint16_t *trans_id,
46 46
                   enum signaling_type *sig_type);
47 47

  
48 48
/**
......
57 57
 * @param[in] trans_id transaction number associated with this request.
58 58
 * @return 1 on success, <0 on error.
59 59
 */
60
int requestChunks(struct nodeID *to, const struct chunkID_set *cset, int max_deliver, int trans_id);
60
int requestChunks(struct nodeID *to, const struct chunkID_set *cset, int max_deliver, uint16_t trans_id);
61 61

  
62 62
/**
63 63
 * @brief Deliver a set of Chunks to a Peer as a reply of its previous request of Chunks.
......
70 70
 * @param[in] trans_id transaction number associated with this request.
71 71
 * @return 1 on success, <0 on error.
72 72
 */
73
int deliverChunks(struct nodeID *to, struct chunkID_set *cset, int trans_id);
73
int deliverChunks(struct nodeID *to, struct chunkID_set *cset, uint16_t trans_id);
74 74

  
75 75
/**
76 76
 * @brief Offer a (sub)set of chunks to a Peer.
......
84 84
 * @param[in] trans_id transaction number associated with this request.
85 85
 * @return 1 on success, <0 on error.
86 86
 */
87
int offerChunks(struct nodeID *to, struct chunkID_set *cset, int max_deliver, int trans_id);
87
int offerChunks(struct nodeID *to, struct chunkID_set *cset, int max_deliver, uint16_t trans_id);
88 88

  
89 89
/**
90 90
 * @brief Accept a (sub)set of chunks from a Peer.
......
97 97
 * @param[in] trans_id transaction number associated with this request.
98 98
 * @return 1 on success, <0 on error.
99 99
 */
100
int acceptChunks(struct nodeID *to, struct chunkID_set *cset, int trans_id);
100
int acceptChunks(struct nodeID *to, struct chunkID_set *cset, uint16_t trans_id);
101 101

  
102 102
/**
103 103
 * @brief Send a BufferMap to a Peer.
......
111 111
 * @param[in] trans_id transaction number associated with this send.
112 112
 * @return 1 Success, <0 on error.
113 113
 */
114
int sendBufferMap(struct nodeID *to, const struct nodeID *owner, struct chunkID_set *bmap, int cb_size, int trans_id);
114
int sendBufferMap(struct nodeID *to, const struct nodeID *owner, struct chunkID_set *bmap, int cb_size, uint16_t trans_id);
115 115

  
116 116
/**
117 117
 * @brief Request a BufferMap to a Peer.
......
123 123
 * @param[in] trans_id transaction number associated with this request.
124 124
 * @return 1 Success, <0 on error.
125 125
 */
126
int requestBufferMap(struct nodeID *to, const struct nodeID *owner, int trans_id);
126
int requestBufferMap(struct nodeID *to, const struct nodeID *owner, uint16_t trans_id);
127 127

  
128 128
#endif //TRADE_SIG_HA_H 
src/ChunkTrading/chunk_signaling.c
61 61
}
62 62

  
63 63
int parseSignaling(uint8_t *buff, int buff_len, struct nodeID **owner_id,
64
                   struct chunkID_set **cset, int *max_deliver, int *trans_id,
64
                   struct chunkID_set **cset, int *max_deliver, uint16_t *trans_id,
65 65
                   enum signaling_type *sig_type)
66 66
{
67 67
  int meta_len = 0;
......
109 109
static int sendSignaling(int type, struct nodeID *to_id,
110 110
                         const struct nodeID *owner_id,
111 111
                         const struct chunkID_set *cset, int max_deliver,
112
                         int trans_id)
112
                         uint16_t trans_id)
113 113
{
114 114
  int meta_len, msg_len;
115 115
  uint8_t *buff;
......
154 154
}
155 155

  
156 156
int requestChunks(struct nodeID *to, const ChunkIDSet *cset,
157
                  int max_deliver, int trans_id)
157
                  int max_deliver, uint16_t trans_id)
158 158
{
159 159
  return sendSignaling(MSG_SIG_REQ, to, NULL, cset, max_deliver, trans_id);
160 160
}
161 161

  
162
int deliverChunks(struct nodeID *to, ChunkIDSet *cset, int trans_id)
162
int deliverChunks(struct nodeID *to, ChunkIDSet *cset, uint16_t trans_id)
163 163
{
164 164
  return sendSignaling(MSG_SIG_DEL, to, NULL, cset, 0, trans_id);
165 165
}
166 166

  
167 167
int offerChunks(struct nodeID *to, struct chunkID_set *cset,
168
                int max_deliver, int trans_id)
168
                int max_deliver, uint16_t trans_id)
169 169
{
170 170
  return sendSignaling(MSG_SIG_OFF, to, NULL, cset, max_deliver, trans_id);
171 171
}
172 172

  
173
int acceptChunks(struct nodeID *to, struct chunkID_set *cset, int trans_id)
173
int acceptChunks(struct nodeID *to, struct chunkID_set *cset, uint16_t trans_id)
174 174
{
175 175
  return sendSignaling(MSG_SIG_ACC, to, NULL, cset, 0, trans_id);
176 176
}
177 177

  
178 178
int sendBufferMap(struct nodeID *to, const struct nodeID *owner,
179
                  struct chunkID_set *bmap, int cb_size, int trans_id)
179
                  struct chunkID_set *bmap, int cb_size, uint16_t trans_id)
180 180
{
181 181
  return sendSignaling(MSG_SIG_BMOFF, to, (!owner ? localID : owner), bmap,
182 182
                       cb_size, trans_id);
183 183
}
184 184

  
185 185
int requestBufferMap(struct nodeID *to, const struct nodeID *owner,
186
                     int trans_id)
186
                     uint16_t trans_id)
187 187
{
188 188
  return sendSignaling(MSG_SIG_BMREQ, to, (!owner?localID:owner), NULL,
189 189
                       0, trans_id);

Also available in: Unified diff