mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 20:18:20 +00:00
order list of services in store key
This commit is contained in:
parent
ddf2d2d8a9
commit
9e1e177621
1 changed files with 7 additions and 2 deletions
|
@ -40,7 +40,7 @@ export {
|
||||||
type AddrPortServTriplet: record {
|
type AddrPortServTriplet: record {
|
||||||
host: addr;
|
host: addr;
|
||||||
p: port;
|
p: port;
|
||||||
serv: set[string];
|
serv: vector of string;
|
||||||
};
|
};
|
||||||
|
|
||||||
## Holds the set of all known services. Keys in the store are
|
## Holds the set of all known services. Keys in the store are
|
||||||
|
@ -109,7 +109,12 @@ event service_info_commit(info: ServicesInfo)
|
||||||
if ( ! Known::use_service_store )
|
if ( ! Known::use_service_store )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
local key = AddrPortServTriplet($host = info$host, $p = info$port_num, $serv = info$service);
|
local v : vector of string;
|
||||||
|
for ( s in info$service )
|
||||||
|
v += s;
|
||||||
|
sort(v, strcmp); # sort the vector for proper key comparison in put_unique
|
||||||
|
|
||||||
|
local key = AddrPortServTriplet($host = info$host, $p = info$port_num, $serv = v);
|
||||||
|
|
||||||
when ( local r = Broker::put_unique(Known::service_store$store, key,
|
when ( local r = Broker::put_unique(Known::service_store$store, key,
|
||||||
T, Known::service_store_expiry) )
|
T, Known::service_store_expiry) )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue