diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b8d1e8b..42f74f6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -221,7 +221,7 @@ endif() add_subdirectory(tools) -foreach(TARGET_NAME wivrn wivrn-server wivrn-common) +foreach(TARGET_NAME wivrn wivrn-server wivrn-common wivrn-dissector) if(TARGET ${TARGET_NAME}) target_compile_options(${TARGET_NAME} PRIVATE -fdiagnostics-color -Wall -Wextra -pedantic diff --git a/tools/wireshark/dissector.cpp b/tools/wireshark/dissector.cpp index 04fc1ca7..bb6daec0 100644 --- a/tools/wireshark/dissector.cpp +++ b/tools/wireshark/dissector.cpp @@ -285,7 +285,7 @@ struct tree_traits>> } template - static void dissect_aux1(proto_tree *tree, tvbuff_t *tvb, int& start, std::index_sequence) + static void dissect_aux1([[maybe_unused]] proto_tree * tree, [[maybe_unused]] tvbuff_t *tvb, int& start, std::index_sequence) { (dissect_aux2(tree, tvb, start), ...); } @@ -309,7 +309,7 @@ struct tree_traits>> } template - static size_t size_aux1(tvbuff_t *tvb, int& start, std::index_sequence) + static size_t size_aux1([[maybe_unused]] tvbuff_t *tvb, int& start, std::index_sequence) { return (size_aux2(tvb, start) + ... + 0); } @@ -350,7 +350,7 @@ struct tree_traits static void dissect(proto_tree *tree, tvbuff_t *tvb, int& start) { - size_t string_size = tvb_get_guint16(tvb, start, ENC_LITTLE_ENDIAN); + size_t string_size = tvb_get_uint16(tvb, start, ENC_LITTLE_ENDIAN); start += sizeof(uint16_t); proto_tree_add_item(tree, field_handle, tvb, start, string_size, ENC_STRING); @@ -360,7 +360,7 @@ struct tree_traits static size_t size(tvbuff_t *tvb, int& start) { - size_t string_size = tvb_get_guint16(tvb, start, ENC_LITTLE_ENDIAN); + size_t string_size = tvb_get_uint16(tvb, start, ENC_LITTLE_ENDIAN); start += sizeof(uint16_t); start += string_size; @@ -403,7 +403,7 @@ struct tree_traits> proto_item * ti = proto_tree_add_item(tree, field_handle, tvb, start, size2, ENC_NA); proto_tree * subtree = proto_item_add_subtree(ti, subtree_handles.at(abbrev.value)); - size_t count = tvb_get_guint16(tvb, start, ENC_LITTLE_ENDIAN); + size_t count = tvb_get_uint16(tvb, start, ENC_LITTLE_ENDIAN); start += sizeof(uint16_t); for(size_t i = 0; i < count; i++) @@ -414,7 +414,7 @@ struct tree_traits> static size_t size(tvbuff_t *tvb, int& start) { - size_t count = tvb_get_guint16(tvb, start, ENC_LITTLE_ENDIAN); + size_t count = tvb_get_uint16(tvb, start, ENC_LITTLE_ENDIAN); start += sizeof(uint16_t); size_t size = sizeof(uint16_t); @@ -440,7 +440,7 @@ struct tree_traits> int start2 = start; size_t size2 = size(tvb, start2); - bool has_value = tvb_get_guint8(tvb, start); + bool has_value = tvb_get_uint8(tvb, start); if (has_value) { @@ -457,7 +457,7 @@ struct tree_traits> static size_t size(tvbuff_t *tvb, int& start) { - bool has_value = tvb_get_guint8(tvb, start); + bool has_value = tvb_get_uint8(tvb, start); start += sizeof(uint8_t); size_t size = sizeof(uint8_t); @@ -555,7 +555,7 @@ struct tree_traits> static void dissect(proto_tree *tree, tvbuff_t *tvb, int& start) { - uint8_t type_index = tvb_get_guint8(tvb, start); + uint8_t type_index = tvb_get_uint8(tvb, start); start += 1; dissect_aux(tree, tvb, start, type_index, std::make_index_sequence()); @@ -571,7 +571,7 @@ struct tree_traits> static size_t size(tvbuff_t *tvb, int& start) { - uint8_t type_index = tvb_get_guint8(tvb, start); + uint8_t type_index = tvb_get_uint8(tvb, start); start += sizeof(uint8_t); return sizeof(uint8_t) + size_aux(tvb, start, type_index, std::make_index_sequence()); @@ -642,7 +642,7 @@ struct tree_traits> static void dissect(proto_tree *tree, tvbuff_t *tvb, int& start) { - size_t span_size = tvb_get_guint16(tvb, start, ENC_LITTLE_ENDIAN); + size_t span_size = tvb_get_uint16(tvb, start, ENC_LITTLE_ENDIAN); start += sizeof(uint16_t); proto_tree_add_item(tree, field_handle, tvb, start, span_size, ENC_NA); @@ -652,7 +652,7 @@ struct tree_traits> static size_t size(tvbuff_t *tvb, int& start) { - size_t span_size = tvb_get_guint16(tvb, start, ENC_LITTLE_ENDIAN); + size_t span_size = tvb_get_uint16(tvb, start, ENC_LITTLE_ENDIAN); start += sizeof(uint16_t); start += span_size;