%PDF- %PDF-
Direktori : /usr/lib/python2.7/site-packages/salt/states/ |
Current File : //usr/lib/python2.7/site-packages/salt/states/nftables.pyo |
� ���^c @@ s� d Z d d l m Z m Z m Z d d l m Z d d l Z e j e � Z d � Z d d d d d d � Z d d d � Z d d � Z d d � Z d d � Z d d � Z d S( u Management of nftables ====================== This is an nftables-specific module designed to manage Linux firewalls. It is expected that this state module, and other system-specific firewall states, may at some point be deprecated in favor of a more generic `firewall` state. .. code-block:: yaml httpd: nftables.append: - table: filter - chain: input - jump: accept - match: state - connstate: new - dport: 80 - proto: tcp - sport: 1025:65535 - save: True httpd: nftables.append: - table: filter - family: ipv6 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - proto: tcp - sport: 1025:65535 - save: True httpd: nftables.insert: - position: 1 - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - proto: tcp - sport: 1025:65535 - save: True httpd: nftables.insert: - position: 1 - table: filter - family: ipv6 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - proto: tcp - sport: 1025:65535 - save: True httpd: nftables.delete: - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - proto: tcp - sport: 1025:65535 - save: True httpd: nftables.delete: - position: 1 - table: filter - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - proto: tcp - sport: 1025:65535 - save: True httpd: nftables.delete: - table: filter - family: ipv6 - chain: INPUT - jump: ACCEPT - match: state - connstate: NEW - dport: 80 - proto: tcp - sport: 1025:65535 - save: True output: nftables.chain_present: - family: ip - table: filter output: nftables.chain_absent: - family: ip - table: filter i ( t absolute_importt print_functiont unicode_literals( t STATE_INTERNAL_KEYWORDSNc C@ s d t k r d St S( uA Only load if the locale module is available in __salt__ u nftables.versionu nftables( t __salt__t False( ( ( s8 /usr/lib/python2.7/site-packages/salt/states/nftables.pyt __virtual__z s u filteru ipv4c C@ s i | d 6i d 6d d 6d d 6} t d | | d | �} | d t k rr t | d <d j | | | � | d <| St d | | d | d | d | d | �} | d t k r� i | d 6| d <t | d <d j | | | � | d <| St | d <d j | | | d j � | � | d <| Sd S( u� .. versionadded:: 2014.7.0 Verify the chain is exist. name A user-defined chain name. table The table to own the chain. family Networking family, either ipv4 or ipv6 u nameu changesu resultu u commentu nftables.check_chaint familyu8 nftables {0} chain is already exist in {1} table for {2}u nftables.new_chaint table_typet hookt priorityu localeu6 nftables {0} chain in {1} table create success for {2}u4 Failed to create {0} chain in {1} table: {2} for {3}N( t NoneR t Truet formatR t strip( t namet tableR R R R t rett chain_checkt res( ( s8 /usr/lib/python2.7/site-packages/salt/states/nftables.pyt chain_present� s<