Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyroute2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
safeedge
pyroute2
Commits
d7b124b1
Commit
d7b124b1
authored
Apr 07, 2020
by
Florent Fourcot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conntrack: add some __slots__ attribute to reduce memory usage
parent
c748a223
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
pyroute2/conntrack.py
pyroute2/conntrack.py
+6
-0
pyroute2/netlink/nfnetlink/nfctsocket.py
pyroute2/netlink/nfnetlink/nfctsocket.py
+5
-0
No files found.
pyroute2/conntrack.py
View file @
d7b124b1
...
...
@@ -9,6 +9,9 @@ from pyroute2.netlink.nfnetlink.nfctsocket import NFCTSocket
class
NFCTATcpProtoInfo
(
object
):
__slots__
=
(
'state'
,
'wscale_orig'
,
'wscale_reply'
,
'flags_orig'
,
'flags_reply'
)
def
__init__
(
self
,
state
,
wscale_orig
=
None
,
wscale_reply
=
None
,
flags_orig
=
None
,
flags_reply
=
None
):
self
.
state
=
state
...
...
@@ -49,6 +52,9 @@ class NFCTATcpProtoInfo(object):
class
ConntrackEntry
(
object
):
__slots__
=
(
'tuple_orig'
,
'tuple_reply'
,
'status'
,
'timeout'
,
'protoinfo'
,
'mark'
,
'id'
,
'use'
)
def
__init__
(
self
,
family
,
tuple_orig
,
tuple_reply
,
cta_status
,
cta_timeout
,
cta_protoinfo
,
cta_mark
,
cta_id
,
cta_use
):
self
.
tuple_orig
=
NFCTAttrTuple
.
from_netlink
(
family
,
tuple_orig
)
...
...
pyroute2/netlink/nfnetlink/nfctsocket.py
View file @
d7b124b1
...
...
@@ -367,6 +367,11 @@ class NFCTAttr(object):
class
NFCTAttrTuple
(
NFCTAttr
):
__slots__
=
(
'saddr'
,
'daddr'
,
'proto'
,
'sport'
,
'dport'
,
'icmp_id'
,
'icmp_type'
,
'family'
,
'_attr_ip'
,
'_attr_icmp'
)
def
__init__
(
self
,
family
=
socket
.
AF_INET
,
saddr
=
None
,
daddr
=
None
,
proto
=
None
,
sport
=
None
,
dport
=
None
,
icmp_id
=
None
,
icmp_type
=
None
,
icmp_code
=
None
):
...
...
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