-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Included Semistandard dev dependency. Changes reflect bringing codebase to semistandard-standard.
- Loading branch information
Dustyn Blackmore
committed
May 20, 2018
1 parent
f921d10
commit 45a54a7
Showing
14 changed files
with
3,306 additions
and
94 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,4 @@ module.exports = (dependencies) => (nfpacket) => { | |
} | ||
|
||
return false; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,32 @@ | ||
module.exports = (dependencies) => (state) => ({ | ||
accept: () => { | ||
state.nfpacket | ||
return state.nfpacket | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_ACCEPT, state.mark) | ||
: false | ||
: false; | ||
}, | ||
reject: () => { | ||
// This allows us to admin-prohibit and immediately reject outgoing, intead of droop (timeout). | ||
if (state.direction === 'outgoing') { | ||
state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_REPEAT, 777) | ||
return state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_REPEAT, 777); | ||
} else { | ||
state.nfpacket | ||
return state.nfpacket | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_DROP, state.mark) | ||
: false | ||
: false; | ||
} | ||
}, | ||
requeue: () => { | ||
state.nfpacket | ||
return state.nfpacket | ||
? state.nfpacket.setVerdict(state.enums.netfilterVerdict.NF_REPEAT, state.mark) | ||
: false | ||
: false; | ||
}, | ||
getVerdict: () => { | ||
switch (state.verdict) { | ||
case state.enums.netfilterVerdict.NF_ACCEPT: | ||
return state.verdicts.accept; | ||
break; | ||
case state.enums.netfilterVerdict.NF_REPEAT: | ||
return state.verdicts.requeue; | ||
break; | ||
default: | ||
return state.verdicts.reject; | ||
break; | ||
} | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
const rules = require('./rules'); | ||
|
||
const nft = (dependencies) => { | ||
|
||
if (Object.keys(dependencies).includes('exec')) { | ||
return Object.assign( | ||
{}, | ||
nft, | ||
rules(dependencies.exec) | ||
) | ||
); | ||
} | ||
|
||
return false; | ||
} | ||
}; | ||
|
||
module.exports = nft; |
Oops, something went wrong.