Skip to content

Commit

Permalink
revised Field metaclass
Browse files Browse the repository at this point in the history
* added a FieldMeta for better processing
* renamed _Field as FieldBase for clearer indication
  • Loading branch information
JarryShaw committed Oct 4, 2023
1 parent 1b638cc commit c3a79e7
Show file tree
Hide file tree
Showing 27 changed files with 261 additions and 243 deletions.
174 changes: 0 additions & 174 deletions docs/source/pcapkit/corekit/fields.rst

This file was deleted.

12 changes: 12 additions & 0 deletions docs/source/pcapkit/corekit/fields/collections.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Container Fields
----------------

.. module:: pcapkit.corekit.fields.collections

.. autoclass:: pcapkit.corekit.fields.collections.ListField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.collections.OptionField
:members:
:show-inheritance:
40 changes: 40 additions & 0 deletions docs/source/pcapkit/corekit/fields/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Protocol Fields
===============

.. module:: pcapkit.corekit.fields

:mod:`pcapkit.corekit.fields` is collection of protocol fields,
descriptive of the structure of protocol headers.

.. toctree::
:maxdepth: 2

numbers
strings
ipaddress
collections
misc

Base Fields
-----------

.. module:: pcapkit.corekit.fields.field

.. autoclass:: pcapkit.corekit.fields.field.FieldMeta
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.field.FieldBase
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.field.Field
:members:
:show-inheritance:

Auxiliary
~~~~~~~~~

.. autoclass:: pcapkit.corekit.fields.field.NoValueType
.. autodata:: pcapkit.corekit.fields.field.NoValue
:no-value:
38 changes: 38 additions & 0 deletions docs/source/pcapkit/corekit/fields/ipaddress.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
IP Address Fields
-----------------

.. module:: pcapkit.corekit.fields.ipaddress

.. autoclass:: pcapkit.corekit.fields.ipaddress._IPField
:members:
:show-inheritance:

IP Addresses
~~~~~~~~~~~~

.. autoclass:: pcapkit.corekit.fields.ipaddress._IPAddressField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.ipaddress.IPv4AddressField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.ipaddress.IPv6AddressField
:members:
:show-inheritance:

IP Interface
~~~~~~~~~~~~

.. autoclass:: pcapkit.corekit.fields.ipaddress._IPInterfaceField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.ipaddress.IPv4InterfaceField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.ipaddress.IPv6InterfaceField
:members:
:show-inheritance:
24 changes: 24 additions & 0 deletions docs/source/pcapkit/corekit/fields/misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Miscellaneous Fields
--------------------

.. module:: pcapkit.corekit.fields.misc

.. autoclass:: pcapkit.corekit.fields.misc.ConditionalField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.misc.PayloadField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.misc.SwitchField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.misc.ForwardMatchField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.misc.NoValueField
:members:
:show-inheritance:
44 changes: 44 additions & 0 deletions docs/source/pcapkit/corekit/fields/numbers.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Numerical Fields
----------------

.. module:: pcapkit.corekit.fields.numbers

.. autoclass:: pcapkit.corekit.fields.numbers.NumberField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.Int32Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.UInt32Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.Int16Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.UInt16Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.Int64Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.UInt64Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.Int8Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.UInt8Field
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.numbers.EnumField
:members:
:show-inheritance:
24 changes: 24 additions & 0 deletions docs/source/pcapkit/corekit/fields/strings.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Text Fields
-----------

.. module:: pcapkit.corekit.fields.strings

.. autoclass:: pcapkit.corekit.fields.strings._TextField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.strings.BytesField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.strings.StringField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.strings.BitField
:members:
:show-inheritance:

.. autoclass:: pcapkit.corekit.fields.strings.PaddingField
:members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/source/pcapkit/corekit/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ and :class:`~pcapkit.corekit.multidict.MultiDict` family inspired from
.. toctree::
:maxdepth: 2

fields
fields/index
infoclass
io
module
Expand Down
Loading

0 comments on commit c3a79e7

Please sign in to comment.