Loading ccsrc/Protocols/Sctp/sctp_offline_layer.cc +19 −7 Original line number Diff line number Diff line Loading @@ -111,24 +111,24 @@ void sctp_offline_layer::process_chunk(const OCTETSTRING& p_chunk, params &p_par p += 2; // Skip Chunk type + Chunk flag // Chunk length uint16_t l = (*p << 8 | *(p + 1)) & 0xffff; loggers::get_instance().log("sctp_offline_layer::receive_data: l: %d", l); loggers::get_instance().log("sctp_offline_layer::process_chunk: l: %d", l); p += 2; p += 4; // Skip Transmission sequence number // Stream identifier OCTETSTRING stream_id = OCTETSTRING(2, p); loggers::get_instance().log_msg("sctp_offline_layer::receive_data: stream_id: ", stream_id); loggers::get_instance().log_msg("sctp_offline_layer::process_chunk: stream_id: ", stream_id); p += 2; // Stream sequence number OCTETSTRING stream_num = OCTETSTRING(2, p); loggers::get_instance().log_msg("sctp_offline_layer::receive_data: stream_num: ", stream_num); loggers::get_instance().log_msg("sctp_offline_layer::process_chunk: stream_num: ", stream_num); p += 2; // Protocol uint32_t protocol = (*p << 24 | *(p + 1) << 16 | *(p + 2) << 8 | *(p + 3)) & 0xffffffff; loggers::get_instance().log("sctp_offline_layer::receive_data: protocol: %d", protocol); loggers::get_instance().log("sctp_offline_layer::process_chunk: protocol: %d", protocol); p += 4; loggers::get_instance().log("sctp_offline_layer::receive_data: pointer offset: %d", (uint32_t)(p - static_cast<const uint8_t*>(p_chunk))); loggers::get_instance().log("sctp_offline_layer::process_chunk: pointer offset: %d", (uint32_t)(p - static_cast<const uint8_t*>(p_chunk))); p_payload = OCTETSTRING(p_chunk.lengthof() - (uint32_t)(p - static_cast<const uint8_t*>(p_chunk)), p); } break; Loading @@ -136,7 +136,19 @@ void sctp_offline_layer::process_chunk(const OCTETSTRING& p_chunk, params &p_par break; case 0x02: // INIT_ACK chunk break; case 0x03: // SACK case 0x03: { // SACK loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): position: %02x", static_cast<const uint8_t>(*(p))); const uint8_t f = static_cast<const uint8_t>(*(p + 1)); loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): flags: %04x", f); const uint16_t l = static_cast<const uint16_t>((*(p + 2) << 8 | *(p + 3)) & 0xffff); loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): length: %d", l); loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): p_chunk.lengthof(): %d", p_chunk.lengthof()); if (p_chunk.lengthof() > l) { // Extract and process the next chunk OCTETSTRING chunk(p_chunk.lengthof() - l, p + l); process_chunk(chunk, p_params, p_payload); } } break; case 0x04: // HEARTBEAT break; Loading @@ -147,7 +159,7 @@ void sctp_offline_layer::process_chunk(const OCTETSTRING& p_chunk, params &p_par case 0x0b: // COOKIE_ACK chunk break; default: // loggers::get_instance().warning("sctp_offline_layer::send_data: Unprocessed chunk: 0x%02x", *p); loggers::get_instance().warning("sctp_offline_layer::process_chunk: Unprocessed chunk: 0x%02x", *p); } loggers::get_instance().log_msg("<<< sctp_offline_layer::process_chunk: p_payload: ", p_payload); Loading Loading
ccsrc/Protocols/Sctp/sctp_offline_layer.cc +19 −7 Original line number Diff line number Diff line Loading @@ -111,24 +111,24 @@ void sctp_offline_layer::process_chunk(const OCTETSTRING& p_chunk, params &p_par p += 2; // Skip Chunk type + Chunk flag // Chunk length uint16_t l = (*p << 8 | *(p + 1)) & 0xffff; loggers::get_instance().log("sctp_offline_layer::receive_data: l: %d", l); loggers::get_instance().log("sctp_offline_layer::process_chunk: l: %d", l); p += 2; p += 4; // Skip Transmission sequence number // Stream identifier OCTETSTRING stream_id = OCTETSTRING(2, p); loggers::get_instance().log_msg("sctp_offline_layer::receive_data: stream_id: ", stream_id); loggers::get_instance().log_msg("sctp_offline_layer::process_chunk: stream_id: ", stream_id); p += 2; // Stream sequence number OCTETSTRING stream_num = OCTETSTRING(2, p); loggers::get_instance().log_msg("sctp_offline_layer::receive_data: stream_num: ", stream_num); loggers::get_instance().log_msg("sctp_offline_layer::process_chunk: stream_num: ", stream_num); p += 2; // Protocol uint32_t protocol = (*p << 24 | *(p + 1) << 16 | *(p + 2) << 8 | *(p + 3)) & 0xffffffff; loggers::get_instance().log("sctp_offline_layer::receive_data: protocol: %d", protocol); loggers::get_instance().log("sctp_offline_layer::process_chunk: protocol: %d", protocol); p += 4; loggers::get_instance().log("sctp_offline_layer::receive_data: pointer offset: %d", (uint32_t)(p - static_cast<const uint8_t*>(p_chunk))); loggers::get_instance().log("sctp_offline_layer::process_chunk: pointer offset: %d", (uint32_t)(p - static_cast<const uint8_t*>(p_chunk))); p_payload = OCTETSTRING(p_chunk.lengthof() - (uint32_t)(p - static_cast<const uint8_t*>(p_chunk)), p); } break; Loading @@ -136,7 +136,19 @@ void sctp_offline_layer::process_chunk(const OCTETSTRING& p_chunk, params &p_par break; case 0x02: // INIT_ACK chunk break; case 0x03: // SACK case 0x03: { // SACK loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): position: %02x", static_cast<const uint8_t>(*(p))); const uint8_t f = static_cast<const uint8_t>(*(p + 1)); loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): flags: %04x", f); const uint16_t l = static_cast<const uint16_t>((*(p + 2) << 8 | *(p + 3)) & 0xffff); loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): length: %d", l); loggers::get_instance().log("sctp_offline_layer::process_chunk (SACK): p_chunk.lengthof(): %d", p_chunk.lengthof()); if (p_chunk.lengthof() > l) { // Extract and process the next chunk OCTETSTRING chunk(p_chunk.lengthof() - l, p + l); process_chunk(chunk, p_params, p_payload); } } break; case 0x04: // HEARTBEAT break; Loading @@ -147,7 +159,7 @@ void sctp_offline_layer::process_chunk(const OCTETSTRING& p_chunk, params &p_par case 0x0b: // COOKIE_ACK chunk break; default: // loggers::get_instance().warning("sctp_offline_layer::send_data: Unprocessed chunk: 0x%02x", *p); loggers::get_instance().warning("sctp_offline_layer::process_chunk: Unprocessed chunk: 0x%02x", *p); } loggers::get_instance().log_msg("<<< sctp_offline_layer::process_chunk: p_payload: ", p_payload); Loading