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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Hide 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:
"""Close intra-VLAN chains."""
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
)
def
ipt_filter_vlan_jump
(
self
):
...
...
@@ -100,7 +100,7 @@ class BuildFirewall:
except
KeyError
:
pass
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
))
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):
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
"source port"
),
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)],
help_text
=
_
(
"Source port number of packets that match."
))
priority
=
models
.
IntegerField
(
verbose_name
=
_
(
"
priority
"
),
weight
=
models
.
IntegerField
(
verbose_name
=
_
(
"
weight
"
),
validators
=
[
MinValueValidator
(
1
),
MaxValueValidator
(
65535
)],
help_text
=
_
(
"
TODO
"
),
default
=
1
000
)
help_text
=
_
(
"
Rule weight
"
),
default
=
30
000
)
proto
=
models
.
CharField
(
max_length
=
10
,
choices
=
CHOICES_proto
,
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
"protocol"
),
help_text
=
_
(
"Protocol of packets that match."
))
...
...
@@ -205,7 +205,7 @@ class Rule(models.Model):
# process foreign vlans
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
,
src
=
src
,
dst
=
dst
,
dport
=
dport
,
sport
=
sport
)
# 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