You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
suricata/doc/userguide
Eric Leblond f46f895e8d rust/smb: import NT status code for Microsoft doc
This patch updates the NT status code definition to use the status
definition used on Microsoft documentation website. A first python
script is building JSON object with code definition.

```
import json
from bs4 import BeautifulSoup
import requests

ntstatus = requests.get('https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55')

ntstatus_parsed = BeautifulSoup(ntstatus.text, 'html.parser')

ntstatus_parsed = ntstatus_parsed.find('tbody')

ntstatus_dict = {}

for item in ntstatus_parsed.find_all('tr'):
    cell = item.find_all('td')
    if len(cell) == 0:
        continue
    code = cell[0].find_all('p')
    description_ps = cell[1].find_all('p')
    description_list = []
    if len(description_ps):
        for desc in description_ps:
            if not desc.string is None:
                description_list.append(desc.string.replace('\n ', ''))
    else:
        description_list = ['Description not available']
    if not code[0].string.lower() in ntstatus_dict:
        ntstatus_dict[code[0].string.lower()] = {"text": code[1].string, "desc": ' '.join(description_list)}

print(json.dumps(ntstatus_dict))
```

The second one is generating the code that is ready to be inserted into the
source file:

```
import json

ntstatus_file = open('ntstatus.json', 'r')

ntstatus = json.loads(ntstatus_file.read())

declaration_format = 'pub const SMB_NT%s:%su32 = %s;\n'
resolution_format = '        SMB_NT%s%s=> "%s",\n'

declaration = ""
resolution = ""

text_max = len(max([ntstatus[x]['text'] for x in ntstatus.keys()], key=len))

for code in ntstatus.keys():
    text = ntstatus[code]['text']
    text_spaces = ' ' * (4 + text_max - len(text))
    declaration += declaration_format % (text, text_spaces, code)
    resolution += resolution_format % (text, text_spaces, text)

print(declaration)
print('\n')
print('''
pub fn smb_ntstatus_string(c: u32) -> String {
    match c {
''')
print(resolution)
print('''
        _ => { return (c).to_string(); },
    }.to_string()
}
''')
```

Bug #5412.
3 years ago
..
3rd-party-integration doc/userguide: new 3rd party section, add bluecoat 6 years ago
_static doc: Add suricata.css to allow for some custom styling 8 years ago
capture-hardware napatech: Added comment indicating that hba will be deprecated 5 years ago
configuration userguide: add section about exception policies 3 years ago
devguide devguide: incorporate contribution process page 3 years ago
file-extraction http2: allow filestore to work with HTTP2 5 years ago
licenses doc: convert fancy quotes to straight quotes 6 years ago
lua doc: Document SCByteVarGet lua function 3 years ago
manpages userguide: update references to Suricata website 4 years ago
output doc/tls: Add documentation for TLS logging 3 years ago
partials userguide: Add rule file globbing option details 3 years ago
performance userguide: add section about exception policies 3 years ago
reputation userguide: remove old reference to rule-reload option 6 years ago
rule-management doc: Improve grammar, spelling and clarifications 5 years ago
rules rust/smb: import NT status code for Microsoft doc 3 years ago
setting-up-ipsinline-for-linux
upgrade doc: document removal of unified2 5 years ago
.gitignore doc: hook sphinx into build 9 years ago
Makefile.am devguide: drop use of mscgen script in builds/make 3 years ago
Makefile.sphinx doc: hook sphinx into build 9 years ago
README.md devguide: move into userguide as last chapter 3 years ago
acknowledgements.rst doc: Add my own name to the acknowledgements 8 years ago
command-line-options.rst doc: Improve grammar, spelling and clarifications 5 years ago
conf.py doc/conf: fix sphinx language setting 3 years ago
convert.py
index.rst devguide: move into userguide as last chapter 3 years ago
initscripts.rst doc: Improve grammar, spelling and clarifications 5 years ago
install.rst pcre2: remove PCRE1 as dependency 4 years ago
make-sense-alerts.rst doc: Improve grammar, spelling and clarifications 5 years ago
public-data-sets.rst userguide: update wiresharkwiki in public datasets 4 years ago
quickstart.rst doc/quickstart: use new test url that works 4 years ago
setting-up-ipsinline-for-linux.rst userguide: minor rewording and typo fixes 3 years ago
setting-up-ipsinline-for-windows.rst doc: Improve grammar, spelling and clarifications 5 years ago
unix-socket.rst doc: fix URL for unix-socket python example 5 years ago
upgrade.rst doc/userguide: updates for eve dns v1 removal 3 years ago
what-is-suricata.rst doc: Improve grammar, spelling and clarifications 5 years ago

README.md

Suricata User Guide

This directory contains the Suricata Guide. The Suricata Developer's guide is included as a chapter of the Guide. The Sphinx Document Generator is used to build the documentation. For a primer os reStructuredText see the reStructuredText Primer.

Verifying Changes

There are a number of output formats to choose from when making the source documentation locally (e.g. html, pdf, man).

The documentation source can be built with make -f Makefile.sphinx html. Substitute the 'html' word for desired output format.

There are different application dependencies based on the output desired.