Packages

A library to streamline creating and following protocols

Current section

Files

Jump to
etiquette lib compilation_tests udp_spec.ex
Raw

lib/compilation_tests/udp_spec.ex

defmodule UDPSpec do
@moduledoc false
use Etiquette.Spec
packet "UDP Header Format", id: :udp_header do
field "Source Port", 16, doc: "This field identifies the sender's port."
field "Destination Port", 16, doc: "This field identifies the receiver's port and is required."
field "Length", 16, id: :length, doc: "This field specifies the length in bytes of the UDP datagram."
field "Checksum", 16, doc: "The checksum field may be used for error-checking of the header and data."
field "Data", (..), length_by: :length, doc: "The payload of the UDP packet."
end
end