Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1d9db1cf
authored
Mar 27, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: rename Rule.priority to weight
parent
fb51025b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
7 deletions
+7
-7
circle/firewall/fw.py
+2
-2
circle/firewall/migrations/0047_auto__del_field_rule_priority__add_field_rule_weight.py
+0
-0
circle/firewall/models.py
+5
-5
No files found.
circle/firewall/fw.py
View file @
1d9db1cf
...
@@ -86,7 +86,7 @@ class BuildFirewall:
...
@@ -86,7 +86,7 @@ class BuildFirewall:
"""Close intra-VLAN chains."""
"""Close intra-VLAN chains."""
for
chain
in
self
.
chains
.
values
():
for
chain
in
self
.
chains
.
values
():
close_chain_rule
=
IptRule
(
priority
=
65534
,
action
=
'LOG_DROP'
)
close_chain_rule
=
IptRule
(
priority
=
1
,
action
=
'LOG_DROP'
)
chain
.
add
(
close_chain_rule
)
chain
.
add
(
close_chain_rule
)
def
ipt_filter_vlan_jump
(
self
):
def
ipt_filter_vlan_jump
(
self
):
...
@@ -100,7 +100,7 @@ class BuildFirewall:
...
@@ -100,7 +100,7 @@ class BuildFirewall:
except
KeyError
:
except
KeyError
:
pass
pass
else
:
else
:
jump_rule
=
IptRule
(
priority
=
1
,
action
=
chain
.
name
,
jump_rule
=
IptRule
(
priority
=
65535
,
action
=
chain
.
name
,
extra
=
'-i
%
s -o
%
s'
%
(
vl_in
,
vl_out
))
extra
=
'-i
%
s -o
%
s'
%
(
vl_in
,
vl_out
))
self
.
add_rules
(
FORWARD
=
jump_rule
)
self
.
add_rules
(
FORWARD
=
jump_rule
)
...
...
circle/firewall/migrations/0047_auto__del_field_rule_priority__add_field_rule_weight.py
0 → 100644
View file @
1d9db1cf
This diff is collapsed.
Click to expand it.
circle/firewall/models.py
View file @
1d9db1cf
...
@@ -59,11 +59,11 @@ class Rule(models.Model):
...
@@ -59,11 +59,11 @@ class Rule(models.Model):
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
"source port"
),
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
"source port"
),
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)],
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)],
help_text
=
_
(
"Source port number of packets that match."
))
help_text
=
_
(
"Source port number of packets that match."
))
priority
=
models
.
IntegerField
(
weight
=
models
.
IntegerField
(
verbose_name
=
_
(
"
priority
"
),
verbose_name
=
_
(
"
weight
"
),
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)],
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)],
help_text
=
_
(
"
TODO
"
),
help_text
=
_
(
"
Rule weight
"
),
default
=
1
000
)
default
=
30
000
)
proto
=
models
.
CharField
(
max_length
=
10
,
choices
=
CHOICES_proto
,
proto
=
models
.
CharField
(
max_length
=
10
,
choices
=
CHOICES_proto
,
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
"protocol"
),
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
"protocol"
),
help_text
=
_
(
"Protocol of packets that match."
))
help_text
=
_
(
"Protocol of packets that match."
))
...
@@ -205,7 +205,7 @@ class Rule(models.Model):
...
@@ -205,7 +205,7 @@ class Rule(models.Model):
# process foreign vlans
# process foreign vlans
for
foreign_vlan
in
self
.
foreign_network
.
vlans
.
all
():
for
foreign_vlan
in
self
.
foreign_network
.
vlans
.
all
():
r
=
IptRule
(
priority
=
self
.
priority
,
action
=
action
,
r
=
IptRule
(
priority
=
self
.
weight
,
action
=
action
,
proto
=
self
.
proto
,
extra
=
self
.
extra
,
proto
=
self
.
proto
,
extra
=
self
.
extra
,
src
=
src
,
dst
=
dst
,
dport
=
dport
,
sport
=
sport
)
src
=
src
,
dst
=
dst
,
dport
=
dport
,
sport
=
sport
)
# host, hostgroup or vlan rule
# host, hostgroup or vlan rule
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment