Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up some minor spicy tutorial docs #270

Merged
merged 1 commit into from
Aug 8, 2024
Merged
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
20 changes: 14 additions & 6 deletions devel/spicy/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ package with a skeleton of everything needed for an analyzer.
Before proceeding, make sure that your Zeek comes with Spicy support
built-in---which is the default since Zeek version 5.0::

# zeek - N Zeek::Spicy
# zeek -N Zeek::Spicy
Zeek::Spicy - Support for Spicy parsers (*.hlto) (built-in)

You should also have ``spicyz`` in your ``PATH``::
Expand Down Expand Up @@ -82,7 +82,7 @@ protocol analyzer. We follow the same scheme here and put the
following into ``tftp.evt``, the analyzer definition file:

.. literalinclude:: autogen/tftp.evt
:lines: 3-5
:lines: 5-7
:language: spicy-evt

The first line provides our analyzer with a Zeek-side name
Expand Down Expand Up @@ -184,7 +184,7 @@ unit parameter, we can easily separate the two by gating event
generation through an additional ``if`` condition:

.. literalinclude:: autogen/tftp.evt
:lines: 9-10
:lines: 11-12
:language: spicy-evt

This now defines two separate events, each being generated only for
Expand All @@ -208,8 +208,16 @@ function that Spicy makes available once we have successfully parsed a
request: :spicylink:`spicy::accept_input
<programming/library.html#spicy-accept-input>`. That function signals
the host application---i.e., Zeek in our case—--that the parser is
processing the expected protocol. With that, our request looks like
this now:
processing the expected protocol.

First, we need to make sure the Spicy standard library is imported
in ``tftp.spicy``, so that we will have its functions available:

.. code::

import spicy;

With that, our request looks like this now:

.. code-block::

Expand Down Expand Up @@ -241,7 +249,7 @@ events for them as well. The following is our complete ``tftp.evt``
file:

.. literalinclude:: autogen/tftp.evt
:lines: 3-
:lines: 5-
:language: spicy-evt


Expand Down
Loading