Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions netflow/ipfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,15 @@ def __init__(self, data, template: List[Union[TemplateField, TemplateFieldEnterp
# See comment in IPFIXFieldTypes.get_type_unpack for more information.

field_type = IPFIXFieldTypes.by_id(field_type_id) # type: Optional[FieldType]
if not field_type and type(field) is not TemplateFieldEnterprise:
# This should break, since the exporter seems to use a field identifier
# which is not standardized by IANA.
raise NotImplementedError("Field type with ID {} is not implemented".format(field_type_id))
if not field_type:
if type(field) is not TemplateFieldEnterprise:
# This should break, since the exporter seems to use a field identifier
# which is not standardized by IANA.
raise NotImplementedError("Field type with ID {} is not implemented".format(field_type_id))
else:
# This should break, since the exporter seems to use a field identifier
# which is not suppored
raise NotImplementedError("Field type with ID {} is not suppored".format(field_type_id))

datatype = field_type.type # type: str
discovered_fields.append((datatype, field_type_id))
Expand Down