mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Fix generation of file IDs.
They weren't stable, and potentially repetitive. Note: We should backport this to the external plugin.
This commit is contained in:
parent
0040111955
commit
e6af74c8aa
5 changed files with 11 additions and 12 deletions
|
@ -18,11 +18,16 @@ using namespace zeek::spicy::rt;
|
||||||
void EndpointState::debug(const std::string& msg) { spicy::rt::debug(_cookie, msg); }
|
void EndpointState::debug(const std::string& msg) { spicy::rt::debug(_cookie, msg); }
|
||||||
|
|
||||||
static auto create_endpoint(bool is_orig, analyzer::Analyzer* analyzer, ::spicy::rt::driver::ParsingType type) {
|
static auto create_endpoint(bool is_orig, analyzer::Analyzer* analyzer, ::spicy::rt::driver::ParsingType type) {
|
||||||
|
static uint64_t id_counter = 0;
|
||||||
|
|
||||||
|
++id_counter;
|
||||||
|
|
||||||
cookie::ProtocolAnalyzer cookie{.analyzer = analyzer,
|
cookie::ProtocolAnalyzer cookie{.analyzer = analyzer,
|
||||||
.is_orig = is_orig,
|
.is_orig = is_orig,
|
||||||
.fstate_orig = cookie::FileStateStack(hilti::rt::fmt("%x.orig", analyzer->GetID())),
|
.fstate_orig =
|
||||||
|
cookie::FileStateStack(hilti::rt::fmt("%" PRIx64 ".orig", id_counter)),
|
||||||
.fstate_resp =
|
.fstate_resp =
|
||||||
cookie::FileStateStack(hilti::rt::fmt("%x.resp", analyzer->GetID()))};
|
cookie::FileStateStack(hilti::rt::fmt("%" PRIx64 ".resp", id_counter))};
|
||||||
|
|
||||||
// Cannot get parser here yet, analyzer may not have been fully set up.
|
// Cannot get parser here yet, analyzer may not have been fully set up.
|
||||||
return EndpointState(std::move(cookie), type);
|
return EndpointState(std::move(cookie), type);
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
FL4lmy3f7owPUUoQ8l
|
FM47gX3vI5ofQPm1li
|
||||||
FhCRq1oIy2uDU8rog
|
FZjUS57tUkGFTibv3
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
|
||||||
FL4lmy3f7owPUUoQ8l
|
FM47gX3vI5ofQPm1li
|
||||||
FhCRq1oIy2uDU8rog
|
FZjUS57tUkGFTibv3
|
||||||
|
|
|
@ -9,9 +9,6 @@ else
|
||||||
sed="sed -E"
|
sed="sed -E"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# File IDs changed between Zeek 3.1 and 3.2.
|
|
||||||
|
|
||||||
${sed} 's/^ *#(open|close).(19|20)..-..-..-..-..-..$/#\1 XXXX-XX-XX-XX-XX-XX/g' |
|
${sed} 's/^ *#(open|close).(19|20)..-..-..-..-..-..$/#\1 XXXX-XX-XX-XX-XX-XX/g' |
|
||||||
${sed} 's/F[A-Za-z0-9]{14,17}/XXXXXXXXXXXXXXXXX/g' |
|
|
||||||
$(dirname $0)/diff-remove-timestamps |
|
$(dirname $0)/diff-remove-timestamps |
|
||||||
$(dirname $0)/diff-remove-abspath
|
$(dirname $0)/diff-remove-abspath
|
||||||
|
|
|
@ -9,10 +9,7 @@ else
|
||||||
sed="sed -E"
|
sed="sed -E"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# File IDs changed between Zeek 3.1 and 3.2.
|
|
||||||
|
|
||||||
${sed} 's/^ *#(open|close).(19|20)..-..-..-..-..-..$/#\1 XXXX-XX-XX-XX-XX-XX/g' |
|
${sed} 's/^ *#(open|close).(19|20)..-..-..-..-..-..$/#\1 XXXX-XX-XX-XX-XX-XX/g' |
|
||||||
${sed} 's/F[A-Za-z0-9]{15,17}/XXXXXXXXXXXXXXXXX/g' |
|
|
||||||
$(dirname $0)/diff-sort |
|
$(dirname $0)/diff-sort |
|
||||||
$(dirname $0)/diff-remove-timestamps |
|
$(dirname $0)/diff-remove-timestamps |
|
||||||
$(dirname $0)/diff-remove-abspath
|
$(dirname $0)/diff-remove-abspath
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue