(field name, field type, default value) +
-[example]
-====
+
*Example:* +
this is the 'dst' field for the 'Ether' protocol
[source,bash]
["dst","MACField","('00:00:00:01:00:00')"]
----
-====
+
=== Offsets Dictionary and Offset Entry
==== The *"Offset Entry"* data sturcture contains the offset of a field within the *layer*, and its size. +
[field offset (within the layer), field size] +
-[example]
-====
+
*Example:* +
This is the 'src' field for the 'IP' protocol: +
the offset within the layer is 16 bytes, and the size of the field is 4 bytes (as defined in the IP spec)
----
'dst': [16, 4]
----
-====
==== The *"Offsets Dictionary"* data sturcture simply maps the offsets for each layer according to name. +
Has the following structure: +
+
-[example]
-====
+
*Example:* +
This is the Offsets Dictionary for the IP layer: +
[source,bash]
}
}
----
-====
+
Each layer has a 'global_offset' key. this key represents the *offset of the layer within the packet*. +
In the example above, the IP layer starts at offset 0, and the field src is at offset 12 within the packet. +
'Protocol Name' : 'Protocol Field Description' +
+
-[example]
-====
+
*Example*: +
[source,bash]
----
.
}
----
-====
+
=== Fields Dictionary
The fields dictionary contains mapping between a field's name and its regular expression, +
Which has the following structure: +
=== Get protocol tree hierarchy example
* *Name* - 'get_tree'
-* *Description* - returns a dictionary of protocols ordered in an hierarchy tree +
-* *Paramters* - none
-* *Result* [dictionary] - example for packet layers that can be used to build a packet. ordered in an hierarchy tree
+* *Description* - returns a *suggested* dictionary of protocols ordered in a hierarchy tree. +
+User can still create non valid hierarchies. (such as Ether()/DNS()/IP())
+* *Parameters* - none
+* *Result* [dictionary] - Example for packet layers that can be used to build a packet. Ordered in an hierarchy tree.
*Example:*
* Run the Python Interpreter (Scapy Server currently supports Python2)
* Import the scapy_zmq_server.py file
* Create a Scapy_server Object with argument as port number. default argument is port 4507
-* Invoke method activate. this is blocking because the server is listening on the port
+* Invoke method activate(). (This method is blocking because the server is listening on the port).
[source,bash]
----