summaryrefslogtreecommitdiff
path: root/src/PeerMessageUtil.h
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-01-25 16:47:29 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-01-25 16:47:29 +0000
commitcd9e35bc632dd4a4bb6a543266803e34376e7964 (patch)
tree6042dd0473d1ca7ba845a35fb79745011f7ead7e /src/PeerMessageUtil.h
parent139f46332e0472546cef1dcc31abf98ab0ca93f5 (diff)
2007-01-26 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
* src/message.h: Added EX_INVALID_PAYLOAD_SIZE and EX_INVALID_BT_MESSAGE_ID. Following source files affected. * src/BtAllowedFastMessage.cc: * src/BtBitfieldMessage.cc * src/BtCancelMessage.cc * src/BtChokeMessage.cc * src/BtHaveAllMessage.cc * src/BtHaveMessage.cc * src/BtHaveNoneMessage.cc * src/BtInterestedMessage.cc * src/BtNotInterestedMessage.cc * src/BtPieceMessage.cc * src/BtPortMessage.cc * src/BtRejectMessage.cc * src/BtRequestMessage.cc * src/BtSuggestPieceMessage.cc * src/BtUnchokeMessage.cc * src/message.h: Added EX_INVALID_CHUNK_CHECKSUM. Following source files are affected. * src/ChunkChecksumValidator.cc * src/SegmentMan.cc
Diffstat (limited to 'src/PeerMessageUtil.h')
-rw-r--r--src/PeerMessageUtil.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/PeerMessageUtil.h b/src/PeerMessageUtil.h
index 110cef54..53648b5b 100644
--- a/src/PeerMessageUtil.h
+++ b/src/PeerMessageUtil.h
@@ -43,28 +43,28 @@ class PeerMessageUtil {
private:
PeerMessageUtil() {}
public:
- static uint32_t getIntParam(const unsigned char* msg, int32_t offset);
+ static int32_t getIntParam(const unsigned char* msg, int32_t offset);
- static uint16_t getShortIntParam(const unsigned char* msg, int32_t offset);
+ static int16_t getShortIntParam(const unsigned char* msg, int32_t offset);
- static void setIntParam(unsigned char* dest, uint32_t param);
+ static void setIntParam(unsigned char* dest, int32_t param);
- static void setShortIntParam(unsigned char* dest, uint16_t param);
+ static void setShortIntParam(unsigned char* dest, int16_t param);
- static uint8_t getId(const unsigned char* msg);
+ static int8_t getId(const unsigned char* msg);
- static void checkIndex(int32_t index, uint32_t pieces);
- static void checkBegin(int32_t begin, uint32_t pieceLength);
- static void checkLength(uint32_t length);
- static void checkRange(int32_t begin, uint32_t length, uint32_t pieceLength);
+ static void checkIndex(int32_t index, int32_t pieces);
+ static void checkBegin(int32_t begin, int32_t pieceLength);
+ static void checkLength(int32_t length);
+ static void checkRange(int32_t begin, int32_t length, int32_t pieceLength);
static void checkBitfield(const unsigned char* bitfield,
- uint32_t bitfieldLength,
- uint32_t pieces);
+ int32_t bitfieldLength,
+ int32_t pieces);
static void createPeerMessageString(unsigned char* msg,
- uint32_t msgLength,
- uint32_t payloadLength,
- uint8_t messageId);
+ int32_t msgLength,
+ int32_t payloadLength,
+ int8_t messageId);
};
#endif // _D_PEER_MESSAGE_UTIL_H_