diff --git a/proto/ei-scanner b/proto/ei-scanner index 302efa8..17a5f01 100755 --- a/proto/ei-scanner +++ b/proto/ei-scanner @@ -181,14 +181,19 @@ class Entry: name: str = attr.ib() value: int = attr.ib() + enum: "Enum" = attr.ib() summary: str = attr.ib() since: int = attr.ib() @classmethod def create( - cls, name: str, value: int, summary: str = "", since: int = 1 + cls, name: str, value: int, enum: "Enum", summary: str = "", since: int = 1 ) -> "Entry": - return cls(name=name, value=value, summary=summary, since=since) + return cls(name=name, value=value, enum=enum, summary=summary, since=since) + + @property + def fqdn(self) -> str: + return f"{self.enum.fqdn}_{self.name}" @attr.s @@ -532,7 +537,13 @@ class Protocol(xml.sax.handler.ContentHandler): value = int(attrs["value"]) summary = attrs.get("summary", "") since = int(attrs.get("since", 1)) - entry = Entry.create(name=name, value=value, summary=summary, since=since) + entry = Entry.create( + name=name, + value=value, + enum=self.current_message, + summary=summary, + since=since, + ) try: self.current_message.add_entry(entry) except ValueError as e: