mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Run pre-commit on the imported docs files
This includes a minor change to the docs .typos.toml file to not change the string 'tpe' to 'type'.
This commit is contained in:
parent
ded98cd373
commit
0e46cc7a98
10 changed files with 59 additions and 71 deletions
|
@ -10,7 +10,7 @@ repos:
|
||||||
language: python
|
language: python
|
||||||
files: '\.(h|c|cpp|cc|spicy|evt)$'
|
files: '\.(h|c|cpp|cc|spicy|evt)$'
|
||||||
types: [file]
|
types: [file]
|
||||||
exclude: '^(testing/btest/(Baseline|plugins|spicy|scripts)/.*|testing/builtin-plugins/.*|src/3rdparty/.*)$'
|
exclude: '^(testing/btest/(Baseline|plugins|spicy|scripts)/.*|testing/builtin-plugins/.*|src/3rdparty/.*|doc/.*)$'
|
||||||
|
|
||||||
- id: btest-command-commented
|
- id: btest-command-commented
|
||||||
name: Check that all BTest command lines are commented out
|
name: Check that all BTest command lines are commented out
|
||||||
|
|
|
@ -55,6 +55,7 @@ tha = "tha"
|
||||||
uses_seh = "uses_seh"
|
uses_seh = "uses_seh"
|
||||||
exat = "exat"
|
exat = "exat"
|
||||||
EXAT = "EXAT"
|
EXAT = "EXAT"
|
||||||
|
tpe = "tpe"
|
||||||
|
|
||||||
[default.extend-words]
|
[default.extend-words]
|
||||||
caf = "caf"
|
caf = "caf"
|
||||||
|
|
|
@ -5,10 +5,5 @@ project(ZeekPluginConnKeyVxlanVniFivetuple)
|
||||||
include(ZeekPlugin)
|
include(ZeekPlugin)
|
||||||
|
|
||||||
zeek_add_plugin(
|
zeek_add_plugin(
|
||||||
Zeek
|
Zeek ConnKey_Vxlan_Vni_Fivetuple
|
||||||
ConnKey_Vxlan_Vni_Fivetuple
|
SOURCES src/Factory.cc src/Plugin.cc SCRIPT_FILES scripts/__load__.zeek)
|
||||||
SOURCES
|
|
||||||
src/Factory.cc
|
|
||||||
src/Plugin.cc
|
|
||||||
SCRIPT_FILES scripts/__load__.zeek
|
|
||||||
)
|
|
||||||
|
|
|
@ -5,9 +5,5 @@ project(ZeekPluginEventLatency)
|
||||||
include(ZeekPlugin)
|
include(ZeekPlugin)
|
||||||
|
|
||||||
zeek_add_plugin(
|
zeek_add_plugin(
|
||||||
Zeek
|
Zeek EventLatency
|
||||||
EventLatency
|
SOURCES src/Plugin.cc SCRIPT_FILES scripts/__load__.zeek)
|
||||||
SOURCES
|
|
||||||
src/Plugin.cc
|
|
||||||
SCRIPT_FILES scripts/__load__.zeek
|
|
||||||
)
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ fi
|
||||||
set -o errexit
|
set -o errexit
|
||||||
set -o nounset
|
set -o nounset
|
||||||
|
|
||||||
ZEEK="$(cd "$( dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/../../.."
|
ZEEK="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/../../.."
|
||||||
DOC="${ZEEK}/doc"
|
DOC="${ZEEK}/doc"
|
||||||
SPICY="${ZEEK}/auxil/spicy"
|
SPICY="${ZEEK}/auxil/spicy"
|
||||||
SPICYDOC="${ZEEK}/build/auxil/spicy/bin/spicy-doc"
|
SPICYDOC="${ZEEK}/build/auxil/spicy/bin/spicy-doc"
|
||||||
|
@ -33,16 +33,15 @@ if [ ! -x "${SPICYDOC}" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
"${SPICY}/doc/scripts/autogen-spicy-lib" functions zeek < "${ZEEK}/scripts/spicy/zeek.spicy" > "${AUTOGEN_FINAL}/zeek-functions.spicy" || exit 1
|
"${SPICY}/doc/scripts/autogen-spicy-lib" functions zeek <"${ZEEK}/scripts/spicy/zeek.spicy" >"${AUTOGEN_FINAL}/zeek-functions.spicy" || exit 1
|
||||||
|
|
||||||
# Copy some static files over.
|
# Copy some static files over.
|
||||||
cp "${TFTP}"/scripts/main.zeek "${AUTOGEN_FINAL}"/tftp.zeek || exit 1
|
cp "${TFTP}"/scripts/main.zeek "${AUTOGEN_FINAL}"/tftp.zeek || exit 1
|
||||||
cp "${TFTP}"/analyzer/tftp.spicy "${AUTOGEN_FINAL}"/tftp.spicy || exit 1
|
cp "${TFTP}"/analyzer/tftp.spicy "${AUTOGEN_FINAL}"/tftp.spicy || exit 1
|
||||||
cp "${TFTP}"/analyzer/tftp.evt "${AUTOGEN_FINAL}"/tftp.evt || exit 1
|
cp "${TFTP}"/analyzer/tftp.evt "${AUTOGEN_FINAL}"/tftp.evt || exit 1
|
||||||
cat "${TFTP}"/analyzer/tftp.spicy | grep -v spicy::accept_input > "${AUTOGEN_FINAL}"/tftp-no-accept.spicy || exit 1
|
cat "${TFTP}"/analyzer/tftp.spicy | grep -v spicy::accept_input >"${AUTOGEN_FINAL}"/tftp-no-accept.spicy || exit 1
|
||||||
|
|
||||||
# Copy some files from the Zeek source tree so that zeek-docs remains standaline for CI.
|
# Copy some files from the Zeek source tree so that zeek-docs remains standaline for CI.
|
||||||
cp "${ZEEK}/scripts/base/frameworks/spicy/init-bare.zeek" "${AUTOGEN_FINAL}/"
|
cp "${ZEEK}/scripts/base/frameworks/spicy/init-bare.zeek" "${AUTOGEN_FINAL}/"
|
||||||
cp "${ZEEK}/scripts/base/frameworks/spicy/init-framework.zeek" "${AUTOGEN_FINAL}/"
|
cp "${ZEEK}/scripts/base/frameworks/spicy/init-framework.zeek" "${AUTOGEN_FINAL}/"
|
||||||
cp "${ZEEK}/auxil/spicy/doc/scripts/spicy-pygments.py" "${DOC}/ext"
|
cp "${ZEEK}/auxil/spicy/doc/scripts/spicy-pygments.py" "${DOC}/ext"
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,10 @@ import spicy;
|
||||||
# | TFTP Opcode |
|
# | TFTP Opcode |
|
||||||
# ---------------
|
# ---------------
|
||||||
|
|
||||||
public type Packet = unit { # public top-level entry point for parsing
|
public type Packet = unit {
|
||||||
|
# public top-level entry point for parsing
|
||||||
op: uint16 &convert=Opcode($$);
|
op: uint16 &convert=Opcode($$);
|
||||||
switch ( self.op ) {
|
switch (self.op) {
|
||||||
Opcode::RRQ -> rrq: Request(True);
|
Opcode::RRQ -> rrq: Request(True);
|
||||||
Opcode::WRQ -> wrq: Request(False);
|
Opcode::WRQ -> wrq: Request(False);
|
||||||
Opcode::DATA -> data: Data;
|
Opcode::DATA -> data: Data;
|
||||||
|
@ -39,7 +40,7 @@ type Opcode = enum {
|
||||||
WRQ = 0x02,
|
WRQ = 0x02,
|
||||||
DATA = 0x03,
|
DATA = 0x03,
|
||||||
ACK = 0x04,
|
ACK = 0x04,
|
||||||
ERROR = 0x05
|
ERROR = 0x05,
|
||||||
};
|
};
|
||||||
|
|
||||||
# Figure 5-1: RRQ/WRQ packet
|
# Figure 5-1: RRQ/WRQ packet
|
||||||
|
@ -52,7 +53,6 @@ type Opcode = enum {
|
||||||
type Request = unit(is_read: bool) {
|
type Request = unit(is_read: bool) {
|
||||||
filename: bytes &until=b"\x00";
|
filename: bytes &until=b"\x00";
|
||||||
mode: bytes &until=b"\x00";
|
mode: bytes &until=b"\x00";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Figure 5-2: DATA packet
|
# Figure 5-2: DATA packet
|
||||||
|
|
|
@ -15,9 +15,10 @@ import spicy;
|
||||||
# | TFTP Opcode |
|
# | TFTP Opcode |
|
||||||
# ---------------
|
# ---------------
|
||||||
|
|
||||||
public type Packet = unit { # public top-level entry point for parsing
|
public type Packet = unit {
|
||||||
|
# public top-level entry point for parsing
|
||||||
op: uint16 &convert=Opcode($$);
|
op: uint16 &convert=Opcode($$);
|
||||||
switch ( self.op ) {
|
switch (self.op) {
|
||||||
Opcode::RRQ -> rrq: Request(True);
|
Opcode::RRQ -> rrq: Request(True);
|
||||||
Opcode::WRQ -> wrq: Request(False);
|
Opcode::WRQ -> wrq: Request(False);
|
||||||
Opcode::DATA -> data: Data;
|
Opcode::DATA -> data: Data;
|
||||||
|
@ -39,7 +40,7 @@ type Opcode = enum {
|
||||||
WRQ = 0x02,
|
WRQ = 0x02,
|
||||||
DATA = 0x03,
|
DATA = 0x03,
|
||||||
ACK = 0x04,
|
ACK = 0x04,
|
||||||
ERROR = 0x05
|
ERROR = 0x05,
|
||||||
};
|
};
|
||||||
|
|
||||||
# Figure 5-1: RRQ/WRQ packet
|
# Figure 5-1: RRQ/WRQ packet
|
||||||
|
@ -53,7 +54,9 @@ type Request = unit(is_read: bool) {
|
||||||
filename: bytes &until=b"\x00";
|
filename: bytes &until=b"\x00";
|
||||||
mode: bytes &until=b"\x00";
|
mode: bytes &until=b"\x00";
|
||||||
|
|
||||||
on %done { spicy::accept_input(); }
|
on %done {
|
||||||
|
spicy::accept_input();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
# Figure 5-2: DATA packet
|
# Figure 5-2: DATA packet
|
||||||
|
|
|
@ -733,4 +733,3 @@ id: fully-qualified name of the global Zeek vector to check
|
||||||
Returns the size of a Zeek vector.
|
Returns the size of a Zeek vector.
|
||||||
|
|
||||||
v: opaque handle to the Zeek vector, as returned by other functions
|
v: opaque handle to the Zeek vector, as returned by other functions
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
bool LLCDemo::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
bool LLCDemo::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet) {
|
||||||
{
|
|
||||||
// Rudimentary parsing of 802.2 LLC
|
// Rudimentary parsing of 802.2 LLC
|
||||||
if ( 17 >= len )
|
if ( 17 >= len ) {
|
||||||
{
|
|
||||||
packet->Weird("truncated_llc_header");
|
packet->Weird("truncated_llc_header");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -14,10 +12,7 @@ bool LLCDemo::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
||||||
auto ssap = data[15];
|
auto ssap = data[15];
|
||||||
auto control = data[16];
|
auto control = data[16];
|
||||||
|
|
||||||
event_mgr.Enqueue(llc_demo_message,
|
event_mgr.Enqueue(llc_demo_message, val_mgr->Count(dsap), val_mgr->Count(ssap), val_mgr->Count(control));
|
||||||
val_mgr->Count(dsap),
|
|
||||||
val_mgr->Count(ssap),
|
|
||||||
val_mgr->Count(control));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue