1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-23 02:35:57 +01:00

Fixed TCP checksum. Documented pdu.h.

This commit is contained in:
Matias
2011-08-12 20:17:21 -03:00
parent d59cec94b6
commit 2cdf0f6b29
7 changed files with 124 additions and 34 deletions

View File

@@ -185,12 +185,6 @@ namespace Tins {
* payload and options size.
*/
uint32_t header_size() const;
/** \brief Serialices this TCP PDU.
* \param buffer The buffer in which the PDU will be serialized.
* \param total_sz The size available in the buffer.
*/
void write_serialization(uint8_t *buffer, uint32_t total_sz);
private:
struct tcphdr {
uint16_t sport;
@@ -239,7 +233,15 @@ namespace Tins {
static const uint16_t DEFAULT_WINDOW;
uint16_t do_checksum(uint8_t *start, uint8_t *end) const;
/** \brief Serialices this TCP PDU.
* \param buffer The buffer in which the PDU will be serialized.
* \param total_sz The size available in the buffer.
* \param parent The PDU that's one level below this one on the stack.
*/
void write_serialization(uint8_t *buffer, uint32_t total_sz, PDU *parent);
uint32_t do_checksum(uint8_t *start, uint8_t *end) const;
uint32_t pseudoheader_checksum(uint32_t source_ip, uint32_t dest_ip) const;
tcphdr _tcp;
std::vector<TCPOption> _options;