コード例 #1
0
 def start(self):
     if self.cidr_prefix_length is not None:
         start, end = ipu.cidr_to_range(self.first_ip,
                                        self.cidr_prefix_length)
         return start
     else:
         return ipu.to_number(self.first_ip)
コード例 #2
0
 def end(self):
     if self.last_ip is not None:
         return ipu.to_number(self.last_ip)
     if self.cidr_prefix_length is not None:
         start, end = ipu.cidr_to_range(self.first_ip,
                                        self.cidr_prefix_length)
         return end
     return self.start