Skip to content
This repository was archived by the owner on Oct 13, 2025. It is now read-only.

Commit 8f38ae2

Browse files
committed
Merge remote-tracking branch 'origin/topic/timw/regenerate-docs-after-spicy-tftp-reformat'
* origin/topic/timw/regenerate-docs-after-spicy-tftp-reformat: Remove devel/spicy/autogen/tftp-no-accept.spicy Regenerate docs, including spicy autogen
2 parents 2731def + 821325a commit 8f38ae2

File tree

4 files changed

+16
-106
lines changed

4 files changed

+16
-106
lines changed

devel/spicy/autogen-spicy-docs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ fi
3939
cp "${TFTP}"/scripts/main.zeek "${AUTOGEN_FINAL}"/tftp.zeek || exit 1
4040
cp "${TFTP}"/analyzer/tftp.spicy "${AUTOGEN_FINAL}"/tftp.spicy || exit 1
4141
cp "${TFTP}"/analyzer/tftp.evt "${AUTOGEN_FINAL}"/tftp.evt || exit 1
42-
cat "${TFTP}"/analyzer/tftp.spicy | grep -v spicy::accept_input > "${AUTOGEN_FINAL}"/tftp-no-accept.spicy || exit 1
4342

4443
# Copy some files from the Zeek source tree so that zeek-docs remains standaline for CI.
4544
cp "${ZEEK}/scripts/base/frameworks/spicy/init-bare.zeek" "${AUTOGEN_FINAL}/"
4645
cp "${ZEEK}/scripts/base/frameworks/spicy/init-framework.zeek" "${AUTOGEN_FINAL}/"
4746
cp "${ZEEK}/auxil/spicy/doc/scripts/spicy-pygments.py" "${DOC}/ext"
48-

devel/spicy/autogen/tftp-no-accept.spicy

Lines changed: 0 additions & 91 deletions
This file was deleted.

devel/spicy/autogen/tftp.spicy

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@ import spicy;
1515
# | TFTP Opcode |
1616
# ---------------
1717

18-
public type Packet = unit { # public top-level entry point for parsing
18+
public type Packet = unit {
19+
# public top-level entry point for parsing
1920
op: uint16 &convert=Opcode($$);
20-
switch ( self.op ) {
21-
Opcode::RRQ -> rrq: Request(True);
22-
Opcode::WRQ -> wrq: Request(False);
23-
Opcode::DATA -> data: Data;
24-
Opcode::ACK -> ack: Acknowledgement;
21+
switch (self.op) {
22+
Opcode::RRQ -> rrq: Request(True);
23+
Opcode::WRQ -> wrq: Request(False);
24+
Opcode::DATA -> data: Data;
25+
Opcode::ACK -> ack: Acknowledgement;
2526
Opcode::ERROR -> error: Error;
26-
};
27+
};
2728
};
2829

2930
# TFTP supports five types of packets [...]:
@@ -39,7 +40,7 @@ type Opcode = enum {
3940
WRQ = 0x02,
4041
DATA = 0x03,
4142
ACK = 0x04,
42-
ERROR = 0x05
43+
ERROR = 0x05,
4344
};
4445

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

5253
type Request = unit(is_read: bool) {
5354
filename: bytes &until=b"\x00";
54-
mode: bytes &until=b"\x00";
55+
mode: bytes &until=b"\x00";
5556

56-
on %done { spicy::accept_input(); }
57+
on %done {
58+
spicy::accept_input();
59+
}
5760
};
5861

5962
# Figure 5-2: DATA packet
@@ -64,7 +67,7 @@ type Request = unit(is_read: bool) {
6467
# ----------------------------------
6568

6669
type Data = unit {
67-
num: uint16;
70+
num: uint16;
6871
data: bytes &eod;
6972
};
7073

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

8992
type Error = unit {
9093
code: uint16;
91-
msg: bytes &until=b"\x00";
94+
msg: bytes &until=b"\x00";
9295
};

scripts/base/utils/urls.zeek.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Types
106106
Functions
107107
#########
108108
.. zeek:id:: decompose_uri
109-
:source-code: base/utils/urls.zeek 52 136
109+
:source-code: base/utils/urls.zeek 52 135
110110

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

0 commit comments

Comments
 (0)