ditched kwalify for python with jsonschema and pyyaml.

This commit is contained in:
Marcel 2016-09-18 18:35:20 +02:00
parent 67485f775a
commit e921420dfc
2 changed files with 13 additions and 14 deletions

View File

@ -2,14 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="208c8f22-eeea-487d-8a23-c2fce1eb1434" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/protocols/osi1-2/arp.yml" afterPath="$PROJECT_DIR$/protocols/osi1-2/arp.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/protocols/osi1-2/eth-frame.yml" afterPath="$PROJECT_DIR$/protocols/osi1-2/eth-frame.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/protocols/osi1-2/eth-packet.yml" afterPath="$PROJECT_DIR$/protocols/osi1-2/eth-packet.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/protocols/osi3/icmpv4.yml" afterPath="$PROJECT_DIR$/protocols/osi3/icmpv4.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/protocols/osi3/ipv4.yml" afterPath="$PROJECT_DIR$/protocols/osi3/ipv4.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/schema.yml" afterPath="$PROJECT_DIR$/schema.yml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/validate.py" afterPath="$PROJECT_DIR$/validate.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/README.md" afterPath="$PROJECT_DIR$/README.md" />
</list>
<ignored path="npd.iws" />
<ignored path=".idea/workspace.xml" />

View File

@ -23,11 +23,17 @@ Simple, isn't it?
How to add a new protocol
----
- Clone.
- Install ruby+[kwalify](http://www.kuwata-lab.com/kwalify/) (gem install kwalify).
Requirements:
- Python 3.5
- jsonschema
- PyYaml
- (the old kwalify schemas are still present, but deprecated.)
Howto:
- Clone.
- Check structure-schema.yml.
- Write protocol file in ./protocols/osi[layer]/[protocolname].yml.
- Validate structure with 'kwalify -lf structure-schema.yml [path/to/protocolname].yml' or validate all at once with 'kwalify -lf structure-schema.yml ./protocols/osi*/*.yml'.
- Write protocol file in ./protocols/osi[layer]/[protocolname].yml.
- Validate structure with 'python validate.py -f [path/to/protocolname].yml' or all at once with 'python validate.py --all'
- Set up a merge request.
- Be happy.
@ -36,9 +42,9 @@ How to use this dictionary
Currently not recommended, because the project lacks deeper tests than just schema validation. ;)
- Clone.
- Clone.
- Get a YAML library for your program language. Or get a converter for JSON or XML, to use these markup languages.
- Load desired protocol files, or all of them.
- Load desired protocol files, or all of them.
- Use resulting data structures to build protocol packet structures.
This repository will provide examples or useable code snippets for specific programming languages in the future...