Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not support "AUGMENTS"? #23

Open
ewildgoose opened this issue Jun 7, 2023 · 0 comments
Open

Does not support "AUGMENTS"? #23

ewildgoose opened this issue Jun 7, 2023 · 0 comments

Comments

@ewildgoose
Copy link

ewildgoose commented Jun 7, 2023

I think the current library fails if using "AUGMENTS" in an mib? I wanted to implement IF-MIB in my app, so I created a stub something like:

defmodule SnmpAgent.Mib.If do
  use Snmp.Mib, name: "IF-MIB"
end

Then added IF-MIB and IANAifType-MIB into my local mibs directory. This fails with an error:

Generated sys_data app
==> snmp_agent
Compiling 10 files (.ex)

== Compilation error in file lib/snmp_agent/mib/if.ex ==
** (Protocol.UndefinedError) protocol Enumerable not implemented for {:augments, {:ifEntry, :undefined}} of type Tuple
    (elixir 1.14.5) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.14.5) lib/enum.ex:166: Enumerable.reduce/3
    (elixir 1.14.5) lib/enum.ex:4307: Enum.map/2
    (elixir_snmp 0.2.1) lib/snmp/mib/table_info.ex:66: Snmp.Mib.TableInfo.find_indices/1
    (elixir_snmp 0.2.1) lib/snmp/mib/table_info.ex:27: Snmp.Mib.TableInfo.new/2
    (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir 1.14.5) lib/enum.ex:1658: Enum."-map/2-lists^map/1-0-"/2
    (elixir_snmp 0.2.1) expanding macro: Snmp.Mib.__using__/1

If I replace the "AUGMENTS { ifEntry }" in IfXEntry, then it compiles (and gives me errors about missing definitions)

So I speculate that it's something to do with the thing being augmented being described in the same file? However, I'm not sure how to progress to resolve this? Any guidance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant