mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
utils: Introduce packages.zeek with can_load() helper
This commit is contained in:
parent
704f75a214
commit
947294efab
5 changed files with 54 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
@load base/utils/geoip-distance
|
||||
@load base/utils/hash_hrw
|
||||
@load base/utils/numbers
|
||||
@load base/utils/packages
|
||||
@load base/utils/paths
|
||||
@load base/utils/patterns
|
||||
@load base/utils/queue
|
||||
|
|
16
scripts/base/utils/packages.zeek
Normal file
16
scripts/base/utils/packages.zeek
Normal file
|
@ -0,0 +1,16 @@
|
|||
##! Rudimentary functions for helping with Zeek packages.
|
||||
|
||||
## Checks whether @load of a given package name could
|
||||
## be successful.
|
||||
##
|
||||
## This tests for the existence of corresponding script files
|
||||
## in ZEEKPATH. It does not attempt to parse and validate
|
||||
## any actual Zeek script code.
|
||||
##
|
||||
## path: The filename, package or path to test.
|
||||
##
|
||||
## Returns: T if the given filename, package or path may load.
|
||||
function can_load(p: string): bool
|
||||
{
|
||||
return find_in_zeekpath(p) != "";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue