mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Remove devel/spicy/autogen/tftp-no-accept.spicy
This commit is contained in:
parent
423d3864da
commit
7e638a41f2
2 changed files with 0 additions and 95 deletions
|
@ -39,7 +39,6 @@ fi
|
||||||
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
|
|
||||||
|
|
||||||
# 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}/"
|
||||||
|
|
|
@ -1,94 +0,0 @@
|
||||||
# Copyright (c) 2021 by the Zeek Project. See LICENSE for details.
|
|
||||||
#
|
|
||||||
# Trivial File Transfer Protocol
|
|
||||||
#
|
|
||||||
# Specs from https://tools.ietf.org/html/rfc1350
|
|
||||||
|
|
||||||
module TFTP;
|
|
||||||
|
|
||||||
import spicy;
|
|
||||||
|
|
||||||
# Common header for all messages:
|
|
||||||
#
|
|
||||||
# 2 bytes
|
|
||||||
# ---------------
|
|
||||||
# | TFTP Opcode |
|
|
||||||
# ---------------
|
|
||||||
|
|
||||||
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;
|
|
||||||
Opcode::ERROR -> error: Error;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# TFTP supports five types of packets [...]:
|
|
||||||
#
|
|
||||||
# opcode operation
|
|
||||||
# 1 Read request (RRQ)
|
|
||||||
# 2 Write request (WRQ)
|
|
||||||
# 3 Data (DATA)
|
|
||||||
# 4 Acknowledgment (ACK)
|
|
||||||
# 5 Error (ERROR)
|
|
||||||
type Opcode = enum {
|
|
||||||
RRQ = 0x01,
|
|
||||||
WRQ = 0x02,
|
|
||||||
DATA = 0x03,
|
|
||||||
ACK = 0x04,
|
|
||||||
ERROR = 0x05,
|
|
||||||
};
|
|
||||||
|
|
||||||
# Figure 5-1: RRQ/WRQ packet
|
|
||||||
#
|
|
||||||
# 2 bytes string 1 byte string 1 byte
|
|
||||||
# ------------------------------------------------
|
|
||||||
# | Opcode | Filename | 0 | Mode | 0 |
|
|
||||||
# ------------------------------------------------
|
|
||||||
|
|
||||||
type Request = unit(is_read: bool) {
|
|
||||||
filename: bytes &until=b"\x00";
|
|
||||||
mode: bytes &until=b"\x00";
|
|
||||||
|
|
||||||
on %done {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
# Figure 5-2: DATA packet
|
|
||||||
#
|
|
||||||
# 2 bytes 2 bytes n bytes
|
|
||||||
# ----------------------------------
|
|
||||||
# | Opcode | Block # | Data |
|
|
||||||
# ----------------------------------
|
|
||||||
|
|
||||||
type Data = unit {
|
|
||||||
num: uint16;
|
|
||||||
data: bytes &eod;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Figure 5-3: ACK packet
|
|
||||||
#
|
|
||||||
# 2 bytes 2 bytes
|
|
||||||
# ---------------------
|
|
||||||
# | Opcode | Block # |
|
|
||||||
# ---------------------
|
|
||||||
|
|
||||||
type Acknowledgement = unit {
|
|
||||||
num: uint16;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Figure 5-4: ERROR packet
|
|
||||||
#
|
|
||||||
# 2 bytes 2 bytes string 1 byte
|
|
||||||
# -----------------------------------------
|
|
||||||
# | Opcode | ErrorCode | ErrMsg | 0 |
|
|
||||||
# -----------------------------------------
|
|
||||||
|
|
||||||
type Error = unit {
|
|
||||||
code: uint16;
|
|
||||||
msg: bytes &until=b"\x00";
|
|
||||||
};
|
|
Loading…
Add table
Add a link
Reference in a new issue