├── .formatter.exs
├── .gitignore
├── .gitlab-ci.yml
├── .iex.exs
├── LICENSE.MPL
├── README.md
├── config
└── config.exs
├── dev_test.sh
├── dialyzer.ignore
├── lib
├── snmp.ex
├── snmp
│ ├── discovery_agent.ex
│ ├── mib.ex
│ └── utility.ex
└── snmp_check.ex
├── mix.exs
├── mix.lock
├── priv
└── .gitkeep
├── run_dialyzer.sh
├── snmp-elixir.iml
├── snmp_ex.iml
├── tcpdump_lo0.sh
└── test
├── fixtures
├── broken_mibs
│ ├── DISMAN-EVENT-MIB.mib
│ ├── IPV6-ICMP-MIB.mib
│ ├── IPV6-MIB.mib
│ ├── IPV6-TC.mib
│ ├── IPV6-TCP-MIB.mib
│ ├── IPV6-UDP-MIB.mib
│ ├── UCD-DEMO-MIB.mib
│ ├── UCD-DISKIO-MIB.mib
│ ├── UCD-DLMOD-MIB.mib
│ ├── UCD-IPFWACC-MIB.mib
│ └── UCD-SNMP-MIB.mib
└── mibs
│ ├── AGENTX-MIB.mib
│ ├── BRIDGE-MIB.mib
│ ├── CISCO-SMI.mib
│ ├── CISCO-VTP-MIB.mib
│ ├── DISMAN-EVENT-MIB.mib
│ ├── DISMAN-SCHEDULE-MIB.mib
│ ├── DISMAN-SCRIPT-MIB.mib
│ ├── EtherLike-MIB.mib
│ ├── HCNUM-TC.mib
│ ├── HOST-RESOURCES-MIB.mib
│ ├── HOST-RESOURCES-TYPES.mib
│ ├── IANA-ADDRESS-FAMILY-NUMBERS-MIB.mib
│ ├── IANA-LANGUAGE-MIB.mib
│ ├── IANA-RTPROTO-MIB.mib
│ ├── IANAifType-MIB.mib
│ ├── IF-INVERTED-STACK-MIB.mib
│ ├── IF-MIB.mib
│ ├── INET-ADDRESS-MIB.mib
│ ├── IP-FORWARD-MIB.mib
│ ├── IP-MIB.mib
│ ├── IPV6-FLOW-LABEL-MIB.mib
│ ├── NET-SNMP-AGENT-MIB.mib
│ ├── NET-SNMP-EXAMPLES-MIB.mib
│ ├── NET-SNMP-EXTEND-MIB.mib
│ ├── NET-SNMP-MIB.mib
│ ├── NET-SNMP-PASS-MIB.mib
│ ├── NET-SNMP-TC.mib
│ ├── NET-SNMP-VACM-MIB.mib
│ ├── NOTIFICATION-LOG-MIB.mib
│ ├── RFC-1215.mib
│ ├── RFC1155-SMI.mib
│ ├── RFC1213-MIB.mib
│ ├── RMON-MIB.mib
│ ├── SCTP-MIB.mib
│ ├── SMUX-MIB.mib
│ ├── SNMP-COMMUNITY-MIB.mib
│ ├── SNMP-FRAMEWORK-MIB.mib
│ ├── SNMP-MPD-MIB.mib
│ ├── SNMP-NOTIFICATION-MIB.mib
│ ├── SNMP-PROXY-MIB.mib
│ ├── SNMP-TARGET-MIB.mib
│ ├── SNMP-TLS-TM-MIB.mib
│ ├── SNMP-TSM-MIB.mib
│ ├── SNMP-USER-BASED-SM-MIB.mib
│ ├── SNMP-USM-AES-MIB.mib
│ ├── SNMP-USM-DH-OBJECTS-MIB.mib
│ ├── SNMP-VIEW-BASED-ACM-MIB.mib
│ ├── SNMPv2-CONF.mib
│ ├── SNMPv2-MIB.mib
│ ├── SNMPv2-SMI.mib
│ ├── SNMPv2-TC.mib
│ ├── SNMPv2-TM.mib
│ ├── TCP-MIB.mib
│ ├── TRANSPORT-ADDRESS-MIB.mib
│ ├── TUNNEL-MIB.mib
│ ├── UCD-DEMO-MIB.mib
│ ├── UCD-DISKIO-MIB.mib
│ ├── UCD-DLMOD-MIB.mib
│ ├── UCD-IPFWACC-MIB.mib
│ ├── UCD-SNMP-MIB.mib
│ └── UDP-MIB.mib
├── snmp
├── discovery_agent_test.exs
├── mib_test.exs
└── utility_test.exs
├── snmp_test.exs
└── test_helper.exs
/.formatter.exs:
--------------------------------------------------------------------------------
1 | [ inputs: [],
2 | line_length: 59,
3 | ]
4 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # The directory Mix will write compiled artifacts to.
2 | /_build
3 |
4 | # If you run "mix test --cover", coverage assets end up here.
5 | /cover
6 |
7 | # The directory Mix downloads your dependencies sources to.
8 | /deps
9 |
10 | # Where 3rd-party dependencies like ExDoc output generated docs.
11 | /doc
12 |
13 | # Ignore .fetch files in case you like to edit your project deps locally.
14 | /.fetch
15 |
16 | # If the VM crashes, it generates a dump, let's ignore it too.
17 | erl_crash.dump
18 |
19 | # Also ignore archive artifacts (built via "mix archive.build").
20 | *.ez
21 |
22 | # Ignore hidden and swap files
23 | .*
24 | !.gitkeep
25 | !.iex.exs
26 | *~
27 |
28 | # Ignore snmp state
29 | /priv/snmp
30 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | image: elixir:latest
2 |
3 | services:
4 | - name: davaeron/snmpsim
5 | alias: snmpsim
6 |
7 | variables:
8 | MIX_ENV: test
9 |
10 | before_script:
11 | - echo "Elixir v${ELIXIR_VERSION/v/} (compiled with OTP $OTP_VERSION)"
12 | - export PLT_FILENAME=elixir-${ELIXIR_VERSION/v/}_${OTP_VERSION}.plt
13 | - export PLT_TESTNAME=dialyxir_erlang-${OTP_VERSION}_elixir-${ELIXIR_VERSION/v/}_deps-${MIX_ENV}.plt
14 | - export PLT_LOCATION=_build/$MIX_ENV/$PLT_TESTNAME
15 | - mix local.hex --force
16 | - mix local.rebar --force
17 | # Install dialyxir
18 | - git clone https://github.com/asummers/erlex.git
19 | - cd erlex
20 | - mix deps.get
21 | - mix do compile, archive.build
22 | - mix archive.install --force
23 | - cd ..
24 | - git clone https://github.com/jeremyjh/dialyxir.git
25 | - cd dialyxir
26 | - mix deps.get
27 | - MIX_ENV=prod mix do compile, archive.build
28 | - MIX_ENV=prod mix archive.install --force
29 | - cd ..
30 | # Download and stage pre-built PLT
31 | - mkdir -p _build/$MIX_ENV
32 | - wget -O $PLT_LOCATION https://gitlab.com/jonnystorm/gitlab-elixir-plts/raw/master/$PLT_FILENAME
33 |
34 | mix:
35 | script:
36 | - mix do deps.get, deps.compile
37 | - mix test --include integrated
38 | - mix dialyzer
39 |
40 |
--------------------------------------------------------------------------------
/.iex.exs:
--------------------------------------------------------------------------------
1 | uri = URI.parse("snmp://127.0.0.1")
2 | creds = SNMP.credential(%{version: :v2, community: "public"})
3 | varbinds = [%{oid: [1, 3, 6, 1, 2, 1, 1]}]
4 |
5 | defmodule Iex_SNMP do
6 | def uri do
7 | URI.parse("snmp://127.0.0.1")
8 | end
9 |
10 | def creds do
11 | SNMP.credential(%{version: :v2, community: "public"})
12 | end
13 |
14 | def vb_simple do
15 | [%{oid: [1, 3, 6, 1, 2, 1, 1]}]
16 | end
17 |
18 | def vb_if do
19 | [%{oid: [1, 3, 6, 1, 2, 1, 2, 2, 1]}]
20 | end
21 |
22 | def vb_ifx do
23 | [%{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1]}]
24 | end
25 |
26 | def vb_ifx_name do
27 | [%{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1]}]
28 | end
29 |
30 | def get_request do
31 | SNMP.request(%{uri: uri(), credential: creds(), varbind: [system_varbinds()]})
32 | end
33 |
34 | def system_varbinds do
35 | [
36 | %{oid: [1, 3, 6, 1, 2, 1, 1, 1, 0]},
37 | %{oid: [1, 3, 6, 1, 2, 1, 1, 3, 0]},
38 | %{oid: [1, 3, 6, 1, 2, 1, 1, 4, 0]},
39 | %{oid: [1, 3, 6, 1, 2, 1, 1, 5, 0]}
40 | ]
41 | end
42 |
43 | def be_specific do
44 | [
45 | %{oid: [1, 3, 6, 1, 2, 1, 1, 1, 0]},
46 | %{oid: [1, 3, 6, 1, 2, 1, 1, 3, 0]},
47 | %{oid: [1, 3, 6, 1, 2, 1, 1, 4, 0]},
48 | %{oid: [1, 3, 6, 1, 2, 1, 1, 5, 0]},
49 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 1]},
50 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1, 2]},
51 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6, 1]},
52 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6, 2]},
53 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 10, 1]},
54 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 10, 2]}
55 | ]
56 | end
57 |
58 | def ifx_name_octet_varbinds do
59 | [
60 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 1]},
61 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 6]},
62 | %{oid: [1, 3, 6, 1, 2, 1, 31, 1, 1, 1, 10]}
63 | ]
64 | end
65 |
66 | # Test bulkget in normal get operations with v2c
67 | def specific_get do
68 | SNMP.request(%{
69 | credential: creds(),
70 | uri: uri(),
71 | varbind: be_specific()
72 | })
73 | end
74 |
75 | # small request for perf testing
76 | def short_get(_) do
77 | SNMP.request(%{
78 | credential: creds(),
79 | uri: uri(),
80 | varbinds: system_varbinds()
81 | })
82 | end
83 |
84 | def perftest do
85 | 1..500_000
86 | |> Task.async_stream(Iex_SNMP, :short_get, [], max_concurrency: 230)
87 | |> Enum.to_list()
88 | end
89 |
90 | def walk do
91 | %{uri: uri(), credential: creds(), varbinds: vb_ifx()} |> SNMP.walk()
92 | end
93 |
94 | def bulkwalk do
95 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: vb_simple()}, [max_repetitions: 12])
96 | |> Enum.to_list()
97 | end
98 |
99 | def bulkwalk_all do
100 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: []}, [max_repetitions: 12])
101 | |> Enum.to_list()
102 | end
103 |
104 | def bulkwalk_test(varbinds) do
105 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: varbinds}, [max_repetitions: 12])
106 | |> Enum.to_list()
107 | end
108 |
109 | def bulkwalk_if do
110 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: vb_if()}, [max_repetitions: 12])
111 | |> Enum.to_list()
112 | end
113 |
114 | def bulkwalk_ifx do
115 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: vb_ifx()}, [max_repetitions: 12])
116 | |> Enum.to_list()
117 | end
118 |
119 | def bulkwalk_ifx_name do
120 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: vb_ifx_name()}, [max_repetitions: 12])
121 | |> Enum.to_list()
122 | end
123 |
124 | def bulkwalk_mediumpacket do
125 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: vb_ifx()}, [max_repetitions: 25])
126 | |> Enum.to_list()
127 | end
128 |
129 | def bulkwalk_bigpacket do
130 | SNMP.bulkwalk(%{uri: uri(), credential: creds(), varbinds: vb_ifx()}, [max_repetitions: 50, timeout: 20000])
131 | |> Enum.to_list()
132 | end
133 |
134 | def output_results(results) do
135 | results
136 | # |> Enum.map(fn {_, result} -> result end)
137 | |> Enum.each(fn result -> IO.puts(
138 | "#{format_oid(result.oid)} = #{result.type}: #{format_value(result.type, result.value)}") end)
139 | # |> Enum.each(fn result -> IO.inspect(result) end)
140 | end
141 |
142 | def format_oid(oid) when is_list(oid) do
143 | "." <> Enum.join(oid, ".")
144 | end
145 |
146 | def format_value(:"OCTET STRING", value) when is_binary(value) do
147 | # For potentially non-printable binaries, use inspect with limit: :infinity
148 | # to see the full binary representation
149 | inspect(value, limit: :infinity, printable_limit: :infinity)
150 | end
151 |
152 | # def format_value(:"OCTET STRING", value) when is_list(value) do
153 | # # For char lists, try to convert to string when possible
154 | # try do
155 | # List.to_string(value)
156 | # rescue
157 | # _ -> inspect(value)
158 | # end
159 | # end
160 |
161 | def format_value(type, value) when type == :"OBJECT IDENTIFIER" do
162 | format_oid(value)
163 | end
164 |
165 | #def format_value(:INTEGER, value), do: to_string(value)
166 |
167 | # def format_value(:"Counter32", value), do: to_string(value)
168 | # def format_value(:"Counter64", value), do: to_string(value)
169 | # def format_value(:"Gauge32", value), do: to_string(value)
170 | # def format_value(:"TimeTicks", value), do: to_string(value)
171 |
172 | # Fallback for all other types
173 | def format_value(_type, value) do
174 | inspect(value)
175 | end
176 |
177 | def bulkwalk_output do
178 | bulkwalk_test([%{oid: [1, 3, 6, 1]}])
179 | |> output_results()
180 | end
181 | end
182 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # snmp-elixir
2 |
3 | [](https://gitlab.com/jonnystorm/snmp-elixir/commits/master)
4 |
5 | An SNMP client library for Elixir.
6 |
7 | This is my effort to replace the terrible but useful
8 | [net-snmp-elixir](https://gitlab.com/jonnystorm/net-snmp-elixir)
9 | with a facile Elixir wrapper for OTP's harrowing SNMP API.
10 |
11 | Many thanks to Dave Martin for his
12 | [post](https://groups.google.com/forum/#!topic/elixir-lang-talk/lGWGXFoUVvc),
13 | without which I may never have bothered returning to this
14 | problem.
15 |
16 | ## Usage in CLI
17 |
18 | ```elixir
19 | iex> SNMP.start
20 | iex>
21 | iex> v2_cred =
22 | ...> SNMP.credential(
23 | ...> %{version: :v2, community: "public"}
24 | ...> )
25 | %SNMP.CommunityCredential{
26 | community: 'public',
27 | sec_model: :v2c,
28 | version: :v2
29 | }
30 | iex>
31 | iex> {:ok, base_oid} =
32 | ...> SNMP.resolve_object_name_to_oid(:sysName)
33 | {:ok, [1, 3, 6, 1, 2, 1, 1, 5]}
34 | iex>
35 | iex> %{uri: URI.parse("snmp://an-snmp-host.local"),
36 | ...> credential: v2_cred,
37 | ...> varbinds: [%{oid: base_oid ++ [0]}],
38 | ...> } |> SNMP.request
39 | { :ok,
40 | [ %{oid: [1, 3, 6, 1, 2, 1, 1, 5, 0],
41 | type: :"OCTET STRING",
42 | value: "an-snmp-host"
43 | }
44 | ]
45 | }
46 | iex>
47 | iex> v3_cred =
48 | ...> SNMP.credential(
49 | ...> %{version: :v3,
50 | ...> sec_name: "user",
51 | ...> auth: :sha,
52 | ...> auth_pass: "authpass",
53 | ...> priv: :aes,
54 | ...> priv_pass: "privpass",
55 | ...> }
56 | ...> )
57 | %SNMP.USMCredential{
58 | auth: :sha,
59 | auth_pass: 'authpass',
60 | priv: :aes,
61 | priv_pass: 'privpass',
62 | sec_level: :authPriv,
63 | sec_model: :usm,
64 | sec_name: 'nms',
65 | version: :v3
66 | }
67 | iex> %{uri: URI.parse("snmp://an-snmp-host.local"),
68 | ...> credential: v3_cred,
69 | ...> varbinds: [%{oid: "ipAddrTable"}],
70 | ...> } |> SNMP.walk
71 | ...> |> Enum.take(1)
72 | [ %{oid: [1, 3, 6, 1, 2, 1, 4, 20, 1, 1, 192, 0, 2, 1],
73 | type: :IpAddress,
74 | value: [192, 0, 2, 1],
75 | }
76 | ]
77 | ```
78 |
79 | ## Installation
80 |
81 | Add `:snmp_ex` to `mix.exs`:
82 |
83 | ```
84 | defp deps do
85 | [ { :snmp_ex, "~> 0.4.0" } ]
86 | end
87 | ```
88 |
89 | Any of the following defaults may be overridden in your
90 | `config.exs`.
91 |
92 | ```
93 | config :snmp_ex,
94 | timeout: 5000,
95 | max_repetitions: 10,
96 | engine_discovery_timeout: 1000,
97 | mib_cache: "priv/snmp/mibs",
98 | snmp_conf_dir: "priv/snmp/conf",
99 | snmpm_conf_dir: "priv/snmp",
100 | snmpc_verbosity: "silence",
101 | mib_sources: ["/usr/share/snmp/mibs"]
102 | ```
103 |
104 | `snmpc_verbosity` can be set to different values, see the [erlang docs](http://erlang.org/doc/man/snmpc.html) on which values you can use.
105 |
106 | Finally, ensure the `:snmp` OTP application is available in
107 | your development environment. Some Linux distributions, such
108 | as CentOS, provide separate packages for individual OTP
109 | services and tools. Check for `erlang-snmp` if this is a
110 | concern. As for production, the release process will ensure
111 | `:snmp` is automatically included in the resulting tarball.
112 |
113 | ## Why another wrapper?
114 |
115 | `net-snmp-elixir` was my experimental hack to get something
116 | that worked. I didn't expect it to become one of the top
117 | Google results for "elixir snmp" but it is, which scares me.
118 | Elixir may be the best language for network interaction in
119 | existence, but we still need worthy SNMP support.
120 |
121 | ## Contributing
122 |
123 | This project will accept (merge/rebase/squash) *all*
124 | contributions. Contributions that break the build will be
125 | reverted.
126 |
127 | For details, please see [Why Optimistic Merging Works
128 | Better](http://hintjens.com/blog:106).
129 |
130 | ## TODO
131 |
132 | * ~~SNMPv3 USM~~ (AES support requires OTP >=23; see corresponding [pull request](https://github.com/erlang/otp/pull/2544) for details.)
133 | * ~~USM engine discovery~~
134 | * SNMP tables
135 | * ~~MIB name resolution~~
136 | * ~~Basic SNMP operations~~ (~~GET~~, ~~GET-NEXT~~, ~~WALK~~, ~~SET~~)
137 | * Bulk SNMP operations
138 | * Process management (~~supervision~~, `:snmpm` agents)
139 | * Make it decent
140 |
141 |
--------------------------------------------------------------------------------
/config/config.exs:
--------------------------------------------------------------------------------
1 | import Config
2 |
3 |
--------------------------------------------------------------------------------
/dev_test.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | function run
4 | {
5 | mix clean &&
6 | env MIX_ENV=test ERL_COMPILER_OPTIONS=bin_opt_info \
7 | mix compile --force &&
8 | mix test --stale &&
9 | env MIX_ENV=test mix dialyzer
10 | }
11 |
12 | clear
13 | run
14 |
15 | while true
16 | do
17 | inotifywait --exclude \..*\.sw. -re modify .
18 | clear
19 | run
20 | done
21 |
--------------------------------------------------------------------------------
/dialyzer.ignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonnystorm/snmp-elixir/a432bce1e99b0850bbaabeb79e6f522b5c247e7d/dialyzer.ignore
--------------------------------------------------------------------------------
/lib/snmp/discovery_agent.ex:
--------------------------------------------------------------------------------
1 | defmodule SNMP.DiscoveryAgent do
2 | # Provides abstractions to SNMP engine discovery through
3 | # snmp agent
4 | @moduledoc false
5 |
6 | use GenServer
7 | require Logger
8 |
9 | def start_link(state \\ [], opts0 \\ []) do
10 | opts = [{:name, __MODULE__} | opts0]
11 |
12 | GenServer.start_link(__MODULE__, state, opts)
13 | end
14 |
15 | def init(opts) do
16 | GenServer.cast(self(), {:seed_and_start_agent, opts})
17 |
18 | {:ok, []}
19 | end
20 |
21 | defp agent_dir do
22 | :snmp_ex
23 | |> Application.get_env(:snmp_conf_dir)
24 | |> Path.expand()
25 | |> Path.join("agent")
26 | end
27 |
28 | def handle_cast({:seed_and_start_agent, opts}, state) do
29 | agent_dir()
30 | |> Path.join("db")
31 | |> File.mkdir_p!()
32 |
33 | _ =
34 | [ "#{agent_dir()}/agent.conf",
35 | "#{agent_dir()}/standard.conf",
36 | "#{agent_dir()}/usm.conf",
37 | "#{agent_dir()}/community.conf",
38 | ]
39 | |> Enum.map(&File.touch!/1)
40 |
41 | _ = seed_config(opts)
42 | _ = start_agent()
43 |
44 | {:noreply, state}
45 | end
46 |
47 | def seed_config(opts) do
48 | seed_agent_config(opts)
49 | seed_standard_config(opts)
50 |
51 | [ &:snmpa_conf.write_community_config/2,
52 | &:snmpa_conf.write_usm_config/2,
53 | &:snmpa_conf.write_context_config/2,
54 | &:snmpa_conf.write_notify_config/2,
55 | ]
56 | |> Enum.map(fn fun ->
57 | :ok = fun.(~c'#{agent_dir()}', [])
58 | end)
59 | end
60 |
61 | defp do_seed_config(
62 | opts,
63 | default_opts,
64 | config_fun,
65 | write_fun
66 | ) do
67 | :ok =
68 | default_opts
69 | |> Keyword.merge(opts)
70 | |> Enum.map(config_fun)
71 | |> write_fun.()
72 | end
73 |
74 | def seed_agent_config(agent_opts \\ [])
75 |
76 | def seed_agent_config(agent_opts) do
77 | config_fun =
78 | fn {k, v} ->
79 | :snmpa_conf.agent_entry(k, v)
80 | end
81 |
82 | write_fun =
83 | &:snmpa_conf.write_agent_config(~c'#{agent_dir()}', &1)
84 |
85 | init_engine_id =
86 | :binary.bin_to_list(SNMP.Utility.local_engine_id())
87 |
88 | [ intAgentTransports: [
89 | transportDomainUdpIpv4: {127, 0, 0, 1},
90 | transportDomainUdpIpv6: {0, 0, 0, 0, 0, 0, 0, 1},
91 | ],
92 | snmpEngineID: init_engine_id,
93 | intAgentUDPPort: 6000,
94 | snmpEngineMaxMessageSize: 484,
95 | ]
96 | |> do_seed_config(agent_opts, config_fun, write_fun)
97 |
98 | config =
99 | :snmpa_conf.read_agent_config(~c'#{agent_dir()}')
100 |
101 | :ok = Logger.info("SNMP agent.conf created - #{inspect(config)}")
102 | end
103 |
104 | def seed_standard_config(standard_opts \\ [])
105 |
106 | def seed_standard_config(standard_opts) do
107 | config_fun =
108 | fn {k, v} ->
109 | :snmpa_conf.standard_entry(k, v)
110 | end
111 |
112 | write_fun =
113 | fn x ->
114 | :snmpa_conf.write_standard_config(
115 | ~c'#{agent_dir()}',
116 | x
117 | )
118 | end
119 |
120 | [ sysName: ~c'Discovery agent',
121 | sysDescr: ~c'Discovery agent',
122 | sysContact: ~c'',
123 | sysLocation: ~c'',
124 | sysObjectID: [3, 6, 1, 4, 1, 193, 19],
125 | sysServices: 72,
126 | snmpEnableAuthenTraps: :disabled,
127 | ]
128 | |> do_seed_config(
129 | standard_opts,
130 | config_fun,
131 | write_fun
132 | )
133 |
134 | config =
135 | :snmpa_conf.read_standard_config(~c'#{agent_dir()}')
136 |
137 | :ok = Logger.info("SNMP standard.conf created - #{inspect(config)}")
138 | end
139 |
140 | def start_agent() do
141 | :ok = Logger.info("Starting snmp agent...")
142 |
143 | result =
144 | [ agent_type: :master,
145 | discovery: [
146 | originating: [enable: true],
147 | terminating: [enable: true]
148 | ],
149 | db_dir: ~c'#{agent_dir()}/db',
150 | db_init_error: :create_db_and_dir,
151 | config: [dir: ~c'#{agent_dir()}'],
152 | ]
153 | |> :snmpa_supervisor.start_master_sup()
154 |
155 | case result do
156 | {:ok, _} ->
157 | nil
158 |
159 | {:error, {:already_started, _}} ->
160 | nil
161 | end
162 |
163 | configure_discovery()
164 | end
165 |
166 | def configure_discovery do
167 | {:ok, _} =
168 | :snmp_view_based_acm_mib.add_access(
169 | ~c'discovery_group',
170 | ~c'',
171 | :usm,
172 | :noAuthNoPriv,
173 | :exact,
174 | ~c'discovery',
175 | ~c'discovery',
176 | ~c'discovery'
177 | )
178 |
179 | {:ok, _} =
180 | :snmp_view_based_acm_mib.add_sec2group(
181 | :usm,
182 | ~c'',
183 | ~c'discovery_group'
184 | )
185 |
186 | {:ok, _} =
187 | :snmp_view_based_acm_mib.add_view_tree_fam(
188 | ~c'discovery',
189 | [1, 3, 6, 1],
190 | :included,
191 | :null
192 | )
193 |
194 | {:ok, _} =
195 | :snmp_target_mib.add_params(
196 | ~c'discovery_params',
197 | :v3,
198 | :usm,
199 | ~c'',
200 | :noAuthNoPriv
201 | )
202 | end
203 |
204 | @type uri :: URI.t()
205 | @type opts :: Keyword.t()
206 |
207 | @type engine_id :: charlist()
208 |
209 | @spec discover_engine_id(uri, opts)
210 | :: {:ok, engine_id}
211 | | {:error, any}
212 | def discover_engine_id(uri, opts \\ [])
213 |
214 | def discover_engine_id(uri, opts) do
215 | clean_opts =
216 | Enum.reject(opts, fn {_k, v} -> is_nil(v) end)
217 |
218 | msg = {:discover_engine_id, uri, clean_opts}
219 |
220 | GenServer.call(__MODULE__, msg, 60_000)
221 | end
222 |
223 | def handle_call(
224 | {:discover_engine_id, uri, opts_input},
225 | _from,
226 | state
227 | ) do
228 | # OTP multiplies the below timeout by 10, then doubles
229 | # it for each successive retry. Consequently, given an
230 | # initial timeout of 100, OTP will first use a timeout
231 | # of 1000, followed by a timeout of 2000, followed by a
232 | # timeout of 4000, and so on. Whether this is all in
233 | # milliseconds is unclear. It probably is milliseconds.
234 | #
235 | # For proof, please see
236 | # https://github.com/jonnystorm/otp/blob/f6a862dcc515d8500097aac2b0f84e501d8d0968/lib/snmp/src/agent/snmpa_trap.erl#L631-L677
237 | #
238 | default_opts =
239 | [ port: uri.port || 161,
240 | transport: :transportDomainUdpIpv4,
241 | timeout: 1000,
242 | retries: 2,
243 | notification: :coldStart,
244 | ]
245 |
246 | opts = Keyword.merge(default_opts, opts_input)
247 | timeout = trunc(opts[:timeout] / 10)
248 | ip_string = String.replace(uri.host, ".", "_")
249 |
250 | agent_name =
251 | to_charlist("discovery_agent_#{ip_string}")
252 |
253 | erl_ip_address =
254 | uri.host
255 | |> NetAddr.ip()
256 | |> NetAddr.netaddr_to_list()
257 |
258 | {:ok, _} =
259 | :snmp_target_mib.add_addr(
260 | agent_name,
261 | opts[:transport],
262 | {erl_ip_address, opts[:port]},
263 | timeout,
264 | opts[:retries],
265 | ~c'',
266 | ~c'discovery_params',
267 | ~c'',
268 | [],
269 | 2048
270 | )
271 |
272 | result =
273 | :snmpa.discovery(agent_name, opts[:notification])
274 |
275 | {:reply, result, state}
276 | end
277 | end
278 |
--------------------------------------------------------------------------------
/lib/snmp/mib.ex:
--------------------------------------------------------------------------------
1 | # This Source Code Form is subject to the terms of the
2 | # Mozilla Public License, v. 2.0. If a copy of the MPL was
3 | # not distributed with this file, You can obtain one at
4 | # http://mozilla.org/MPL/2.0/.
5 |
6 | defmodule SNMP.MIB do
7 | @moduledoc """
8 | Functions for working with SNMP MIBs.
9 | """
10 |
11 | alias SNMP.Utility
12 |
13 | require Logger
14 |
15 | # http://erlang.org/doc/apps/snmp/snmp_mib_compiler.html#id77861
16 | defp builtin_mibs do
17 | ~w(SNMPv2-SMI
18 | RFC-1215
19 | RFC-1212
20 | SNMPv2-TC
21 | SNMPv2-CONF
22 | RFC1155-SMI
23 | )
24 | end
25 |
26 | defp get_obsolete_mib_rfc_tuple(mib_name) do
27 | %{"IPV6-MIB" =>
28 | {"RFC 8096", "https://tools.ietf.org/html/rfc8096"},
29 | "IPV6-TC" =>
30 | {"RFC 8096", "https://tools.ietf.org/html/rfc8096"},
31 | "IPV6-ICMP-MIB" =>
32 | {"RFC 8096", "https://tools.ietf.org/html/rfc8096"},
33 | "IPV6-TCP-MIB" =>
34 | {"RFC 8096", "https://tools.ietf.org/html/rfc8096"},
35 | "IPV6-UDP-MIB" =>
36 | {"RFC 8096", "https://tools.ietf.org/html/rfc8096"}
37 | }[String.upcase(mib_name)]
38 | end
39 |
40 | defp is_obsolete_mib(mib_name),
41 | do: get_obsolete_mib_rfc_tuple(mib_name) != nil
42 |
43 | defp exclude_builtin_mibs(mibs) do
44 | Enum.filter(mibs, &(&1 not in builtin_mibs()))
45 | end
46 |
47 | defp get_imports_from_lines(lines) do
48 | lines
49 | |> Stream.filter(&String.contains?(&1, "FROM"))
50 | |> Stream.flat_map(fn line ->
51 | mib_import =
52 | ~r/\s?FROM\s+([^\s;]+)/
53 | |> Regex.run(line, capture: :all_but_first)
54 |
55 | mib_import || []
56 | end)
57 | |> Enum.to_list()
58 | end
59 |
60 | defp _get_imports([], acc), do: acc
61 |
62 | defp _get_imports([mib_file | rest], acc) do
63 | imports =
64 | try do
65 | mib_file
66 | |> File.stream!()
67 | |> get_imports_from_lines
68 | |> exclude_builtin_mibs
69 | |> Stream.map(fn name ->
70 | Path.join(Path.dirname(mib_file), "#{name}.mib")
71 | end)
72 | |> Enum.map(&{mib_file, &1})
73 | rescue
74 | File.Error ->
75 | :ok = Logger.debug("Unable to find MIB file: #{inspect(mib_file)}")
76 |
77 | [{mib_file, []}]
78 | end
79 |
80 | _get_imports(rest, Enum.concat(imports, acc))
81 | end
82 |
83 | defp get_imports(mib_files) when is_list(mib_files),
84 | do: _get_imports(mib_files, [])
85 |
86 | @type mib_file :: String.t()
87 | @type include_paths :: [String.t()]
88 |
89 | @doc """
90 | Compile the MIB in `mib_file` with includes from
91 | `include_paths`.
92 | """
93 | @spec compile(mib_file, include_paths)
94 | :: {:ok, term}
95 | | {:error, term}
96 | def compile(mib_file, include_paths) do
97 | outdir = Path.dirname(mib_file)
98 | erl_outdir = :binary.bin_to_list(outdir)
99 | erl_mib_file = :binary.bin_to_list(mib_file)
100 |
101 | erl_include_paths =
102 | Enum.map(include_paths,
103 | &:binary.bin_to_list("#{&1}/")
104 | )
105 |
106 | options = [
107 | :relaxed_row_name_assign_check,
108 | warnings: false,
109 | verbosity:
110 | Application.get_env(
111 | :snmp_ex,
112 | :snmpc_verbosity,
113 | :silence
114 | ),
115 | group_check: false,
116 | i: erl_include_paths,
117 | outdir: erl_outdir
118 | ]
119 |
120 | mib_name = Path.basename(mib_file, ".mib")
121 |
122 | if is_obsolete_mib(mib_name) do
123 | {rfc, link} =
124 | get_obsolete_mib_rfc_tuple(mib_name)
125 |
126 | :ok = Logger.warning("Compiling obsolete MIB #{inspect(mib_name)}... This may not work. Please see #{rfc} at #{link} for details")
127 | end
128 |
129 | case :snmpc.compile(erl_mib_file, options) do
130 | {:error, {:invalid_file, _}} = error ->
131 | :ok = Logger.debug("Unable to compile MIB #{inspect(mib_file)}: not a valid file")
132 |
133 | error
134 |
135 | {:error, {:invalid_option, option}} = error ->
136 | :ok = Logger.debug("Unable to compile MIB #{inspect(mib_file)} with invalid option #{inspect(option)}")
137 |
138 | error
139 |
140 | {:error, :compilation_failed} = error ->
141 | :ok = Logger.debug("Unable to compile MIB file #{inspect(mib_file)}")
142 |
143 | error
144 |
145 | other ->
146 | other
147 | end
148 | end
149 |
150 | defp list_files_with_mib_extension(paths) do
151 | Enum.flat_map(paths, fn path ->
152 | path
153 | |> File.ls!()
154 | |> Stream.map(&Path.join(path, &1))
155 | |> Enum.filter(&String.ends_with?(&1, ".mib"))
156 | end)
157 | end
158 |
159 | defp convert_imports_to_adjacencies(imports),
160 | do: Enum.group_by(imports, &elem(&1, 1), &elem(&1, 0))
161 |
162 | defp order_imports_by_dependency_chains(adjacency_map),
163 | do: Utility.topological_sort(adjacency_map)
164 |
165 | @type mib_dir :: String.t()
166 |
167 | @doc """
168 | Compile all .mib files in `mib_dirs`.
169 | """
170 | @spec compile_all(mib_dir | [mib_dir, ...])
171 | :: [ {mib_file, {:ok, term} | {:error, term}},
172 | ...
173 | ]
174 | def compile_all(mib_dirs) when is_list(mib_dirs) do
175 | mib_dirs
176 | |> list_files_with_mib_extension
177 | |> get_imports
178 | |> convert_imports_to_adjacencies
179 | |> order_imports_by_dependency_chains
180 | |> List.flatten()
181 | |> Enum.map(&{&1, compile(&1, mib_dirs)})
182 | end
183 |
184 | def compile_all(mib_dir),
185 | do: compile_all([mib_dir])
186 | end
187 |
--------------------------------------------------------------------------------
/lib/snmp/utility.ex:
--------------------------------------------------------------------------------
1 | defmodule SNMP.Utility do
2 | @moduledoc false
3 |
4 | @spec local_engine_id() :: <<_::40>>
5 | def local_engine_id,
6 | do: <<0x8000000006::8*5>>
7 |
8 | # Takes
9 | #
10 | # a d
11 | # / \ /
12 | # b c e
13 | #
14 | # and returns
15 | #
16 | # {bce}
17 | #
18 | defp subtract_minimal_elements_from_poset(poset, adj_map)
19 | do
20 | poset
21 | |> Enum.flat_map(&Map.get(adj_map, &1, []))
22 | |> MapSet.new()
23 | end
24 |
25 | defp _topological_sort(poset, adj_map, acc) do
26 | if MapSet.size(poset) > 0 do
27 | next_poset =
28 | poset
29 | |> subtract_minimal_elements_from_poset(adj_map)
30 |
31 | minimal_elements =
32 | MapSet.difference(poset, next_poset)
33 |
34 | if MapSet.size(minimal_elements) == 0 do
35 | raise(
36 | RuntimeError,
37 | "detected cycle in subset: #{inspect(MapSet.to_list(poset))}"
38 | )
39 | end
40 |
41 | next_acc = [minimal_elements | acc]
42 |
43 | _topological_sort(next_poset, adj_map, next_acc)
44 | else
45 | acc
46 | |> Enum.map(&MapSet.to_list(&1))
47 | |> Enum.reverse()
48 | end
49 | end
50 |
51 | # Takes mappings of the form {a => [b, c, ...]} to mean
52 | # a < b, a < c, ...
53 | #
54 | # For the Hasse diagram
55 | #
56 | # a d
57 | # / \ /
58 | # b c e
59 | #
60 | # it returns
61 | #
62 | # [[b, c, e], [a, d]]
63 | #
64 | @spec topological_sort(%{term => [term]})
65 | :: [[term], ...]
66 | def topological_sort(adjacency_map) do
67 | adjacency_map
68 | |> Map.keys()
69 | |> MapSet.new()
70 | |> _topological_sort(adjacency_map, [])
71 | end
72 |
73 | # Kludge to make snmp-elixir compile on 1.3.4 while
74 | # avoiding inevitable doom of `Enum.partition/2`
75 | #
76 | defmacrop separate_dirs_from_files(paths) do
77 | if System.version() =~ ~r/^1\.[0-3]\./ do
78 | quote bind_quoted: [paths: paths] do
79 | Enum.partition(
80 | paths,
81 | &(File.lstat!(&1).type == :directory)
82 | )
83 | end
84 | else
85 | quote bind_quoted: [paths: paths] do
86 | Enum.split_with(
87 | paths,
88 | &(File.lstat!(&1).type == :directory)
89 | )
90 | end
91 | end
92 | end
93 |
94 | defp _find_files_recursive([], _pattern, acc),
95 | do: Enum.sort(acc)
96 |
97 | defp _find_files_recursive([dir | rest], pattern, acc) do
98 | {new_dirs, files} =
99 | dir
100 | |> File.ls!()
101 | |> Enum.map(&Path.absname(&1, dir))
102 | |> separate_dirs_from_files
103 |
104 | next_acc =
105 | files
106 | |> Enum.filter(&String.match?(&1, pattern))
107 | |> Enum.concat(acc)
108 |
109 | next_dirs = new_dirs ++ rest
110 |
111 | _find_files_recursive(next_dirs, pattern, next_acc)
112 | end
113 |
114 | @type path :: String.t()
115 | @type pattern :: Regex.t()
116 | @type filepath :: String.t()
117 | @type filepaths :: [filepath, ...] | []
118 |
119 | # Analogous to GNU find
120 | @spec find_files_recursive(path, pattern)
121 | :: filepaths
122 | def find_files_recursive(path, pattern \\ ~r//)
123 |
124 | def find_files_recursive(path, pattern) do
125 | if File.dir?(path) do
126 | _find_files_recursive([path], pattern, [])
127 | else
128 | if String.match?(path, pattern) do
129 | [path]
130 | else
131 | []
132 | end
133 | end
134 | end
135 | end
136 |
--------------------------------------------------------------------------------
/lib/snmp_check.ex:
--------------------------------------------------------------------------------
1 | defmodule SNMPCheck do
2 | @moduledoc false
3 |
4 | import SNMP
5 |
6 | # Trigger dialyzer success typing checks in SNMP API
7 | #
8 | def check do
9 | v2_cred = credential(%{community: "public"})
10 | req =
11 | %{uri: URI.parse("snmp://192.0.2.1"),
12 | credential: v2_cred,
13 | varbinds: [%{oid: [1,3,6,1,2,1,1,5,0]}],
14 | }
15 |
16 | _ = request(req)
17 | _ = walk(req)
18 |
19 | _ = load_mib("some_mib")
20 | _ = resolve_object_name_to_oid([1,3,6])
21 | _ = resolve_object_name_to_oid(:sysName)
22 |
23 | _ = credential(%{sec_name: "admin"})
24 |
25 | _ = list_oid_to_string([1,3,6])
26 | _ = string_oid_to_list("1.3.6")
27 | end
28 | end
29 |
--------------------------------------------------------------------------------
/mix.exs:
--------------------------------------------------------------------------------
1 | defmodule SNMP.Mixfile do
2 | use Mix.Project
3 |
4 | def project do
5 | [ app: :snmp_ex,
6 | version: "0.7.0",
7 | elixir: "~> 1.12",
8 | build_embedded: Mix.env() == :prod,
9 | start_permanent: Mix.env() == :prod,
10 | deps: deps(),
11 | description: description(),
12 | package: package(),
13 | dialyzer: [
14 | plt_add_apps: [
15 | :logger,
16 | :netaddr_ex,
17 | :snmp,
18 | ],
19 | ignore_warnings: "dialyzer.ignore",
20 | flags: [
21 | :unmatched_returns,
22 | :error_handling,
23 | :underspecs,
24 | ],
25 | ],
26 | ]
27 | end
28 |
29 | def application do
30 | [ extra_applications: [
31 | :crypto,
32 | :logger,
33 | :snmp,
34 | ],
35 | env: [
36 | timeout: 5000,
37 | max_repetitions: 10,
38 | engine_discovery_timeout: 1000,
39 | mib_cache: "priv/snmp/mibs",
40 | snmp_conf_dir: "priv/snmp/conf",
41 | snmpm_conf_dir: "priv/snmp",
42 | mib_sources: [
43 | "/usr/share/snmp/mibs",
44 | ],
45 | ],
46 | mod: {SNMP, []},
47 | ]
48 | end
49 |
50 | defp deps do
51 | [ {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false},
52 | {:ex_doc, "~> 0.34", only: :dev, runtime: false},
53 | {:netaddr_ex, "~> 1.3"},
54 | ]
55 | end
56 |
57 | defp description do
58 | "An SNMP client library for Elixir, wrapping the Erlang OTP SNMP API and Logic"
59 | end
60 |
61 | defp package do
62 | [ licenses: ["Mozilla Public License 2.0"],
63 | links: %{
64 | "GitHub" => "https://github.com/jonnystorm/snmp-elixir",
65 | },
66 | ]
67 | end
68 |
69 |
70 | end
71 |
--------------------------------------------------------------------------------
/mix.lock:
--------------------------------------------------------------------------------
1 | %{
2 | "dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
3 | "earmark": {:hex, :earmark, "1.4.3", "364ca2e9710f6bff494117dbbd53880d84bebb692dafc3a78eb50aa3183f2bfd", [:mix], [], "hexpm", "8cf8a291ebf1c7b9539e3cddb19e9cef066c2441b1640f13c34c1d3cfc825fec"},
4 | "earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
5 | "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
6 | "ex_doc": {:hex, :ex_doc, "0.34.2", "13eedf3844ccdce25cfd837b99bea9ad92c4e511233199440488d217c92571e8", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "5ce5f16b41208a50106afed3de6a2ed34f4acfd65715b82a0b84b49d995f95c1"},
7 | "jds_math_ex": {:git, "https://gitlab.com/jonnystorm/jds-math-elixir.git", "e4090226e6d0139adac8ed310310e4e325da7bb5", []},
8 | "linear_ex": {:git, "https://gitlab.com/jonnystorm/linear-elixir.git", "b2bb2546f78e97e4fb6d6b2b3ad00f586864c312", []},
9 | "makeup": {:hex, :makeup, "1.1.2", "9ba8837913bdf757787e71c1581c21f9d2455f4dd04cfca785c70bbfff1a76a3", [:mix], [{:nimble_parsec, "~> 1.2.2 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "cce1566b81fbcbd21eca8ffe808f33b221f9eee2cbc7a1706fc3da9ff18e6cac"},
10 | "makeup_elixir": {:hex, :makeup_elixir, "0.16.2", "627e84b8e8bf22e60a2579dad15067c755531fea049ae26ef1020cad58fe9578", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "41193978704763f6bbe6cc2758b84909e62984c7752b3784bd3c218bb341706b"},
11 | "makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
12 | "netaddr_ex": {:hex, :netaddr_ex, "1.3.1", "ce5e8ebdf3ade9fb42a07e910a43a2f607c48bc5401f071772364f61263fc328", [:mix], [], "hexpm", "cae2d1deccc0becb31c8a5dcbf7010cc598a35eb0ff61689995dfbe7cda74224"},
13 | "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
14 | }
15 |
--------------------------------------------------------------------------------
/priv/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jonnystorm/snmp-elixir/a432bce1e99b0850bbaabeb79e6f522b5c247e7d/priv/.gitkeep
--------------------------------------------------------------------------------
/run_dialyzer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | # ELIXIR_VERSION=1.4.2 OTP_RELEASE=19.2 ./run_dialyzer.sh
3 | export MIX_ENV=test
4 |
5 | export PLT_FILENAME=elixir-${ELIXIR_VERSION}_${OTP_RELEASE}.plt
6 | export PLT_TESTNAME=dialyxir_erlang-${OTP_RELEASE}_elixir-${ELIXIR_VERSION}_deps-${MIX_ENV}.plt
7 | export PLT_LOCATION=_build/$MIX_ENV/$PLT_TESTNAME
8 |
9 | mix dialyzer
10 |
--------------------------------------------------------------------------------
/snmp-elixir.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/snmp_ex.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/tcpdump_lo0.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | sudo tcpdump -i lo0 -nn -s0 udp port 161
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/IPV6-TC.mib:
--------------------------------------------------------------------------------
1 | IPV6-TC DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | Integer32 FROM SNMPv2-SMI
5 | TEXTUAL-CONVENTION FROM SNMPv2-TC;
6 |
7 | -- definition of textual conventions
8 | Ipv6Address ::= TEXTUAL-CONVENTION
9 | DISPLAY-HINT "2x:"
10 | STATUS current
11 | DESCRIPTION
12 | "This data type is used to model IPv6 addresses.
13 | This is a binary string of 16 octets in network
14 | byte-order."
15 | SYNTAX OCTET STRING (SIZE (16))
16 |
17 | Ipv6AddressPrefix ::= TEXTUAL-CONVENTION
18 | DISPLAY-HINT "2x:"
19 | STATUS current
20 | DESCRIPTION
21 | "This data type is used to model IPv6 address
22 | prefixes. This is a binary string of up to 16
23 | octets in network byte-order."
24 | SYNTAX OCTET STRING (SIZE (0..16))
25 |
26 | Ipv6AddressIfIdentifier ::= TEXTUAL-CONVENTION
27 | DISPLAY-HINT "2x:"
28 | STATUS current
29 | DESCRIPTION
30 | "This data type is used to model IPv6 address
31 | interface identifiers. This is a binary string
32 | of up to 8 octets in network byte-order."
33 | SYNTAX OCTET STRING (SIZE (0..8))
34 |
35 | Ipv6IfIndex ::= TEXTUAL-CONVENTION
36 | DISPLAY-HINT "d"
37 | STATUS current
38 | DESCRIPTION
39 | "A unique value, greater than zero for each
40 | internetwork-layer interface in the managed
41 | system. It is recommended that values are assigned
42 | contiguously starting from 1. The value for each
43 | internetwork-layer interface must remain constant
44 | at least from one re-initialization of the entity's
45 | network management system to the next
46 |
47 | re-initialization."
48 | SYNTAX Integer32 (1..2147483647)
49 |
50 | Ipv6IfIndexOrZero ::= TEXTUAL-CONVENTION
51 | DISPLAY-HINT "d"
52 | STATUS current
53 | DESCRIPTION
54 | "This textual convention is an extension of the
55 | Ipv6IfIndex convention. The latter defines
56 | a greater than zero value used to identify an IPv6
57 | interface in the managed system. This extension
58 | permits the additional value of zero. The value
59 | zero is object-specific and must therefore be
60 | defined as part of the description of any object
61 | which uses this syntax. Examples of the usage of
62 | zero might include situations where interface was
63 | unknown, or when none or all interfaces need to be
64 | referenced."
65 | SYNTAX Integer32 (0..2147483647)
66 |
67 | END
68 |
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/IPV6-TCP-MIB.mib:
--------------------------------------------------------------------------------
1 | IPV6-TCP-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
5 | MODULE-IDENTITY, OBJECT-TYPE,
6 | mib-2, experimental FROM SNMPv2-SMI
7 | Ipv6Address, Ipv6IfIndexOrZero FROM IPV6-TC;
8 |
9 | ipv6TcpMIB MODULE-IDENTITY
10 | LAST-UPDATED "9801290000Z"
11 | ORGANIZATION "IETF IPv6 MIB Working Group"
12 | CONTACT-INFO
13 | " Mike Daniele
14 |
15 | Postal: Compaq Computer Corporation
16 | 110 Spitbrook Rd
17 | Nashua, NH 03062.
18 | US
19 |
20 | Phone: +1 603 884 1423
21 | Email: daniele@zk3.dec.com"
22 | DESCRIPTION
23 | "The MIB module for entities implementing TCP over IPv6."
24 | ::= { experimental 86 }
25 |
26 | -- objects specific to TCP for IPv6
27 |
28 | tcp OBJECT IDENTIFIER ::= { mib-2 6 }
29 |
30 | -- the TCP over IPv6 Connection table
31 |
32 | -- This connection table contains information about this
33 | -- entity's existing TCP connections between IPv6 endpoints.
34 | -- Only connections between IPv6 addresses are contained in
35 | -- this table. This entity's connections between IPv4
36 | -- endpoints are contained in tcpConnTable.
37 |
38 | ipv6TcpConnTable OBJECT-TYPE
39 | SYNTAX SEQUENCE OF Ipv6TcpConnEntry
40 | MAX-ACCESS not-accessible
41 | STATUS current
42 | DESCRIPTION
43 | "A table containing TCP connection-specific information,
44 | for only those connections whose endpoints are IPv6 addresses."
45 | ::= { tcp 16 }
46 |
47 | ipv6TcpConnEntry OBJECT-TYPE
48 | SYNTAX Ipv6TcpConnEntry
49 | MAX-ACCESS not-accessible
50 | STATUS current
51 | DESCRIPTION
52 | "A conceptual row of the ipv6TcpConnTable containing
53 | information about a particular current TCP connection.
54 | Each row of this table is transient, in that it ceases to
55 | exist when (or soon after) the connection makes the transition
56 | to the CLOSED state.
57 |
58 | Note that conceptual rows in this table require an additional
59 | index object compared to tcpConnTable, since IPv6 addresses
60 | are not guaranteed to be unique on the managed node."
61 | INDEX { ipv6TcpConnLocalAddress,
62 | ipv6TcpConnLocalPort,
63 | ipv6TcpConnRemAddress,
64 | ipv6TcpConnRemPort,
65 | ipv6TcpConnIfIndex }
66 | ::= { ipv6TcpConnTable 1 }
67 |
68 | Ipv6TcpConnEntry ::=
69 | SEQUENCE { ipv6TcpConnLocalAddress Ipv6Address,
70 | ipv6TcpConnLocalPort INTEGER (0..65535),
71 | ipv6TcpConnRemAddress Ipv6Address,
72 | ipv6TcpConnRemPort INTEGER (0..65535),
73 | ipv6TcpConnIfIndex Ipv6IfIndexOrZero,
74 | ipv6TcpConnState INTEGER }
75 |
76 | ipv6TcpConnLocalAddress OBJECT-TYPE
77 | SYNTAX Ipv6Address
78 | MAX-ACCESS not-accessible
79 | STATUS current
80 | DESCRIPTION
81 | "The local IPv6 address for this TCP connection. In
82 | the case of a connection in the listen state which
83 | is willing to accept connections for any IPv6
84 | address associated with the managed node, the value
85 | ::0 is used."
86 | ::= { ipv6TcpConnEntry 1 }
87 |
88 | ipv6TcpConnLocalPort OBJECT-TYPE
89 | SYNTAX INTEGER (0..65535)
90 | MAX-ACCESS not-accessible
91 | STATUS current
92 | DESCRIPTION
93 | "The local port number for this TCP connection."
94 | ::= { ipv6TcpConnEntry 2 }
95 |
96 | ipv6TcpConnRemAddress OBJECT-TYPE
97 | SYNTAX Ipv6Address
98 | MAX-ACCESS not-accessible
99 | STATUS current
100 | DESCRIPTION
101 | "The remote IPv6 address for this TCP connection."
102 | ::= { ipv6TcpConnEntry 3 }
103 |
104 | ipv6TcpConnRemPort OBJECT-TYPE
105 | SYNTAX INTEGER (0..65535)
106 | MAX-ACCESS not-accessible
107 | STATUS current
108 | DESCRIPTION
109 | "The remote port number for this TCP connection."
110 | ::= { ipv6TcpConnEntry 4 }
111 |
112 | ipv6TcpConnIfIndex OBJECT-TYPE
113 | SYNTAX Ipv6IfIndexOrZero
114 | MAX-ACCESS not-accessible
115 | STATUS current
116 | DESCRIPTION
117 | "An index object used to disambiguate conceptual rows in
118 | the table, since the connection 4-tuple may not be unique.
119 |
120 | If the connection's remote address (ipv6TcpConnRemAddress)
121 | is a link-local address and the connection's local address
122 |
123 | (ipv6TcpConnLocalAddress) is not a link-local address, this
124 | object identifies a local interface on the same link as
125 | the connection's remote link-local address.
126 |
127 | Otherwise, this object identifies the local interface that
128 | is associated with the ipv6TcpConnLocalAddress for this
129 | TCP connection. If such a local interface cannot be determined,
130 | this object should take on the value 0. (A possible example
131 | of this would be if the value of ipv6TcpConnLocalAddress is ::0.)
132 |
133 | The interface identified by a particular non-0 value of this
134 | index is the same interface as identified by the same value
135 | of ipv6IfIndex.
136 |
137 | The value of this object must remain constant during the life
138 | of the TCP connection."
139 | ::= { ipv6TcpConnEntry 5 }
140 |
141 | ipv6TcpConnState OBJECT-TYPE
142 | SYNTAX INTEGER {
143 | closed(1),
144 | listen(2),
145 | synSent(3),
146 | synReceived(4),
147 | established(5),
148 | finWait1(6),
149 | finWait2(7),
150 | closeWait(8),
151 | lastAck(9),
152 | closing(10),
153 | timeWait(11),
154 | deleteTCB(12) }
155 | MAX-ACCESS read-write
156 | STATUS current
157 | DESCRIPTION
158 | "The state of this TCP connection.
159 |
160 | The only value which may be set by a management station is
161 | deleteTCB(12). Accordingly, it is appropriate for an agent
162 | to return an error response (`badValue' for SNMPv1, 'wrongValue'
163 | for SNMPv2) if a management station attempts to set this
164 | object to any other value.
165 |
166 | If a management station sets this object to the value
167 | deleteTCB(12), then this has the effect of deleting the TCB
168 | (as defined in RFC 793) of the corresponding connection on
169 | the managed node, resulting in immediate termination of the
170 | connection.
171 |
172 | As an implementation-specific option, a RST segment may be
173 | sent from the managed node to the other TCP endpoint (note
174 | however that RST segments are not sent reliably)."
175 | ::= { ipv6TcpConnEntry 6 }
176 |
177 | --
178 | -- conformance information
179 | --
180 |
181 | ipv6TcpConformance OBJECT IDENTIFIER ::= { ipv6TcpMIB 2 }
182 |
183 | ipv6TcpCompliances OBJECT IDENTIFIER ::= { ipv6TcpConformance 1 }
184 | ipv6TcpGroups OBJECT IDENTIFIER ::= { ipv6TcpConformance 2 }
185 |
186 | -- compliance statements
187 |
188 | ipv6TcpCompliance MODULE-COMPLIANCE
189 | STATUS current
190 | DESCRIPTION
191 | "The compliance statement for SNMPv2 entities which
192 | implement TCP over IPv6."
193 | MODULE -- this module
194 | MANDATORY-GROUPS { ipv6TcpGroup }
195 | ::= { ipv6TcpCompliances 1 }
196 |
197 | ipv6TcpGroup OBJECT-GROUP
198 | OBJECTS { -- these are defined in this module
199 | -- ipv6TcpConnLocalAddress (not-accessible)
200 | -- ipv6TcpConnLocalPort (not-accessible)
201 | -- ipv6TcpConnRemAddress (not-accessible)
202 | -- ipv6TcpConnRemPort (not-accessible)
203 | -- ipv6TcpConnIfIndex (not-accessible)
204 | ipv6TcpConnState }
205 | STATUS current
206 | DESCRIPTION
207 | "The group of objects providing management of
208 | TCP over IPv6."
209 | ::= { ipv6TcpGroups 1 }
210 |
211 | END
212 |
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/IPV6-UDP-MIB.mib:
--------------------------------------------------------------------------------
1 | IPV6-UDP-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
5 | MODULE-IDENTITY, OBJECT-TYPE,
6 | mib-2, experimental FROM SNMPv2-SMI
7 | Ipv6Address, Ipv6IfIndexOrZero FROM IPV6-TC;
8 |
9 | ipv6UdpMIB MODULE-IDENTITY
10 | LAST-UPDATED "9801290000Z"
11 | ORGANIZATION "IETF IPv6 MIB Working Group"
12 | CONTACT-INFO
13 | " Mike Daniele
14 |
15 | Postal: Compaq Computer Corporation
16 | 110 Spitbrook Rd
17 | Nashua, NH 03062.
18 | US
19 |
20 | Phone: +1 603 884 1423
21 | Email: daniele@zk3.dec.com"
22 | DESCRIPTION
23 | "The MIB module for entities implementing UDP over IPv6."
24 | ::= { experimental 87 }
25 |
26 | -- objects specific to UDP for IPv6
27 |
28 | udp OBJECT IDENTIFIER ::= { mib-2 7 }
29 |
30 | -- the UDP over IPv6 Listener table
31 |
32 | -- This table contains information about this entity's
33 | -- UDP/IPv6 endpoints. Only endpoints utilizing IPv6 addresses
34 | -- are contained in this table. This entity's UDP/IPv4 endpoints
35 | -- are contained in udpTable.
36 |
37 | ipv6UdpTable OBJECT-TYPE
38 | SYNTAX SEQUENCE OF Ipv6UdpEntry
39 | MAX-ACCESS not-accessible
40 | STATUS current
41 | DESCRIPTION
42 | "A table containing UDP listener information for
43 | UDP/IPv6 endpoints."
44 | ::= { udp 6 }
45 |
46 | ipv6UdpEntry OBJECT-TYPE
47 | SYNTAX Ipv6UdpEntry
48 | MAX-ACCESS not-accessible
49 | STATUS current
50 | DESCRIPTION
51 | "Information about a particular current UDP listener.
52 |
53 | Note that conceptual rows in this table require an
54 | additional index object compared to udpTable, since
55 | IPv6 addresses are not guaranteed to be unique on the
56 | managed node."
57 | INDEX { ipv6UdpLocalAddress,
58 | ipv6UdpLocalPort,
59 | ipv6UdpIfIndex }
60 | ::= { ipv6UdpTable 1 }
61 |
62 | Ipv6UdpEntry ::= SEQUENCE {
63 | ipv6UdpLocalAddress Ipv6Address,
64 | ipv6UdpLocalPort INTEGER (0..65535),
65 | ipv6UdpIfIndex Ipv6IfIndexOrZero }
66 |
67 | ipv6UdpLocalAddress OBJECT-TYPE
68 | SYNTAX Ipv6Address
69 | MAX-ACCESS not-accessible
70 | STATUS current
71 | DESCRIPTION
72 | "The local IPv6 address for this UDP listener.
73 | In the case of a UDP listener which is willing
74 | to accept datagrams for any IPv6 address
75 | associated with the managed node, the value ::0
76 | is used."
77 | ::= { ipv6UdpEntry 1 }
78 |
79 | ipv6UdpLocalPort OBJECT-TYPE
80 | SYNTAX INTEGER (0..65535)
81 | MAX-ACCESS not-accessible
82 | STATUS current
83 | DESCRIPTION
84 | "The local port number for this UDP listener."
85 | ::= { ipv6UdpEntry 2 }
86 |
87 | ipv6UdpIfIndex OBJECT-TYPE
88 | SYNTAX Ipv6IfIndexOrZero
89 | MAX-ACCESS read-only
90 | STATUS current
91 | DESCRIPTION
92 | "An index object used to disambiguate conceptual rows in
93 | the table, since the ipv6UdpLocalAddress/ipv6UdpLocalPort
94 | pair may not be unique.
95 |
96 | This object identifies the local interface that is
97 | associated with ipv6UdpLocalAddress for this UDP listener.
98 | If such a local interface cannot be determined, this object
99 | should take on the value 0. (A possible example of this
100 | would be if the value of ipv6UdpLocalAddress is ::0.)
101 |
102 | The interface identified by a particular non-0 value of
103 | this index is the same interface as identified by the same
104 | value of ipv6IfIndex.
105 |
106 | The value of this object must remain constant during
107 | the life of this UDP endpoint."
108 | ::= { ipv6UdpEntry 3 }
109 |
110 | --
111 | -- conformance information
112 | --
113 |
114 | ipv6UdpConformance OBJECT IDENTIFIER ::= { ipv6UdpMIB 2 }
115 |
116 | ipv6UdpCompliances OBJECT IDENTIFIER ::= { ipv6UdpConformance 1 }
117 | ipv6UdpGroups OBJECT IDENTIFIER ::= { ipv6UdpConformance 2 }
118 |
119 | -- compliance statements
120 |
121 | ipv6UdpCompliance MODULE-COMPLIANCE
122 | STATUS current
123 | DESCRIPTION
124 | "The compliance statement for SNMPv2 entities which
125 | implement UDP over IPv6."
126 | MODULE -- this module
127 | MANDATORY-GROUPS { ipv6UdpGroup }
128 | ::= { ipv6UdpCompliances 1 }
129 |
130 | ipv6UdpGroup OBJECT-GROUP
131 | OBJECTS { -- these are defined in this module
132 | -- ipv6UdpLocalAddress (not-accessible)
133 | -- ipv6UdpLocalPort (not-accessible)
134 | ipv6UdpIfIndex }
135 | STATUS current
136 | DESCRIPTION
137 | "The group of objects providing management of
138 | UDP over IPv6."
139 | ::= { ipv6UdpGroups 1 }
140 |
141 | END
142 |
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/UCD-DEMO-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-DEMO-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, OBJECT-TYPE, Integer32 FROM SNMPv2-SMI
5 | ucdavis FROM UCD-SNMP-MIB;
6 |
7 | ucdDemoMIB MODULE-IDENTITY
8 | LAST-UPDATED "9912090000Z"
9 | ORGANIZATION "University of California, Davis"
10 | CONTACT-INFO
11 | "This mib is no longer being maintained by the University of
12 | California and is now in life-support-mode and being
13 | maintained by the net-snmp project. The best place to write
14 | for public questions about the net-snmp-coders mailing list
15 | at net-snmp-coders@lists.sourceforge.net.
16 |
17 | postal: Wes Hardaker
18 | P.O. Box 382
19 | Davis CA 95617
20 |
21 | email: net-snmp-coders@lists.sourceforge.net
22 | "
23 | DESCRIPTION
24 | "The UCD-SNMP Demonstration MIB."
25 | REVISION "9912090000Z"
26 | DESCRIPTION
27 | "SMIv2 version converted from older MIB definitions."
28 | ::= { ucdavis 14 }
29 |
30 | ucdDemoMIBObjects OBJECT IDENTIFIER ::= { ucdDemoMIB 1 }
31 |
32 | ucdDemoPublic OBJECT IDENTIFIER ::= { ucdDemoMIBObjects 1 }
33 |
34 | ucdDemoResetKeys OBJECT-TYPE
35 | SYNTAX Integer32 (0..2147483647)
36 | MAX-ACCESS read-write
37 | STATUS current
38 | DESCRIPTION
39 | "A set of value 1 to this object resets the
40 | demonstration user's auth and priv keys to the
41 | keys based on the P->Ku->Kul transformation of the
42 | value of the ucdDemoPasspharse object.
43 |
44 | Values other than 1 are ignored."
45 | ::= { ucdDemoPublic 1 }
46 |
47 | ucdDemoPublicString OBJECT-TYPE
48 | SYNTAX OCTET STRING (SIZE(0..1024))
49 | MAX-ACCESS read-write
50 | STATUS current
51 | DESCRIPTION
52 | "A publicly settable string that can be set for testing
53 | snmpsets. This value has no real usage other than
54 | testing purposes."
55 | ::= { ucdDemoPublic 2 }
56 |
57 | ucdDemoUserList OBJECT-TYPE
58 | SYNTAX OCTET STRING
59 | MAX-ACCESS read-only
60 | STATUS current
61 | DESCRIPTION
62 | "The list of users affected by the ucdDemoResetKeys object."
63 | ::= { ucdDemoPublic 3 }
64 |
65 | ucdDemoPassphrase OBJECT-TYPE
66 | SYNTAX OCTET STRING
67 | MAX-ACCESS read-only
68 | STATUS current
69 | DESCRIPTION
70 | "The demo passphrase that ucdDemoResetKeys changes each
71 | users localized key to based on the P->Ku->Kul transformation."
72 | ::= { ucdDemoPublic 4 }
73 |
74 | END
75 |
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/UCD-DISKIO-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-DISKIO-MIB DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Derived from the original VEST-INTERNETT-MIB. Open issues:
5 | --
6 | -- (a) where to register this MIB?
7 | -- (b) use not-accessible for diskIOIndex?
8 | --
9 |
10 |
11 | IMPORTS
12 | MODULE-IDENTITY, OBJECT-TYPE, Integer32, Counter32, Counter64
13 | FROM SNMPv2-SMI
14 | DisplayString
15 | FROM SNMPv2-TC
16 | ucdExperimental
17 | FROM UCD-SNMP-MIB;
18 |
19 | ucdDiskIOMIB MODULE-IDENTITY
20 | LAST-UPDATED "200504200000Z"
21 | ORGANIZATION "University of California, Davis"
22 | CONTACT-INFO
23 | "This mib is no longer being maintained by the University of
24 | California and is now in life-support-mode and being
25 | maintained by the net-snmp project. The best place to write
26 | for public questions about the net-snmp-coders mailing list
27 | at net-snmp-coders@lists.sourceforge.net.
28 |
29 | postal: Wes Hardaker
30 | P.O. Box 382
31 | Davis CA 95617
32 |
33 | email: net-snmp-coders@lists.sourceforge.net
34 | "
35 | DESCRIPTION
36 | "This MIB module defines objects for disk IO statistics."
37 |
38 | REVISION "200504200000Z"
39 | DESCRIPTION
40 | "Add 64 bit counters. Patch from Dan Nelson."
41 |
42 | REVISION "200202130000Z"
43 | DESCRIPTION
44 | "Add 1, 5 and 15-minute load average objects"
45 |
46 | REVISION "200001260000Z"
47 | DESCRIPTION
48 | "SMIv2 version derived from older definitions contained
49 | in the VEST-INTERNETT-MIB module."
50 | ::= { ucdExperimental 15 }
51 |
52 | diskIOTable OBJECT-TYPE
53 | SYNTAX SEQUENCE OF DiskIOEntry
54 | MAX-ACCESS not-accessible
55 | STATUS current
56 | DESCRIPTION
57 | "Table of IO devices and how much data they have read/written."
58 | ::= { ucdDiskIOMIB 1 }
59 |
60 | diskIOEntry OBJECT-TYPE
61 | SYNTAX DiskIOEntry
62 | MAX-ACCESS not-accessible
63 | STATUS current
64 | DESCRIPTION
65 | "An entry containing a device and its statistics."
66 | INDEX { diskIOIndex }
67 | ::= { diskIOTable 1 }
68 |
69 | DiskIOEntry ::= SEQUENCE {
70 | diskIOIndex Integer32,
71 | diskIODevice DisplayString,
72 | diskIONRead Counter32,
73 | diskIONWritten Counter32,
74 | diskIOReads Counter32,
75 | diskIOWrites Counter32,
76 | diskIOLA1 Integer32,
77 | diskIOLA5 Integer32,
78 | diskIOLA15 Integer32,
79 | diskIONReadX Counter64,
80 | diskIONWrittenX Counter64
81 | }
82 |
83 | diskIOIndex OBJECT-TYPE
84 | SYNTAX Integer32 (0..65535)
85 | MAX-ACCESS read-only
86 | STATUS current
87 | DESCRIPTION
88 | "Reference index for each observed device."
89 | ::= { diskIOEntry 1 }
90 |
91 | diskIODevice OBJECT-TYPE
92 | SYNTAX DisplayString
93 | MAX-ACCESS read-only
94 | STATUS current
95 | DESCRIPTION
96 | "The name of the device we are counting/checking."
97 | ::= { diskIOEntry 2 }
98 |
99 | diskIONRead OBJECT-TYPE
100 | SYNTAX Counter32
101 | MAX-ACCESS read-only
102 | STATUS current
103 | DESCRIPTION
104 | "The number of bytes read from this device since boot."
105 | ::= { diskIOEntry 3 }
106 |
107 | diskIONWritten OBJECT-TYPE
108 | SYNTAX Counter32
109 | MAX-ACCESS read-only
110 | STATUS current
111 | DESCRIPTION
112 | "The number of bytes written to this device since boot."
113 | ::= { diskIOEntry 4 }
114 |
115 | diskIOReads OBJECT-TYPE
116 | SYNTAX Counter32
117 | MAX-ACCESS read-only
118 | STATUS current
119 | DESCRIPTION
120 | "The number of read accesses from this device since boot."
121 | ::= { diskIOEntry 5 }
122 |
123 | diskIOWrites OBJECT-TYPE
124 | SYNTAX Counter32
125 | MAX-ACCESS read-only
126 | STATUS current
127 | DESCRIPTION
128 | "The number of write accesses to this device since boot."
129 | ::= { diskIOEntry 6 }
130 |
131 | diskIOLA1 OBJECT-TYPE
132 | SYNTAX Integer32 (0..100)
133 | MAX-ACCESS read-only
134 | STATUS current
135 | DESCRIPTION
136 | "The 1 minute average load of disk (%)"
137 | ::= { diskIOEntry 9 }
138 |
139 | diskIOLA5 OBJECT-TYPE
140 | SYNTAX Integer32 (0..100)
141 | MAX-ACCESS read-only
142 | STATUS current
143 | DESCRIPTION
144 | "The 5 minute average load of disk (%)"
145 | ::= { diskIOEntry 10 }
146 |
147 | diskIOLA15 OBJECT-TYPE
148 | SYNTAX Integer32 (0..100)
149 | MAX-ACCESS read-only
150 | STATUS current
151 | DESCRIPTION
152 | "The 15 minute average load of disk (%)"
153 | ::= { diskIOEntry 11 }
154 |
155 | diskIONReadX OBJECT-TYPE
156 | SYNTAX Counter64
157 | MAX-ACCESS read-only
158 | STATUS current
159 | DESCRIPTION
160 | "The number of bytes read from this device since boot."
161 | ::= { diskIOEntry 12 }
162 |
163 | diskIONWrittenX OBJECT-TYPE
164 | SYNTAX Counter64
165 | MAX-ACCESS read-only
166 | STATUS current
167 | DESCRIPTION
168 | "The number of bytes written to this device since boot."
169 | ::= { diskIOEntry 13 }
170 |
171 | END
172 |
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/UCD-DLMOD-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-DLMOD-MIB DEFINITIONS ::= BEGIN
2 |
3 | -- Why do we have dlmodNextIndex if the dlmodTable is read-write?
4 | -- What exactly is the dlmodName and dlmodPath?
5 | -- Should there not be a timestamp associated with dlmodError?
6 | -- What exactly do the dlmodStatus enumerations mean?
7 |
8 | IMPORTS
9 | OBJECT-TYPE, MODULE-IDENTITY, Integer32 FROM SNMPv2-SMI
10 | DisplayString FROM SNMPv2-TC
11 | ucdExperimental FROM UCD-SNMP-MIB;
12 |
13 | ucdDlmodMIB MODULE-IDENTITY
14 | LAST-UPDATED "200001260000Z"
15 | ORGANIZATION "University of California, Davis"
16 | CONTACT-INFO
17 | "This mib is no longer being maintained by the University of
18 | California and is now in life-support-mode and being
19 | maintained by the net-snmp project. The best place to write
20 | for public questions about the net-snmp-coders mailing list
21 | at net-snmp-coders@lists.sourceforge.net.
22 |
23 | postal: Wes Hardaker
24 | P.O. Box 382
25 | Davis CA 95617
26 |
27 | email: net-snmp-coders@lists.sourceforge.net
28 | "
29 | DESCRIPTION
30 | "This file defines the MIB objects for dynamic
31 | loadable MIB modules."
32 |
33 | REVISION "200001260000Z"
34 | DESCRIPTION
35 | "Renamed MIB root object"
36 |
37 | REVISION "9912100000Z"
38 | DESCRIPTION
39 | "SMIv2 version converted from older MIB definitions."
40 | ::= { ucdExperimental 14 }
41 |
42 | dlmodNextIndex OBJECT-TYPE
43 | SYNTAX Integer32
44 | MAX-ACCESS read-only
45 | STATUS current
46 | DESCRIPTION
47 | "The index number of next appropiate unassigned entry
48 | in the dlmodTable."
49 | ::= { ucdDlmodMIB 1 }
50 |
51 | dlmodTable OBJECT-TYPE
52 | SYNTAX SEQUENCE OF DlmodEntry
53 | MAX-ACCESS not-accessible
54 | STATUS current
55 | DESCRIPTION
56 | "A table of dlmodEntry."
57 | ::= { ucdDlmodMIB 2 }
58 |
59 | dlmodEntry OBJECT-TYPE
60 | SYNTAX DlmodEntry
61 | MAX-ACCESS not-accessible
62 | STATUS current
63 | DESCRIPTION
64 | "The parameters of dynamically loaded MIB module."
65 | INDEX { dlmodIndex }
66 | ::= { dlmodTable 1 }
67 |
68 | DlmodEntry ::= SEQUENCE {
69 | dlmodIndex Integer32,
70 | dlmodName DisplayString,
71 | dlmodPath DisplayString,
72 | dlmodError DisplayString,
73 | dlmodStatus INTEGER
74 | }
75 |
76 | dlmodIndex OBJECT-TYPE
77 | SYNTAX Integer32 (1..65535)
78 | MAX-ACCESS not-accessible
79 | STATUS current
80 | DESCRIPTION
81 | "An index that uniqely identifies an entry in the dlmodTable."
82 | ::= { dlmodEntry 1 }
83 |
84 | dlmodName OBJECT-TYPE
85 | SYNTAX DisplayString
86 | MAX-ACCESS read-write
87 | STATUS current
88 | DESCRIPTION
89 | "The module name."
90 | ::= { dlmodEntry 2 }
91 |
92 | dlmodPath OBJECT-TYPE
93 | SYNTAX DisplayString
94 | MAX-ACCESS read-write
95 | STATUS current
96 | DESCRIPTION
97 | "The path of the module executable file."
98 | ::= { dlmodEntry 3 }
99 |
100 | dlmodError OBJECT-TYPE
101 | SYNTAX DisplayString
102 | MAX-ACCESS read-only
103 | STATUS current
104 | DESCRIPTION
105 | "The last error from dlmod_load_module."
106 | ::= { dlmodEntry 4 }
107 |
108 | dlmodStatus OBJECT-TYPE
109 | SYNTAX INTEGER {
110 | loaded(1),
111 | unloaded(2),
112 | error(3),
113 | load(4),
114 | unload(5),
115 | create(6),
116 | delete(7)
117 | }
118 | MAX-ACCESS read-write
119 | STATUS current
120 | DESCRIPTION
121 | "The current status of the loaded module."
122 | ::= { dlmodEntry 5 }
123 |
124 | END
125 |
--------------------------------------------------------------------------------
/test/fixtures/broken_mibs/UCD-IPFWACC-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-IPFWACC-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | OBJECT-TYPE, MODULE-IDENTITY, IpAddress, Integer32, Counter32
5 | FROM SNMPv2-SMI
6 | DisplayString
7 | FROM SNMPv2-TC
8 | ucdExperimental
9 | FROM UCD-SNMP-MIB;
10 |
11 | ucdIpFwAccMIB MODULE-IDENTITY
12 | LAST-UPDATED "9912160000Z"
13 | ORGANIZATION "University of California, Davis"
14 | CONTACT-INFO
15 | "This mib is no longer being maintained by the University of
16 | California and is now in life-support-mode and being
17 | maintained by the net-snmp project. The best place to write
18 | for public questions about the net-snmp-coders mailing list
19 | at net-snmp-coders@lists.sourceforge.net.
20 |
21 | postal: Wes Hardaker
22 | P.O. Box 382
23 | Davis CA 95617
24 |
25 | email: net-snmp-coders@lists.sourceforge.net
26 | "
27 | DESCRIPTION
28 | "This module defines MIB components for reading information
29 | from the accounting rules IP Firewall. This would typically
30 | let you read the rules and the counters. I did not include
31 | some flags and fields that I considered irrelevant for the
32 | accounting rules. Resetting the counters of the rules by SNMP
33 | would be simple, but I don't consider it so useful. I gave no
34 | consideration to implementing write access for allowing
35 | modification of the accounting rules.
36 |
37 | Cristian.Estan@net.utcluj.ro "
38 | REVISION "9912160000Z"
39 | DESCRIPTION
40 | "SMIv2 version converted from an older MIB definition."
41 | ::= { ucdExperimental 1 }
42 |
43 | ipFwAccTable OBJECT-TYPE
44 | SYNTAX SEQUENCE OF IpFwAccEntry
45 | MAX-ACCESS not-accessible
46 | STATUS current
47 | DESCRIPTION
48 | "A table with the accounting rules of the IP firewall"
49 | ::= { ucdIpFwAccMIB 1 }
50 |
51 | ipFwAccEntry OBJECT-TYPE
52 | SYNTAX IpFwAccEntry
53 | MAX-ACCESS not-accessible
54 | STATUS current
55 | DESCRIPTION
56 | "An accounting rule of the IP firewall"
57 | INDEX { ipFwAccIndex }
58 | ::= { ipFwAccTable 1 }
59 |
60 | IpFwAccEntry ::= SEQUENCE {
61 | ipFwAccIndex Integer32,
62 | ipFwAccSrcAddr IpAddress,
63 | ipFwAccSrcNetMask IpAddress,
64 | ipFwAccDstAddr IpAddress,
65 | ipFwAccDstNetMask IpAddress,
66 | ipFwAccViaName DisplayString,
67 | ipFwAccViaAddr IpAddress,
68 | ipFwAccProto INTEGER,
69 | ipFwAccBidir INTEGER,
70 | ipFwAccDir INTEGER,
71 | ipFwAccBytes Counter32,
72 | ipFwAccPackets Counter32,
73 | ipFwAccNrSrcPorts Integer32,
74 | ipFwAccNrDstPorts Integer32,
75 | ipFwAccSrcIsRange INTEGER,
76 | ipFwAccDstIsRange INTEGER,
77 | ipFwAccPort1 Integer32,
78 | ipFwAccPort2 Integer32,
79 | ipFwAccPort3 Integer32,
80 | ipFwAccPort4 Integer32,
81 | ipFwAccPort5 Integer32,
82 | ipFwAccPort6 Integer32,
83 | ipFwAccPort7 Integer32,
84 | ipFwAccPort8 Integer32,
85 | ipFwAccPort9 Integer32,
86 | ipFwAccPort10 Integer32
87 | }
88 |
89 | ipFwAccIndex OBJECT-TYPE
90 | SYNTAX Integer32 (0..2147483647)
91 | MAX-ACCESS read-only
92 | STATUS current
93 | DESCRIPTION
94 | "Reference index for each firewall rule."
95 | ::= { ipFwAccEntry 1 }
96 |
97 | ipFwAccSrcAddr OBJECT-TYPE
98 | SYNTAX IpAddress
99 | MAX-ACCESS read-only
100 | STATUS current
101 | DESCRIPTION
102 | "The source address in the firewall rule."
103 | ::= { ipFwAccEntry 2 }
104 |
105 | ipFwAccSrcNetMask OBJECT-TYPE
106 | SYNTAX IpAddress
107 | MAX-ACCESS read-only
108 | STATUS current
109 | DESCRIPTION
110 | "The netmask of the source address in the firewall rule."
111 | ::= { ipFwAccEntry 3 }
112 |
113 | ipFwAccDstAddr OBJECT-TYPE
114 | SYNTAX IpAddress
115 | MAX-ACCESS read-only
116 | STATUS current
117 | DESCRIPTION
118 | "The destination address in the firewall rule."
119 | ::= { ipFwAccEntry 4 }
120 |
121 | ipFwAccDstNetMask OBJECT-TYPE
122 | SYNTAX IpAddress
123 | MAX-ACCESS read-only
124 | STATUS current
125 | DESCRIPTION
126 | "The netmask of the destination address in the firewall rule."
127 | ::= { ipFwAccEntry 5 }
128 |
129 | ipFwAccViaName OBJECT-TYPE
130 | SYNTAX DisplayString (SIZE(1..64))
131 | MAX-ACCESS read-only
132 | STATUS current
133 | DESCRIPTION
134 | "The name of the interface to which the rule applies. If no
135 | interface is associated with the present rule, this should
136 | contain a dash (-)."
137 | ::= { ipFwAccEntry 6 }
138 |
139 | ipFwAccViaAddr OBJECT-TYPE
140 | SYNTAX IpAddress
141 | MAX-ACCESS read-only
142 | STATUS current
143 | DESCRIPTION
144 | "The address of the interface to which the rule applies.
145 | Using this parameter makes sense when multiple addresses are
146 | associated to the same physical interface. If not defined
147 | for the current rule this should be set to 0."
148 | ::= { ipFwAccEntry 7 }
149 |
150 | ipFwAccProto OBJECT-TYPE
151 | SYNTAX INTEGER {
152 | other(1),
153 | all(2),
154 | tcp(3),
155 | udp(4),
156 | icmp(5)
157 | }
158 | MAX-ACCESS read-only
159 | STATUS current
160 | DESCRIPTION
161 | "The protocol(s) to which the rule applies."
162 | ::= { ipFwAccEntry 8 }
163 |
164 | ipFwAccBidir OBJECT-TYPE
165 | SYNTAX INTEGER {
166 | unidirectional(1),
167 | bidirectional(2)
168 | }
169 | MAX-ACCESS read-only
170 | STATUS current
171 | DESCRIPTION
172 | "Whether the rule works in both directions (i.e. with the
173 | source and destination parts swapped) or not."
174 | ::= { ipFwAccEntry 9 }
175 |
176 | ipFwAccDir OBJECT-TYPE
177 | SYNTAX INTEGER {
178 | both(1),
179 | in(2),
180 | out(3)
181 | }
182 | MAX-ACCESS read-only
183 | STATUS current
184 | DESCRIPTION
185 | "Whether the rule applies to packets entering or exiting the
186 | kernel."
187 | ::= { ipFwAccEntry 10 }
188 |
189 | ipFwAccBytes OBJECT-TYPE
190 | SYNTAX Counter32
191 | MAX-ACCESS read-only
192 | STATUS current
193 | DESCRIPTION
194 | "The number of bytes that matched this rule since the last
195 | reset of the counters."
196 | ::= { ipFwAccEntry 11 }
197 |
198 | ipFwAccPackets OBJECT-TYPE
199 | SYNTAX Counter32
200 | MAX-ACCESS read-only
201 | STATUS current
202 | DESCRIPTION
203 | "The number of packets that matched this rule since the last
204 | reset of the counters."
205 | ::= { ipFwAccEntry 12 }
206 |
207 | ipFwAccNrSrcPorts OBJECT-TYPE
208 | SYNTAX Integer32
209 | MAX-ACCESS read-only
210 | STATUS current
211 | DESCRIPTION
212 | "The number of ports that refer to the source address."
213 | ::= { ipFwAccEntry 13 }
214 |
215 | ipFwAccNrDstPorts OBJECT-TYPE
216 | SYNTAX Integer32
217 | MAX-ACCESS read-only
218 | STATUS current
219 | DESCRIPTION
220 | "The number of ports that refer to the destination address."
221 | ::= { ipFwAccEntry 14 }
222 |
223 | ipFwAccSrcIsRange OBJECT-TYPE
224 | SYNTAX INTEGER {
225 | srchasrange(1),
226 | srchasnorange(2)
227 | }
228 | MAX-ACCESS read-only
229 | STATUS current
230 | DESCRIPTION
231 | "Interpret the first two ports of the source part as
232 | the upper and lower limit of an interval or not."
233 | ::= { ipFwAccEntry 15 }
234 |
235 | ipFwAccDstIsRange OBJECT-TYPE
236 | SYNTAX INTEGER {
237 | dsthasrange(1),
238 | dsthasnorange(2)
239 | }
240 | MAX-ACCESS read-only
241 | STATUS current
242 | DESCRIPTION
243 | "Interpret the first two ports of the destination part as
244 | the upper and lower limit of an interval or not."
245 | ::= { ipFwAccEntry 16 }
246 |
247 | ipFwAccPort1 OBJECT-TYPE
248 | SYNTAX Integer32
249 | MAX-ACCESS read-only
250 | STATUS current
251 | DESCRIPTION
252 | "Port number 1."
253 | ::= { ipFwAccEntry 17 }
254 |
255 | ipFwAccPort2 OBJECT-TYPE
256 | SYNTAX Integer32
257 | MAX-ACCESS read-only
258 | STATUS current
259 | DESCRIPTION
260 | "Port number 2."
261 | ::= { ipFwAccEntry 18 }
262 |
263 | ipFwAccPort3 OBJECT-TYPE
264 | SYNTAX Integer32
265 | MAX-ACCESS read-only
266 | STATUS current
267 | DESCRIPTION
268 | "Port number 3."
269 | ::= { ipFwAccEntry 19 }
270 |
271 | ipFwAccPort4 OBJECT-TYPE
272 | SYNTAX Integer32
273 | MAX-ACCESS read-only
274 | STATUS current
275 | DESCRIPTION
276 | "Port number 4."
277 | ::= { ipFwAccEntry 20 }
278 |
279 | ipFwAccPort5 OBJECT-TYPE
280 | SYNTAX Integer32
281 | MAX-ACCESS read-only
282 | STATUS current
283 | DESCRIPTION
284 | "Port number 5."
285 | ::= { ipFwAccEntry 21 }
286 |
287 | ipFwAccPort6 OBJECT-TYPE
288 | SYNTAX Integer32
289 | MAX-ACCESS read-only
290 | STATUS current
291 | DESCRIPTION
292 | "Port number 6."
293 | ::= { ipFwAccEntry 22 }
294 |
295 | ipFwAccPort7 OBJECT-TYPE
296 | SYNTAX Integer32
297 | MAX-ACCESS read-only
298 | STATUS current
299 | DESCRIPTION
300 | "Port number 7."
301 | ::= { ipFwAccEntry 23 }
302 |
303 | ipFwAccPort8 OBJECT-TYPE
304 | SYNTAX Integer32
305 | MAX-ACCESS read-only
306 | STATUS current
307 | DESCRIPTION
308 | "Port number 8."
309 | ::= { ipFwAccEntry 24 }
310 |
311 | ipFwAccPort9 OBJECT-TYPE
312 | SYNTAX Integer32
313 | MAX-ACCESS read-only
314 | STATUS current
315 | DESCRIPTION
316 | "Port number 9."
317 | ::= { ipFwAccEntry 25 }
318 |
319 | ipFwAccPort10 OBJECT-TYPE
320 | SYNTAX Integer32
321 | MAX-ACCESS read-only
322 | STATUS current
323 | DESCRIPTION
324 | "Port number 10."
325 | ::= { ipFwAccEntry 26 }
326 |
327 | END
328 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/HCNUM-TC.mib:
--------------------------------------------------------------------------------
1 | HCNUM-TC DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, mib-2, Counter64
5 | FROM SNMPv2-SMI
6 | TEXTUAL-CONVENTION
7 | FROM SNMPv2-TC;
8 |
9 | hcnumTC MODULE-IDENTITY
10 | LAST-UPDATED "200006080000Z"
11 |
12 | ORGANIZATION "IETF OPS Area"
13 | CONTACT-INFO
14 | " E-mail: mibs@ops.ietf.org
15 | Subscribe: majordomo@psg.com
16 | with msg body: subscribe mibs
17 |
18 | Andy Bierman
19 | Cisco Systems Inc.
20 | 170 West Tasman Drive
21 | San Jose, CA 95134 USA
22 | +1 408-527-3711
23 | abierman@cisco.com
24 |
25 | Keith McCloghrie
26 | Cisco Systems Inc.
27 | 170 West Tasman Drive
28 | San Jose, CA 95134 USA
29 | +1 408-526-5260
30 | kzm@cisco.com
31 |
32 | Randy Presuhn
33 | BMC Software, Inc.
34 | Office 1-3141
35 | 2141 North First Street
36 | San Jose, California 95131 USA
37 | +1 408 546-1006
38 | rpresuhn@bmc.com"
39 | DESCRIPTION
40 | "A MIB module containing textual conventions
41 | for high capacity data types. This module
42 | addresses an immediate need for data types not directly
43 | supported in the SMIv2. This short-term solution
44 | is meant to be deprecated as a long-term solution
45 | is deployed."
46 | REVISION "200006080000Z"
47 | DESCRIPTION
48 | "Initial Version of the High Capacity Numbers
49 | MIB module, published as RFC 2856."
50 | ::= { mib-2 78 }
51 |
52 | CounterBasedGauge64 ::= TEXTUAL-CONVENTION
53 | STATUS current
54 | DESCRIPTION
55 | "The CounterBasedGauge64 type represents a non-negative
56 | integer, which may increase or decrease, but shall never
57 | exceed a maximum value, nor fall below a minimum value. The
58 | maximum value can not be greater than 2^64-1
59 | (18446744073709551615 decimal), and the minimum value can
60 |
61 | not be smaller than 0. The value of a CounterBasedGauge64
62 | has its maximum value whenever the information being modeled
63 | is greater than or equal to its maximum value, and has its
64 | minimum value whenever the information being modeled is
65 | smaller than or equal to its minimum value. If the
66 | information being modeled subsequently decreases below
67 | (increases above) the maximum (minimum) value, the
68 | CounterBasedGauge64 also decreases (increases).
69 |
70 | Note that this TC is not strictly supported in SMIv2,
71 | because the 'always increasing' and 'counter wrap' semantics
72 | associated with the Counter64 base type are not preserved.
73 | It is possible that management applications which rely
74 | solely upon the (Counter64) ASN.1 tag to determine object
75 | semantics will mistakenly operate upon objects of this type
76 | as they would for Counter64 objects.
77 |
78 | This textual convention represents a limited and short-term
79 | solution, and may be deprecated as a long term solution is
80 | defined and deployed to replace it."
81 | SYNTAX Counter64
82 |
83 | ZeroBasedCounter64 ::= TEXTUAL-CONVENTION
84 | STATUS current
85 | DESCRIPTION
86 | "This TC describes an object which counts events with the
87 | following semantics: objects of this type will be set to
88 | zero(0) on creation and will thereafter count appropriate
89 | events, wrapping back to zero(0) when the value 2^64 is
90 | reached.
91 |
92 | Provided that an application discovers the new object within
93 | the minimum time to wrap it can use the initial value as a
94 | delta since it last polled the table of which this object is
95 | part. It is important for a management station to be aware
96 | of this minimum time and the actual time between polls, and
97 | to discard data if the actual time is too long or there is
98 | no defined minimum time.
99 |
100 | Typically this TC is used in tables where the INDEX space is
101 | constantly changing and/or the TimeFilter mechanism is in
102 | use.
103 |
104 | Note that this textual convention does not retain all the
105 | semantics of the Counter64 base type. Specifically, a
106 | Counter64 has an arbitrary initial value, but objects
107 | defined with this TC are required to start at the value
108 |
109 | zero. This behavior is not likely to have any adverse
110 | effects on management applications which are expecting
111 | Counter64 semantics.
112 |
113 | This textual convention represents a limited and short-term
114 | solution, and may be deprecated as a long term solution is
115 | defined and deployed to replace it."
116 | SYNTAX Counter64
117 |
118 | END
119 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/IANA-ADDRESS-FAMILY-NUMBERS-MIB.mib:
--------------------------------------------------------------------------------
1 | IANA-ADDRESS-FAMILY-NUMBERS-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY,
5 | mib-2 FROM SNMPv2-SMI
6 | TEXTUAL-CONVENTION FROM SNMPv2-TC;
7 |
8 | ianaAddressFamilyNumbers MODULE-IDENTITY
9 | LAST-UPDATED "201309250000Z" -- September 25, 2013
10 | ORGANIZATION "IANA"
11 | CONTACT-INFO
12 | "Postal: Internet Assigned Numbers Authority
13 | Internet Corporation for Assigned Names
14 | and Numbers
15 | 12025 Waterfront Drive, Suite 300
16 | Los Angeles, CA 90094-2536
17 | USA
18 |
19 | Tel: +1 310-301-5800
20 | E-Mail: iana&iana.org"
21 | DESCRIPTION
22 | "The MIB module defines the AddressFamilyNumbers
23 | textual convention."
24 |
25 | -- revision history
26 |
27 | REVISION "201309250000Z" -- September 25, 2013
28 | DESCRIPTION "Fixed labels for 16389-16390."
29 |
30 | REVISION "201307160000Z" -- July 16, 2013
31 | DESCRIPTION "Fixed labels for 16389-16390."
32 |
33 | REVISION "201306260000Z" -- June 26, 2013
34 | DESCRIPTION "Added assignments 26-28."
35 |
36 | REVISION "201306180000Z" -- June 18, 2013
37 | DESCRIPTION "Added assignments 16384-16390. Assignment
38 | 25 added in 2007 revision."
39 |
40 | REVISION "200203140000Z" -- March 14, 2002
41 | DESCRIPTION "AddressFamilyNumbers assignment 22 to
42 | fibreChannelWWPN. AddressFamilyNumbers
43 | assignment 23 to fibreChannelWWNN.
44 | AddressFamilyNumers assignment 24 to gwid."
45 |
46 | REVISION "200009080000Z" -- September 8, 2000
47 | DESCRIPTION "AddressFamilyNumbers assignment 19 to xtpOverIpv4.
48 | AddressFamilyNumbers assignment 20 to xtpOverIpv6.
49 | AddressFamilyNumbers assignment 21 to xtpNativeModeXTP."
50 |
51 | REVISION "200003010000Z" -- March 1, 2000
52 | DESCRIPTION "AddressFamilyNumbers assignment 17 to distinguishedName.
53 | AddressFamilyNumbers assignment 18 to asNumber."
54 |
55 | REVISION "200002040000Z" -- February 4, 2000
56 | DESCRIPTION "AddressFamilyNumbers assignment 16 to dns."
57 |
58 | REVISION "9908260000Z" -- August 26, 1999
59 | DESCRIPTION "Initial version, published as RFC 2677."
60 | ::= { mib-2 72 }
61 |
62 | AddressFamilyNumbers ::= TEXTUAL-CONVENTION
63 | STATUS current
64 | DESCRIPTION
65 | "The definition of this textual convention with the
66 | addition of newly assigned values is published
67 | periodically by the IANA, in either the Assigned
68 | Numbers RFC, or some derivative of it specific to
69 | Internet Network Management number assignments.
70 | (The latest arrangements can be obtained by
71 | contacting the IANA.)
72 |
73 | The enumerations are described as:
74 |
75 | other(0), -- none of the following
76 | ipV4(1), -- IP Version 4
77 | ipV6(2), -- IP Version 6
78 | nsap(3), -- NSAP
79 | hdlc(4), -- (8-bit multidrop)
80 | bbn1822(5),
81 | all802(6), -- (includes all 802 media
82 | -- plus Ethernet 'canonical format')
83 | e163(7),
84 | e164(8), -- (SMDS, Frame Relay, ATM)
85 | f69(9), -- (Telex)
86 | x121(10), -- (X.25, Frame Relay)
87 | ipx(11), -- IPX (Internet Protocol Exchange)
88 | appleTalk(12), -- Apple Talk
89 | decnetIV(13), -- DEC Net Phase IV
90 | banyanVines(14), -- Banyan Vines
91 | e164withNsap(15),
92 | -- (E.164 with NSAP format subaddress)
93 | dns(16), -- (Domain Name System)
94 | distinguishedName(17), -- (Distinguished Name, per X.500)
95 | asNumber(18), -- (16-bit quantity, per the AS number space)
96 | xtpOverIpv4(19), -- XTP over IP version 4
97 | xtpOverIpv6(20), -- XTP over IP version 6
98 | xtpNativeModeXTP(21), -- XTP native mode XTP
99 | fibreChannelWWPN(22), -- Fibre Channel World-Wide Port Name
100 | fibreChannelWWNN(23), -- Fibre Channel World-Wide Node Name
101 | gwid(24), -- Gateway Identifier
102 | afi(25), -- AFI for L2VPN information
103 | mplsTpSectionEndpointIdentifier(26), -- MPLS-TP Section Endpoint Identifier
104 | mplsTpLspEndpointIdentifier(27), -- MPLS-TP LSP Endpoint Identifier
105 | mplsTpPseudowireEndpointIdentifier(28), -- MPLS-TP Pseudowire Endpoint Identifier
106 | eigrpCommonServiceFamily(16384), -- EIGRP Common Service Family
107 | eigrpIpv4ServiceFamily(16385), -- EIGRP IPv4 Service Family
108 | eigrpIpv6ServiceFamily(16386), -- EIGRP IPv6 Service Family
109 | lispCanonicalAddressFormat(16387), -- LISP Canonical Address Format (LCAF)
110 | bgpLs(16388), -- BGP-LS
111 | fortyeightBitMacBitMac(16389), -- 48-bit MAC
112 | sixtyfourBitMac(16390), -- 64-bit MAC
113 | oui(16391), -- OUI
114 | mac24(16392), -- MAC/24
115 | mac40(16393), -- MAC/40
116 | ipv664(16394), -- IPv6/64
117 | rBridgePortID(16395), -- RBridge Port ID
118 | reserved(65535)
119 |
120 | Requests for new values should be made to IANA via
121 | email (iana&iana.org)."
122 | SYNTAX INTEGER {
123 | other(0),
124 | ipV4(1),
125 | ipV6(2),
126 | nsap(3),
127 | hdlc(4),
128 | bbn1822(5),
129 | all802(6),
130 | e163(7),
131 | e164(8),
132 | f69(9),
133 | x121(10),
134 | ipx(11),
135 | appleTalk(12),
136 | decnetIV(13),
137 | banyanVines(14),
138 | e164withNsap(15),
139 | dns(16),
140 | distinguishedName(17), -- (Distinguished Name, per X.500)
141 | asNumber(18), -- (16-bit quantity, per the AS number space)
142 | xtpOverIpv4(19),
143 | xtpOverIpv6(20),
144 | xtpNativeModeXTP(21),
145 | fibreChannelWWPN(22),
146 | fibreChannelWWNN(23),
147 | gwid(24),
148 | afi(25),
149 | mplsTpSectionEndpointIdentifier(26),
150 | mplsTpLspEndpointIdentifier(27),
151 | mplsTpPseudowireEndpointIdentifier(28),
152 | eigrpCommonServiceFamily(16384),
153 | eigrpIpv4ServiceFamily(16385),
154 | eigrpIpv6ServiceFamily(16386),
155 | lispCanonicalAddressFormat(16387),
156 | bgpLs(16388),
157 | fortyeightBitMac(16389),
158 | sixtyfourBitMac(16390),
159 | oui(16391),
160 | mac24(16392),
161 | mac40(16393),
162 | ipv664(16394),
163 | rBridgePortID(16395),
164 | reserved(65535)
165 | }
166 | END
167 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/IANA-LANGUAGE-MIB.mib:
--------------------------------------------------------------------------------
1 | IANA-LANGUAGE-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, OBJECT-IDENTITY, mib-2
5 | FROM SNMPv2-SMI;
6 |
7 | ianaLanguages MODULE-IDENTITY
8 | LAST-UPDATED "201405220000Z" -- May 22, 2014
9 | ORGANIZATION "IANA"
10 | CONTACT-INFO
11 | "Internet Assigned Numbers Authority (IANA)
12 |
13 | Postal: ICANN
14 | 12025 Waterfront Drive, Suite 300
15 | Los Angeles, CA 90094-2536
16 |
17 | Tel: +1 310-301-5800
18 | E-Mail: iana&iana.org"
19 | DESCRIPTION
20 | "The MIB module registers object identifier values for
21 | well-known programming and scripting languages. Every
22 | language registration MUST describe the format used
23 | when transferring scripts written in this language.
24 |
25 | Any additions or changes to the contents of this MIB
26 | module require Designated Expert Review as defined in
27 | the Guidelines for Writing IANA Considerations Section
28 | document. The Designated Expert will be selected by
29 | the IESG Area Director of the OPS Area.
30 |
31 | Note, this module does not have to register all possible
32 | languages since languages are identified by object
33 | identifier values. It is therefore possible to registered
34 | languages in private OID trees. The references given below are not
35 | normative with regard to the language version. Other
36 | references might be better suited to describe some newer
37 | versions of this language. The references are only
38 | provided as `a pointer into the right direction'."
39 |
40 | -- Revision log, in reverse chronological order
41 |
42 | REVISION "201405220000Z" -- May 22, 2014
43 | DESCRIPTION "Updated contact info."
44 |
45 | REVISION "200005100000Z" -- May 10, 2000
46 | DESCRIPTION "Import mib-2 instead of experimental, so that
47 | this module compiles"
48 |
49 | REVISION "199909090900Z" -- September 9, 1999
50 | DESCRIPTION "Initial version as published at time of
51 | publication of RFC 2591."
52 | ::= { mib-2 73 }
53 |
54 | ianaLangJavaByteCode OBJECT-IDENTITY
55 | STATUS current
56 | DESCRIPTION
57 | "Java byte code to be processed by a Java virtual machine.
58 | A script written in Java byte code is transferred by using
59 | the Java archive file format (JAR)."
60 | REFERENCE
61 | "The Java Virtual Machine Specification.
62 | ISBN 0-201-63452-X"
63 | ::= { ianaLanguages 1 }
64 |
65 | ianaLangTcl OBJECT-IDENTITY
66 | STATUS current
67 | DESCRIPTION
68 | "The Tool Command Language (Tcl). A script written in the
69 | Tcl language is transferred in Tcl source code format."
70 | REFERENCE
71 | "Tcl and the Tk Toolkit.
72 | ISBN 0-201-63337-X"
73 | ::= { ianaLanguages 2 }
74 |
75 | ianaLangPerl OBJECT-IDENTITY
76 | STATUS current
77 | DESCRIPTION
78 | "The Perl language. A script written in the Perl language
79 | is transferred in Perl source code format."
80 | REFERENCE
81 | "Programming Perl.
82 | ISBN 1-56592-149-6"
83 | ::= { ianaLanguages 3 }
84 |
85 | ianaLangScheme OBJECT-IDENTITY
86 | STATUS current
87 | DESCRIPTION
88 | "The Scheme language. A script written in the Scheme
89 | language is transferred in Scheme source code format."
90 | REFERENCE
91 | "The Revised^4 Report on the Algorithmic Language Scheme.
92 | MIT Press"
93 | ::= { ianaLanguages 4 }
94 |
95 | ianaLangSRSL OBJECT-IDENTITY
96 | STATUS current
97 | DESCRIPTION
98 | "The SNMP Script Language defined by SNMP Research. A
99 | script written in the SNMP Script Language is transferred
100 | in the SNMP Script Language source code format."
101 | ::= { ianaLanguages 5 }
102 |
103 | ianaLangPSL OBJECT-IDENTITY
104 | STATUS current
105 | DESCRIPTION
106 | "The Patrol Script Language defined by BMC Software. A script
107 | written in the Patrol Script Language is transferred in the
108 | Patrol Script Language source code format."
109 | REFERENCE
110 | "PATROL Script Language Reference Manual, Version 3.0,
111 | November 30, 1995. BMC Software, Inc. 2101 City West Blvd.,
112 | Houston, Texas 77042."
113 | ::= { ianaLanguages 6 }
114 |
115 | ianaLangSMSL OBJECT-IDENTITY
116 | STATUS current
117 | DESCRIPTION
118 | "The Systems Management Scripting Language. A script written
119 | in the SMSL language is transferred in the SMSL source code
120 | format."
121 | REFERENCE
122 | "ISO/ITU Command Sequencer.
123 | ISO 10164-21 or ITU X.753"
124 | ::= { ianaLanguages 7 }
125 |
126 | END
127 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/IANA-RTPROTO-MIB.mib:
--------------------------------------------------------------------------------
1 | IANA-RTPROTO-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, mib-2 FROM SNMPv2-SMI
5 | TEXTUAL-CONVENTION FROM SNMPv2-TC;
6 |
7 | ianaRtProtoMIB MODULE-IDENTITY
8 | LAST-UPDATED "201208300000Z" -- August 30, 2012
9 | ORGANIZATION "IANA"
10 | CONTACT-INFO
11 | " Internet Assigned Numbers Authority
12 | Internet Corporation for Assigned Names and Numbers
13 | 12025 Waterfront Drive, Suite 300
14 | Los Angeles, CA 90094-2536
15 |
16 | Phone: +1 310 301 5800
17 | EMail: iana&iana.org"
18 | DESCRIPTION
19 | "This MIB module defines the IANAipRouteProtocol and
20 | IANAipMRouteProtocol textual conventions for use in MIBs
21 | which need to identify unicast or multicast routing
22 | mechanisms.
23 |
24 | Any additions or changes to the contents of this MIB module
25 | require either publication of an RFC, or Designated Expert
26 | Review as defined in RFC 2434, Guidelines for Writing an
27 | IANA Considerations Section in RFCs. The Designated Expert
28 | will be selected by the IESG Area Director(s) of the Routing
29 | Area."
30 |
31 | REVISION "201208300000Z" -- August 30, 2012
32 | DESCRIPTION "Added dhcp(19)."
33 |
34 | REVISION "201107220000Z" -- July 22, 2011
35 | DESCRIPTION "Added rpl(18) ."
36 |
37 | REVISION "200009260000Z" -- September 26, 2000
38 | DESCRIPTION "Original version, published in coordination
39 | with RFC 2932."
40 | ::= { mib-2 84 }
41 |
42 | IANAipRouteProtocol ::= TEXTUAL-CONVENTION
43 | STATUS current
44 | DESCRIPTION
45 | "A mechanism for learning routes. Inclusion of values for
46 | routing protocols is not intended to imply that those
47 | protocols need be supported."
48 | SYNTAX INTEGER {
49 | other (1), -- not specified
50 | local (2), -- local interface
51 | netmgmt (3), -- static route
52 | icmp (4), -- result of ICMP Redirect
53 |
54 | -- the following are all dynamic
55 | -- routing protocols
56 |
57 | egp (5), -- Exterior Gateway Protocol
58 | ggp (6), -- Gateway-Gateway Protocol
59 | hello (7), -- FuzzBall HelloSpeak
60 | rip (8), -- Berkeley RIP or RIP-II
61 | isIs (9), -- Dual IS-IS
62 | esIs (10), -- ISO 9542
63 | ciscoIgrp (11), -- Cisco IGRP
64 | bbnSpfIgp (12), -- BBN SPF IGP
65 | ospf (13), -- Open Shortest Path First
66 | bgp (14), -- Border Gateway Protocol
67 | idpr (15), -- InterDomain Policy Routing
68 | ciscoEigrp (16), -- Cisco EIGRP
69 | dvmrp (17), -- DVMRP
70 | rpl (18), -- RPL [RFC-ietf-roll-rpl-19]
71 | dhcp (19) -- DHCP [RFC2132]
72 | }
73 |
74 | IANAipMRouteProtocol ::= TEXTUAL-CONVENTION
75 | STATUS current
76 | DESCRIPTION
77 | "The multicast routing protocol. Inclusion of values for
78 | multicast routing protocols is not intended to imply that
79 | those protocols need be supported."
80 | SYNTAX INTEGER {
81 | other(1), -- none of the following
82 | local(2), -- e.g., manually configured
83 | netmgmt(3), -- set via net.mgmt protocol
84 | dvmrp(4),
85 | mospf(5),
86 | pimSparseDense(6), -- PIMv1, both DM and SM
87 | cbt(7),
88 | pimSparseMode(8), -- PIM-SM
89 | pimDenseMode(9), -- PIM-DM
90 | igmpOnly(10),
91 | bgmp(11),
92 | msdp(12)
93 | }
94 |
95 | END
96 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/IF-INVERTED-STACK-MIB.mib:
--------------------------------------------------------------------------------
1 | IF-INVERTED-STACK-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, OBJECT-TYPE, mib-2 FROM SNMPv2-SMI
5 | RowStatus FROM SNMPv2-TC
6 | MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
7 | ifStackGroup2,
8 | ifStackHigherLayer, ifStackLowerLayer FROM IF-MIB;
9 |
10 | ifInvertedStackMIB MODULE-IDENTITY
11 | LAST-UPDATED "200006140000Z"
12 | ORGANIZATION "IETF Interfaces MIB Working Group"
13 | CONTACT-INFO
14 | " Keith McCloghrie
15 | Cisco Systems, Inc.
16 | 170 West Tasman Drive
17 | San Jose, CA 95134-1706
18 | US
19 |
20 | 408-526-5260
21 | kzm@cisco.com"
22 | DESCRIPTION
23 | "The MIB module which provides the Inverted Stack Table for
24 | interface sub-layers."
25 | REVISION "200006140000Z"
26 | DESCRIPTION
27 | "Initial revision, published as RFC 2864"
28 | ::= { mib-2 77 }
29 |
30 | ifInvMIBObjects OBJECT IDENTIFIER ::= { ifInvertedStackMIB 1 }
31 |
32 | --
33 | -- The Inverted Interface Stack Group
34 | --
35 |
36 | ifInvStackTable OBJECT-TYPE
37 | SYNTAX SEQUENCE OF IfInvStackEntry
38 | MAX-ACCESS not-accessible
39 | STATUS current
40 | DESCRIPTION
41 | "A table containing information on the relationships between
42 |
43 | the multiple sub-layers of network interfaces. In
44 | particular, it contains information on which sub-layers run
45 | 'underneath' which other sub-layers, where each sub-layer
46 | corresponds to a conceptual row in the ifTable. For
47 | example, when the sub-layer with ifIndex value x runs
48 | underneath the sub-layer with ifIndex value y, then this
49 | table contains:
50 |
51 | ifInvStackStatus.x.y=active
52 |
53 | For each ifIndex value, z, which identifies an active
54 | interface, there are always at least two instantiated rows
55 | in this table associated with z. For one of these rows, z
56 | is the value of ifStackHigherLayer; for the other, z is the
57 | value of ifStackLowerLayer. (If z is not involved in
58 | multiplexing, then these are the only two rows associated
59 | with z.)
60 |
61 | For example, two rows exist even for an interface which has
62 | no others stacked on top or below it:
63 |
64 | ifInvStackStatus.z.0=active
65 | ifInvStackStatus.0.z=active
66 |
67 | This table contains exactly the same number of rows as the
68 | ifStackTable, but the rows appear in a different order."
69 | REFERENCE
70 | "ifStackTable of RFC 2863"
71 | ::= { ifInvMIBObjects 1 }
72 |
73 | ifInvStackEntry OBJECT-TYPE
74 | SYNTAX IfInvStackEntry
75 | MAX-ACCESS not-accessible
76 | STATUS current
77 | DESCRIPTION
78 | "Information on a particular relationship between two sub-
79 | layers, specifying that one sub-layer runs underneath the
80 | other sub-layer. Each sub-layer corresponds to a conceptual
81 | row in the ifTable."
82 | INDEX { ifStackLowerLayer, ifStackHigherLayer }
83 | ::= { ifInvStackTable 1 }
84 |
85 | IfInvStackEntry ::=
86 | SEQUENCE {
87 | ifInvStackStatus RowStatus
88 | }
89 |
90 | ifInvStackStatus OBJECT-TYPE
91 | SYNTAX RowStatus
92 | MAX-ACCESS read-only
93 | STATUS current
94 | DESCRIPTION
95 | "The status of the relationship between two sub-layers.
96 |
97 | An instance of this object exists for each instance of the
98 | ifStackStatus object, and vice versa. For example, if the
99 | variable ifStackStatus.H.L exists, then the variable
100 | ifInvStackStatus.L.H must also exist, and vice versa. In
101 | addition, the two variables always have the same value.
102 |
103 | However, unlike ifStackStatus, the ifInvStackStatus object
104 | is NOT write-able. A network management application wishing
105 | to change a relationship between sub-layers H and L cannot
106 | do so by modifying the value of ifInvStackStatus.L.H, but
107 | must instead modify the value of ifStackStatus.H.L. After
108 | the ifStackTable is modified, the change will be reflected
109 | in this table."
110 | ::= { ifInvStackEntry 1 }
111 |
112 | -- conformance information
113 |
114 | ifInvConformance OBJECT IDENTIFIER ::= { ifInvMIBObjects 2 }
115 |
116 | ifInvGroups OBJECT IDENTIFIER ::= { ifInvConformance 1 }
117 | ifInvCompliances OBJECT IDENTIFIER ::= { ifInvConformance 2 }
118 |
119 | -- compliance statements
120 |
121 | ifInvCompliance MODULE-COMPLIANCE
122 | STATUS current
123 | DESCRIPTION
124 | "The compliance statement for SNMP entities which provide
125 | inverted information on the layering of network interfaces."
126 |
127 | MODULE -- this module
128 | MANDATORY-GROUPS { ifInvStackGroup }
129 |
130 | OBJECT ifInvStackStatus
131 | SYNTAX INTEGER { active(1) }
132 | DESCRIPTION
133 | "Support is only required for 'active'."
134 |
135 | MODULE IF-MIB
136 | MANDATORY-GROUPS { ifStackGroup2 }
137 | ::= { ifInvCompliances 1 }
138 |
139 | -- units of conformance
140 |
141 | ifInvStackGroup OBJECT-GROUP
142 | OBJECTS { ifInvStackStatus }
143 | STATUS current
144 | DESCRIPTION
145 | "A collection of objects providing inverted information on
146 | the layering of MIB-II interfaces."
147 | ::= { ifInvGroups 1 }
148 |
149 | END
150 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/IPV6-FLOW-LABEL-MIB.mib:
--------------------------------------------------------------------------------
1 | IPV6-FLOW-LABEL-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 |
5 | MODULE-IDENTITY, mib-2, Integer32 FROM SNMPv2-SMI
6 | TEXTUAL-CONVENTION FROM SNMPv2-TC;
7 |
8 | ipv6FlowLabelMIB MODULE-IDENTITY
9 |
10 | LAST-UPDATED "200308280000Z" -- 28 August 2003
11 | ORGANIZATION "IETF Operations and Management Area"
12 | CONTACT-INFO "Bert Wijnen (Editor)
13 | Lucent Technologies
14 | Schagen 33
15 | 3461 GL Linschoten
16 | Netherlands
17 |
18 | Phone: +31 348-407-775
19 | EMail: bwijnen@lucent.com
20 |
21 | Send comments to .
22 | "
23 | DESCRIPTION "This MIB module provides commonly used textual
24 | conventions for IPv6 Flow Labels.
25 |
26 | Copyright (C) The Internet Society (2003). This
27 | version of this MIB module is part of RFC 3595,
28 | see the RFC itself for full legal notices.
29 | "
30 | -- Revision History
31 |
32 | REVISION "200308280000Z" -- 28 August 2003
33 | DESCRIPTION "Initial version, published as RFC 3595."
34 | ::= { mib-2 103 }
35 |
36 | IPv6FlowLabel ::= TEXTUAL-CONVENTION
37 | DISPLAY-HINT "d"
38 | STATUS current
39 | DESCRIPTION "The flow identifier or Flow Label in an IPv6
40 | packet header that may be used to discriminate
41 | traffic flows.
42 | "
43 | REFERENCE "Internet Protocol, Version 6 (IPv6) specification,
44 | section 6. RFC 2460.
45 | "
46 | SYNTAX Integer32 (0..1048575)
47 |
48 | IPv6FlowLabelOrAny ::= TEXTUAL-CONVENTION
49 | DISPLAY-HINT "d"
50 | STATUS current
51 | DESCRIPTION "The flow identifier or Flow Label in an IPv6
52 | packet header that may be used to discriminate
53 | traffic flows. The value of -1 is used to
54 | indicate a wildcard, i.e. any value.
55 | "
56 | SYNTAX Integer32 (-1 | 0..1048575)
57 |
58 | END
59 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/NET-SNMP-EXAMPLES-MIB.mib:
--------------------------------------------------------------------------------
1 | NET-SNMP-EXAMPLES-MIB DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Example MIB objects for agent module example implementations
5 | --
6 |
7 | IMPORTS
8 | MODULE-IDENTITY, OBJECT-TYPE, Integer32,
9 | NOTIFICATION-TYPE FROM SNMPv2-SMI
10 | SnmpAdminString FROM SNMP-FRAMEWORK-MIB
11 | netSnmp FROM NET-SNMP-MIB
12 | RowStatus, StorageType FROM SNMPv2-TC
13 | InetAddressType, InetAddress FROM INET-ADDRESS-MIB
14 | ;
15 |
16 | netSnmpExamples MODULE-IDENTITY
17 | LAST-UPDATED "200406150000Z"
18 | ORGANIZATION "www.net-snmp.org"
19 | CONTACT-INFO
20 | "postal: Wes Hardaker
21 | P.O. Box 382
22 | Davis CA 95617
23 |
24 | email: net-snmp-coders@lists.sourceforge.net"
25 | DESCRIPTION
26 | "Example MIB objects for agent module example implementations"
27 | REVISION "200406150000Z"
28 | DESCRIPTION
29 | "Corrected notification example definitions"
30 | REVISION "200202060000Z"
31 | DESCRIPTION
32 | "First draft"
33 | ::= { netSnmp 2 }
34 |
35 | --
36 | -- top level structure
37 | --
38 | netSnmpExampleScalars OBJECT IDENTIFIER ::= { netSnmpExamples 1 }
39 | netSnmpExampleTables OBJECT IDENTIFIER ::= { netSnmpExamples 2 }
40 | netSnmpExampleNotifications OBJECT IDENTIFIER ::= { netSnmpExamples 3 }
41 | netSnmpExampleNotificationPrefix OBJECT IDENTIFIER
42 | ::= { netSnmpExampleNotifications 0 }
43 | netSnmpExampleNotificationObjects OBJECT IDENTIFIER
44 | ::= { netSnmpExampleNotifications 2 }
45 | -- netSnmpTutorial OBJECT IDENTIFIER ::= { netSnmpExamples 4 }
46 |
47 | --
48 | -- Example scalars
49 | --
50 |
51 | netSnmpExampleInteger OBJECT-TYPE
52 | SYNTAX Integer32
53 | MAX-ACCESS read-write
54 | STATUS current
55 | DESCRIPTION
56 | "This is a simple object which merely houses a writable
57 | integer. It's only purposes is to hold the value of a single
58 | integer. Writing to it will simply change the value for
59 | subsequent GET/GETNEXT/GETBULK retrievals.
60 |
61 | This example object is implemented in the
62 | agent/mibgroup/examples/scalar_int.c file."
63 | DEFVAL { 42 }
64 | ::= { netSnmpExampleScalars 1 }
65 |
66 | netSnmpExampleSleeper OBJECT-TYPE
67 | SYNTAX Integer32
68 | MAX-ACCESS read-write
69 | STATUS current
70 | DESCRIPTION
71 | "This is a simple object which is a basic integer. It's value
72 | indicates the number of seconds that the agent will take in
73 | responding to requests of this object. This is implemented
74 | in a way which will allow the agent to keep responding to
75 | other requests while access to this object is blocked. It is
76 | writable, and changing it's value will change the amount of
77 | time the agent will effectively wait for before returning a
78 | response when this object is manipulated. Note that SET
79 | requests through this object will take longer, since the
80 | delay is applied to each internal transaction phase, which
81 | could result in delays of up to 4 times the value of this
82 | object.
83 |
84 | This example object is implemented in the
85 | agent/mibgroup/examples/delayed_instance.c file."
86 | DEFVAL { 1 }
87 | ::= { netSnmpExampleScalars 2 }
88 |
89 | netSnmpExampleString OBJECT-TYPE
90 | SYNTAX SnmpAdminString
91 | MAX-ACCESS read-write
92 | STATUS current
93 | DESCRIPTION
94 | "This is a simple object which merely houses a writable
95 | string. It's only purposes is to hold the value of a single
96 | string. Writing to it will simply change the value for
97 | subsequent GET/GETNEXT/GETBULK retrievals.
98 |
99 | This example object is implemented in the
100 | agent/mibgroup/examples/watched.c file."
101 | DEFVAL { "So long, and thanks for all the fish!" }
102 | ::= { netSnmpExampleScalars 3 }
103 |
104 |
105 | --
106 | -- Example Tables
107 | --
108 |
109 | netSnmpIETFWGTable OBJECT-TYPE
110 | SYNTAX SEQUENCE OF NetSnmpIETFWGEntry
111 | MAX-ACCESS not-accessible
112 | STATUS current
113 | DESCRIPTION
114 | "This table merely contains a set of data which is otherwise
115 | useless for true network management. It is a table which
116 | describes properies about a IETF Working Group, such as the
117 | names of the two working group chairs.
118 |
119 | This example table is implemented in the
120 | agent/mibgroup/examples/data_set.c file."
121 | ::= { netSnmpExampleTables 1 }
122 |
123 | netSnmpIETFWGEntry OBJECT-TYPE
124 | SYNTAX NetSnmpIETFWGEntry
125 | MAX-ACCESS not-accessible
126 | STATUS current
127 | DESCRIPTION
128 | "A row describing a given working group"
129 | INDEX { nsIETFWGName }
130 | ::= {netSnmpIETFWGTable 1 }
131 |
132 | NetSnmpIETFWGEntry ::= SEQUENCE {
133 | nsIETFWGName OCTET STRING,
134 | nsIETFWGChair1 OCTET STRING,
135 | nsIETFWGChair2 OCTET STRING
136 | }
137 |
138 | nsIETFWGName OBJECT-TYPE
139 | SYNTAX OCTET STRING (SIZE(1..32))
140 | MAX-ACCESS not-accessible
141 | STATUS current
142 | DESCRIPTION
143 | "The name of the IETF Working Group this table describes."
144 | ::= { netSnmpIETFWGEntry 1 }
145 |
146 | nsIETFWGChair1 OBJECT-TYPE
147 | SYNTAX OCTET STRING
148 | MAX-ACCESS read-create
149 | STATUS current
150 | DESCRIPTION
151 | "One of the names of the chairs for the IETF working group."
152 | ::= { netSnmpIETFWGEntry 2 }
153 |
154 | nsIETFWGChair2 OBJECT-TYPE
155 | SYNTAX OCTET STRING
156 | MAX-ACCESS read-create
157 | STATUS current
158 | DESCRIPTION
159 | "The other name, if one exists, of the chairs for the IETF
160 | working group."
161 | ::= { netSnmpIETFWGEntry 3 }
162 |
163 | --
164 | -- A table used in a table_iterator example
165 | -- (agent/mibgroup/examples/netSnmpHostsTable*.[ch])
166 | --
167 |
168 | netSnmpHostsTable OBJECT-TYPE
169 | SYNTAX SEQUENCE OF NetSnmpHostsEntry
170 | MAX-ACCESS not-accessible
171 | STATUS current
172 | DESCRIPTION
173 | "An example table that implements a wrapper around the
174 | /etc/hosts file on a machine using the iterator helper API."
175 | ::= { netSnmpExampleTables 2 }
176 |
177 | netSnmpHostsEntry OBJECT-TYPE
178 | SYNTAX NetSnmpHostsEntry
179 | MAX-ACCESS not-accessible
180 | STATUS current
181 | DESCRIPTION
182 | "A host name mapped to an ip address"
183 | INDEX { netSnmpHostName }
184 | ::= { netSnmpHostsTable 1 }
185 |
186 | NetSnmpHostsEntry ::= SEQUENCE {
187 | netSnmpHostName OCTET STRING,
188 | netSnmpHostAddressType InetAddressType,
189 | netSnmpHostAddress InetAddress,
190 | netSnmpHostStorage StorageType,
191 | netSnmpHostRowStatus RowStatus
192 | }
193 |
194 | netSnmpHostName OBJECT-TYPE
195 | SYNTAX OCTET STRING (SIZE(0..64))
196 | MAX-ACCESS not-accessible
197 | STATUS current
198 | DESCRIPTION
199 | "A host name that exists in the /etc/hosts (unix) file."
200 | ::= { netSnmpHostsEntry 1 }
201 |
202 | netSnmpHostAddressType OBJECT-TYPE
203 | SYNTAX InetAddressType
204 | MAX-ACCESS read-create
205 | STATUS current
206 | DESCRIPTION
207 | "The address type of then given host."
208 | ::= { netSnmpHostsEntry 2 }
209 |
210 | netSnmpHostAddress OBJECT-TYPE
211 | SYNTAX InetAddress
212 | MAX-ACCESS read-create
213 | STATUS current
214 | DESCRIPTION
215 | "The address of then given host."
216 | ::= { netSnmpHostsEntry 3 }
217 |
218 | netSnmpHostStorage OBJECT-TYPE
219 | SYNTAX StorageType
220 | MAX-ACCESS read-create
221 | STATUS current
222 | DESCRIPTION "The storage type for this conceptual row."
223 | DEFVAL { nonVolatile }
224 | ::= { netSnmpHostsEntry 4 }
225 |
226 | netSnmpHostRowStatus OBJECT-TYPE
227 | SYNTAX RowStatus
228 | MAX-ACCESS read-create
229 | STATUS current
230 | DESCRIPTION "The status of this conceptual row."
231 | ::= { netSnmpHostsEntry 5 }
232 |
233 |
234 | --
235 | -- Example Notifications
236 | --
237 |
238 | netSnmpExampleHeartbeatRate OBJECT-TYPE
239 | SYNTAX Integer32
240 | MAX-ACCESS accessible-for-notify
241 | STATUS current
242 | DESCRIPTION
243 | "A simple integer object, to act as a payload for the
244 | netSnmpExampleHeartbeatNotification. The value has
245 | no real meaning, but is nominally the interval (in
246 | seconds) between successive heartbeat notifications."
247 | ::= { netSnmpExampleNotificationObjects 1 }
248 |
249 | netSnmpExampleHeartbeatName OBJECT-TYPE
250 | SYNTAX SnmpAdminString
251 | MAX-ACCESS accessible-for-notify
252 | STATUS current
253 | DESCRIPTION
254 | "A simple string object, to act as an optional payload
255 | for the netSnmpExampleHeartbeatNotification. This varbind
256 | is not part of the notification definition, so is optional
257 | and need not be included in the notification payload.
258 | The value has no real meaning, but the romantically inclined
259 | may take it to be the object of the sender's affection,
260 | and hence the cause of the heart beating faster."
261 | ::= { netSnmpExampleNotificationObjects 2 }
262 |
263 | netSnmpExampleHeartbeatNotification NOTIFICATION-TYPE
264 | OBJECTS { netSnmpExampleHeartbeatRate }
265 | STATUS current
266 | DESCRIPTION
267 | "An example notification, used to illustrate the
268 | definition and generation of trap and inform PDUs
269 | (including the use of both standard and additional
270 | varbinds in the notification payload).
271 | This notification will typically be sent every
272 | 30 seconds, using the code found in the example module
273 | agent/mibgroup/examples/notification.c"
274 | ::= { netSnmpExampleNotificationPrefix 1 }
275 |
276 | netSnmpExampleNotification OBJECT-TYPE
277 | SYNTAX SnmpAdminString
278 | MAX-ACCESS accessible-for-notify
279 | STATUS obsolete
280 | DESCRIPTION
281 | "This object was improperly defined for its original purpose,
282 | and should no longer be used."
283 | ::= { netSnmpExampleNotifications 1 }
284 |
285 | END
286 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/NET-SNMP-MIB.mib:
--------------------------------------------------------------------------------
1 | NET-SNMP-MIB DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Top-level infrastructure of the Net-SNMP project enterprise MIB tree
5 | --
6 |
7 | IMPORTS
8 | MODULE-IDENTITY, enterprises FROM SNMPv2-SMI;
9 |
10 | netSnmp MODULE-IDENTITY
11 | LAST-UPDATED "200201300000Z"
12 | ORGANIZATION "www.net-snmp.org"
13 | CONTACT-INFO
14 | "postal: Wes Hardaker
15 | P.O. Box 382
16 | Davis CA 95617
17 |
18 | email: net-snmp-coders@lists.sourceforge.net"
19 | DESCRIPTION
20 | "Top-level infrastructure of the Net-SNMP project enterprise MIB tree"
21 | REVISION "200201300000Z"
22 | DESCRIPTION
23 | "First draft"
24 | ::= { enterprises 8072}
25 |
26 |
27 | --
28 | -- Net-SNMP enterprise-specific management objects
29 | --
30 |
31 | netSnmpObjects OBJECT IDENTIFIER ::= {netSnmp 1}
32 | -- netSnmpExamples OBJECT IDENTIFIER ::= {netSnmp 2}
33 | netSnmpEnumerations OBJECT IDENTIFIER ::= {netSnmp 3}
34 | netSnmpModuleIDs OBJECT IDENTIFIER ::= {netSnmpEnumerations 1}
35 | netSnmpAgentOIDs OBJECT IDENTIFIER ::= {netSnmpEnumerations 2}
36 | netSnmpDomains OBJECT IDENTIFIER ::= {netSnmpEnumerations 3}
37 | netSnmpExperimental OBJECT IDENTIFIER ::= {netSnmp 9999}
38 |
39 | --
40 | -- A subtree specifically designed for private testing purposes.
41 | -- No "public" management objects should ever be defined within this tree.
42 | --
43 | -- It is provided for private experimentation, prior to transferring a MIB
44 | -- structure to another part of the overall OID tree
45 | --
46 | netSnmpPlaypen OBJECT IDENTIFIER ::= {netSnmpExperimental 9999}
47 |
48 |
49 | --
50 | -- Notifications
51 | --
52 |
53 | netSnmpNotificationPrefix OBJECT IDENTIFIER ::= {netSnmp 4}
54 | netSnmpNotifications OBJECT IDENTIFIER ::= {netSnmpNotificationPrefix 0}
55 | netSnmpNotificationObjects OBJECT IDENTIFIER ::= {netSnmpNotificationPrefix 1}
56 |
57 |
58 | --
59 | -- Conformance
60 | -- (No laughing at the back!)
61 | --
62 |
63 | netSnmpConformance OBJECT IDENTIFIER ::= {netSnmp 5}
64 | netSnmpCompliances OBJECT IDENTIFIER ::= {netSnmpConformance 1}
65 | netSnmpGroups OBJECT IDENTIFIER ::= {netSnmpConformance 2}
66 |
67 | END
68 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/NET-SNMP-PASS-MIB.mib:
--------------------------------------------------------------------------------
1 | NET-SNMP-PASS-MIB DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Example MIB objects for "pass" and "pass-persist" extension script
5 | --
6 |
7 | IMPORTS
8 | MODULE-IDENTITY, OBJECT-TYPE, TimeTicks, IpAddress,
9 | Counter32, Gauge32, Integer32 FROM SNMPv2-SMI
10 | SnmpAdminString FROM SNMP-FRAMEWORK-MIB
11 | netSnmpExamples FROM NET-SNMP-EXAMPLES-MIB
12 | ;
13 |
14 | netSnmpPassExamples MODULE-IDENTITY
15 | LAST-UPDATED "200905280000Z"
16 | ORGANIZATION "www.net-snmp.org"
17 | CONTACT-INFO
18 | "postal: Wes Hardaker
19 | P.O. Box 382
20 | Davis CA 95617
21 |
22 | email: net-snmp-coders@lists.sourceforge.net"
23 | DESCRIPTION
24 | "Example MIB objects for pass/pass-persist extension script"
25 | ::= { netSnmpExamples 255 }
26 |
27 | --
28 | -- Example scalars
29 | --
30 |
31 | netSnmpPassString OBJECT-TYPE
32 | SYNTAX SnmpAdminString
33 | MAX-ACCESS read-write
34 | STATUS current
35 | DESCRIPTION "Example string scalar object."
36 | DEFVAL { "Life, the Universe, and Everything" }
37 | ::= { netSnmpPassExamples 1 }
38 |
39 | netSnmpPassTimeTicks OBJECT-TYPE
40 | SYNTAX TimeTicks
41 | MAX-ACCESS read-write
42 | STATUS current
43 | DESCRIPTION "Example timetick object."
44 | DEFVAL { 363136200 } -- 42 days, 0:42:42.00
45 | ::= { netSnmpPassExamples 3 }
46 |
47 | netSnmpPassIpAddress OBJECT-TYPE
48 | SYNTAX IpAddress
49 | MAX-ACCESS read-write
50 | STATUS current
51 | DESCRIPTION "Example IP Address object."
52 | DEFVAL { '7f000001'H } -- 127.0.0.1
53 | ::= { netSnmpPassExamples 4 }
54 |
55 | netSnmpPassCounter OBJECT-TYPE
56 | SYNTAX Counter32
57 | MAX-ACCESS read-only
58 | STATUS current
59 | DESCRIPTION "Example counter object.
60 | Note that this object will always return the value '42'."
61 | ::= { netSnmpPassExamples 5 }
62 |
63 | netSnmpPassGauge OBJECT-TYPE
64 | SYNTAX Gauge32
65 | MAX-ACCESS read-write
66 | STATUS current
67 | DESCRIPTION "Example Gauge object."
68 | DEFVAL { 42 }
69 | ::= { netSnmpPassExamples 6 }
70 |
71 |
72 | netSnmpPassOIDValue OBJECT IDENTIFIER
73 | ::= { netSnmpPassExamples 99 }
74 |
75 | --
76 | -- Example Table
77 | --
78 |
79 | netSnmpPassTable OBJECT-TYPE
80 | SYNTAX SEQUENCE OF NetSnmpPassEntry
81 | MAX-ACCESS not-accessible
82 | STATUS current
83 | DESCRIPTION "Example table"
84 | ::= { netSnmpPassExamples 2 }
85 |
86 | netSnmpPassEntry OBJECT-TYPE
87 | SYNTAX NetSnmpPassEntry
88 | MAX-ACCESS not-accessible
89 | STATUS current
90 | DESCRIPTION "Conceptual row in the example table."
91 | INDEX { netSnmpPassIndex }
92 | ::= {netSnmpPassTable 1 }
93 |
94 | NetSnmpPassEntry ::= SEQUENCE {
95 | netSnmpPassIndex Integer32,
96 | netSnmpPassInteger Integer32,
97 | netSnmpPassOID OBJECT IDENTIFIER
98 | }
99 |
100 | netSnmpPassIndex OBJECT-TYPE
101 | SYNTAX Integer32
102 | MAX-ACCESS not-accessible
103 | STATUS current
104 | DESCRIPTION "Arbitrary index into the netSnmpPassTable.
105 | Note that there will always be one row, with index 1"
106 | ::= { netSnmpPassEntry 1 }
107 |
108 | netSnmpPassInteger OBJECT-TYPE
109 | SYNTAX Integer32
110 | MAX-ACCESS read-write
111 | STATUS current
112 | DESCRIPTION "Example Integer (table) object."
113 | DEFVAL { 42 }
114 | ::= { netSnmpPassEntry 2 }
115 |
116 | netSnmpPassOID OBJECT-TYPE
117 | SYNTAX OBJECT IDENTIFIER
118 | MAX-ACCESS read-write
119 | STATUS current
120 | DESCRIPTION "Example OID (table) object."
121 | DEFVAL { netSnmpPassOIDValue }
122 | ::= { netSnmpPassEntry 3 }
123 |
124 | END
125 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/NET-SNMP-TC.mib:
--------------------------------------------------------------------------------
1 | NET-SNMP-TC DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Textual conventions and enumerations for the Net-SNMP project
5 | --
6 |
7 | IMPORTS
8 | netSnmpModuleIDs, netSnmpAgentOIDs, netSnmpDomains FROM NET-SNMP-MIB
9 |
10 | MODULE-IDENTITY, Opaque FROM SNMPv2-SMI
11 |
12 | TEXTUAL-CONVENTION FROM SNMPv2-TC;
13 |
14 | netSnmpTCs MODULE-IDENTITY
15 | LAST-UPDATED "200510140000Z"
16 | ORGANIZATION "www.net-snmp.org"
17 | CONTACT-INFO
18 | "postal: Wes Hardaker
19 | P.O. Box 382
20 | Davis CA 95617
21 |
22 | email: net-snmp-coders@lists.sourceforge.net"
23 | DESCRIPTION
24 | "Textual conventions and enumerations for the Net-SNMP project"
25 | REVISION "200202120000Z"
26 | DESCRIPTION
27 | "First draft"
28 | ::= { netSnmpModuleIDs 1}
29 |
30 |
31 | -- =====================
32 | --
33 | -- Textual Conventions
34 | --
35 | -- =====================
36 |
37 | --
38 | -- Define the Float Textual Convention
39 | -- This definition was written by David Perkins.
40 | --
41 |
42 | Float ::= TEXTUAL-CONVENTION
43 | STATUS current
44 | DESCRIPTION
45 | "A single precision floating-point number. The semantics
46 | and encoding are identical for type 'single' defined in
47 | IEEE Standard for Binary Floating-Point,
48 | ANSI/IEEE Std 754-1985.
49 | The value is restricted to the BER serialization of
50 | the following ASN.1 type:
51 | FLOATTYPE ::= [120] IMPLICIT FloatType
52 | (note: the value 120 is the sum of '30'h and '48'h)
53 | The BER serialization of the length for values of
54 | this type must use the definite length, short
55 | encoding form.
56 |
57 | For example, the BER serialization of value 123
58 | of type FLOATTYPE is '9f780442f60000'h. (The tag
59 | is '9f78'h; the length is '04'h; and the value is
60 | '42f60000'h.) The BER serialization of value
61 | '9f780442f60000'h of data type Opaque is
62 | '44079f780442f60000'h. (The tag is '44'h; the length
63 | is '07'h; and the value is '9f780442f60000'h.)"
64 | SYNTAX Opaque (SIZE (7))
65 |
66 |
67 | -- =====================
68 | --
69 | -- Enumerations
70 | --
71 | -- =====================
72 |
73 | --
74 | -- System Object ID values
75 | --
76 | -- XXX - do we want to distinguish between O/S versions ?
77 | -- (as is currently done with HP-UX)
78 | --
79 |
80 | hpux9 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 1 }
81 | sunos4 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 2 }
82 | solaris OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 3 }
83 | osf OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 4 }
84 | ultrix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 5 }
85 | hpux10 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 6 }
86 | netbsd OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 7 }
87 | freebsd OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 8 }
88 | irix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 9 }
89 | linux OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 10 }
90 | bsdi OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 11 }
91 | openbsd OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 12 }
92 | win32 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 13 } -- unlucky
93 | hpux11 OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 14 }
94 | aix OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 15 }
95 | macosx OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 16 }
96 | dragonfly OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 17 }
97 | unknown OBJECT IDENTIFIER ::= { netSnmpAgentOIDs 255 }
98 |
99 |
100 |
101 | --
102 | -- Transport Domains
103 | --
104 | -- Object identifiers for the non-standard transports that UCD/Net-SNMP
105 | -- supports. Note that snmpTCPDomain is the subject of Internet Draft
106 | -- draft-irtf-nmrg-snmp-tcp-06.txt, which defines the OID
107 | -- .iso.org.dod.internet.experimental.nmrg.nmrgSnmpDomains.snmpTCPDomain
108 | -- (.1.3.6.1.3.91.1.1) for the SNMP over TCP over IPv4 transport domain.
109 | -- This draft (or its successor) is available from the Network Management
110 | -- Research Group web page at http://www.ibr.cs.tu-bs.de/projects/nmrg/
111 | --
112 | -- The NMRG OID for snmpTCPDomain is currently used by the code, but in case
113 | -- this is thought to be a Bad Idea, we define a private transport domain here
114 | -- that we could use instead. The Unix domain, AAL5 PVC domain and
115 | -- the IPv6 domains are also defined privately here (for now).
116 |
117 | netSnmpTCPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 1 } -- obsolete
118 | netSnmpUnixDomain OBJECT IDENTIFIER ::= { netSnmpDomains 2 } -- obsolete
119 | netSnmpAAL5PVCDomain OBJECT IDENTIFIER ::= { netSnmpDomains 3 }
120 | netSnmpUDPIPv6Domain OBJECT IDENTIFIER ::= { netSnmpDomains 4 } -- obsolete
121 | netSnmpTCPIPv6Domain OBJECT IDENTIFIER ::= { netSnmpDomains 5 } -- obsolete
122 | netSnmpCallbackDomain OBJECT IDENTIFIER ::= { netSnmpDomains 6 }
123 | netSnmpAliasDomain OBJECT IDENTIFIER ::= { netSnmpDomains 7 }
124 | netSnmpDTLSUDPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 8 }
125 | netSnmpDTLSSCTPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 9 }
126 | netSnmpTLSTCPDomain OBJECT IDENTIFIER ::= { netSnmpDomains 10 }
127 |
128 | END
129 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/NET-SNMP-VACM-MIB.mib:
--------------------------------------------------------------------------------
1 | NET-SNMP-VACM-MIB DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Defines Net-SNMP extensions to the standard VACM view table.
5 | --
6 |
7 | IMPORTS
8 | SnmpAdminString
9 | FROM SNMP-FRAMEWORK-MIB
10 |
11 | netSnmpObjects, netSnmpGroups
12 | FROM NET-SNMP-MIB
13 |
14 | vacmGroupName, vacmAccessContextPrefix, vacmAccessSecurityModel,
15 | vacmAccessSecurityLevel
16 | FROM SNMP-VIEW-BASED-ACM-MIB
17 |
18 | OBJECT-TYPE, MODULE-IDENTITY
19 | FROM SNMPv2-SMI
20 |
21 | OBJECT-GROUP, NOTIFICATION-GROUP
22 | FROM SNMPv2-CONF
23 |
24 | TEXTUAL-CONVENTION, DisplayString, RowStatus, StorageType
25 | FROM SNMPv2-TC;
26 |
27 |
28 | netSnmpVacmMIB MODULE-IDENTITY
29 | LAST-UPDATED "200608270000Z"
30 | ORGANIZATION "www.net-snmp.org"
31 | CONTACT-INFO
32 | "postal: Wes Hardaker
33 | P.O. Box 382
34 | Davis CA 95617
35 |
36 | email: net-snmp-coders@lists.sourceforge.net"
37 | DESCRIPTION
38 | "Defines Net-SNMP extensions to the standard VACM view table."
39 | REVISION "200608270000Z"
40 | DESCRIPTION
41 | "First draft"
42 | ::= { netSnmpObjects 9 }
43 |
44 |
45 | nsVacmAccessTable OBJECT-TYPE
46 | SYNTAX SEQUENCE OF NsVacmAccessEntry
47 | MAX-ACCESS not-accessible
48 | STATUS current
49 | DESCRIPTION "Net-SNMP extensions to vacmAccessTable."
50 | ::= { netSnmpVacmMIB 1 }
51 |
52 | nsVacmAccessEntry OBJECT-TYPE
53 | SYNTAX NsVacmAccessEntry
54 | MAX-ACCESS not-accessible
55 | STATUS current
56 | DESCRIPTION "Net-SNMP extensions to vacmAccessTable."
57 | INDEX { vacmGroupName,
58 | vacmAccessContextPrefix,
59 | vacmAccessSecurityModel,
60 | vacmAccessSecurityLevel,
61 | nsVacmAuthType
62 | }
63 | ::= { nsVacmAccessTable 1 }
64 |
65 | NsVacmAccessEntry ::= SEQUENCE
66 | {
67 | nsVacmAuthType SnmpAdminString,
68 | nsVacmContextMatch INTEGER,
69 | nsVacmViewName SnmpAdminString,
70 | nsVacmStorageType StorageType,
71 | nsVacmStatus RowStatus
72 | }
73 |
74 | nsVacmAuthType OBJECT-TYPE
75 | SYNTAX SnmpAdminString (SIZE(0..32))
76 | MAX-ACCESS not-accessible
77 | STATUS current
78 | DESCRIPTION "The type of processing that the specified view
79 | should be applied to. See 'snmpd.conf(5)' and
80 | 'snmptrapd.conf(5)' for details."
81 | ::= { nsVacmAccessEntry 1 }
82 |
83 | nsVacmContextMatch OBJECT-TYPE
84 | SYNTAX INTEGER
85 | { exact (1), -- exact match of prefix and contextName
86 | prefix (2) -- Only match to the prefix
87 | }
88 | MAX-ACCESS read-create
89 | STATUS current
90 | DESCRIPTION "If the value of this object is exact(1), then all
91 | rows where the contextName exactly matches
92 | vacmAccessContextPrefix are selected.
93 |
94 | If the value of this object is prefix(2), then all
95 | rows where the contextName whose starting octets
96 | exactly match vacmAccessContextPrefix are selected.
97 | This allows for a simple form of wildcarding.
98 |
99 | The value of this object should be consistent across
100 | all nsVacmAccessEntries corresponding to a single
101 | row of the vacmAccessTable.
102 | "
103 | DEFVAL { exact }
104 | ::= { nsVacmAccessEntry 2 }
105 |
106 | nsVacmViewName OBJECT-TYPE
107 | SYNTAX SnmpAdminString (SIZE(0..32))
108 | MAX-ACCESS read-create
109 | STATUS current
110 | DESCRIPTION "The MIB view authorised for the appropriate style
111 | of processing (as indicated by nsVacmToken).
112 |
113 | The interpretation of this value is the same as for
114 | the standard VACM ViewName objects."
115 | DEFVAL { ''H } -- the empty string
116 | ::= { nsVacmAccessEntry 3 }
117 |
118 |
119 | nsVacmStorageType OBJECT-TYPE
120 | SYNTAX StorageType
121 | MAX-ACCESS read-create
122 | STATUS current
123 | DESCRIPTION "The storage type for this (group of) conceptual rows.
124 |
125 | Conceptual rows having the value 'permanent' need not
126 | allow write-access to any columnar objects in the row.
127 |
128 | The value of this object should be consistent across
129 | all nsVacmAccessEntries corresponding to a single
130 | row of the vacmAccessTable.
131 | "
132 | DEFVAL { nonVolatile }
133 | ::= { nsVacmAccessEntry 4 }
134 |
135 | nsVacmStatus OBJECT-TYPE
136 | SYNTAX RowStatus
137 | MAX-ACCESS read-create
138 | STATUS current
139 | DESCRIPTION "The status of this (group of) conceptual rows.
140 |
141 | The RowStatus TC [RFC2579] requires that this
142 | DESCRIPTION clause states under which circumstances
143 | other objects in this row can be modified:
144 |
145 | The value of this object has no effect on whether
146 | other objects in this conceptual row can be modified.
147 |
148 | The value of this object should be consistent across
149 | all nsVacmAccessEntries corresponding to a single
150 | row of the vacmAccessTable.
151 | "
152 | ::= { nsVacmAccessEntry 5 }
153 |
154 | END
155 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/RFC-1215.mib:
--------------------------------------------------------------------------------
1 |
2 | RFC-1215 DEFINITIONS ::= BEGIN
3 |
4 | -- This module is a empty module. It has been created solely for the
5 | -- purpose of allowing other modules to correctly import the TRAP-TYPE
6 | -- clause from RFC-1215 where it should be imported from. It's a
7 | -- built in type in the UCD-SNMP code, and in fact RFC-1215 doesn't
8 | -- actually define a mib at all; it only defines macros. However,
9 | -- importing the TRAP-TYPE is conventionally done from an import
10 | -- clause pointing to RFC-1215.
11 | --
12 | -- Wes 7/17/98
13 |
14 | TRAP-TYPE MACRO ::=
15 | BEGIN
16 | TYPE NOTATION ::= "ENTERPRISE" value
17 | (enterprise OBJECT IDENTIFIER)
18 | VarPart
19 | DescrPart
20 | ReferPart
21 | VALUE NOTATION ::= value (VALUE INTEGER)
22 | VarPart ::=
23 | "VARIABLES" "{" VarTypes "}"
24 | | empty
25 | VarTypes ::=
26 | VarType | VarTypes "," VarType
27 | VarType ::=
28 | value (vartype ObjectName)
29 | DescrPart ::=
30 | "DESCRIPTION" value (description DisplayString)
31 | | empty
32 | ReferPart ::=
33 | "REFERENCE" value (reference DisplayString)
34 | | empty
35 | END
36 |
37 |
38 | END
39 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/RFC1155-SMI.mib:
--------------------------------------------------------------------------------
1 | RFC1155-SMI DEFINITIONS ::= BEGIN
2 |
3 | EXPORTS -- EVERYTHING
4 | internet, directory, mgmt,
5 | experimental, private, enterprises,
6 | OBJECT-TYPE, ObjectName, ObjectSyntax, SimpleSyntax,
7 | ApplicationSyntax, NetworkAddress, IpAddress,
8 | Counter, Gauge, TimeTicks, Opaque;
9 |
10 | -- the path to the root
11 |
12 | internet OBJECT IDENTIFIER ::= { iso org(3) dod(6) 1 }
13 |
14 | directory OBJECT IDENTIFIER ::= { internet 1 }
15 |
16 | mgmt OBJECT IDENTIFIER ::= { internet 2 }
17 |
18 | experimental OBJECT IDENTIFIER ::= { internet 3 }
19 |
20 | private OBJECT IDENTIFIER ::= { internet 4 }
21 | enterprises OBJECT IDENTIFIER ::= { private 1 }
22 |
23 | -- definition of object types
24 |
25 | OBJECT-TYPE MACRO ::=
26 | BEGIN
27 | TYPE NOTATION ::= "SYNTAX" type (TYPE ObjectSyntax)
28 | "ACCESS" Access
29 | "STATUS" Status
30 | VALUE NOTATION ::= value (VALUE ObjectName)
31 |
32 | Access ::= "read-only"
33 | | "read-write"
34 | | "write-only"
35 | | "not-accessible"
36 | Status ::= "mandatory"
37 | | "optional"
38 | | "obsolete"
39 | END
40 |
41 | -- names of objects in the MIB
42 |
43 | ObjectName ::=
44 | OBJECT IDENTIFIER
45 |
46 | -- syntax of objects in the MIB
47 |
48 | ObjectSyntax ::=
49 | CHOICE {
50 | simple
51 | SimpleSyntax,
52 | -- note that simple SEQUENCEs are not directly
53 | -- mentioned here to keep things simple (i.e.,
54 | -- prevent mis-use). However, application-wide
55 | -- types which are IMPLICITly encoded simple
56 | -- SEQUENCEs may appear in the following CHOICE
57 |
58 | application-wide
59 | ApplicationSyntax
60 | }
61 |
62 | SimpleSyntax ::=
63 | CHOICE {
64 | number
65 | INTEGER,
66 | string
67 | OCTET STRING,
68 | object
69 | OBJECT IDENTIFIER,
70 | empty
71 | NULL
72 | }
73 |
74 | ApplicationSyntax ::=
75 | CHOICE {
76 | address
77 | NetworkAddress,
78 | counter
79 | Counter,
80 | gauge
81 | Gauge,
82 | ticks
83 | TimeTicks,
84 | arbitrary
85 | Opaque
86 |
87 | -- other application-wide types, as they are
88 | -- defined, will be added here
89 | }
90 |
91 | -- application-wide types
92 |
93 | NetworkAddress ::=
94 | CHOICE {
95 | internet
96 | IpAddress
97 | }
98 |
99 | IpAddress ::=
100 | [APPLICATION 0] -- in network-byte order
101 | IMPLICIT OCTET STRING (SIZE (4))
102 |
103 | Counter ::=
104 | [APPLICATION 1]
105 | IMPLICIT INTEGER (0..4294967295)
106 |
107 | Gauge ::=
108 | [APPLICATION 2]
109 | IMPLICIT INTEGER (0..4294967295)
110 |
111 | TimeTicks ::=
112 | [APPLICATION 3]
113 | IMPLICIT INTEGER (0..4294967295)
114 |
115 | Opaque ::=
116 | [APPLICATION 4] -- arbitrary ASN.1 value,
117 | IMPLICIT OCTET STRING -- "double-wrapped"
118 |
119 | END
120 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SMUX-MIB.mib:
--------------------------------------------------------------------------------
1 | SMUX-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | enterprises
5 | FROM RFC1155-SMI
6 | DisplayString
7 | FROM SNMPv2-TC
8 | OBJECT-TYPE
9 | FROM RFC-1212;
10 |
11 | unix OBJECT IDENTIFIER ::= { enterprises 4 }
12 |
13 | smux OBJECT IDENTIFIER ::= { unix 4 }
14 |
15 | smuxPeerTable OBJECT-TYPE
16 | SYNTAX SEQUENCE OF SmuxPeerEntry
17 | ACCESS not-accessible
18 | STATUS mandatory
19 | DESCRIPTION
20 | "The SMUX peer table."
21 | ::= { smux 1 }
22 |
23 | smuxPeerEntry OBJECT-TYPE
24 | SYNTAX SmuxPeerEntry
25 | ACCESS not-accessible
26 | STATUS mandatory
27 | DESCRIPTION
28 | "An entry in the SMUX peer table."
29 | INDEX { smuxPindex }
30 | ::= { smuxPeerTable 1}
31 |
32 | SmuxPeerEntry ::=
33 | SEQUENCE {
34 | smuxPindex
35 | INTEGER,
36 | smuxPidentity
37 | OBJECT IDENTIFIER,
38 | smuxPdescription
39 | DisplayString,
40 | smuxPstatus
41 | INTEGER
42 | }
43 |
44 | smuxPindex OBJECT-TYPE
45 | SYNTAX INTEGER
46 | ACCESS read-only
47 | STATUS mandatory
48 | DESCRIPTION
49 | "An index which uniquely identifies a SMUX peer."
50 | ::= { smuxPeerEntry 1 }
51 |
52 | smuxPidentity OBJECT-TYPE
53 | SYNTAX OBJECT IDENTIFIER
54 | ACCESS read-only
55 | STATUS mandatory
56 | DESCRIPTION
57 | "The authoritative designation for a SMUX peer."
58 | ::= { smuxPeerEntry 2 }
59 |
60 | smuxPdescription OBJECT-TYPE
61 | SYNTAX DisplayString (SIZE (0..255))
62 | ACCESS read-only
63 | STATUS mandatory
64 | DESCRIPTION
65 | "A human-readable description of a SMUX peer."
66 | ::= { smuxPeerEntry 3 }
67 |
68 | smuxPstatus OBJECT-TYPE
69 | SYNTAX INTEGER { valid(1), invalid(2), connecting(3) }
70 | ACCESS read-write
71 | STATUS mandatory
72 | DESCRIPTION
73 | "The type of SMUX peer.
74 |
75 | Setting this object to the value invalid(2) has
76 | the effect of invaliding the corresponding entry
77 | in the smuxPeerTable. It is an implementation-
78 | specific matter as to whether the agent removes an
79 | invalidated entry from the table. Accordingly,
80 | management stations must be prepared to receive
81 | tabular information from agents that correspond to
82 | entries not currently in use. Proper
83 | interpretation of such entries requires
84 | examination of the relative smuxPstatus object."
85 | ::= { smuxPeerEntry 4 }
86 |
87 | smuxTreeTable OBJECT-TYPE
88 | SYNTAX SEQUENCE OF SmuxTreeEntry
89 | ACCESS not-accessible
90 | STATUS mandatory
91 | DESCRIPTION
92 | "The SMUX tree table."
93 | ::= { smux 2 }
94 |
95 | smuxTreeEntry OBJECT-TYPE
96 | SYNTAX SmuxTreeEntry
97 | ACCESS not-accessible
98 | STATUS mandatory
99 | DESCRIPTION
100 | "An entry in the SMUX tree table."
101 | INDEX { smuxTsubtree, smuxTpriority }
102 | ::= { smuxTreeTable 1}
103 |
104 | SmuxTreeEntry ::=
105 | SEQUENCE {
106 | smuxTsubtree
107 | OBJECT IDENTIFIER,
108 | smuxTpriority
109 | INTEGER,
110 | smuxTindex
111 | INTEGER,
112 | smuxTstatus
113 | INTEGER
114 | }
115 |
116 | smuxTsubtree OBJECT-TYPE
117 | SYNTAX OBJECT IDENTIFIER
118 | ACCESS read-only
119 | STATUS mandatory
120 | DESCRIPTION
121 | "The MIB subtree being exported by a SMUX peer."
122 | ::= { smuxTreeEntry 1 }
123 |
124 | smuxTpriority OBJECT-TYPE
125 | SYNTAX INTEGER (0..'07fffffff'h)
126 | ACCESS read-only
127 | STATUS mandatory
128 | DESCRIPTION
129 | "The SMUX peer's priority when exporting the MIB
130 | subtree."
131 | ::= { smuxTreeEntry 2 }
132 |
133 | smuxTindex OBJECT-TYPE
134 | SYNTAX INTEGER
135 | ACCESS read-only
136 | STATUS mandatory
137 | DESCRIPTION
138 | "The SMUX peer's identity."
139 | ::= { smuxTreeEntry 3 }
140 |
141 | smuxTstatus OBJECT-TYPE
142 | SYNTAX INTEGER { valid(1), invalid(2) }
143 | ACCESS read-write
144 | STATUS mandatory
145 | DESCRIPTION
146 | "The type of SMUX tree.
147 |
148 | Setting this object to the value invalid(2) has
149 | the effect of invaliding the corresponding entry
150 | in the smuxTreeTable. It is an implementation-
151 | specific matter as to whether the agent removes an
152 | invalidated entry from the table. Accordingly,
153 | management stations must be prepared to receive
154 | tabular information from agents that correspond to
155 | entries not currently in use. Proper
156 | interpretation of such entries requires
157 | examination of the relative smuxTstatus object."
158 | ::= { smuxTreeEntry 4 }
159 |
160 | END
161 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMP-MPD-MIB.mib:
--------------------------------------------------------------------------------
1 | SNMP-MPD-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
5 | MODULE-IDENTITY, OBJECT-TYPE,
6 | snmpModules, Counter32 FROM SNMPv2-SMI;
7 |
8 | snmpMPDMIB MODULE-IDENTITY
9 | LAST-UPDATED "200210140000Z"
10 | ORGANIZATION "SNMPv3 Working Group"
11 | CONTACT-INFO "WG-EMail: snmpv3@lists.tislabs.com
12 | Subscribe: snmpv3-request@lists.tislabs.com
13 |
14 | Co-Chair: Russ Mundy
15 | Network Associates Laboratories
16 | postal: 15204 Omega Drive, Suite 300
17 | Rockville, MD 20850-4601
18 | USA
19 |
20 | EMail: mundy@tislabs.com
21 | phone: +1 301-947-7107
22 |
23 | Co-Chair &
24 | Co-editor: David Harrington
25 | Enterasys Networks
26 | postal: 35 Industrial Way
27 | P. O. Box 5005
28 | Rochester NH 03866-5005
29 | USA
30 | EMail: dbh@enterasys.com
31 | phone: +1 603-337-2614
32 |
33 | Co-editor: Jeffrey Case
34 | SNMP Research, Inc.
35 | postal: 3001 Kimberlin Heights Road
36 | Knoxville, TN 37920-9716
37 | USA
38 | EMail: case@snmp.com
39 | phone: +1 423-573-1434
40 |
41 | Co-editor: Randy Presuhn
42 | BMC Software, Inc.
43 | postal: 2141 North First Street
44 | San Jose, CA 95131
45 | USA
46 | EMail: randy_presuhn@bmc.com
47 | phone: +1 408-546-1006
48 |
49 | Co-editor: Bert Wijnen
50 | Lucent Technologies
51 | postal: Schagen 33
52 | 3461 GL Linschoten
53 | Netherlands
54 | EMail: bwijnen@lucent.com
55 | phone: +31 348-680-485
56 | "
57 | DESCRIPTION "The MIB for Message Processing and Dispatching
58 |
59 | Copyright (C) The Internet Society (2002). This
60 | version of this MIB module is part of RFC 3412;
61 | see the RFC itself for full legal notices.
62 | "
63 | REVISION "200210140000Z" -- 14 October 2002
64 | DESCRIPTION "Updated addresses, published as RFC 3412."
65 | REVISION "199905041636Z" -- 4 May 1999
66 | DESCRIPTION "Updated addresses, published as RFC 2572."
67 |
68 | REVISION "199709300000Z" -- 30 September 1997
69 | DESCRIPTION "Original version, published as RFC 2272."
70 | ::= { snmpModules 11 }
71 |
72 | -- Administrative assignments ***************************************
73 |
74 | snmpMPDAdmin OBJECT IDENTIFIER ::= { snmpMPDMIB 1 }
75 | snmpMPDMIBObjects OBJECT IDENTIFIER ::= { snmpMPDMIB 2 }
76 | snmpMPDMIBConformance OBJECT IDENTIFIER ::= { snmpMPDMIB 3 }
77 |
78 | -- Statistics for SNMP Messages *************************************
79 |
80 | snmpMPDStats OBJECT IDENTIFIER ::= { snmpMPDMIBObjects 1 }
81 |
82 | snmpUnknownSecurityModels OBJECT-TYPE
83 | SYNTAX Counter32
84 | MAX-ACCESS read-only
85 | STATUS current
86 | DESCRIPTION "The total number of packets received by the SNMP
87 | engine which were dropped because they referenced a
88 | securityModel that was not known to or supported by
89 | the SNMP engine.
90 | "
91 | ::= { snmpMPDStats 1 }
92 |
93 | snmpInvalidMsgs OBJECT-TYPE
94 | SYNTAX Counter32
95 | MAX-ACCESS read-only
96 | STATUS current
97 | DESCRIPTION "The total number of packets received by the SNMP
98 | engine which were dropped because there were invalid
99 | or inconsistent components in the SNMP message.
100 | "
101 | ::= { snmpMPDStats 2 }
102 |
103 | snmpUnknownPDUHandlers OBJECT-TYPE
104 | SYNTAX Counter32
105 | MAX-ACCESS read-only
106 | STATUS current
107 | DESCRIPTION "The total number of packets received by the SNMP
108 | engine which were dropped because the PDU contained
109 | in the packet could not be passed to an application
110 | responsible for handling the pduType, e.g. no SNMP
111 | application had registered for the proper
112 | combination of the contextEngineID and the pduType.
113 | "
114 | ::= { snmpMPDStats 3 }
115 |
116 | -- Conformance information ******************************************
117 |
118 | snmpMPDMIBCompliances OBJECT IDENTIFIER ::= {snmpMPDMIBConformance 1}
119 | snmpMPDMIBGroups OBJECT IDENTIFIER ::= {snmpMPDMIBConformance 2}
120 |
121 | -- Compliance statements
122 |
123 | snmpMPDCompliance MODULE-COMPLIANCE
124 | STATUS current
125 | DESCRIPTION "The compliance statement for SNMP entities which
126 | implement the SNMP-MPD-MIB.
127 | "
128 | MODULE -- this module
129 | MANDATORY-GROUPS { snmpMPDGroup }
130 | ::= { snmpMPDMIBCompliances 1 }
131 |
132 | snmpMPDGroup OBJECT-GROUP
133 | OBJECTS {
134 | snmpUnknownSecurityModels,
135 | snmpInvalidMsgs,
136 | snmpUnknownPDUHandlers
137 | }
138 | STATUS current
139 | DESCRIPTION "A collection of objects providing for remote
140 | monitoring of the SNMP Message Processing and
141 | Dispatching process.
142 | "
143 | ::= { snmpMPDMIBGroups 1 }
144 |
145 | END
146 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMP-PROXY-MIB.mib:
--------------------------------------------------------------------------------
1 | SNMP-PROXY-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY,
5 | OBJECT-TYPE,
6 | snmpModules
7 | FROM SNMPv2-SMI
8 |
9 | RowStatus,
10 | StorageType
11 | FROM SNMPv2-TC
12 |
13 | SnmpEngineID,
14 | SnmpAdminString
15 | FROM SNMP-FRAMEWORK-MIB
16 |
17 | SnmpTagValue
18 | FROM SNMP-TARGET-MIB
19 |
20 | MODULE-COMPLIANCE,
21 | OBJECT-GROUP
22 | FROM SNMPv2-CONF;
23 |
24 | snmpProxyMIB MODULE-IDENTITY
25 | LAST-UPDATED "200210140000Z"
26 | ORGANIZATION "IETF SNMPv3 Working Group"
27 | CONTACT-INFO
28 | "WG-email: snmpv3@lists.tislabs.com
29 | Subscribe: majordomo@lists.tislabs.com
30 | In message body: subscribe snmpv3
31 |
32 | Co-Chair: Russ Mundy
33 | Network Associates Laboratories
34 | Postal: 15204 Omega Drive, Suite 300
35 | Rockville, MD 20850-4601
36 | USA
37 | EMail: mundy@tislabs.com
38 | Phone: +1 301-947-7107
39 |
40 | Co-Chair: David Harrington
41 | Enterasys Networks
42 | Postal: 35 Industrial Way
43 | P. O. Box 5004
44 | Rochester, New Hampshire 03866-5005
45 | USA
46 | EMail: dbh@enterasys.com
47 | Phone: +1 603-337-2614
48 |
49 | Co-editor: David B. Levi
50 | Nortel Networks
51 | Postal: 3505 Kesterwood Drive
52 | Knoxville, Tennessee 37918
53 | EMail: dlevi@nortelnetworks.com
54 | Phone: +1 865 686 0432
55 |
56 | Co-editor: Paul Meyer
57 | Secure Computing Corporation
58 | Postal: 2675 Long Lake Road
59 | Roseville, Minnesota 55113
60 | EMail: paul_meyer@securecomputing.com
61 | Phone: +1 651 628 1592
62 |
63 | Co-editor: Bob Stewart
64 | Retired"
65 | DESCRIPTION
66 | "This MIB module defines MIB objects which provide
67 | mechanisms to remotely configure the parameters
68 | used by a proxy forwarding application.
69 |
70 | Copyright (C) The Internet Society (2002). This
71 | version of this MIB module is part of RFC 3413;
72 | see the RFC itself for full legal notices.
73 | "
74 | REVISION "200210140000Z" -- 14 October 2002
75 | DESCRIPTION "Clarifications, published as
76 | RFC 3413."
77 | REVISION "199808040000Z" -- 4 August 1998
78 | DESCRIPTION "Clarifications, published as
79 | RFC 2573."
80 | REVISION "199707140000Z" -- 14 July 1997
81 | DESCRIPTION "The initial revision, published as RFC2273."
82 | ::= { snmpModules 14 }
83 |
84 | snmpProxyObjects OBJECT IDENTIFIER ::= { snmpProxyMIB 1 }
85 | snmpProxyConformance OBJECT IDENTIFIER ::= { snmpProxyMIB 3 }
86 |
87 | --
88 |
89 | --
90 | -- The snmpProxyObjects group
91 | --
92 | --
93 |
94 | snmpProxyTable OBJECT-TYPE
95 | SYNTAX SEQUENCE OF SnmpProxyEntry
96 | MAX-ACCESS not-accessible
97 | STATUS current
98 | DESCRIPTION
99 | "The table of translation parameters used by proxy forwarder
100 | applications for forwarding SNMP messages."
101 | ::= { snmpProxyObjects 2 }
102 |
103 | snmpProxyEntry OBJECT-TYPE
104 | SYNTAX SnmpProxyEntry
105 | MAX-ACCESS not-accessible
106 | STATUS current
107 | DESCRIPTION
108 | "A set of translation parameters used by a proxy forwarder
109 | application for forwarding SNMP messages.
110 |
111 | Entries in the snmpProxyTable are created and deleted
112 | using the snmpProxyRowStatus object."
113 | INDEX { IMPLIED snmpProxyName }
114 | ::= { snmpProxyTable 1 }
115 |
116 | SnmpProxyEntry ::= SEQUENCE {
117 | snmpProxyName SnmpAdminString,
118 | snmpProxyType INTEGER,
119 | snmpProxyContextEngineID SnmpEngineID,
120 | snmpProxyContextName SnmpAdminString,
121 | snmpProxyTargetParamsIn SnmpAdminString,
122 | snmpProxySingleTargetOut SnmpAdminString,
123 | snmpProxyMultipleTargetOut SnmpTagValue,
124 | snmpProxyStorageType StorageType,
125 | snmpProxyRowStatus RowStatus
126 | }
127 |
128 | snmpProxyName OBJECT-TYPE
129 | SYNTAX SnmpAdminString (SIZE(1..32))
130 | MAX-ACCESS not-accessible
131 | STATUS current
132 | DESCRIPTION
133 | "The locally arbitrary, but unique identifier associated
134 | with this snmpProxyEntry."
135 | ::= { snmpProxyEntry 1 }
136 |
137 | snmpProxyType OBJECT-TYPE
138 | SYNTAX INTEGER {
139 | read(1),
140 | write(2),
141 | trap(3),
142 | inform(4)
143 | }
144 | MAX-ACCESS read-create
145 | STATUS current
146 | DESCRIPTION
147 | "The type of message that may be forwarded using
148 | the translation parameters defined by this entry."
149 | ::= { snmpProxyEntry 2 }
150 |
151 | snmpProxyContextEngineID OBJECT-TYPE
152 | SYNTAX SnmpEngineID
153 | MAX-ACCESS read-create
154 | STATUS current
155 | DESCRIPTION
156 | "The contextEngineID contained in messages that
157 | may be forwarded using the translation parameters
158 | defined by this entry."
159 | ::= { snmpProxyEntry 3 }
160 |
161 | snmpProxyContextName OBJECT-TYPE
162 | SYNTAX SnmpAdminString
163 | MAX-ACCESS read-create
164 | STATUS current
165 | DESCRIPTION
166 | "The contextName contained in messages that may be
167 | forwarded using the translation parameters defined
168 | by this entry.
169 |
170 | This object is optional, and if not supported, the
171 | contextName contained in a message is ignored when
172 | selecting an entry in the snmpProxyTable."
173 | ::= { snmpProxyEntry 4 }
174 |
175 | snmpProxyTargetParamsIn OBJECT-TYPE
176 | SYNTAX SnmpAdminString
177 | MAX-ACCESS read-create
178 | STATUS current
179 | DESCRIPTION
180 | "This object selects an entry in the snmpTargetParamsTable.
181 | The selected entry is used to determine which row of the
182 | snmpProxyTable to use for forwarding received messages."
183 | ::= { snmpProxyEntry 5 }
184 |
185 | snmpProxySingleTargetOut OBJECT-TYPE
186 | SYNTAX SnmpAdminString
187 | MAX-ACCESS read-create
188 | STATUS current
189 | DESCRIPTION
190 | "This object selects a management target defined in the
191 | snmpTargetAddrTable (in the SNMP-TARGET-MIB). The
192 | selected target is defined by an entry in the
193 | snmpTargetAddrTable whose index value (snmpTargetAddrName)
194 | is equal to this object.
195 |
196 | This object is only used when selection of a single
197 | target is required (i.e. when forwarding an incoming
198 | read or write request)."
199 | ::= { snmpProxyEntry 6 }
200 |
201 | snmpProxyMultipleTargetOut OBJECT-TYPE
202 | SYNTAX SnmpTagValue
203 | MAX-ACCESS read-create
204 | STATUS current
205 | DESCRIPTION
206 | "This object selects a set of management targets defined
207 | in the snmpTargetAddrTable (in the SNMP-TARGET-MIB).
208 |
209 | This object is only used when selection of multiple
210 | targets is required (i.e. when forwarding an incoming
211 | notification)."
212 | ::= { snmpProxyEntry 7 }
213 |
214 | snmpProxyStorageType OBJECT-TYPE
215 | SYNTAX StorageType
216 | MAX-ACCESS read-create
217 | STATUS current
218 | DESCRIPTION
219 | "The storage type of this conceptual row.
220 | Conceptual rows having the value 'permanent' need not
221 | allow write-access to any columnar objects in the row."
222 | DEFVAL { nonVolatile }
223 | ::= { snmpProxyEntry 8 }
224 |
225 | snmpProxyRowStatus OBJECT-TYPE
226 | SYNTAX RowStatus
227 | MAX-ACCESS read-create
228 | STATUS current
229 | DESCRIPTION
230 | "The status of this conceptual row.
231 |
232 | To create a row in this table, a manager must
233 |
234 | set this object to either createAndGo(4) or
235 | createAndWait(5).
236 |
237 | The following objects may not be modified while the
238 | value of this object is active(1):
239 | - snmpProxyType
240 | - snmpProxyContextEngineID
241 | - snmpProxyContextName
242 | - snmpProxyTargetParamsIn
243 | - snmpProxySingleTargetOut
244 | - snmpProxyMultipleTargetOut"
245 | ::= { snmpProxyEntry 9 }
246 |
247 | --
248 | --
249 | -- Conformance information
250 | --
251 | --
252 |
253 | snmpProxyCompliances OBJECT IDENTIFIER ::=
254 | { snmpProxyConformance 1 }
255 | snmpProxyGroups OBJECT IDENTIFIER ::=
256 | { snmpProxyConformance 2 }
257 |
258 | --
259 | --
260 | -- Compliance statements
261 | --
262 | --
263 |
264 | snmpProxyCompliance MODULE-COMPLIANCE
265 | STATUS current
266 | DESCRIPTION
267 | "The compliance statement for SNMP entities which include
268 | a proxy forwarding application."
269 | MODULE SNMP-TARGET-MIB
270 | MANDATORY-GROUPS { snmpTargetBasicGroup,
271 | snmpTargetResponseGroup }
272 | MODULE -- This Module
273 | MANDATORY-GROUPS { snmpProxyGroup }
274 | ::= { snmpProxyCompliances 1 }
275 |
276 | snmpProxyGroup OBJECT-GROUP
277 | OBJECTS {
278 | snmpProxyType,
279 | snmpProxyContextEngineID,
280 | snmpProxyContextName,
281 | snmpProxyTargetParamsIn,
282 | snmpProxySingleTargetOut,
283 | snmpProxyMultipleTargetOut,
284 | snmpProxyStorageType,
285 | snmpProxyRowStatus
286 | }
287 | STATUS current
288 | DESCRIPTION
289 | "A collection of objects providing remote configuration of
290 | management target translation parameters for use by
291 | proxy forwarder applications."
292 | ::= { snmpProxyGroups 3 }
293 |
294 | END
295 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMP-TSM-MIB.mib:
--------------------------------------------------------------------------------
1 | SNMP-TSM-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, OBJECT-TYPE,
5 | mib-2, Counter32
6 | FROM SNMPv2-SMI -- RFC2578
7 | MODULE-COMPLIANCE, OBJECT-GROUP
8 | FROM SNMPv2-CONF -- RFC2580
9 | TruthValue
10 | FROM SNMPv2-TC -- RFC2579
11 | ;
12 |
13 | snmpTsmMIB MODULE-IDENTITY
14 | LAST-UPDATED "200906090000Z"
15 | ORGANIZATION "ISMS Working Group"
16 | CONTACT-INFO "WG-EMail: isms@lists.ietf.org
17 | Subscribe: isms-request@lists.ietf.org
18 |
19 | Chairs:
20 | Juergen Quittek
21 | NEC Europe Ltd.
22 | Network Laboratories
23 | Kurfuersten-Anlage 36
24 | 69115 Heidelberg
25 | Germany
26 | +49 6221 90511-15
27 | quittek@netlab.nec.de
28 |
29 | Juergen Schoenwaelder
30 | Jacobs University Bremen
31 | Campus Ring 1
32 | 28725 Bremen
33 | Germany
34 | +49 421 200-3587
35 | j.schoenwaelder@jacobs-university.de
36 |
37 | Editor:
38 | David Harrington
39 | Huawei Technologies USA
40 | 1700 Alma Dr.
41 | Plano TX 75075
42 | USA
43 | +1 603-436-8634
44 | ietfdbh@comcast.net
45 |
46 | Wes Hardaker
47 | Cobham Analytic Solutions
48 | P.O. Box 382
49 | Davis, CA 95617
50 | USA
51 | +1 530 792 1913
52 | ietf@hardakers.net
53 | "
54 | DESCRIPTION
55 | "The Transport Security Model MIB.
56 |
57 | In keeping with the RFC 3411 design decisions to use
58 | self-contained documents, the RFC that contains the definition
59 | of this MIB module also includes the elements of procedure
60 | that are needed for processing the Transport Security Model
61 | for SNMP. These MIB objects SHOULD NOT be modified via other
62 | subsystems or models defined in other documents. This allows
63 | the Transport Security Model for SNMP to be designed and
64 | documented as independent and self-contained, having no direct
65 | impact on other modules, and this allows this module to be
66 | upgraded and supplemented as the need arises, and to move
67 | along the standards track on different time-lines from other
68 | modules.
69 |
70 | Copyright (c) 2009 IETF Trust and the persons
71 | identified as authors of the code. All rights reserved.
72 |
73 | Redistribution and use in source and binary forms, with or
74 | without modification, are permitted provided that the
75 | following conditions are met:
76 |
77 | - Redistributions of source code must retain the above copyright
78 | notice, this list of conditions and the following disclaimer.
79 |
80 | - Redistributions in binary form must reproduce the above
81 | copyright notice, this list of conditions and the following
82 | disclaimer in the documentation and/or other materials
83 | provided with the distribution.
84 |
85 | - Neither the name of Internet Society, IETF or IETF Trust,
86 | nor the names of specific contributors, may be used to endorse
87 | or promote products derived from this software without
88 | specific prior written permission.
89 |
90 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
91 | CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES,
92 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
93 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
94 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
95 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
96 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
97 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
98 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
99 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
100 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
101 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
102 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
103 |
104 | This version of this MIB module is part of RFC 5591;
105 | see the RFC itself for full legal notices."
106 |
107 | REVISION "200906090000Z"
108 | DESCRIPTION "The initial version, published in RFC 5591."
109 | ::= { mib-2 190 }
110 |
111 | -- ---------------------------------------------------------- --
112 | -- subtrees in the SNMP-TSM-MIB
113 | -- ---------------------------------------------------------- --
114 |
115 | snmpTsmNotifications OBJECT IDENTIFIER ::= { snmpTsmMIB 0 }
116 | snmpTsmMIBObjects OBJECT IDENTIFIER ::= { snmpTsmMIB 1 }
117 | snmpTsmConformance OBJECT IDENTIFIER ::= { snmpTsmMIB 2 }
118 |
119 | -- -------------------------------------------------------------
120 | -- Objects
121 | -- -------------------------------------------------------------
122 |
123 | -- Statistics for the Transport Security Model
124 |
125 | snmpTsmStats OBJECT IDENTIFIER ::= { snmpTsmMIBObjects 1 }
126 |
127 | snmpTsmInvalidCaches OBJECT-TYPE
128 | SYNTAX Counter32
129 | MAX-ACCESS read-only
130 | STATUS current
131 | DESCRIPTION "The number of incoming messages dropped because the
132 |
133 | tmStateReference referred to an invalid cache.
134 | "
135 | ::= { snmpTsmStats 1 }
136 |
137 | snmpTsmInadequateSecurityLevels OBJECT-TYPE
138 | SYNTAX Counter32
139 | MAX-ACCESS read-only
140 | STATUS current
141 | DESCRIPTION "The number of incoming messages dropped because
142 | the securityLevel asserted by the Transport Model was
143 | less than the securityLevel requested by the
144 | application.
145 | "
146 | ::= { snmpTsmStats 2 }
147 |
148 | snmpTsmUnknownPrefixes OBJECT-TYPE
149 | SYNTAX Counter32
150 | MAX-ACCESS read-only
151 | STATUS current
152 | DESCRIPTION "The number of messages dropped because
153 | snmpTsmConfigurationUsePrefix was set to true and
154 | there is no known prefix for the specified transport
155 | domain.
156 | "
157 | ::= { snmpTsmStats 3 }
158 |
159 | snmpTsmInvalidPrefixes OBJECT-TYPE
160 | SYNTAX Counter32
161 | MAX-ACCESS read-only
162 | STATUS current
163 | DESCRIPTION "The number of messages dropped because
164 | the securityName associated with an outgoing message
165 | did not contain a valid transport domain prefix.
166 | "
167 | ::= { snmpTsmStats 4 }
168 |
169 | -- -------------------------------------------------------------
170 | -- Configuration
171 | -- -------------------------------------------------------------
172 |
173 | -- Configuration for the Transport Security Model
174 |
175 | snmpTsmConfiguration OBJECT IDENTIFIER ::= { snmpTsmMIBObjects 2 }
176 |
177 | snmpTsmConfigurationUsePrefix OBJECT-TYPE
178 | SYNTAX TruthValue
179 | MAX-ACCESS read-write
180 | STATUS current
181 | DESCRIPTION "If this object is set to true, then securityNames
182 | passing to and from the application are expected to
183 | contain a transport-domain-specific prefix. If this
184 | object is set to true, then a domain-specific prefix
185 | will be added by the TSM to the securityName for
186 | incoming messages and removed from the securityName
187 | when processing outgoing messages. Transport domains
188 | and prefixes are maintained in a registry by IANA.
189 | This object SHOULD persist across system reboots.
190 | "
191 | DEFVAL { false }
192 | ::= { snmpTsmConfiguration 1 }
193 |
194 | -- -------------------------------------------------------------
195 | -- snmpTsmMIB - Conformance Information
196 | -- -------------------------------------------------------------
197 |
198 | snmpTsmCompliances OBJECT IDENTIFIER ::= { snmpTsmConformance 1 }
199 |
200 | snmpTsmGroups OBJECT IDENTIFIER ::= { snmpTsmConformance 2 }
201 |
202 | -- -------------------------------------------------------------
203 | -- Compliance statements
204 | -- -------------------------------------------------------------
205 |
206 | snmpTsmCompliance MODULE-COMPLIANCE
207 | STATUS current
208 | DESCRIPTION "The compliance statement for SNMP engines that support
209 | the SNMP-TSM-MIB.
210 | "
211 | MODULE
212 | MANDATORY-GROUPS { snmpTsmGroup }
213 | ::= { snmpTsmCompliances 1 }
214 |
215 | -- -------------------------------------------------------------
216 | -- Units of conformance
217 | -- -------------------------------------------------------------
218 | snmpTsmGroup OBJECT-GROUP
219 | OBJECTS {
220 | snmpTsmInvalidCaches,
221 | snmpTsmInadequateSecurityLevels,
222 | snmpTsmUnknownPrefixes,
223 | snmpTsmInvalidPrefixes,
224 | snmpTsmConfigurationUsePrefix
225 | }
226 | STATUS current
227 | DESCRIPTION "A collection of objects for maintaining
228 | information of an SNMP engine that implements
229 |
230 | the SNMP Transport Security Model.
231 | "
232 | ::= { snmpTsmGroups 2 }
233 |
234 | END
235 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMP-USM-AES-MIB.mib:
--------------------------------------------------------------------------------
1 | SNMP-USM-AES-MIB DEFINITIONS ::= BEGIN
2 | IMPORTS
3 | MODULE-IDENTITY, OBJECT-IDENTITY,
4 | snmpModules FROM SNMPv2-SMI -- [RFC2578]
5 | snmpPrivProtocols FROM SNMP-FRAMEWORK-MIB; -- [RFC3411]
6 |
7 | snmpUsmAesMIB MODULE-IDENTITY
8 | LAST-UPDATED "200406140000Z"
9 | ORGANIZATION "IETF"
10 | CONTACT-INFO "Uri Blumenthal
11 | Lucent Technologies / Bell Labs
12 | 67 Whippany Rd.
13 | 14D-318
14 | Whippany, NJ 07981, USA
15 | 973-386-2163
16 | uri@bell-labs.com
17 |
18 | Fabio Maino
19 | Andiamo Systems, Inc.
20 | 375 East Tasman Drive
21 | San Jose, CA 95134, USA
22 | 408-853-7530
23 | fmaino@andiamo.com
24 |
25 | Keith McCloghrie
26 | Cisco Systems, Inc.
27 | 170 West Tasman Drive
28 | San Jose, CA 95134-1706, USA
29 |
30 | 408-526-5260
31 | kzm@cisco.com"
32 | DESCRIPTION "Definitions of Object Identities needed for
33 | the use of AES by SNMP's User-based Security
34 | Model.
35 |
36 | Copyright (C) The Internet Society (2004).
37 |
38 | This version of this MIB module is part of RFC 3826;
39 | see the RFC itself for full legal notices.
40 | Supplementary information may be available on
41 | http://www.ietf.org/copyrights/ianamib.html."
42 |
43 | REVISION "200406140000Z"
44 | DESCRIPTION "Initial version, published as RFC3826"
45 | ::= { snmpModules 20 }
46 |
47 | usmAesCfb128Protocol OBJECT-IDENTITY
48 | STATUS current
49 | DESCRIPTION "The CFB128-AES-128 Privacy Protocol."
50 | REFERENCE "- Specification for the ADVANCED ENCRYPTION
51 | STANDARD. Federal Information Processing
52 | Standard (FIPS) Publication 197.
53 | (November 2001).
54 |
55 | - Dworkin, M., NIST Recommendation for Block
56 | Cipher Modes of Operation, Methods and
57 | Techniques. NIST Special Publication 800-38A
58 | (December 2001).
59 | "
60 | ::= { snmpPrivProtocols 4 }
61 |
62 | END
63 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMPv2-CONF.mib:
--------------------------------------------------------------------------------
1 | SNMPv2-CONF DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS ObjectName, NotificationName, ObjectSyntax
4 | FROM SNMPv2-SMI;
5 |
6 | -- definitions for conformance groups
7 |
8 | OBJECT-GROUP MACRO ::=
9 | BEGIN
10 | TYPE NOTATION ::=
11 | ObjectsPart
12 | "STATUS" Status
13 | "DESCRIPTION" Text
14 | ReferPart
15 |
16 | VALUE NOTATION ::=
17 | value(VALUE OBJECT IDENTIFIER)
18 |
19 | ObjectsPart ::=
20 | "OBJECTS" "{" Objects "}"
21 | Objects ::=
22 | Object
23 | | Objects "," Object
24 | Object ::=
25 |
26 | value(ObjectName)
27 |
28 | Status ::=
29 | "current"
30 | | "deprecated"
31 | | "obsolete"
32 |
33 | ReferPart ::=
34 | "REFERENCE" Text
35 | | empty
36 |
37 | -- a character string as defined in [2]
38 | Text ::= value(IA5String)
39 | END
40 |
41 | -- more definitions for conformance groups
42 |
43 | NOTIFICATION-GROUP MACRO ::=
44 | BEGIN
45 | TYPE NOTATION ::=
46 | NotificationsPart
47 | "STATUS" Status
48 | "DESCRIPTION" Text
49 | ReferPart
50 |
51 | VALUE NOTATION ::=
52 | value(VALUE OBJECT IDENTIFIER)
53 |
54 | NotificationsPart ::=
55 | "NOTIFICATIONS" "{" Notifications "}"
56 | Notifications ::=
57 | Notification
58 | | Notifications "," Notification
59 | Notification ::=
60 | value(NotificationName)
61 |
62 | Status ::=
63 | "current"
64 | | "deprecated"
65 | | "obsolete"
66 |
67 | ReferPart ::=
68 | "REFERENCE" Text
69 | | empty
70 |
71 | -- a character string as defined in [2]
72 | Text ::= value(IA5String)
73 | END
74 |
75 | -- definitions for compliance statements
76 |
77 | MODULE-COMPLIANCE MACRO ::=
78 | BEGIN
79 | TYPE NOTATION ::=
80 | "STATUS" Status
81 | "DESCRIPTION" Text
82 | ReferPart
83 | ModulePart
84 |
85 | VALUE NOTATION ::=
86 | value(VALUE OBJECT IDENTIFIER)
87 |
88 | Status ::=
89 | "current"
90 | | "deprecated"
91 | | "obsolete"
92 |
93 | ReferPart ::=
94 | "REFERENCE" Text
95 | | empty
96 |
97 | ModulePart ::=
98 | Modules
99 | Modules ::=
100 | Module
101 | | Modules Module
102 | Module ::=
103 | -- name of module --
104 | "MODULE" ModuleName
105 | MandatoryPart
106 | CompliancePart
107 |
108 | ModuleName ::=
109 | -- identifier must start with uppercase letter
110 | identifier ModuleIdentifier
111 | -- must not be empty unless contained
112 | -- in MIB Module
113 | | empty
114 | ModuleIdentifier ::=
115 | value(OBJECT IDENTIFIER)
116 | | empty
117 |
118 | MandatoryPart ::=
119 | "MANDATORY-GROUPS" "{" Groups "}"
120 | | empty
121 |
122 | Groups ::=
123 |
124 | Group
125 | | Groups "," Group
126 | Group ::=
127 | value(OBJECT IDENTIFIER)
128 |
129 | CompliancePart ::=
130 | Compliances
131 | | empty
132 |
133 | Compliances ::=
134 | Compliance
135 | | Compliances Compliance
136 | Compliance ::=
137 | ComplianceGroup
138 | | Object
139 |
140 | ComplianceGroup ::=
141 | "GROUP" value(OBJECT IDENTIFIER)
142 | "DESCRIPTION" Text
143 |
144 | Object ::=
145 | "OBJECT" value(ObjectName)
146 | SyntaxPart
147 | WriteSyntaxPart
148 | AccessPart
149 | "DESCRIPTION" Text
150 |
151 | -- must be a refinement for object's SYNTAX clause
152 | SyntaxPart ::= "SYNTAX" Syntax
153 | | empty
154 |
155 | -- must be a refinement for object's SYNTAX clause
156 | WriteSyntaxPart ::= "WRITE-SYNTAX" Syntax
157 | | empty
158 |
159 | Syntax ::= -- Must be one of the following:
160 | -- a base type (or its refinement),
161 | -- a textual convention (or its refinement), or
162 | -- a BITS pseudo-type
163 | type
164 | | "BITS" "{" NamedBits "}"
165 |
166 | NamedBits ::= NamedBit
167 | | NamedBits "," NamedBit
168 |
169 | NamedBit ::= identifier "(" number ")" -- number is nonnegative
170 |
171 | AccessPart ::=
172 | "MIN-ACCESS" Access
173 | | empty
174 | Access ::=
175 | "not-accessible"
176 | | "accessible-for-notify"
177 | | "read-only"
178 | | "read-write"
179 | | "read-create"
180 |
181 | -- a character string as defined in [2]
182 | Text ::= value(IA5String)
183 | END
184 |
185 | -- definitions for capabilities statements
186 |
187 | AGENT-CAPABILITIES MACRO ::=
188 | BEGIN
189 | TYPE NOTATION ::=
190 | "PRODUCT-RELEASE" Text
191 | "STATUS" Status
192 | "DESCRIPTION" Text
193 | ReferPart
194 | ModulePart
195 |
196 | VALUE NOTATION ::=
197 | value(VALUE OBJECT IDENTIFIER)
198 |
199 | Status ::=
200 | "current"
201 | | "obsolete"
202 |
203 | ReferPart ::=
204 | "REFERENCE" Text
205 | | empty
206 |
207 | ModulePart ::=
208 | Modules
209 | | empty
210 | Modules ::=
211 | Module
212 | | Modules Module
213 | Module ::=
214 | -- name of module --
215 | "SUPPORTS" ModuleName
216 | "INCLUDES" "{" Groups "}"
217 | VariationPart
218 |
219 | ModuleName ::=
220 |
221 | -- identifier must start with uppercase letter
222 | identifier ModuleIdentifier
223 | ModuleIdentifier ::=
224 | value(OBJECT IDENTIFIER)
225 | | empty
226 |
227 | Groups ::=
228 | Group
229 | | Groups "," Group
230 | Group ::=
231 | value(OBJECT IDENTIFIER)
232 |
233 | VariationPart ::=
234 | Variations
235 | | empty
236 | Variations ::=
237 | Variation
238 | | Variations Variation
239 |
240 | Variation ::=
241 | ObjectVariation
242 | | NotificationVariation
243 |
244 | NotificationVariation ::=
245 | "VARIATION" value(NotificationName)
246 | AccessPart
247 | "DESCRIPTION" Text
248 |
249 | ObjectVariation ::=
250 | "VARIATION" value(ObjectName)
251 | SyntaxPart
252 | WriteSyntaxPart
253 | AccessPart
254 | CreationPart
255 | DefValPart
256 | "DESCRIPTION" Text
257 |
258 | -- must be a refinement for object's SYNTAX clause
259 | SyntaxPart ::= "SYNTAX" Syntax
260 | | empty
261 |
262 | WriteSyntaxPart ::= "WRITE-SYNTAX" Syntax
263 | | empty
264 |
265 | Syntax ::= -- Must be one of the following:
266 | -- a base type (or its refinement),
267 | -- a textual convention (or its refinement), or
268 | -- a BITS pseudo-type
269 |
270 | type
271 | | "BITS" "{" NamedBits "}"
272 |
273 | NamedBits ::= NamedBit
274 | | NamedBits "," NamedBit
275 |
276 | NamedBit ::= identifier "(" number ")" -- number is nonnegative
277 |
278 | AccessPart ::=
279 | "ACCESS" Access
280 | | empty
281 |
282 | Access ::=
283 | "not-implemented"
284 | -- only "not-implemented" for notifications
285 | | "accessible-for-notify"
286 | | "read-only"
287 | | "read-write"
288 | | "read-create"
289 | -- following is for backward-compatibility only
290 | | "write-only"
291 |
292 | CreationPart ::=
293 | "CREATION-REQUIRES" "{" Cells "}"
294 | | empty
295 | Cells ::=
296 | Cell
297 | | Cells "," Cell
298 | Cell ::=
299 | value(ObjectName)
300 |
301 | DefValPart ::= "DEFVAL" "{" Defvalue "}"
302 | | empty
303 |
304 | Defvalue ::= -- must be valid for the object's syntax
305 | -- in this macro's SYNTAX clause, if present,
306 | -- or if not, in object's OBJECT-TYPE macro
307 | value(ObjectSyntax)
308 | | "{" BitsValue "}"
309 |
310 | BitsValue ::= BitNames
311 | | empty
312 |
313 | BitNames ::= BitName
314 | | BitNames "," BitName
315 |
316 | BitName ::= identifier
317 |
318 | -- a character string as defined in [2]
319 | Text ::= value(IA5String)
320 | END
321 |
322 | END
323 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMPv2-SMI.mib:
--------------------------------------------------------------------------------
1 | SNMPv2-SMI DEFINITIONS ::= BEGIN
2 |
3 | -- the path to the root
4 |
5 | org OBJECT IDENTIFIER ::= { iso 3 } -- "iso" = 1
6 | dod OBJECT IDENTIFIER ::= { org 6 }
7 | internet OBJECT IDENTIFIER ::= { dod 1 }
8 |
9 | directory OBJECT IDENTIFIER ::= { internet 1 }
10 |
11 | mgmt OBJECT IDENTIFIER ::= { internet 2 }
12 | mib-2 OBJECT IDENTIFIER ::= { mgmt 1 }
13 | transmission OBJECT IDENTIFIER ::= { mib-2 10 }
14 |
15 | experimental OBJECT IDENTIFIER ::= { internet 3 }
16 |
17 | private OBJECT IDENTIFIER ::= { internet 4 }
18 | enterprises OBJECT IDENTIFIER ::= { private 1 }
19 |
20 | security OBJECT IDENTIFIER ::= { internet 5 }
21 |
22 | snmpV2 OBJECT IDENTIFIER ::= { internet 6 }
23 |
24 | -- transport domains
25 | snmpDomains OBJECT IDENTIFIER ::= { snmpV2 1 }
26 |
27 | -- transport proxies
28 | snmpProxys OBJECT IDENTIFIER ::= { snmpV2 2 }
29 |
30 | -- module identities
31 | snmpModules OBJECT IDENTIFIER ::= { snmpV2 3 }
32 |
33 | -- Extended UTCTime, to allow dates with four-digit years
34 | -- (Note that this definition of ExtUTCTime is not to be IMPORTed
35 | -- by MIB modules.)
36 | ExtUTCTime ::= OCTET STRING(SIZE(11 | 13))
37 | -- format is YYMMDDHHMMZ or YYYYMMDDHHMMZ
38 |
39 | -- where: YY - last two digits of year (only years
40 | -- between 1900-1999)
41 | -- YYYY - last four digits of the year (any year)
42 | -- MM - month (01 through 12)
43 | -- DD - day of month (01 through 31)
44 | -- HH - hours (00 through 23)
45 | -- MM - minutes (00 through 59)
46 | -- Z - denotes GMT (the ASCII character Z)
47 | --
48 | -- For example, "9502192015Z" and "199502192015Z" represent
49 | -- 8:15pm GMT on 19 February 1995. Years after 1999 must use
50 | -- the four digit year format. Years 1900-1999 may use the
51 | -- two or four digit format.
52 |
53 | -- definitions for information modules
54 |
55 | MODULE-IDENTITY MACRO ::=
56 | BEGIN
57 | TYPE NOTATION ::=
58 | "LAST-UPDATED" value(Update ExtUTCTime)
59 | "ORGANIZATION" Text
60 | "CONTACT-INFO" Text
61 | "DESCRIPTION" Text
62 | RevisionPart
63 |
64 | VALUE NOTATION ::=
65 | value(VALUE OBJECT IDENTIFIER)
66 |
67 | RevisionPart ::=
68 | Revisions
69 | | empty
70 | Revisions ::=
71 | Revision
72 | | Revisions Revision
73 | Revision ::=
74 | "REVISION" value(Update ExtUTCTime)
75 | "DESCRIPTION" Text
76 |
77 | -- a character string as defined in section 3.1.1
78 | Text ::= value(IA5String)
79 | END
80 |
81 | OBJECT-IDENTITY MACRO ::=
82 | BEGIN
83 | TYPE NOTATION ::=
84 | "STATUS" Status
85 | "DESCRIPTION" Text
86 |
87 | ReferPart
88 |
89 | VALUE NOTATION ::=
90 | value(VALUE OBJECT IDENTIFIER)
91 |
92 | Status ::=
93 | "current"
94 | | "deprecated"
95 | | "obsolete"
96 |
97 | ReferPart ::=
98 | "REFERENCE" Text
99 | | empty
100 |
101 | -- a character string as defined in section 3.1.1
102 | Text ::= value(IA5String)
103 | END
104 |
105 | -- names of objects
106 | -- (Note that these definitions of ObjectName and NotificationName
107 | -- are not to be IMPORTed by MIB modules.)
108 |
109 | ObjectName ::=
110 | OBJECT IDENTIFIER
111 |
112 | NotificationName ::=
113 | OBJECT IDENTIFIER
114 |
115 | -- syntax of objects
116 |
117 | -- the "base types" defined here are:
118 | -- 3 built-in ASN.1 types: INTEGER, OCTET STRING, OBJECT IDENTIFIER
119 | -- 8 application-defined types: Integer32, IpAddress, Counter32,
120 | -- Gauge32, Unsigned32, TimeTicks, Opaque, and Counter64
121 |
122 | ObjectSyntax ::=
123 | CHOICE {
124 | simple
125 | SimpleSyntax,
126 | -- note that SEQUENCEs for conceptual tables and
127 | -- rows are not mentioned here...
128 |
129 | application-wide
130 | ApplicationSyntax
131 | }
132 |
133 | -- built-in ASN.1 types
134 |
135 | SimpleSyntax ::=
136 | CHOICE {
137 | -- INTEGERs with a more restrictive range
138 | -- may also be used
139 | integer-value -- includes Integer32
140 | INTEGER (-2147483648..2147483647),
141 | -- OCTET STRINGs with a more restrictive size
142 | -- may also be used
143 | string-value
144 | OCTET STRING (SIZE (0..65535)),
145 | objectID-value
146 | OBJECT IDENTIFIER
147 | }
148 |
149 | -- indistinguishable from INTEGER, but never needs more than
150 | -- 32-bits for a two's complement representation
151 | Integer32 ::=
152 | INTEGER (-2147483648..2147483647)
153 |
154 | -- application-wide types
155 |
156 | ApplicationSyntax ::=
157 | CHOICE {
158 | ipAddress-value
159 | IpAddress,
160 | counter-value
161 | Counter32,
162 | timeticks-value
163 | TimeTicks,
164 | arbitrary-value
165 | Opaque,
166 | big-counter-value
167 | Counter64,
168 | unsigned-integer-value -- includes Gauge32
169 | Unsigned32
170 | }
171 |
172 | -- in network-byte order
173 |
174 | -- (this is a tagged type for historical reasons)
175 | IpAddress ::=
176 | [APPLICATION 0]
177 | IMPLICIT OCTET STRING (SIZE (4))
178 |
179 | -- this wraps
180 | Counter32 ::=
181 | [APPLICATION 1]
182 | IMPLICIT INTEGER (0..4294967295)
183 |
184 | -- this doesn't wrap
185 | Gauge32 ::=
186 | [APPLICATION 2]
187 | IMPLICIT INTEGER (0..4294967295)
188 |
189 | -- an unsigned 32-bit quantity
190 | -- indistinguishable from Gauge32
191 | Unsigned32 ::=
192 | [APPLICATION 2]
193 | IMPLICIT INTEGER (0..4294967295)
194 |
195 | -- hundredths of seconds since an epoch
196 | TimeTicks ::=
197 | [APPLICATION 3]
198 | IMPLICIT INTEGER (0..4294967295)
199 |
200 | -- for backward-compatibility only
201 | Opaque ::=
202 | [APPLICATION 4]
203 | IMPLICIT OCTET STRING
204 |
205 | -- for counters that wrap in less than one hour with only 32 bits
206 | Counter64 ::=
207 | [APPLICATION 6]
208 | IMPLICIT INTEGER (0..18446744073709551615)
209 |
210 | -- definition for objects
211 |
212 | OBJECT-TYPE MACRO ::=
213 | BEGIN
214 | TYPE NOTATION ::=
215 | "SYNTAX" Syntax
216 | UnitsPart
217 | "MAX-ACCESS" Access
218 | "STATUS" Status
219 | "DESCRIPTION" Text
220 | ReferPart
221 |
222 | IndexPart
223 | DefValPart
224 |
225 | VALUE NOTATION ::=
226 | value(VALUE ObjectName)
227 |
228 | Syntax ::= -- Must be one of the following:
229 | -- a base type (or its refinement),
230 | -- a textual convention (or its refinement), or
231 | -- a BITS pseudo-type
232 | type
233 | | "BITS" "{" NamedBits "}"
234 |
235 | NamedBits ::= NamedBit
236 | | NamedBits "," NamedBit
237 |
238 | NamedBit ::= identifier "(" number ")" -- number is nonnegative
239 |
240 | UnitsPart ::=
241 | "UNITS" Text
242 | | empty
243 |
244 | Access ::=
245 | "not-accessible"
246 | | "accessible-for-notify"
247 | | "read-only"
248 | | "read-write"
249 | | "read-create"
250 |
251 | Status ::=
252 | "current"
253 | | "deprecated"
254 | | "obsolete"
255 |
256 | ReferPart ::=
257 | "REFERENCE" Text
258 | | empty
259 |
260 | IndexPart ::=
261 | "INDEX" "{" IndexTypes "}"
262 | | "AUGMENTS" "{" Entry "}"
263 | | empty
264 | IndexTypes ::=
265 | IndexType
266 | | IndexTypes "," IndexType
267 | IndexType ::=
268 | "IMPLIED" Index
269 | | Index
270 |
271 | Index ::=
272 | -- use the SYNTAX value of the
273 | -- correspondent OBJECT-TYPE invocation
274 | value(ObjectName)
275 | Entry ::=
276 | -- use the INDEX value of the
277 | -- correspondent OBJECT-TYPE invocation
278 | value(ObjectName)
279 |
280 | DefValPart ::= "DEFVAL" "{" Defvalue "}"
281 | | empty
282 |
283 | Defvalue ::= -- must be valid for the type specified in
284 | -- SYNTAX clause of same OBJECT-TYPE macro
285 | value(ObjectSyntax)
286 | | "{" BitsValue "}"
287 |
288 | BitsValue ::= BitNames
289 | | empty
290 |
291 | BitNames ::= BitName
292 | | BitNames "," BitName
293 |
294 | BitName ::= identifier
295 |
296 | -- a character string as defined in section 3.1.1
297 | Text ::= value(IA5String)
298 | END
299 |
300 | -- definitions for notifications
301 |
302 | NOTIFICATION-TYPE MACRO ::=
303 | BEGIN
304 | TYPE NOTATION ::=
305 | ObjectsPart
306 | "STATUS" Status
307 | "DESCRIPTION" Text
308 | ReferPart
309 |
310 | VALUE NOTATION ::=
311 | value(VALUE NotificationName)
312 |
313 | ObjectsPart ::=
314 | "OBJECTS" "{" Objects "}"
315 | | empty
316 | Objects ::=
317 | Object
318 |
319 | | Objects "," Object
320 | Object ::=
321 | value(ObjectName)
322 |
323 | Status ::=
324 | "current"
325 | | "deprecated"
326 | | "obsolete"
327 |
328 | ReferPart ::=
329 | "REFERENCE" Text
330 | | empty
331 |
332 | -- a character string as defined in section 3.1.1
333 | Text ::= value(IA5String)
334 | END
335 |
336 | -- definitions of administrative identifiers
337 |
338 | zeroDotZero OBJECT-IDENTITY
339 | STATUS current
340 | DESCRIPTION
341 | "A value used for null identifiers."
342 | ::= { 0 0 }
343 |
344 | END
345 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/SNMPv2-TM.mib:
--------------------------------------------------------------------------------
1 | SNMPv2-TM DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, OBJECT-IDENTITY,
5 | snmpModules, snmpDomains, snmpProxys
6 | FROM SNMPv2-SMI
7 | TEXTUAL-CONVENTION
8 | FROM SNMPv2-TC;
9 |
10 | snmpv2tm MODULE-IDENTITY
11 | LAST-UPDATED "200210160000Z"
12 | ORGANIZATION "IETF SNMPv3 Working Group"
13 | CONTACT-INFO
14 | "WG-EMail: snmpv3@lists.tislabs.com
15 | Subscribe: snmpv3-request@lists.tislabs.com
16 |
17 | Co-Chair: Russ Mundy
18 | Network Associates Laboratories
19 | postal: 15204 Omega Drive, Suite 300
20 | Rockville, MD 20850-4601
21 | USA
22 | EMail: mundy@tislabs.com
23 | phone: +1 301 947-7107
24 |
25 | Co-Chair: David Harrington
26 | Enterasys Networks
27 | postal: 35 Industrial Way
28 | P. O. Box 5005
29 | Rochester, NH 03866-5005
30 | USA
31 | EMail: dbh@enterasys.com
32 | phone: +1 603 337-2614
33 |
34 | Editor: Randy Presuhn
35 | BMC Software, Inc.
36 | postal: 2141 North First Street
37 | San Jose, CA 95131
38 | USA
39 | EMail: randy_presuhn@bmc.com
40 | phone: +1 408 546-1006"
41 | DESCRIPTION
42 | "The MIB module for SNMP transport mappings.
43 |
44 | Copyright (C) The Internet Society (2002). This
45 | version of this MIB module is part of RFC 3417;
46 | see the RFC itself for full legal notices.
47 | "
48 | REVISION "200210160000Z"
49 | DESCRIPTION
50 | "Clarifications, published as RFC 3417."
51 | REVISION "199601010000Z"
52 | DESCRIPTION
53 | "Clarifications, published as RFC 1906."
54 | REVISION "199304010000Z"
55 | DESCRIPTION
56 | "The initial version, published as RFC 1449."
57 | ::= { snmpModules 19 }
58 |
59 | -- SNMP over UDP over IPv4
60 |
61 | snmpUDPDomain OBJECT-IDENTITY
62 | STATUS current
63 | DESCRIPTION
64 | "The SNMP over UDP over IPv4 transport domain.
65 | The corresponding transport address is of type
66 | SnmpUDPAddress."
67 | ::= { snmpDomains 1 }
68 |
69 | SnmpUDPAddress ::= TEXTUAL-CONVENTION
70 | DISPLAY-HINT "1d.1d.1d.1d/2d"
71 | STATUS current
72 | DESCRIPTION
73 | "Represents a UDP over IPv4 address:
74 |
75 | octets contents encoding
76 | 1-4 IP-address network-byte order
77 | 5-6 UDP-port network-byte order
78 | "
79 | SYNTAX OCTET STRING (SIZE (6))
80 |
81 | -- SNMP over OSI
82 |
83 | snmpCLNSDomain OBJECT-IDENTITY
84 | STATUS current
85 | DESCRIPTION
86 | "The SNMP over CLNS transport domain.
87 | The corresponding transport address is of type
88 | SnmpOSIAddress."
89 | ::= { snmpDomains 2 }
90 |
91 | snmpCONSDomain OBJECT-IDENTITY
92 | STATUS current
93 | DESCRIPTION
94 | "The SNMP over CONS transport domain.
95 | The corresponding transport address is of type
96 | SnmpOSIAddress."
97 | ::= { snmpDomains 3 }
98 |
99 | SnmpOSIAddress ::= TEXTUAL-CONVENTION
100 | DISPLAY-HINT "*1x:/1x:"
101 | STATUS current
102 | DESCRIPTION
103 | "Represents an OSI transport-address:
104 |
105 | octets contents encoding
106 | 1 length of NSAP 'n' as an unsigned-integer
107 | (either 0 or from 3 to 20)
108 | 2..(n+1) NSAP concrete binary representation
109 | (n+2)..m TSEL string of (up to 64) octets
110 | "
111 | SYNTAX OCTET STRING (SIZE (1 | 4..85))
112 |
113 | -- SNMP over DDP
114 |
115 | snmpDDPDomain OBJECT-IDENTITY
116 | STATUS current
117 | DESCRIPTION
118 | "The SNMP over DDP transport domain. The corresponding
119 | transport address is of type SnmpNBPAddress."
120 | ::= { snmpDomains 4 }
121 |
122 | SnmpNBPAddress ::= TEXTUAL-CONVENTION
123 | STATUS current
124 | DESCRIPTION
125 | "Represents an NBP name:
126 |
127 | octets contents encoding
128 | 1 length of object 'n' as an unsigned integer
129 | 2..(n+1) object string of (up to 32) octets
130 | n+2 length of type 'p' as an unsigned integer
131 | (n+3)..(n+2+p) type string of (up to 32) octets
132 | n+3+p length of zone 'q' as an unsigned integer
133 | (n+4+p)..(n+3+p+q) zone string of (up to 32) octets
134 |
135 | For comparison purposes, strings are
136 | case-insensitive. All strings may contain any octet
137 | other than 255 (hex ff)."
138 | SYNTAX OCTET STRING (SIZE (3..99))
139 |
140 | -- SNMP over IPX
141 |
142 | snmpIPXDomain OBJECT-IDENTITY
143 | STATUS current
144 | DESCRIPTION
145 | "The SNMP over IPX transport domain. The corresponding
146 | transport address is of type SnmpIPXAddress."
147 | ::= { snmpDomains 5 }
148 |
149 | SnmpIPXAddress ::= TEXTUAL-CONVENTION
150 | DISPLAY-HINT "4x.1x:1x:1x:1x:1x:1x.2d"
151 | STATUS current
152 | DESCRIPTION
153 | "Represents an IPX address:
154 |
155 | octets contents encoding
156 | 1-4 network-number network-byte order
157 | 5-10 physical-address network-byte order
158 | 11-12 socket-number network-byte order
159 | "
160 | SYNTAX OCTET STRING (SIZE (12))
161 |
162 | -- for proxy to SNMPv1 (RFC 1157)
163 |
164 | rfc1157Proxy OBJECT IDENTIFIER ::= { snmpProxys 1 }
165 |
166 | rfc1157Domain OBJECT-IDENTITY
167 | STATUS deprecated
168 | DESCRIPTION
169 | "The transport domain for SNMPv1 over UDP over IPv4.
170 | The corresponding transport address is of type
171 | SnmpUDPAddress."
172 | ::= { rfc1157Proxy 1 }
173 |
174 | -- ::= { rfc1157Proxy 2 } this OID is obsolete
175 |
176 | END
177 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/UCD-DEMO-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-DEMO-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | MODULE-IDENTITY, OBJECT-TYPE, Integer32 FROM SNMPv2-SMI
5 | ucdavis FROM UCD-SNMP-MIB;
6 |
7 | ucdDemoMIB MODULE-IDENTITY
8 | LAST-UPDATED "9912090000Z"
9 | ORGANIZATION "University of California, Davis"
10 | CONTACT-INFO
11 | "This mib is no longer being maintained by the University of
12 | California and is now in life-support-mode and being
13 | maintained by the net-snmp project. The best place to write
14 | for public questions about the net-snmp-coders mailing list
15 | at net-snmp-coders@lists.sourceforge.net.
16 |
17 | postal: Wes Hardaker
18 | P.O. Box 382
19 | Davis CA 95617
20 |
21 | email: net-snmp-coders@lists.sourceforge.net
22 | "
23 | DESCRIPTION
24 | "The UCD-SNMP Demonstration MIB."
25 | REVISION "9912090000Z"
26 | DESCRIPTION
27 | "SMIv2 version converted from older MIB definitions."
28 | ::= { ucdavis 14 }
29 |
30 | ucdDemoMIBObjects OBJECT IDENTIFIER ::= { ucdDemoMIB 1 }
31 |
32 | ucdDemoPublic OBJECT IDENTIFIER ::= { ucdDemoMIBObjects 1 }
33 |
34 | ucdDemoResetKeys OBJECT-TYPE
35 | SYNTAX Integer32 (0..2147483647)
36 | MAX-ACCESS read-write
37 | STATUS current
38 | DESCRIPTION
39 | "A set of value 1 to this object resets the
40 | demonstration user's auth and priv keys to the
41 | keys based on the P->Ku->Kul transformation of the
42 | value of the ucdDemoPasspharse object.
43 |
44 | Values other than 1 are ignored."
45 | ::= { ucdDemoPublic 1 }
46 |
47 | ucdDemoPublicString OBJECT-TYPE
48 | SYNTAX OCTET STRING (SIZE(0..1024))
49 | MAX-ACCESS read-write
50 | STATUS current
51 | DESCRIPTION
52 | "A publicly settable string that can be set for testing
53 | snmpsets. This value has no real usage other than
54 | testing purposes."
55 | ::= { ucdDemoPublic 2 }
56 |
57 | ucdDemoUserList OBJECT-TYPE
58 | SYNTAX OCTET STRING
59 | MAX-ACCESS read-only
60 | STATUS current
61 | DESCRIPTION
62 | "The list of users affected by the ucdDemoResetKeys object."
63 | ::= { ucdDemoPublic 3 }
64 |
65 | ucdDemoPassphrase OBJECT-TYPE
66 | SYNTAX OCTET STRING
67 | MAX-ACCESS read-only
68 | STATUS current
69 | DESCRIPTION
70 | "The demo passphrase that ucdDemoResetKeys changes each
71 | users localized key to based on the P->Ku->Kul transformation."
72 | ::= { ucdDemoPublic 4 }
73 |
74 | END
75 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/UCD-DISKIO-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-DISKIO-MIB DEFINITIONS ::= BEGIN
2 |
3 | --
4 | -- Derived from the original VEST-INTERNETT-MIB. Open issues:
5 | --
6 | -- (a) where to register this MIB?
7 | -- (b) use not-accessible for diskIOIndex?
8 | --
9 |
10 |
11 | IMPORTS
12 | MODULE-IDENTITY, OBJECT-TYPE, Integer32, Counter32, Counter64
13 | FROM SNMPv2-SMI
14 | DisplayString
15 | FROM SNMPv2-TC
16 | ucdExperimental
17 | FROM UCD-SNMP-MIB;
18 |
19 | ucdDiskIOMIB MODULE-IDENTITY
20 | LAST-UPDATED "200504200000Z"
21 | ORGANIZATION "University of California, Davis"
22 | CONTACT-INFO
23 | "This mib is no longer being maintained by the University of
24 | California and is now in life-support-mode and being
25 | maintained by the net-snmp project. The best place to write
26 | for public questions about the net-snmp-coders mailing list
27 | at net-snmp-coders@lists.sourceforge.net.
28 |
29 | postal: Wes Hardaker
30 | P.O. Box 382
31 | Davis CA 95617
32 |
33 | email: net-snmp-coders@lists.sourceforge.net
34 | "
35 | DESCRIPTION
36 | "This MIB module defines objects for disk IO statistics."
37 |
38 | REVISION "200504200000Z"
39 | DESCRIPTION
40 | "Add 64 bit counters. Patch from Dan Nelson."
41 |
42 | REVISION "200202130000Z"
43 | DESCRIPTION
44 | "Add 1, 5 and 15-minute load average objects"
45 |
46 | REVISION "200001260000Z"
47 | DESCRIPTION
48 | "SMIv2 version derived from older definitions contained
49 | in the VEST-INTERNETT-MIB module."
50 | ::= { ucdExperimental 15 }
51 |
52 | diskIOTable OBJECT-TYPE
53 | SYNTAX SEQUENCE OF DiskIOEntry
54 | MAX-ACCESS not-accessible
55 | STATUS current
56 | DESCRIPTION
57 | "Table of IO devices and how much data they have read/written."
58 | ::= { ucdDiskIOMIB 1 }
59 |
60 | diskIOEntry OBJECT-TYPE
61 | SYNTAX DiskIOEntry
62 | MAX-ACCESS not-accessible
63 | STATUS current
64 | DESCRIPTION
65 | "An entry containing a device and its statistics."
66 | INDEX { diskIOIndex }
67 | ::= { diskIOTable 1 }
68 |
69 | DiskIOEntry ::= SEQUENCE {
70 | diskIOIndex Integer32,
71 | diskIODevice DisplayString,
72 | diskIONRead Counter32,
73 | diskIONWritten Counter32,
74 | diskIOReads Counter32,
75 | diskIOWrites Counter32,
76 | diskIOLA1 Integer32,
77 | diskIOLA5 Integer32,
78 | diskIOLA15 Integer32,
79 | diskIONReadX Counter64,
80 | diskIONWrittenX Counter64
81 | }
82 |
83 | diskIOIndex OBJECT-TYPE
84 | SYNTAX Integer32 (0..65535)
85 | MAX-ACCESS read-only
86 | STATUS current
87 | DESCRIPTION
88 | "Reference index for each observed device."
89 | ::= { diskIOEntry 1 }
90 |
91 | diskIODevice OBJECT-TYPE
92 | SYNTAX DisplayString
93 | MAX-ACCESS read-only
94 | STATUS current
95 | DESCRIPTION
96 | "The name of the device we are counting/checking."
97 | ::= { diskIOEntry 2 }
98 |
99 | diskIONRead OBJECT-TYPE
100 | SYNTAX Counter32
101 | MAX-ACCESS read-only
102 | STATUS current
103 | DESCRIPTION
104 | "The number of bytes read from this device since boot."
105 | ::= { diskIOEntry 3 }
106 |
107 | diskIONWritten OBJECT-TYPE
108 | SYNTAX Counter32
109 | MAX-ACCESS read-only
110 | STATUS current
111 | DESCRIPTION
112 | "The number of bytes written to this device since boot."
113 | ::= { diskIOEntry 4 }
114 |
115 | diskIOReads OBJECT-TYPE
116 | SYNTAX Counter32
117 | MAX-ACCESS read-only
118 | STATUS current
119 | DESCRIPTION
120 | "The number of read accesses from this device since boot."
121 | ::= { diskIOEntry 5 }
122 |
123 | diskIOWrites OBJECT-TYPE
124 | SYNTAX Counter32
125 | MAX-ACCESS read-only
126 | STATUS current
127 | DESCRIPTION
128 | "The number of write accesses to this device since boot."
129 | ::= { diskIOEntry 6 }
130 |
131 | diskIOLA1 OBJECT-TYPE
132 | SYNTAX Integer32 (0..100)
133 | MAX-ACCESS read-only
134 | STATUS current
135 | DESCRIPTION
136 | "The 1 minute average load of disk (%)"
137 | ::= { diskIOEntry 9 }
138 |
139 | diskIOLA5 OBJECT-TYPE
140 | SYNTAX Integer32 (0..100)
141 | MAX-ACCESS read-only
142 | STATUS current
143 | DESCRIPTION
144 | "The 5 minute average load of disk (%)"
145 | ::= { diskIOEntry 10 }
146 |
147 | diskIOLA15 OBJECT-TYPE
148 | SYNTAX Integer32 (0..100)
149 | MAX-ACCESS read-only
150 | STATUS current
151 | DESCRIPTION
152 | "The 15 minute average load of disk (%)"
153 | ::= { diskIOEntry 11 }
154 |
155 | diskIONReadX OBJECT-TYPE
156 | SYNTAX Counter64
157 | MAX-ACCESS read-only
158 | STATUS current
159 | DESCRIPTION
160 | "The number of bytes read from this device since boot."
161 | ::= { diskIOEntry 12 }
162 |
163 | diskIONWrittenX OBJECT-TYPE
164 | SYNTAX Counter64
165 | MAX-ACCESS read-only
166 | STATUS current
167 | DESCRIPTION
168 | "The number of bytes written to this device since boot."
169 | ::= { diskIOEntry 13 }
170 |
171 | END
172 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/UCD-DLMOD-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-DLMOD-MIB DEFINITIONS ::= BEGIN
2 |
3 | -- Why do we have dlmodNextIndex if the dlmodTable is read-write?
4 | -- What exactly is the dlmodName and dlmodPath?
5 | -- Should there not be a timestamp associated with dlmodError?
6 | -- What exactly do the dlmodStatus enumerations mean?
7 |
8 | IMPORTS
9 | OBJECT-TYPE, MODULE-IDENTITY, Integer32 FROM SNMPv2-SMI
10 | DisplayString FROM SNMPv2-TC
11 | ucdExperimental FROM UCD-SNMP-MIB;
12 |
13 | ucdDlmodMIB MODULE-IDENTITY
14 | LAST-UPDATED "200001260000Z"
15 | ORGANIZATION "University of California, Davis"
16 | CONTACT-INFO
17 | "This mib is no longer being maintained by the University of
18 | California and is now in life-support-mode and being
19 | maintained by the net-snmp project. The best place to write
20 | for public questions about the net-snmp-coders mailing list
21 | at net-snmp-coders@lists.sourceforge.net.
22 |
23 | postal: Wes Hardaker
24 | P.O. Box 382
25 | Davis CA 95617
26 |
27 | email: net-snmp-coders@lists.sourceforge.net
28 | "
29 | DESCRIPTION
30 | "This file defines the MIB objects for dynamic
31 | loadable MIB modules."
32 |
33 | REVISION "200001260000Z"
34 | DESCRIPTION
35 | "Renamed MIB root object"
36 |
37 | REVISION "9912100000Z"
38 | DESCRIPTION
39 | "SMIv2 version converted from older MIB definitions."
40 | ::= { ucdExperimental 14 }
41 |
42 | dlmodNextIndex OBJECT-TYPE
43 | SYNTAX Integer32
44 | MAX-ACCESS read-only
45 | STATUS current
46 | DESCRIPTION
47 | "The index number of next appropiate unassigned entry
48 | in the dlmodTable."
49 | ::= { ucdDlmodMIB 1 }
50 |
51 | dlmodTable OBJECT-TYPE
52 | SYNTAX SEQUENCE OF DlmodEntry
53 | MAX-ACCESS not-accessible
54 | STATUS current
55 | DESCRIPTION
56 | "A table of dlmodEntry."
57 | ::= { ucdDlmodMIB 2 }
58 |
59 | dlmodEntry OBJECT-TYPE
60 | SYNTAX DlmodEntry
61 | MAX-ACCESS not-accessible
62 | STATUS current
63 | DESCRIPTION
64 | "The parameters of dynamically loaded MIB module."
65 | INDEX { dlmodIndex }
66 | ::= { dlmodTable 1 }
67 |
68 | DlmodEntry ::= SEQUENCE {
69 | dlmodIndex Integer32,
70 | dlmodName DisplayString,
71 | dlmodPath DisplayString,
72 | dlmodError DisplayString,
73 | dlmodStatus INTEGER
74 | }
75 |
76 | dlmodIndex OBJECT-TYPE
77 | SYNTAX Integer32 (1..65535)
78 | MAX-ACCESS not-accessible
79 | STATUS current
80 | DESCRIPTION
81 | "An index that uniqely identifies an entry in the dlmodTable."
82 | ::= { dlmodEntry 1 }
83 |
84 | dlmodName OBJECT-TYPE
85 | SYNTAX DisplayString
86 | MAX-ACCESS read-write
87 | STATUS current
88 | DESCRIPTION
89 | "The module name."
90 | ::= { dlmodEntry 2 }
91 |
92 | dlmodPath OBJECT-TYPE
93 | SYNTAX DisplayString
94 | MAX-ACCESS read-write
95 | STATUS current
96 | DESCRIPTION
97 | "The path of the module executable file."
98 | ::= { dlmodEntry 3 }
99 |
100 | dlmodError OBJECT-TYPE
101 | SYNTAX DisplayString
102 | MAX-ACCESS read-only
103 | STATUS current
104 | DESCRIPTION
105 | "The last error from dlmod_load_module."
106 | ::= { dlmodEntry 4 }
107 |
108 | dlmodStatus OBJECT-TYPE
109 | SYNTAX INTEGER {
110 | loaded(1),
111 | unloaded(2),
112 | error(3),
113 | load(4),
114 | unload(5),
115 | create(6),
116 | delete(7)
117 | }
118 | MAX-ACCESS read-write
119 | STATUS current
120 | DESCRIPTION
121 | "The current status of the loaded module."
122 | ::= { dlmodEntry 5 }
123 |
124 | END
125 |
--------------------------------------------------------------------------------
/test/fixtures/mibs/UCD-IPFWACC-MIB.mib:
--------------------------------------------------------------------------------
1 | UCD-IPFWACC-MIB DEFINITIONS ::= BEGIN
2 |
3 | IMPORTS
4 | OBJECT-TYPE, MODULE-IDENTITY, IpAddress, Integer32, Counter32
5 | FROM SNMPv2-SMI
6 | DisplayString
7 | FROM SNMPv2-TC
8 | ucdExperimental
9 | FROM UCD-SNMP-MIB;
10 |
11 | ucdIpFwAccMIB MODULE-IDENTITY
12 | LAST-UPDATED "9912160000Z"
13 | ORGANIZATION "University of California, Davis"
14 | CONTACT-INFO
15 | "This mib is no longer being maintained by the University of
16 | California and is now in life-support-mode and being
17 | maintained by the net-snmp project. The best place to write
18 | for public questions about the net-snmp-coders mailing list
19 | at net-snmp-coders@lists.sourceforge.net.
20 |
21 | postal: Wes Hardaker
22 | P.O. Box 382
23 | Davis CA 95617
24 |
25 | email: net-snmp-coders@lists.sourceforge.net
26 | "
27 | DESCRIPTION
28 | "This module defines MIB components for reading information
29 | from the accounting rules IP Firewall. This would typically
30 | let you read the rules and the counters. I did not include
31 | some flags and fields that I considered irrelevant for the
32 | accounting rules. Resetting the counters of the rules by SNMP
33 | would be simple, but I don't consider it so useful. I gave no
34 | consideration to implementing write access for allowing
35 | modification of the accounting rules.
36 |
37 | Cristian.Estan@net.utcluj.ro "
38 | REVISION "9912160000Z"
39 | DESCRIPTION
40 | "SMIv2 version converted from an older MIB definition."
41 | ::= { ucdExperimental 1 }
42 |
43 | ipFwAccTable OBJECT-TYPE
44 | SYNTAX SEQUENCE OF IpFwAccEntry
45 | MAX-ACCESS not-accessible
46 | STATUS current
47 | DESCRIPTION
48 | "A table with the accounting rules of the IP firewall"
49 | ::= { ucdIpFwAccMIB 1 }
50 |
51 | ipFwAccEntry OBJECT-TYPE
52 | SYNTAX IpFwAccEntry
53 | MAX-ACCESS not-accessible
54 | STATUS current
55 | DESCRIPTION
56 | "An accounting rule of the IP firewall"
57 | INDEX { ipFwAccIndex }
58 | ::= { ipFwAccTable 1 }
59 |
60 | IpFwAccEntry ::= SEQUENCE {
61 | ipFwAccIndex Integer32,
62 | ipFwAccSrcAddr IpAddress,
63 | ipFwAccSrcNetMask IpAddress,
64 | ipFwAccDstAddr IpAddress,
65 | ipFwAccDstNetMask IpAddress,
66 | ipFwAccViaName DisplayString,
67 | ipFwAccViaAddr IpAddress,
68 | ipFwAccProto INTEGER,
69 | ipFwAccBidir INTEGER,
70 | ipFwAccDir INTEGER,
71 | ipFwAccBytes Counter32,
72 | ipFwAccPackets Counter32,
73 | ipFwAccNrSrcPorts Integer32,
74 | ipFwAccNrDstPorts Integer32,
75 | ipFwAccSrcIsRange INTEGER,
76 | ipFwAccDstIsRange INTEGER,
77 | ipFwAccPort1 Integer32,
78 | ipFwAccPort2 Integer32,
79 | ipFwAccPort3 Integer32,
80 | ipFwAccPort4 Integer32,
81 | ipFwAccPort5 Integer32,
82 | ipFwAccPort6 Integer32,
83 | ipFwAccPort7 Integer32,
84 | ipFwAccPort8 Integer32,
85 | ipFwAccPort9 Integer32,
86 | ipFwAccPort10 Integer32
87 | }
88 |
89 | ipFwAccIndex OBJECT-TYPE
90 | SYNTAX Integer32 (0..2147483647)
91 | MAX-ACCESS read-only
92 | STATUS current
93 | DESCRIPTION
94 | "Reference index for each firewall rule."
95 | ::= { ipFwAccEntry 1 }
96 |
97 | ipFwAccSrcAddr OBJECT-TYPE
98 | SYNTAX IpAddress
99 | MAX-ACCESS read-only
100 | STATUS current
101 | DESCRIPTION
102 | "The source address in the firewall rule."
103 | ::= { ipFwAccEntry 2 }
104 |
105 | ipFwAccSrcNetMask OBJECT-TYPE
106 | SYNTAX IpAddress
107 | MAX-ACCESS read-only
108 | STATUS current
109 | DESCRIPTION
110 | "The netmask of the source address in the firewall rule."
111 | ::= { ipFwAccEntry 3 }
112 |
113 | ipFwAccDstAddr OBJECT-TYPE
114 | SYNTAX IpAddress
115 | MAX-ACCESS read-only
116 | STATUS current
117 | DESCRIPTION
118 | "The destination address in the firewall rule."
119 | ::= { ipFwAccEntry 4 }
120 |
121 | ipFwAccDstNetMask OBJECT-TYPE
122 | SYNTAX IpAddress
123 | MAX-ACCESS read-only
124 | STATUS current
125 | DESCRIPTION
126 | "The netmask of the destination address in the firewall rule."
127 | ::= { ipFwAccEntry 5 }
128 |
129 | ipFwAccViaName OBJECT-TYPE
130 | SYNTAX DisplayString (SIZE(1..64))
131 | MAX-ACCESS read-only
132 | STATUS current
133 | DESCRIPTION
134 | "The name of the interface to which the rule applies. If no
135 | interface is associated with the present rule, this should
136 | contain a dash (-)."
137 | ::= { ipFwAccEntry 6 }
138 |
139 | ipFwAccViaAddr OBJECT-TYPE
140 | SYNTAX IpAddress
141 | MAX-ACCESS read-only
142 | STATUS current
143 | DESCRIPTION
144 | "The address of the interface to which the rule applies.
145 | Using this parameter makes sense when multiple addresses are
146 | associated to the same physical interface. If not defined
147 | for the current rule this should be set to 0."
148 | ::= { ipFwAccEntry 7 }
149 |
150 | ipFwAccProto OBJECT-TYPE
151 | SYNTAX INTEGER {
152 | other(1),
153 | all(2),
154 | tcp(3),
155 | udp(4),
156 | icmp(5)
157 | }
158 | MAX-ACCESS read-only
159 | STATUS current
160 | DESCRIPTION
161 | "The protocol(s) to which the rule applies."
162 | ::= { ipFwAccEntry 8 }
163 |
164 | ipFwAccBidir OBJECT-TYPE
165 | SYNTAX INTEGER {
166 | unidirectional(1),
167 | bidirectional(2)
168 | }
169 | MAX-ACCESS read-only
170 | STATUS current
171 | DESCRIPTION
172 | "Whether the rule works in both directions (i.e. with the
173 | source and destination parts swapped) or not."
174 | ::= { ipFwAccEntry 9 }
175 |
176 | ipFwAccDir OBJECT-TYPE
177 | SYNTAX INTEGER {
178 | both(1),
179 | in(2),
180 | out(3)
181 | }
182 | MAX-ACCESS read-only
183 | STATUS current
184 | DESCRIPTION
185 | "Whether the rule applies to packets entering or exiting the
186 | kernel."
187 | ::= { ipFwAccEntry 10 }
188 |
189 | ipFwAccBytes OBJECT-TYPE
190 | SYNTAX Counter32
191 | MAX-ACCESS read-only
192 | STATUS current
193 | DESCRIPTION
194 | "The number of bytes that matched this rule since the last
195 | reset of the counters."
196 | ::= { ipFwAccEntry 11 }
197 |
198 | ipFwAccPackets OBJECT-TYPE
199 | SYNTAX Counter32
200 | MAX-ACCESS read-only
201 | STATUS current
202 | DESCRIPTION
203 | "The number of packets that matched this rule since the last
204 | reset of the counters."
205 | ::= { ipFwAccEntry 12 }
206 |
207 | ipFwAccNrSrcPorts OBJECT-TYPE
208 | SYNTAX Integer32
209 | MAX-ACCESS read-only
210 | STATUS current
211 | DESCRIPTION
212 | "The number of ports that refer to the source address."
213 | ::= { ipFwAccEntry 13 }
214 |
215 | ipFwAccNrDstPorts OBJECT-TYPE
216 | SYNTAX Integer32
217 | MAX-ACCESS read-only
218 | STATUS current
219 | DESCRIPTION
220 | "The number of ports that refer to the destination address."
221 | ::= { ipFwAccEntry 14 }
222 |
223 | ipFwAccSrcIsRange OBJECT-TYPE
224 | SYNTAX INTEGER {
225 | srchasrange(1),
226 | srchasnorange(2)
227 | }
228 | MAX-ACCESS read-only
229 | STATUS current
230 | DESCRIPTION
231 | "Interpret the first two ports of the source part as
232 | the upper and lower limit of an interval or not."
233 | ::= { ipFwAccEntry 15 }
234 |
235 | ipFwAccDstIsRange OBJECT-TYPE
236 | SYNTAX INTEGER {
237 | dsthasrange(1),
238 | dsthasnorange(2)
239 | }
240 | MAX-ACCESS read-only
241 | STATUS current
242 | DESCRIPTION
243 | "Interpret the first two ports of the destination part as
244 | the upper and lower limit of an interval or not."
245 | ::= { ipFwAccEntry 16 }
246 |
247 | ipFwAccPort1 OBJECT-TYPE
248 | SYNTAX Integer32
249 | MAX-ACCESS read-only
250 | STATUS current
251 | DESCRIPTION
252 | "Port number 1."
253 | ::= { ipFwAccEntry 17 }
254 |
255 | ipFwAccPort2 OBJECT-TYPE
256 | SYNTAX Integer32
257 | MAX-ACCESS read-only
258 | STATUS current
259 | DESCRIPTION
260 | "Port number 2."
261 | ::= { ipFwAccEntry 18 }
262 |
263 | ipFwAccPort3 OBJECT-TYPE
264 | SYNTAX Integer32
265 | MAX-ACCESS read-only
266 | STATUS current
267 | DESCRIPTION
268 | "Port number 3."
269 | ::= { ipFwAccEntry 19 }
270 |
271 | ipFwAccPort4 OBJECT-TYPE
272 | SYNTAX Integer32
273 | MAX-ACCESS read-only
274 | STATUS current
275 | DESCRIPTION
276 | "Port number 4."
277 | ::= { ipFwAccEntry 20 }
278 |
279 | ipFwAccPort5 OBJECT-TYPE
280 | SYNTAX Integer32
281 | MAX-ACCESS read-only
282 | STATUS current
283 | DESCRIPTION
284 | "Port number 5."
285 | ::= { ipFwAccEntry 21 }
286 |
287 | ipFwAccPort6 OBJECT-TYPE
288 | SYNTAX Integer32
289 | MAX-ACCESS read-only
290 | STATUS current
291 | DESCRIPTION
292 | "Port number 6."
293 | ::= { ipFwAccEntry 22 }
294 |
295 | ipFwAccPort7 OBJECT-TYPE
296 | SYNTAX Integer32
297 | MAX-ACCESS read-only
298 | STATUS current
299 | DESCRIPTION
300 | "Port number 7."
301 | ::= { ipFwAccEntry 23 }
302 |
303 | ipFwAccPort8 OBJECT-TYPE
304 | SYNTAX Integer32
305 | MAX-ACCESS read-only
306 | STATUS current
307 | DESCRIPTION
308 | "Port number 8."
309 | ::= { ipFwAccEntry 24 }
310 |
311 | ipFwAccPort9 OBJECT-TYPE
312 | SYNTAX Integer32
313 | MAX-ACCESS read-only
314 | STATUS current
315 | DESCRIPTION
316 | "Port number 9."
317 | ::= { ipFwAccEntry 25 }
318 |
319 | ipFwAccPort10 OBJECT-TYPE
320 | SYNTAX Integer32
321 | MAX-ACCESS read-only
322 | STATUS current
323 | DESCRIPTION
324 | "Port number 10."
325 | ::= { ipFwAccEntry 26 }
326 |
327 | END
328 |
--------------------------------------------------------------------------------
/test/snmp/discovery_agent_test.exs:
--------------------------------------------------------------------------------
1 | defmodule SNMP.DiscoveryAgent.Test do
2 | use ExUnit.Case, async: false
3 |
4 | alias SNMP.DiscoveryAgent
5 |
6 | defp setup_start_agent(context) do
7 | DiscoveryAgent.start_link()
8 |
9 | context
10 | end
11 |
12 | describe "discover engine id" do
13 | setup [:setup_start_agent]
14 |
15 | test "agent engine id" do
16 | uri = URI.parse("snmp://127.0.0.1:6000")
17 |
18 | expected =
19 | :binary.bin_to_list(SNMP.Utility.local_engine_id())
20 |
21 | assert DiscoveryAgent.discover_engine_id(uri) ==
22 | {:ok, expected}
23 | end
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/test/snmp/mib_test.exs:
--------------------------------------------------------------------------------
1 | defmodule SNMP.MIB.Test do
2 | use ExUnit.Case, async: false
3 | doctest SNMP.MIB
4 |
5 | import SNMP.MIB
6 |
7 | @moduletag :integrated
8 |
9 | @tmp_dir "test/mib_tmp"
10 | @fixtures_dir "test/fixtures"
11 |
12 | setup do
13 | on_exit(fn ->
14 | File.rm_rf!(@tmp_dir)
15 | end)
16 | end
17 |
18 | test """
19 | Compiles all good and patched SNMP MIBs in directory
20 | without errors
21 | """ do
22 | File.cp_r!("#{@fixtures_dir}/mibs", @tmp_dir)
23 |
24 | results = compile_all(@tmp_dir)
25 |
26 | mib_files =
27 | Enum.map(
28 | results,
29 | fn {f, _} -> :binary.bin_to_list(f) end
30 | )
31 |
32 | assert Enum.all?(results, fn {_, {a, _}} ->
33 | a == :ok
34 | end)
35 |
36 | assert :snmpc.is_consistent(mib_files) == :ok
37 | end
38 |
39 | test "Fails to compile broken SNMP MIBs" do
40 | File.cp_r!("#{@fixtures_dir}/broken_mibs", @tmp_dir)
41 |
42 | results = compile_all(@tmp_dir)
43 |
44 | assert Enum.all?(results, fn {_, {a, _}} ->
45 | a != :ok
46 | end)
47 | end
48 | end
49 |
--------------------------------------------------------------------------------
/test/snmp/utility_test.exs:
--------------------------------------------------------------------------------
1 | defmodule SNMP.Utility.Test do
2 | use ExUnit.Case
3 |
4 | import SNMP.Utility
5 |
6 | # Takes a strict poset, here represented as a Hasse diagram,
7 | #
8 | # a d
9 | # / \ /
10 | # b c e
11 | #
12 | # to
13 | #
14 | # [[b, c, e], [a, d]]
15 | #
16 | test """
17 | Partitions a strict poset as maximal antichains of
18 | minimal elements
19 | """ do
20 | adjacencies = %{:e => [], :b => [:d, :a], :c => [:a]}
21 |
22 | # Since `topological_sort` does not guarantee an order
23 | # on elements of antichains (which are, by definition,
24 | # without order), we sort them, here, for convenience.
25 | sorted_antichains =
26 | adjacencies
27 | |> topological_sort
28 | |> Enum.map(&Enum.sort/1)
29 |
30 | assert sorted_antichains == [
31 | [:b, :c, :e],
32 | [:a, :d],
33 | ]
34 | end
35 |
36 | # Raises on
37 | #
38 | # :a<----:c
39 | # \ ^
40 | # \ |
41 | # '->:b
42 | #
43 | test "Raises when a cycle is detected" do
44 | adjacencies = %{:a => [:c], :b => [:a], :c => [:b]}
45 |
46 | # Again, the indifference of `topological sort` to tests
47 | # causes us some difficulties, here. Should we ever wish
48 | # to test for cycles of length greater than 3, the
49 | # result of `topological_sort` should itself be revised.
50 | assert_raise RuntimeError,
51 | ~r"^detected cycle in subset: \[(:a, :b, :c|:b, :c, :a|:c, :a, :b)\]$",
52 | fn -> topological_sort(adjacencies) end
53 |
54 | end
55 | end
56 |
--------------------------------------------------------------------------------
/test/test_helper.exs:
--------------------------------------------------------------------------------
1 | ExUnit.start()
2 |
3 | ExUnit.configure(exclude: [:expensive, :integrated])
4 |
--------------------------------------------------------------------------------