Skip to content

Commit

Permalink
README: Improved docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
diosney committed Sep 26, 2014
1 parent 189ea95 commit 51a9b9d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ To run the tests just execute:

make test

and they will run.
and they will run. Note that you will somehow execute the commands with `sudo` privileges.

**Important:** Some of the commands are destructive, like `flush` and `delete`, and since some tests
will try to clear all rules and/or chains, you hace to be careful to not have important custom
Expand Down
29 changes: 28 additions & 1 deletion docs/README-iptables.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ The wrapper error codes matches (unsurprisingly) the same as iptables. They are:
'cluster-total-nodes': 2,
'cluster-local-node': 1,
'cluster-hash-seed': '0xdeadbeef'
},
comment: {
comment: '"Some comment."'
}
},

Expand Down Expand Up @@ -235,11 +239,34 @@ The wrapper error codes matches (unsurprisingly) the same as iptables. They are:
}

for (var table_name in dump) {
var table_dump = dump[table];
var table_dump = dump[table_name];

for (var chain_name in table_dump.chains) {
var chain_dump = table_dump.chains[chain_name];
console.log(table_name, chain_name, chain_dump);
}
}
});

#### Check

iptables.check({
table: 'filter', // default: filter
chain: 'chain-name',

protocol: 'tcp',
source: '10.10.10.0/24',
destination: '11.11.11.0/24',

matches: {
comment: {
comment: '"Some comment."'
}
},

jump: 'DROP'
}, function (error) {
if (!error) {
console.log('The rule exists in the chain.');
}
});

0 comments on commit 51a9b9d

Please sign in to comment.