diff options
author | Christian Pointner <equinox@anytun.org> | 2008-02-23 23:05:43 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-02-23 23:05:43 +0000 |
commit | b8766a2041d57a3aa49c3855902953f8de0b0ec1 (patch) | |
tree | ce3fd0496bbcc9c71b8a16ec1333f574e3fe51a5 /plainPacket.h | |
parent | added routing table basic structure (diff) |
- keyderivation and cipher should work now
however it needs further testing
- rewrite of Buffer and Packets
Diffstat (limited to 'plainPacket.h')
-rw-r--r-- | plainPacket.h | 44 |
1 files changed, 18 insertions, 26 deletions
diff --git a/plainPacket.h b/plainPacket.h index 176d841..54c387a 100644 --- a/plainPacket.h +++ b/plainPacket.h @@ -43,13 +43,17 @@ class Cipher; class PlainPacket : public Buffer { public: - ~PlainPacket(); - /** * Packet constructor - * @param max_payload_length maximum payload length + * @param the length of the payload + * @param allow reallocation of buffer */ - PlainPacket(u_int32_t max_payload_length); + PlainPacket(u_int32_t payload_length, bool allow_realloc = false); + + /** + * Packet destructor + */ + ~PlainPacket() {}; /** * Get the payload type @@ -63,43 +67,31 @@ public: */ void setPayloadType(payload_type_t payload_type); - void setCompletePayloadLength(u_int32_t payload_length); - u_int32_t getCompletePayloadLength(); - /** - * Set the real payload length - * @param length the real payload length + * Get the length of the payload + * @return the length of the payload */ - //void setRealPayloadLengt(u_int32_t length); - - /** - * Get the real payload length - * @return the real length of the payload - */ - //u_int32_t getRealPayloadLength(); + u_int32_t getPayloadLength() const; /** * Set the length of the payload * @param length length of the payload */ - void setLength(u_int32_t length); + void setPayloadLength(u_int32_t payload_length); /** - * Get the size of the allocated memory for the payload - * @return maximum size of payload + * Get the the payload + * @return the Pointer to the payload */ - u_int32_t getMaxLength() const; + u_int8_t* getPayload(); + private: PlainPacket(); PlainPacket(const PlainPacket &src); - void splitPayload(); - u_int32_t max_length_; + payload_type_t* payload_type_; -protected: - friend class Cipher; - u_int8_t * complete_payload_; - u_int32_t complete_payload_length_; + u_int8_t* payload_; }; #endif |