Skip to content

Commit be6869f

Browse files
committed
Move code for packing ipinterface
1 parent d54f81c commit be6869f

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

flow/record/jsonpacker.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def pack_obj(self, obj: Any) -> dict | str:
6868
"sha1": obj.sha1,
6969
"sha256": obj.sha256,
7070
}
71-
if isinstance(obj, (fieldtypes.net.ipaddress, fieldtypes.net.ipnetwork)):
71+
if isinstance(obj, (fieldtypes.net.ipaddress, fieldtypes.net.ipnetwork, fieldtypes.net.ipinterface)):
7272
return str(obj)
7373
if isinstance(obj, bytes):
7474
return base64.b64encode(obj).decode()
@@ -79,12 +79,6 @@ def pack_obj(self, obj: Any) -> dict | str:
7979
"executable": obj.executable,
8080
"args": obj.args,
8181
}
82-
if isinstance(obj, fieldtypes.net.ipinterface):
83-
return {
84-
"ip": str(obj.ip),
85-
"subnetmask": str(obj.netmask),
86-
"network": str(obj.network),
87-
}
8882

8983
raise TypeError(f"Unpackable type {type(obj)}")
9084

0 commit comments

Comments
 (0)