Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions devel/spicy/autogen-spicy-docs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ fi
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.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

# 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-framework.zeek" "${AUTOGEN_FINAL}/"
cp "${ZEEK}/auxil/spicy/doc/scripts/spicy-pygments.py" "${DOC}/ext"

91 changes: 0 additions & 91 deletions devel/spicy/autogen/tftp-no-accept.spicy

This file was deleted.

27 changes: 15 additions & 12 deletions devel/spicy/autogen/tftp.spicy
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ import spicy;
# | 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($$);
switch ( self.op ) {
Opcode::RRQ -> rrq: Request(True);
Opcode::WRQ -> wrq: Request(False);
Opcode::DATA -> data: Data;
Opcode::ACK -> ack: Acknowledgement;
switch (self.op) {
Opcode::RRQ -> rrq: Request(True);
Opcode::WRQ -> wrq: Request(False);
Opcode::DATA -> data: Data;
Opcode::ACK -> ack: Acknowledgement;
Opcode::ERROR -> error: Error;
};
};
};

# TFTP supports five types of packets [...]:
Expand All @@ -39,7 +40,7 @@ type Opcode = enum {
WRQ = 0x02,
DATA = 0x03,
ACK = 0x04,
ERROR = 0x05
ERROR = 0x05,
};

# Figure 5-1: RRQ/WRQ packet
Expand All @@ -51,9 +52,11 @@ type Opcode = enum {

type Request = unit(is_read: bool) {
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
Expand All @@ -64,7 +67,7 @@ type Request = unit(is_read: bool) {
# ----------------------------------

type Data = unit {
num: uint16;
num: uint16;
data: bytes &eod;
};

Expand All @@ -88,5 +91,5 @@ type Acknowledgement = unit {

type Error = unit {
code: uint16;
msg: bytes &until=b"\x00";
msg: bytes &until=b"\x00";
};
2 changes: 1 addition & 1 deletion scripts/base/utils/urls.zeek.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Types
Functions
#########
.. zeek:id:: decompose_uri
:source-code: base/utils/urls.zeek 52 136
:source-code: base/utils/urls.zeek 52 135

:Type: :zeek:type:`function` (uri: :zeek:type:`string`) : :zeek:type:`URI`

Expand Down
Loading