Logo Search packages:      
Sourcecode: ufw version File versions

def src::common::UFWRule::normalize (   self  ) 

Normalize src and dst to standard form

Definition at line 212 of file common.py.

00212                        :
        '''Normalize src and dst to standard form'''
        changed = False
        if self.src:
            try:
                (self.src, changed) = ufw.util.normalize_address(self.src, \
                                                                 self.v6)
            except:
                err_msg = _("Could not normalize source address")
                raise UFWError(err_msg)
        if changed:
            self.updated = changed

        if self.dst:
            try:
                (self.dst, changed) = ufw.util.normalize_address(self.dst, \
                                                                   self.v6)
            except:
                err_msg = _("Could not normalize destination address")
                raise UFWError(err_msg)

        if self.dport:
            ports = self.dport.split(',')
            ports.sort()
            self.dport = ','.join(ports)
            
        if self.sport:
            ports = self.sport.split(',')
            ports.sort()
            self.sport = ','.join(ports)

        if changed:
            self.updated = changed

    def match(x, y):


Generated by  Doxygen 1.6.0   Back to index