Feature: Improve Firewall
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
-
-
-
-
Owner
👍
138 | ipv6 = IPAddress(ipv6, version=6) | |
293 | 139 | octets = [] |
294 | for part in ipv6.split(':'): | |
295 | if not part: | |
296 | octets.extend([0, 0]) | |
297 | else: | |
298 | # Pad hex part to 4 digits. | |
299 | part = '%04x' % int(part, 16) | |
300 | octets.append(int(part[:2], 16)) | |
301 | octets.append(int(part[2:], 16)) | |
140 | for part in ipv6.words: | |
141 | # Pad hex part to 4 digits. | |
142 | part = '%04x' % part | |
143 | octets.append(int(part[:2], 16)) | |
144 | octets.append(int(part[2:], 16)) | |
302 | 145 | return '\\' + '\\'.join(['%03o' % x for x in octets]) |
Please
register
or
sign in
to reply
|
58 | 59 | blank=True, null=True, verbose_name=_("source port"), |
59 | 60 | validators=[MinValueValidator(1), MaxValueValidator(65535)], |
60 | 61 | help_text=_("Source port number of packets that match.")) |
62 | priority = models.IntegerField( | |
63 | verbose_name=_("priority"), | |
64 | validators=[MinValueValidator(1), MaxValueValidator(65535)], | |
65 | help_text=_("TODO"), | |
66 | default=1000) | |
61 | 67 | proto = models.CharField(max_length=10, choices=CHOICES_proto, |
62 | 68 | blank=True, null=True, verbose_name=_("protocol"), |
63 | 69 | help_text=_("Protocol of packets that match.")) |
64 | 70 | extra = models.TextField(blank=True, verbose_name=_("extra arguments"), |
65 | 71 | help_text=_("Additional arguments passed " |
66 | 72 | "literally to the iptables-rule.")) |
67 | accept = models.BooleanField(default=False, verbose_name=_("accept"), | |
73 | accept = models.BooleanField(default=True, verbose_name=_("accept"), | |
|
449 | 501 | |
450 | 502 | @property |
451 | 503 | def incoming_rules(self): |
452 | return self.rules.filter(direction='1') | |
504 | return self.rules.filter(direction='in') | |
505 | ||
506 | @property | |
507 | def ipv6_with_prefixlen(self): | |
508 | try: | |
509 | net = IPNetwork(self.ipv6) | |
510 | net.prefixlen = 112 | |
|
mentioned in merge request !46 (merged)
mentioned in merge request !46 (merged)