better comply with propellor's layout style

This commit is contained in:
Joey Hess 2015-08-13 10:03:06 -04:00
parent f4abc3c1cb
commit 3ee61b70bb
1 changed files with 11 additions and 7 deletions

View File

@ -45,10 +45,14 @@ toIpTableArg :: Rules -> [String]
toIpTableArg Everything = [] toIpTableArg Everything = []
toIpTableArg (Proto proto) = ["-p", map toLower $ show proto] toIpTableArg (Proto proto) = ["-p", map toLower $ show proto]
toIpTableArg (DPort (Port port)) = ["--dport", show port] toIpTableArg (DPort (Port port)) = ["--dport", show port]
toIpTableArg (DPortRange toIpTableArg (DPortRange (Port f, Port t)) =
(Port f, Port t)) = ["--dport", show f ++ ":" ++ show t] ["--dport", show f ++ ":" ++ show t]
toIpTableArg (IFace iface) = ["-i", iface] toIpTableArg (IFace iface) = ["-i", iface]
toIpTableArg (Ctstate states) = ["-m", "conntrack","--ctstate", concat $ intersperse "," (map show states)] toIpTableArg (Ctstate states) =
[ "-m"
, "conntrack"
, "--ctstate", concat $ intersperse "," (map show states)
]
toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r' toIpTableArg (r :- r') = toIpTableArg r <> toIpTableArg r'
data Rule = Rule data Rule = Rule