Server IP : 85.214.239.14 / Your IP : 3.147.48.226 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/2/root/proc/self/root/proc/2/cwd/usr/share/augeas/lenses/dist/ |
Upload File : |
module Iptables = autoload xfm (* Module: Iptables Parse the iptables file format as produced by iptables-save. The resulting tree is fairly simple; in particular a rule is simply a long list of options/switches and their values (if any) This lens should be considered experimental *) let comment = Util.comment let empty = Util.empty let eol = Util.eol let spc = Util.del_ws_spc let dels = Util.del_str let chain_name = store /[A-Za-z0-9_-]+/ let chain = let policy = [ label "policy" . store /ACCEPT|DROP|REJECT|-/ ] in let counters_eol = del /[ \t]*(\[[0-9:]+\])?[ \t]*\n/ "\n" in [ label "chain" . dels ":" . chain_name . spc . policy . counters_eol ] let param (long:string) (short:string) = [ label long . spc . del (/--/ . long | /-/ . short) ("-" . short) . spc . store /(![ \t]*)?[^ \t\n!-][^ \t\n]*/ ] (* A negatable parameter, which can either be FTW ! --param arg or --param ! arg *) let neg_param (long:string) (short:string) = [ label long . [ spc . dels "!" . label "not" ]? . spc . del (/--/ . long | /-/ . short) ("-" . short) . spc . store /(![ \t]*)?[^ \t\n!-][^ \t\n]*/ ] let tcp_flags = let flags = /SYN|ACK|FIN|RST|URG|PSH|ALL|NONE/ in let flag_list (name:string) = Build.opt_list [label name . store flags] (dels ",") in [ label "tcp-flags" . spc . dels "--tcp-flags" . spc . flag_list "mask" . spc . flag_list "set" ] (* misses --set-counters *) let ipt_match = let any_key = /[a-zA-Z-][a-zA-Z0-9-]+/ - /protocol|source|destination|jump|goto|in-interface|out-interface|fragment|match|tcp-flags/ in let any_val = /([^" \t\n!-][^ \t\n]*)|"([^"\\\n]|\\\\.)*"/ in let any_param = [ [ spc . dels "!" . label "not" ]? . spc . dels "--" . key any_key . (spc . store any_val)? ] in (neg_param "protocol" "p" |neg_param "source" "s" |neg_param "destination" "d" |param "jump" "j" |param "goto" "g" |neg_param "in-interface" "i" |neg_param "out-interface" "o" |neg_param "fragment" "f" |param "match" "m" |tcp_flags |any_param)* let chain_action (n:string) (o:string) = [ label n . del (/--/ . n | o) o . spc . chain_name . ipt_match . eol ] let table_rule = chain_action "append" "-A" | chain_action "insert" "-I" | empty let table = [ del /\*/ "*" . label "table" . store /[a-z]+/ . eol . (chain|comment|table_rule)* . dels "COMMIT" . eol ] let lns = (comment|empty|table)* let xfm = transform lns (incl "/etc/sysconfig/iptables" . incl "/etc/sysconfig/iptables.save" . incl "/etc/iptables-save")