Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi committed Jan 8, 2025
1 parent f129005 commit 1071dc5
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 14 deletions.
18 changes: 11 additions & 7 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@ EXTRA_DIST = README.md README.fuzzer.md CHANGELOG.md CONTRIBUTING.md \
autogen.sh wireshark windows utils packages dga \
influxdb/Makefile.in influxdb/metric_anomaly.c influxdb/README.txt \
rrdtool/Makefile.in rrdtool/README.txt rrdtool/rrd_anomaly.c rrdtool/rrd_similarity.c \
doc/requirements.txt doc/monitoring.md doc/conf.py doc/flow_risks.rst doc/protocols.rst doc/guide/nDPI_QuickStartGuide.pages \
doc/requirements.txt doc/conf.py doc/flow_risks.rst doc/protocols.rst doc/guide/nDPI_QuickStartGuide.pages \
doc/guide/nDPI_QuickStartGuide.pdf doc/img/logo.png doc/index.rst \
doc/Makefile doc/what_is_ndpi.rst doc/FAQ.md doc/configuration_parameters.md \
doc/library_initialization.md \
doc/Makefile doc/what_is_ndpi.rst \
doc/FAQ.md doc/include_FAQ.rst \
doc/configuration_parameters.md doc/include_configuration_parameters.rst \
doc/library_initialization.md doc/include_library_initialization.rst \
doc/monitoring.md doc/include_monitoring.rst \
doc/_static/custom.css \
python/DEV_GUIDE.md python/dev_requirements.txt python/ndpi_example.py python/ndpi/__init__.py \
python/ndpi/ndpi_build.py python/ndpi/ndpi.py python/README.md \
python/requirements.txt python/setup.py python/tests.py \
lists/100_malware.list \
lists/107_gambling.list \
lists/107_gambling_custom.list \
lists/public_suffix_list.dat \
lists/README.md \
lists/107_gambling.list \
lists/107_gambling_custom.list \
lists/public_suffix_list.dat \
lists/README.md \
sonar-project.properties .github .ci-ignore

doc:
Expand Down
3 changes: 2 additions & 1 deletion doc/FAQ.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

# FAQ

From https://www.ntop.org/ndpi/ndpi-internals-and-frequent-questions/
From [blog post](https://www.ntop.org/ndpi/ndpi-internals-and-frequent-questions/)

**Q**: How nDPI implements protocol detection?\
**A**: nDPI includes a list of protocol dissectors (364 as of today) that are able to dissect protocols such as WhatsApp or TLS. As soon as a new flow is submitted to nDPI, the library applies in sequence dissectors that can potentially match the protocols (i.e. telnet is a TCP-based protocol, and it will not be considered for UDP flows). We start from the dissector that can most probably match using the port number. This means for traffic on TCP/22 nDPI will start with the SSH dissectors and if not matching continue with the others. Dissection completes as soon as a protocol matches or when none of them matched and in this case the flow will be labelled as Unknown.
Expand Down
3 changes: 3 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.wy-nav-content {
max-width: 75% !important;
}
10 changes: 6 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
extensions = [
'sphinx.ext.intersphinx',
'breathe',
'exhale'
'exhale',
'myst_parser'
]

# Workaround for platforms where swaggerdoc is not available
Expand All @@ -49,7 +50,7 @@

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
source_suffix = ['.rst', '.md']
source_suffix = {'.rst': 'restructuredtext', '.md': 'restructuredtext'}
#source_suffix = '.rst'

# The encoding of source files.
Expand Down Expand Up @@ -152,7 +153,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['_static']
html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -298,7 +299,8 @@
# If true, do not generate a @detailmenu in the "Top" node's menu.
#texinfo_no_detailmenu = False

intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}

def setup(app):
app.add_css_file('css/ntop.css')
app.add_css_file('custom.css')
2 changes: 1 addition & 1 deletion doc/configuration_parameters.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Configuration knobs

TODO
List of the supported configuration options:

| Protocol | Parameter | Default value | Min value | Max value | Description | Notes |
| ------ | ------ | ------ | ------ | ------ | ------ | ------ |
Expand Down
2 changes: 2 additions & 0 deletions doc/include_FAQ.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: FAQ.md
:parser: myst_parser.sphinx_
2 changes: 2 additions & 0 deletions doc/include_configuration_parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: configuration_parameters.md
:parser: myst_parser.sphinx_
2 changes: 2 additions & 0 deletions doc/include_library_initialization.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: library_initialization.md
:parser: myst_parser.sphinx_
2 changes: 2 additions & 0 deletions doc/include_monitoring.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.. include:: monitoring.md
:parser: myst_parser.sphinx_
4 changes: 4 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ nDPI is an open source DPI (Deep Packet Inspection) toolkit for traffic analysis
:caption: User's Guide

what_is_ndpi
include_FAQ

.. toctree::
:maxdepth: 2
Expand All @@ -16,6 +17,9 @@ nDPI is an open source DPI (Deep Packet Inspection) toolkit for traffic analysis
api/library_root
protocols
flow_risks
include_configuration_parameters
include_library_initialization
include_monitoring

.. toctree::
:caption: Other Products
Expand Down
2 changes: 1 addition & 1 deletion doc/library_initialization.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


# Library Initialization

A simple, common example

Expand Down
1 change: 1 addition & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ breathe
exhale
sphinx-rtd-theme
sphinxcontrib-swaggerdoc
myst_parser

0 comments on commit 1071dc5

Please sign in to comment.