aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--erts/doc/src/erlang.xml4
-rw-r--r--erts/emulator/beam/ops.tab2
-rw-r--r--erts/emulator/beam/packet_parser.c2
-rw-r--r--erts/emulator/test/decode_packet_SUITE.erl3
-rw-r--r--lib/diameter/test/diameter.cover12
-rw-r--r--lib/erl_interface/doc/src/ei.xml25
-rw-r--r--lib/erl_interface/include/ei.h23
-rw-r--r--lib/erl_interface/src/decode/decode_atom.c14
-rw-r--r--lib/erl_interface/src/decode/decode_fun.c39
-rw-r--r--lib/erl_interface/src/decode/decode_pid.c10
-rw-r--r--lib/erl_interface/src/decode/decode_port.c10
-rw-r--r--lib/erl_interface/src/decode/decode_ref.c23
-rw-r--r--lib/erl_interface/src/decode/decode_skip.c3
-rw-r--r--lib/erl_interface/src/decode/decode_trace.c28
-rw-r--r--lib/erl_interface/src/encode/encode_atom.c10
-rw-r--r--lib/erl_interface/src/legacy/erl_eterm.c2
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c6
-rw-r--r--lib/erl_interface/src/misc/ei_x_encode.c8
-rw-r--r--lib/erl_interface/src/misc/putget.h8
-rw-r--r--lib/erl_interface/src/prog/ei_fake_prog.c2
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c10
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c35
-rw-r--r--lib/snmp/.gitignore4
-rw-r--r--lib/snmp/doc/src/notes.xml75
-rw-r--r--lib/snmp/src/app/snmp.appup.src8
-rw-r--r--lib/snmp/src/compile/snmpc.erl69
-rw-r--r--lib/snmp/src/compile/snmpc_lib.erl42
-rw-r--r--lib/snmp/src/compile/snmpc_mib_gram.yrl48
-rw-r--r--lib/snmp/test/snmp_compiler_test.erl55
-rw-r--r--lib/snmp/test/snmp_test_data/OTP10799-MIB.mib75
-rw-r--r--lib/snmp/test/snmp_test_data/OTP10808-MIB.mib137
-rw-r--r--lib/snmp/test/test-mibs/ALARM-MIB.mib1214
-rw-r--r--lib/snmp/test/test-mibs/RFC1271-MIB.mib3
-rw-r--r--lib/snmp/test/test-mibs/RMON2-MIB.mib2
-rw-r--r--lib/snmp/vsn.mk4
35 files changed, 1860 insertions, 155 deletions
diff --git a/erts/doc/src/erlang.xml b/erts/doc/src/erlang.xml
index b336a135e7..7804a7498e 100644
--- a/erts/doc/src/erlang.xml
+++ b/erts/doc/src/erlang.xml
@@ -592,7 +592,9 @@ false</pre>
request, a response, a header or an end of header
mark. Invalid lines are returned as <c><anno>HttpError</anno></c>.</p>
<p>Recognized request methods and header fields are returned as atoms.
- Others are returned as strings.</p>
+ Others are returned as strings. Strings of unrecognized header fields
+ are formatted with only capital letters first and after hyphen characters
+ (like <c>"Sec-Websocket-Key"</c>).</p>
<p>The protocol type <c>http</c> should only be used for
the first line when a <c><anno>HttpRequest</anno></c> or a
<c><anno>HttpResponse</anno></c> is expected. The following calls
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 6764e88c81..8a79b4910e 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1021,7 +1021,7 @@ bif0 u$bif:erlang:node/0 Dst=d => node Dst
bif1 Fail Bif=u$bif:erlang:get/1 Src=s Dst=d => i_get Src Dst
-bif2 Jump=j u$bif:erlang:element/2 S1=s S2=s Dst=d => gen_element(Jump, S1, S2, Dst)
+bif2 Jump=j u$bif:erlang:element/2 S1=s S2=rxy Dst=d => gen_element(Jump, S1, S2, Dst)
bif1 Fail Bif Literal=q Dst => move Literal x | bif1 Fail Bif x Dst
bif1 p Bif S1 Dst => bif1_body Bif S1 Dst
diff --git a/erts/emulator/beam/packet_parser.c b/erts/emulator/beam/packet_parser.c
index 1e301e3593..7c9b2d444a 100644
--- a/erts/emulator/beam/packet_parser.c
+++ b/erts/emulator/beam/packet_parser.c
@@ -67,7 +67,7 @@ static int my_strncasecmp(const char *s1, const char *s2, size_t n)
#define HTTP_HDR_HASH_SIZE 53
#define HTTP_METH_HASH_SIZE 13
-#define HTTP_MAX_NAME_LEN 20
+#define HTTP_MAX_NAME_LEN 50
static char tspecial[128];
diff --git a/erts/emulator/test/decode_packet_SUITE.erl b/erts/emulator/test/decode_packet_SUITE.erl
index 4acbe8c6e0..1714551e15 100644
--- a/erts/emulator/test/decode_packet_SUITE.erl
+++ b/erts/emulator/test/decode_packet_SUITE.erl
@@ -403,6 +403,9 @@ http_request(Msg) ->
{"Other-Field: with some text\r\n",
{http_header,0, "Other-Field" ,undefined, "with some text"},
{http_header,0,<<"Other-Field">>,undefined,<<"with some text">>}},
+ {"Make-sure-a-LONG-HEaDer-fIeLd-is-fORMATTED-NicelY: with some text\r\n",
+ {http_header,0, "Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely" ,undefined, "with some text"},
+ {http_header,0,<<"Make-Sure-A-Long-Header-Field-Is-Formatted-Nicely">>,undefined,<<"with some text">>}},
{"Multi-Line: Once upon a time in a land far far away,\r\n"
" there lived a princess imprisoned in the highest tower\r\n"
" of the most haunted castle.\r\n",
diff --git a/lib/diameter/test/diameter.cover b/lib/diameter/test/diameter.cover
index 5fde6c7d01..6586733871 100644
--- a/lib/diameter/test/diameter.cover
+++ b/lib/diameter/test/diameter.cover
@@ -1,6 +1,8 @@
-%% -*- erlang -*-
-{exclude,
- [
- ]
-}.
+{incl_app,diameter,details}.
+{excl_mods, diameter,
+ [diameter_dbg,
+ diameter_info,
+ diameter_etcp,
+ diameter_etcp_sup]
+}.
diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index 03eea49224..dfe181bd1d 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -86,18 +86,21 @@
<title>DATA TYPES</title>
<taglist>
- <tag><marker id="erlang_char_encoding"/>enum erlang_char_encoding</tag>
+ <tag><marker id="erlang_char_encoding"/>erlang_char_encoding</tag>
<item>
<p/>
<code type="none">
-enum erlang_char_encoding {
- ERLANG_ASCII, ERLANG_LATIN1, ERLANG_UTF8
-};
+typedef enum {
+ ERLANG_ASCII = 1,
+ ERLANG_LATIN1 = 2,
+ ERLANG_UTF8 = 4
+}erlang_char_encoding;
</code>
- <p>The character encoding used for atoms. <c>ERLANG_ASCII</c> represents 7-bit ASCII.
+ <p>The character encodings used for atoms. <c>ERLANG_ASCII</c> represents 7-bit ASCII.
Latin1 and UTF8 are different extensions of 7-bit ASCII. All 7-bit ASCII characters
are valid Latin1 and UTF8 characters. ASCII and Latin1 both represent each character
- by one byte. A UTF8 character can consist of one to four bytes.</p>
+ by one byte. A UTF8 character can consist of one to four bytes. Note that these
+ constants are bit-flags and can be combined with bitwise-or.</p>
</item>
</taglist>
</section>
@@ -250,10 +253,10 @@ enum erlang_char_encoding {
</desc>
</func>
<func>
- <name><ret>int</ret><nametext>ei_encode_atom_as(char *buf, int *index, const char *p, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)</nametext></name>
- <name><ret>int</ret><nametext>ei_encode_atom_len_as(char *buf, int *index, const char *p, int len, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)</nametext></name>
- <name><ret>int</ret><nametext>ei_x_encode_atom_as(ei_x_buff* x, const char *p, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)</nametext></name>
- <name><ret>int</ret><nametext>ei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, enum erlang_char_encoding from_enc, enum erlang_char_encoding to_enc)</nametext></name>
+ <name><ret>int</ret><nametext>ei_encode_atom_as(char *buf, int *index, const char *p, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
+ <name><ret>int</ret><nametext>ei_encode_atom_len_as(char *buf, int *index, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
+ <name><ret>int</ret><nametext>ei_x_encode_atom_as(ei_x_buff* x, const char *p, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
+ <name><ret>int</ret><nametext>ei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
<fsummary>Encode an atom</fsummary>
<desc>
<p>Encodes an atom in the binary format with character encoding
@@ -534,7 +537,7 @@ ei_x_encode_empty_list(&amp;x);
</desc>
</func>
<func>
- <name><ret>int</ret><nametext>ei_decode_atom_as(const char *buf, int *index, char *p, int plen, enum erlang_char_encoding want, enum erlang_char_encoding* was, enum erlang_char_encoding* result)</nametext></name>
+ <name><ret>int</ret><nametext>ei_decode_atom_as(const char *buf, int *index, char *p, int plen, erlang_char_encoding want, erlang_char_encoding* was, erlang_char_encoding* result)</nametext></name>
<fsummary>Decode an atom</fsummary>
<desc>
<p>This function decodes an atom from the binary format. The
diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h
index 29d53ab3a2..66dc64a69d 100644
--- a/lib/erl_interface/include/ei.h
+++ b/lib/erl_interface/include/ei.h
@@ -190,17 +190,16 @@ extern volatile int __erl_errno;
#define MAXATOMLEN_UTF8 (255*4 + 1)
#define MAXNODELEN EI_MAXALIVELEN+1+EI_MAXHOSTNAMELEN
-enum erlang_char_encoding {
+typedef enum {
ERLANG_ASCII = 1,
ERLANG_LATIN1 = 2,
ERLANG_UTF8 = 4,
- ERLANG_ANY = ERLANG_ASCII|ERLANG_LATIN1|ERLANG_UTF8
-};
+}erlang_char_encoding;
/* a pid */
typedef struct {
char node[MAXATOMLEN_UTF8];
- enum erlang_char_encoding node_org_enc;
+ erlang_char_encoding node_org_enc;
unsigned int num;
unsigned int serial;
unsigned int creation;
@@ -209,7 +208,7 @@ typedef struct {
/* a port */
typedef struct {
char node[MAXATOMLEN_UTF8];
- enum erlang_char_encoding node_org_enc;
+ erlang_char_encoding node_org_enc;
unsigned int id;
unsigned int creation;
} erlang_port;
@@ -217,7 +216,7 @@ typedef struct {
/* a ref */
typedef struct {
char node[MAXATOMLEN_UTF8];
- enum erlang_char_encoding node_org_enc;
+ erlang_char_encoding node_org_enc;
int len;
unsigned int n[3];
unsigned int creation;
@@ -246,7 +245,7 @@ typedef struct {
typedef struct {
long arity;
char module[MAXATOMLEN_UTF8];
- enum erlang_char_encoding module_org_enc;
+ erlang_char_encoding module_org_enc;
char md5[16];
long index;
long old_index;
@@ -441,16 +440,16 @@ int ei_x_encode_string(ei_x_buff* x, const char* s);
int ei_x_encode_string_len(ei_x_buff* x, const char* s, int len);
int ei_encode_atom(char *buf, int *index, const char *p);
int ei_encode_atom_as(char *buf, int *index, const char *p,
- enum erlang_char_encoding from, enum erlang_char_encoding to);
+ erlang_char_encoding from, erlang_char_encoding to);
int ei_encode_atom_len(char *buf, int *index, const char *p, int len);
int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
- enum erlang_char_encoding from, enum erlang_char_encoding to);
+ erlang_char_encoding from, erlang_char_encoding to);
int ei_x_encode_atom(ei_x_buff* x, const char* s);
int ei_x_encode_atom_as(ei_x_buff* x, const char* s,
- enum erlang_char_encoding from, enum erlang_char_encoding to);
+ erlang_char_encoding from, erlang_char_encoding to);
int ei_x_encode_atom_len(ei_x_buff* x, const char* s, int len);
int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len,
- enum erlang_char_encoding from, enum erlang_char_encoding to);
+ erlang_char_encoding from, erlang_char_encoding to);
int ei_encode_binary(char *buf, int *index, const void *p, long len);
int ei_x_encode_binary(ei_x_buff* x, const void* s, int len);
int ei_encode_pid(char *buf, int *index, const erlang_pid *p);
@@ -500,7 +499,7 @@ int ei_decode_boolean(const char *buf, int *index, int *p);
int ei_decode_char(const char *buf, int *index, char *p);
int ei_decode_string(const char *buf, int *index, char *p);
int ei_decode_atom(const char *buf, int *index, char *p);
-int ei_decode_atom_as(const char *buf, int *index, char *p, int destlen, enum erlang_char_encoding want, enum erlang_char_encoding* was, enum erlang_char_encoding* result);
+int ei_decode_atom_as(const char *buf, int *index, char *p, int destlen, erlang_char_encoding want, erlang_char_encoding* was, erlang_char_encoding* result);
int ei_decode_binary(const char *buf, int *index, void *p, long *len);
int ei_decode_fun(const char* buf, int* index, erlang_fun* p);
void free_fun(erlang_fun* f);
diff --git a/lib/erl_interface/src/decode/decode_atom.c b/lib/erl_interface/src/decode/decode_atom.c
index af4fc114d1..44fd4df12c 100644
--- a/lib/erl_interface/src/decode/decode_atom.c
+++ b/lib/erl_interface/src/decode/decode_atom.c
@@ -28,14 +28,14 @@ int ei_decode_atom(const char *buf, int *index, char *p)
}
int ei_decode_atom_as(const char *buf, int *index, char* p, int destlen,
- enum erlang_char_encoding want_enc,
- enum erlang_char_encoding* was_encp,
- enum erlang_char_encoding* res_encp)
+ erlang_char_encoding want_enc,
+ erlang_char_encoding* was_encp,
+ erlang_char_encoding* res_encp)
{
const char *s = buf + *index;
const char *s0 = s;
int len;
- enum erlang_char_encoding got_enc;
+ erlang_char_encoding got_enc;
switch (get8(s)) {
case ERL_ATOM_EXT:
@@ -92,7 +92,7 @@ int ei_decode_atom_as(const char *buf, int *index, char* p, int destlen,
int utf8_to_latin1(char* dst, const char* src, int slen, int destlen,
- enum erlang_char_encoding* res_encp)
+ erlang_char_encoding* res_encp)
{
const char* const dst_start = dst;
const char* const dst_end = dst + destlen;
@@ -128,7 +128,7 @@ int utf8_to_latin1(char* dst, const char* src, int slen, int destlen,
}
int latin1_to_utf8(char* dst, const char* src, int slen, int destlen,
- enum erlang_char_encoding* res_encp)
+ erlang_char_encoding* res_encp)
{
const char* const src_end = src + slen;
const char* const dst_start = dst;
@@ -163,7 +163,7 @@ int latin1_to_utf8(char* dst, const char* src, int slen, int destlen,
int ei_internal_get_atom(const char** bufp, char* p,
- enum erlang_char_encoding* was_encp)
+ erlang_char_encoding* was_encp)
{
int ix = 0;
if (ei_decode_atom_as(*bufp, &ix, p, MAXATOMLEN_UTF8, ERLANG_UTF8, was_encp, NULL) < 0)
diff --git a/lib/erl_interface/src/decode/decode_fun.c b/lib/erl_interface/src/decode/decode_fun.c
index c4667822e5..2adaedb825 100644
--- a/lib/erl_interface/src/decode/decode_fun.c
+++ b/lib/erl_interface/src/decode/decode_fun.c
@@ -30,6 +30,25 @@ int ei_decode_fun(const char *buf, int *index, erlang_fun *p)
const char *s = buf + *index;
const char *s0 = s;
int i, ix, ix0, n;
+ erlang_pid* p_pid;
+ char* p_module;
+ enum erlang_char_encoding* p_module_org_enc;
+ long* p_index;
+ long* p_uniq;
+ long* p_old_index;
+
+ if (p != NULL) {
+ p_pid = &p->pid;
+ p_module = &p->module[0];
+ p_module_org_enc = &p->module_org_enc;
+ p_index = &p->index;
+ p_uniq = &p->uniq;
+ p_old_index = &p->old_index;
+ }
+ else {
+ p_pid = NULL; p_module = NULL; p_module_org_enc = NULL;
+ p_index = NULL; p_uniq = NULL; p_old_index = NULL;
+ }
switch (get8(s)) {
case ERL_FUN_EXT:
@@ -39,17 +58,17 @@ int ei_decode_fun(const char *buf, int *index, erlang_fun *p)
n = get32be(s);
/* then the pid */
ix = 0;
- if (ei_decode_pid(s, &ix, (p == NULL ? (erlang_pid*)NULL : &p->pid)) < 0)
+ if (ei_decode_pid(s, &ix, p_pid) < 0)
return -1;
/* then the module (atom) */
- if (ei_decode_atom_as(s, &ix, (p == NULL ? (char*)NULL : p->module),
- MAXATOMLEN_UTF8, ERLANG_UTF8, &p->module_org_enc, NULL) < 0)
+ if (ei_decode_atom_as(s, &ix, p_module, MAXATOMLEN_UTF8, ERLANG_UTF8,
+ p_module_org_enc, NULL) < 0)
return -1;
/* then the index */
- if (ei_decode_long(s, &ix, (p == NULL ? (long*)NULL : &p->index)) < 0)
+ if (ei_decode_long(s, &ix, p_index) < 0)
return -1;
/* then the uniq */
- if (ei_decode_long(s, &ix, (p == NULL ? (long*)NULL : &p->uniq)) < 0)
+ if (ei_decode_long(s, &ix, p_uniq) < 0)
return -1;
/* finally the free vars */
ix0 = ix;
@@ -85,17 +104,17 @@ int ei_decode_fun(const char *buf, int *index, erlang_fun *p)
if (p != NULL) p->n_free_vars = i;
/* then the module (atom) */
ix = 0;
- if (ei_decode_atom_as(s, &ix, (p == NULL ? (char*)NULL : p->module),
- MAXATOMLEN_UTF8, ERLANG_UTF8, &p->module_org_enc, NULL) < 0)
+ if (ei_decode_atom_as(s, &ix, p_module, MAXATOMLEN_UTF8, ERLANG_UTF8,
+ p_module_org_enc, NULL) < 0)
return -1;
/* then the old_index */
- if (ei_decode_long(s, &ix, (p == NULL ? (long*)NULL : &p->old_index)) < 0)
+ if (ei_decode_long(s, &ix, p_old_index) < 0)
return -1;
/* then the old_uniq */
- if (ei_decode_long(s, &ix, (p == NULL ? (long*)NULL : &p->uniq)) < 0)
+ if (ei_decode_long(s, &ix, p_uniq) < 0)
return -1;
/* the the pid */
- if (ei_decode_pid(s, &ix, (p == NULL ? (erlang_pid*)NULL : &p->pid)) < 0)
+ if (ei_decode_pid(s, &ix, p_pid) < 0)
return -1;
/* finally the free vars */
s += ix;
diff --git a/lib/erl_interface/src/decode/decode_pid.c b/lib/erl_interface/src/decode/decode_pid.c
index 67ce7e05f9..d429fb2fd8 100644
--- a/lib/erl_interface/src/decode/decode_pid.c
+++ b/lib/erl_interface/src/decode/decode_pid.c
@@ -29,16 +29,16 @@ int ei_decode_pid(const char *buf, int *index, erlang_pid *p)
if (get8(s) != ERL_PID_EXT) return -1;
- /* first the nodename */
- if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
-
- /* now the numbers: num (4), serial (4), creation (1) */
if (p) {
+ if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
p->num = get32be(s) & 0x7fff; /* 15 bits */
p->serial = get32be(s) & 0x1fff; /* 13 bits */
p->creation = get8(s) & 0x03; /* 2 bits */
}
- else s+= 9;
+ else {
+ if (get_atom(&s, NULL, NULL) < 0) return -1;
+ s+= 9;
+ }
*index += s-s0;
diff --git a/lib/erl_interface/src/decode/decode_port.c b/lib/erl_interface/src/decode/decode_port.c
index 2d1b46e705..7a691f0be6 100644
--- a/lib/erl_interface/src/decode/decode_port.c
+++ b/lib/erl_interface/src/decode/decode_port.c
@@ -28,15 +28,15 @@ int ei_decode_port(const char *buf, int *index, erlang_port *p)
if (get8(s) != ERL_PORT_EXT) return -1;
- /* first the nodename */
- if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
-
- /* now the numbers: num (4), creation (1) */
if (p) {
+ if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
p->id = get32be(s) & 0x0fffffff /* 28 bits */;
p->creation = get8(s) & 0x03;
}
- else s += 5;
+ else {
+ if (get_atom(&s, NULL, NULL) < 0) return -1;
+ s += 5;
+ }
*index += s-s0;
diff --git a/lib/erl_interface/src/decode/decode_ref.c b/lib/erl_interface/src/decode/decode_ref.c
index 579371ed7d..01e3061cb4 100644
--- a/lib/erl_interface/src/decode/decode_ref.c
+++ b/lib/erl_interface/src/decode/decode_ref.c
@@ -30,17 +30,16 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p)
switch (get8(s)) {
case ERL_REFERENCE_EXT:
-
- /* nodename */
- if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
-
- /* now the numbers: num (4), creation (1) */
if (p) {
+ if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
p->n[0] = get32be(s);
p->len = 1;
p->creation = get8(s) & 0x03;
}
- else s += 5;
+ else {
+ if (get_atom(&s, NULL, NULL) < 0) return -1;
+ s += 5;
+ }
*index += s-s0;
@@ -50,16 +49,16 @@ int ei_decode_ref(const char *buf, int *index, erlang_ref *p)
case ERL_NEW_REFERENCE_EXT:
/* first the integer count */
count = get16be(s);
- if (p) p->len = count;
- /* then the nodename */
- if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
-
- /* creation */
if (p) {
+ p->len = count;
+ if (get_atom(&s, p->node, &p->node_org_enc) < 0) return -1;
p->creation = get8(s) & 0x03;
}
- else s += 1;
+ else {
+ if (get_atom(&s, NULL, NULL) < 0) return -1;
+ s += 1;
+ }
/* finally the id integers */
if (p) {
diff --git a/lib/erl_interface/src/decode/decode_skip.c b/lib/erl_interface/src/decode/decode_skip.c
index f6c5d861ab..e2bfe1f802 100644
--- a/lib/erl_interface/src/decode/decode_skip.c
+++ b/lib/erl_interface/src/decode/decode_skip.c
@@ -30,7 +30,8 @@ int ei_skip_term(const char* buf, int* index)
switch (ty) {
case ERL_ATOM_EXT:
/* FIXME: what if some weird locale is in use? */
- if (ei_decode_atom(buf, index, NULL) < 0) return -1;
+ if (ei_decode_atom_as(buf, index, NULL, MAXATOMLEN_UTF8, (ERLANG_LATIN1|ERLANG_UTF8),
+ NULL, NULL) < 0) return -1;
break;
case ERL_PID_EXT:
if (ei_decode_pid(buf, index, NULL) < 0) return -1;
diff --git a/lib/erl_interface/src/decode/decode_trace.c b/lib/erl_interface/src/decode/decode_trace.c
index ebaa78e29e..88fb3451ec 100644
--- a/lib/erl_interface/src/decode/decode_trace.c
+++ b/lib/erl_interface/src/decode/decode_trace.c
@@ -22,18 +22,30 @@
int ei_decode_trace(const char *buf, int *index, erlang_trace *p)
{
int arity = 0;
- int tindex = *index;
-
- /* use a temporary index if any function should fail */
+ int tindex = *index; /* use a temporary index if any function should fail */
+ long *p_flags, *p_label, *p_serial, *p_prev;
+ erlang_pid *p_from;
+
+ if (p != NULL) {
+ p_flags = &p->flags;
+ p_label = &p->label;
+ p_serial = &p->serial;
+ p_prev = &p->prev;
+ p_from = &p->from;
+ }
+ else {
+ p_flags = p_label = p_serial = p_prev = NULL;
+ p_from = NULL;
+ }
/* { Flags, Label, Serial, FromPid, Prev } */
if (ei_decode_tuple_header(buf, &tindex, &arity)
|| (arity != 5)
- || ei_decode_long(buf, &tindex, &p->flags)
- || ei_decode_long(buf, &tindex, &p->label)
- || ei_decode_long(buf, &tindex, &p->serial)
- || ei_decode_pid( buf, &tindex, &p->from)
- || ei_decode_long(buf, &tindex, &p->prev)) return -1;
+ || ei_decode_long(buf, &tindex, p_flags)
+ || ei_decode_long(buf, &tindex, p_label)
+ || ei_decode_long(buf, &tindex, p_serial)
+ || ei_decode_pid( buf, &tindex, p_from)
+ || ei_decode_long(buf, &tindex, p_prev)) return -1;
/* index is updated by the functions we called */
diff --git a/lib/erl_interface/src/encode/encode_atom.c b/lib/erl_interface/src/encode/encode_atom.c
index 32f5ae2af1..df4b0af5db 100644
--- a/lib/erl_interface/src/encode/encode_atom.c
+++ b/lib/erl_interface/src/encode/encode_atom.c
@@ -45,15 +45,15 @@ int ei_encode_atom_len(char *buf, int *index, const char *p, int len)
}
int ei_encode_atom_as(char *buf, int *index, const char *p,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
return ei_encode_atom_len_as(buf, index, p, strlen(p), from_enc, to_enc);
}
int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
char *s = buf + *index;
char *s0 = s;
@@ -138,7 +138,7 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
int
ei_internal_put_atom(char** bufp, const char* p, int slen,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding to_enc)
{
int ix = 0;
if (ei_encode_atom_len_as(*bufp, &ix, p, slen, ERLANG_UTF8, to_enc) < 0)
diff --git a/lib/erl_interface/src/legacy/erl_eterm.c b/lib/erl_interface/src/legacy/erl_eterm.c
index 9e778a299e..7ca4f430de 100644
--- a/lib/erl_interface/src/legacy/erl_eterm.c
+++ b/lib/erl_interface/src/legacy/erl_eterm.c
@@ -154,7 +154,7 @@ ETERM *erl_mk_atom (const char *s)
char* erl_atom_ptr_latin1(Erl_Atom_data* a)
{
if (a->latin1 == NULL) {
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
a->lenL = utf8_to_latin1(NULL, a->utf8, a->lenU, a->lenU, &enc);
if (a->lenL < 0) {
a->lenL = 0;
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index c051c3a597..e207b5f0f1 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -660,7 +660,7 @@ static int read_atom(unsigned char** ext, Erl_Atom_data* a)
{
char buf[MAXATOMLEN_UTF8];
int offs = 0;
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
int ret = ei_decode_atom_as((char*)*ext, &offs, buf, MAXATOMLEN_UTF8,
ERLANG_LATIN1|ERLANG_UTF8, NULL, &enc);
*ext += offs;
@@ -1423,8 +1423,8 @@ static int cmpbytes(unsigned char* s1,int l1,unsigned char* s2,int l2)
static int cmpatoms(unsigned char* s1, int l1, unsigned char tag1,
unsigned char* s2, int l2, unsigned char tag2)
{
- enum erlang_char_encoding enc1 = tag2enc(tag1);
- enum erlang_char_encoding enc2 = tag2enc(tag2);
+ erlang_char_encoding enc1 = tag2enc(tag1);
+ erlang_char_encoding enc2 = tag2enc(tag2);
if (enc1 == enc2) {
return cmpbytes(s1, l1,s2,l2);
diff --git a/lib/erl_interface/src/misc/ei_x_encode.c b/lib/erl_interface/src/misc/ei_x_encode.c
index 4e6f4a1d36..14d0b56b8f 100644
--- a/lib/erl_interface/src/misc/ei_x_encode.c
+++ b/lib/erl_interface/src/misc/ei_x_encode.c
@@ -217,15 +217,15 @@ int ei_x_encode_atom_len(ei_x_buff* x, const char* s, int len)
}
int ei_x_encode_atom_as(ei_x_buff* x, const char* s,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
return ei_x_encode_atom_len_as(x, s, strlen(s), from_enc, to_enc);
}
int ei_x_encode_atom_len_as(ei_x_buff* x, const char* s, int len,
- enum erlang_char_encoding from_enc,
- enum erlang_char_encoding to_enc)
+ erlang_char_encoding from_enc,
+ erlang_char_encoding to_enc)
{
int i = x->index;
if (ei_encode_atom_len_as(NULL, &i, s, len, from_enc, to_enc) == -1)
diff --git a/lib/erl_interface/src/misc/putget.h b/lib/erl_interface/src/misc/putget.h
index 587bf1a0f8..c751e03093 100644
--- a/lib/erl_interface/src/misc/putget.h
+++ b/lib/erl_interface/src/misc/putget.h
@@ -105,10 +105,10 @@
((EI_ULONGLONG)((unsigned char *)(s))[-2] << 8) | \
(EI_ULONGLONG)((unsigned char *)(s))[-1]))
-int utf8_to_latin1(char* dst, const char* src, int slen, int destlen, enum erlang_char_encoding* res_encp);
-int latin1_to_utf8(char* dst, const char* src, int slen, int destlen, enum erlang_char_encoding* res_encp);
-int ei_internal_get_atom(const char** bufp, char* p, enum erlang_char_encoding*);
-int ei_internal_put_atom(char** bufp, const char* p, int slen, enum erlang_char_encoding);
+int utf8_to_latin1(char* dst, const char* src, int slen, int destlen, erlang_char_encoding* res_encp);
+int latin1_to_utf8(char* dst, const char* src, int slen, int destlen, erlang_char_encoding* res_encp);
+int ei_internal_get_atom(const char** bufp, char* p, erlang_char_encoding*);
+int ei_internal_put_atom(char** bufp, const char* p, int slen, erlang_char_encoding);
#define get_atom ei_internal_get_atom
#define put_atom ei_internal_put_atom
diff --git a/lib/erl_interface/src/prog/ei_fake_prog.c b/lib/erl_interface/src/prog/ei_fake_prog.c
index 52a46fc341..56d4eb7db4 100644
--- a/lib/erl_interface/src/prog/ei_fake_prog.c
+++ b/lib/erl_interface/src/prog/ei_fake_prog.c
@@ -96,7 +96,7 @@ int main(void)
EI_ULONGLONG *ulonglongp = (EI_ULONGLONG*)NULL;
EI_ULONGLONG ulonglongx = 0;
#endif
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
intx = erl_errno;
diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
index 6db04aa676..f5c8c4fa7d 100644
--- a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
+++ b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
@@ -40,10 +40,12 @@
err, size1, SIZE, (EI_LONGLONG)p);
#endif
+#define ERLANG_ANY (ERLANG_ASCII|ERLANG_LATIN1|ERLANG_UTF8)
+
struct my_atom {
- enum erlang_char_encoding from;
- enum erlang_char_encoding was_check;
- enum erlang_char_encoding result_check;
+ erlang_char_encoding from;
+ erlang_char_encoding was_check;
+ erlang_char_encoding result_check;
};
/* Allow arrays constants to be part of macro arguments */
@@ -668,7 +670,7 @@ TESTCASE(test_ei_decode_utf8_atom)
int ei_decode_my_atom_as(const char *buf, int *index, char *to,
struct my_atom *atom) {
- enum erlang_char_encoding was,result;
+ erlang_char_encoding was,result;
int res = ei_decode_atom_as(buf,index,to,1024,atom->from,&was,&result);
if (res != 0)
return res;
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
index 996d923ffc..317e5edecd 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE_data/ei_decode_encode_test.c
@@ -47,12 +47,13 @@ struct Type {
typedef struct
{
char name[MAXATOMLEN_UTF8];
- enum erlang_char_encoding enc;
+ erlang_char_encoding enc;
}my_atom;
int ei_decode_my_atom(const char *buf, int *index, my_atom* a)
{
- return ei_decode_atom_as(buf, index, a->name, sizeof(a->name), ERLANG_UTF8, &a->enc, NULL);
+ return ei_decode_atom_as(buf, index, (a ? a->name : NULL), sizeof(a->name),
+ ERLANG_UTF8, (a ? &a->enc : NULL), NULL);
}
int ei_encode_my_atom(char *buf, int *index, my_atom* a)
{
@@ -77,7 +78,7 @@ void decode_encode(struct Type* t, void* obj)
MESSAGE("ei_decode_%s, arg is type %s", t->name, t->type);
buf = read_packet(NULL);
- err = t->ei_decode_fp(buf+1, &size1, obj);
+ err = t->ei_decode_fp(buf+1, &size1, NULL);
if (err != 0) {
if (err != -1) {
fail("decode returned non zero but not -1");
@@ -96,7 +97,35 @@ void decode_encode(struct Type* t, void* obj)
return;
}
+ err = t->ei_decode_fp(buf+1, &size2, obj);
+ if (err != 0) {
+ if (err != -1) {
+ fail("decode returned non zero but not -1");
+ } else {
+ fail("decode returned non zero");
+ }
+ return;
+ }
+ if (size1 != size2) {
+ MESSAGE("size1 = %d, size2 = %d\n",size1,size2);
+ fail("decode sizes differs");
+ return;
+ }
+
+ size2 = 0;
+ err = ei_skip_term(buf+1, &size2);
+ if (err != 0) {
+ fail("ei_skip_term returned non zero");
+ return;
+ }
+ if (size1 != size2) {
+ MESSAGE("size1 = %d, size2 = %d\n",size1,size2);
+ fail("skip size differs");
+ return;
+ }
+
MESSAGE("ei_encode_%s buf is NULL, arg is type %s", t->name, t->type);
+ size2 = 0;
err = t->ei_encode_fp(NULL, &size2, obj);
if (err != 0) {
if (err != -1) {
diff --git a/lib/snmp/.gitignore b/lib/snmp/.gitignore
new file mode 100644
index 0000000000..b82d23e7bd
--- /dev/null
+++ b/lib/snmp/.gitignore
@@ -0,0 +1,4 @@
+# Match at any level.
+
+*.BKP
+
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index 5b94dcb051..5222922848 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -34,6 +34,79 @@
<section>
+ <title>SNMP Development Toolkit 4.23.1</title>
+ <p>Version 4.23.1 supports code replacement in runtime from/to
+ version 4.23. </p>
+
+ <section>
+ <title>Improvements and new features</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[agent] Errors in <c>vacmAccessTable</c> RowStatus handling.
+ There are problems with the handling of vacmAccessTableStatus
+ that cause some SNMP test suites to report errors.
+ Most notably, erroneous set operations frequently cause "genErr"
+ errors to be returned. These "genErr" errors are usually caused
+ by badmatch exceptions coming from
+ <c>{ok, Row} = snmpa_vacm:get_row(RowIndex)</c>
+ if the row does not exist. </p>
+ <p>The semantics of the RowStatus handling in that table has
+ been adjusted to be compliant with the RowStatus
+ textual description of SNPMv2-TC MIB. </p>
+ <p>Stefan Zegenhagen</p>
+ <p>Own Id: OTP-10164</p>
+ </item>
+ </list>
+-->
+
+ </section>
+
+ <section>
+ <title>Fixed Bugs and Malfunctions</title>
+<!--
+ <p>-</p>
+-->
+
+ <list type="bulleted">
+ <item>
+ <p>[compiler] Now handles MIBs importing the pesudotype BITS. </p>
+ <p>Own Id: OTP-10799</p>
+ </item>
+
+ <item>
+ <p>[compiler] The MIB compiler could not handle a table index
+ that was defined later in the MIB. </p>
+ <p>Own Id: OTP-10808</p>
+ </item>
+
+ </list>
+
+ </section>
+
+ <section>
+ <title>Incompatibilities</title>
+ <p>-</p>
+
+<!--
+ <list type="bulleted">
+ <item>
+ <p>[manager] The old Addr-and-Port based API functions, previously
+ long deprecated and marked for deletion in R16B, has now been
+ removed. </p>
+ <p>Own Id: OTP-10027</p>
+ </item>
+
+ </list>
+-->
+ </section>
+
+ </section> <!-- 4.23.1 -->
+
+
+ <section>
<title>SNMP Development Toolkit 4.23</title>
<!--
<p>Version 4.23 supports code replacement in runtime from/to
@@ -69,7 +142,6 @@
</item>
</list>
-
</section>
<section>
@@ -90,7 +162,6 @@
</list>
-->
-
</section>
<section>
diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src
index a6abf8439a..4c5f14da90 100644
--- a/lib/snmp/src/app/snmp.appup.src
+++ b/lib/snmp/src/app/snmp.appup.src
@@ -22,11 +22,19 @@
%% ----- U p g r a d e -------------------------------------------------------
[
+ {"4.23",
+ [
+ ]
+ }
],
%% ------D o w n g r a d e ---------------------------------------------------
[
+ {"4.23",
+ [
+ ]
+ }
]
}.
diff --git a/lib/snmp/src/compile/snmpc.erl b/lib/snmp/src/compile/snmpc.erl
index 5e6b81f1ec..d94810bc0a 100644
--- a/lib/snmp/src/compile/snmpc.erl
+++ b/lib/snmp/src/compile/snmpc.erl
@@ -516,7 +516,7 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
fields = FieldList},
Sline}|ColsEtc],
Data) ->
- ?vlog("defloop -> "
+ ?vlog("defloop(~w) -> "
"[object_type(sequence_of),object_type(type,[1]),sequence]:"
"~n NameOfTable: ~p"
"~n SeqName: ~p"
@@ -535,7 +535,8 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
"~n Eline: ~p"
"~n FieldList: ~p"
"~n Sline: ~p",
- [NameOfTable,SeqName,Taccess,Kind,Tstatus,
+ [?LINE,
+ NameOfTable,SeqName,Taccess,Kind,Tstatus,
Tindex,Tunits,Tline,
NameOfEntry,TEline,IndexingInfo,Estatus,Eunits,Ref,Eline,
FieldList,Sline]),
@@ -562,8 +563,9 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
units = Eunits},
{ColMEs, RestObjs} =
define_cols(ColsEtc, 1, FieldList, NameOfEntry, NameOfTable, []),
+ AfterIdxTypes = after_indexes_type(IndexingInfo, RestObjs),
TableInfo = snmpc_lib:make_table_info(Eline, NameOfTable,
- IndexingInfo, ColMEs),
+ IndexingInfo, AfterIdxTypes, ColMEs),
snmpc_lib:add_cdata(#cdata.mes,
[TableEntryME,
TableME#me{assocList=[{table_info,
@@ -595,7 +597,7 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
Sline}|ColsEtc],
#dldata{relaxed_row_name_assign_check = true} = Data)
when is_integer(Idx) andalso (Idx > 1) ->
- ?vlog("defloop -> "
+ ?vlog("defloop(~w) -> "
"[object_type(sequence_of),object_type(type,[~w]),sequence]:"
"~n NameOfTable: ~p"
"~n SeqName: ~p"
@@ -614,7 +616,8 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
"~n Eline: ~p"
"~n FieldList: ~p"
"~n Sline: ~p",
- [Idx,
+ [?LINE,
+ Idx,
NameOfTable,SeqName,Taccess,Kind,Tstatus,
Tindex,Tunits,Tline,
NameOfEntry,TEline,IndexingInfo,Estatus,Eunits,Ref,Eline,
@@ -644,8 +647,9 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
units = Eunits},
{ColMEs, RestObjs} =
define_cols(ColsEtc, 1, FieldList, NameOfEntry, NameOfTable, []),
+ AfterIdxTypes = after_indexes_type(IndexingInfo, RestObjs),
TableInfo = snmpc_lib:make_table_info(Eline, NameOfTable,
- IndexingInfo, ColMEs),
+ IndexingInfo, AfterIdxTypes, ColMEs),
snmpc_lib:add_cdata(#cdata.mes,
[TableEntryME,
TableME#me{assocList=[{table_info,
@@ -673,7 +677,7 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
{#mc_sequence{name = SeqName,
fields = FieldList}, Sline}|ColsEtc],
Data) ->
- ?vlog("defloop -> "
+ ?vlog("defloop(~w) -> "
"[object_type(sequence_of),object_type(type),sequence(fieldList)]:"
"~n NameOfTable: ~p"
"~n SeqName: ~p"
@@ -692,7 +696,8 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
"~n Eline: ~p"
"~n FieldList: ~p"
"~n Sline: ~p",
- [NameOfTable,SeqName,Taccess,Kind,Tstatus,
+ [?LINE,
+ NameOfTable,SeqName,Taccess,Kind,Tstatus,
Tindex,Tunits,Tline,
NameOfEntry,IndexingInfo,Estatus,BadOID,Eunits,Ref,Eline,
FieldList,Sline]),
@@ -720,8 +725,9 @@ definitions_loop([{#mc_object_type{name = NameOfTable,
units = Eunits},
{ColMEs, RestObjs} =
define_cols(ColsEtc, 1, FieldList, NameOfEntry, NameOfTable, []),
+ AfterIdxTypes = after_indexes_type(IndexingInfo, RestObjs),
TableInfo = snmpc_lib:make_table_info(Eline, NameOfTable,
- IndexingInfo, ColMEs),
+ IndexingInfo, AfterIdxTypes, ColMEs),
snmpc_lib:add_cdata(#cdata.mes,
[TableEntryME,
TableME#me{assocList=[{table_info,
@@ -813,7 +819,7 @@ definitions_loop([{#mc_module_identity{name = NewVarName,
"~n Desc: ~p"
"~n Revs0: ~p"
"~n Parent: ~p"
- "~n SubIndex: ~p",
+ "~n SubIndex: ~w",
[NewVarName, LU, Org, CI, Desc, Revs0, Parent, SubIndex], Line),
ensure_macro_imported('MODULE-IDENTITY', Line),
snmpc_lib:register_oid(Line, NewVarName, Parent, SubIndex),
@@ -839,7 +845,7 @@ definitions_loop([{#mc_internal{name = NewVarName,
"~n NewVarName: ~p"
"~n Macro: ~p"
"~n Parent: ~p"
- "~n SubIndex: ~p",
+ "~n SubIndex: ~w",
[NewVarName, Macro, Parent, SubIndex], Line),
ensure_macro_imported(Macro, Line),
snmpc_lib:register_oid(Line, NewVarName, Parent, SubIndex),
@@ -1205,6 +1211,12 @@ safe_elem(N,T) ->
X -> X
end.
+
+%% An table index is either:
+%% a) part of the table
+%% b) not part of the table and defined *before* the table
+%% c) not part of the table and defined *after* the table
+
%% A correct column
define_cols([{#mc_object_type{name = NameOfCol,
syntax = Type1,
@@ -1379,14 +1391,45 @@ define_cols(Rest, _SubIndex,_,_,_,ColMEs) ->
snmpc_lib:print_error("Corrupt table definition.",[]),
{ColMEs,Rest}.
+
+%% Table indexes can either be:
+%% a) part of the table (a column)
+%% b) not part of the table and defined *before* the table
+%% c) not part of the table and defined *after* the table
+
+after_indexes_type({indexes, Indexes}, Objs) ->
+ after_indexes_type2(Indexes, Objs);
+after_indexes_type(_, _) ->
+ [].
+
+after_indexes_type2(Indexes, Objs) ->
+ after_indexes_type2(Indexes, Objs, []).
+
+after_indexes_type2([], _Objs, IndexesASN1types) ->
+ IndexesASN1types;
+after_indexes_type2([Index|Indexes], Objs, Acc) ->
+ Acc2 = after_indexes_type3(Index, Objs, Acc),
+ after_indexes_type2(Indexes, Objs, Acc2).
+
+after_indexes_type3(_Index, [], Acc) ->
+ Acc;
+after_indexes_type3(Index,
+ [{#mc_object_type{name = Index,
+ syntax = Syntax},_}|_], Acc) ->
+ ASN1 = snmpc_lib:make_ASN1type(Syntax),
+ [{Index, ASN1}|Acc];
+after_indexes_type3(Index, [_|Objs], Acc) ->
+ after_indexes_type3(Index, Objs, Acc).
+
+
+
ensure_macro_imported(dummy, _Line) -> ok;
ensure_macro_imported(Macro, Line) ->
Macros = (get(cdata))#cdata.imported_macros,
case lists:member(Macro, Macros) of
true -> ok;
false ->
- snmpc_lib:print_error("Macro ~p not imported.", [Macro],
- Line)
+ snmpc_lib:print_error("Macro ~p not imported.", [Macro], Line)
end.
test_table(NameOfTable, Taccess, Kind, _Tindex, Tline) ->
diff --git a/lib/snmp/src/compile/snmpc_lib.erl b/lib/snmp/src/compile/snmpc_lib.erl
index c7eae307e8..5a661cf194 100644
--- a/lib/snmp/src/compile/snmpc_lib.erl
+++ b/lib/snmp/src/compile/snmpc_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -24,7 +24,7 @@
-compile({no_auto_import,[error/2]}).
-export([test_father/4, make_ASN1type/1, import/1, makeInternalNode2/2,
is_consistent/1, resolve_defval/1, make_variable_info/1,
- check_trap_name/3, make_table_info/4, get_final_mib/2, set_dir/2,
+ check_trap_name/3, make_table_info/5, get_final_mib/2, set_dir/2,
look_at/1, add_cdata/2,
check_object_group/4, check_notification_group/4,
check_notification/3,
@@ -240,7 +240,10 @@ import_mib({{'SNMPv2-SMI', ImportsFromMib},Line}) ->
aliasname = 'Opaque'},
#asn1_type{bertype = 'Counter64',
aliasname = 'Counter64',
- lo = 0, hi = 18446744073709551615}],
+ lo = 0, hi = 18446744073709551615},
+ #asn1_type{bertype = 'BITS',
+ aliasname = 'BITS'}
+ ],
Macros = ['MODULE-IDENTITY','OBJECT-IDENTITY','OBJECT-TYPE',
'NOTIFICATION-TYPE'],
import_built_in_loop(ImportsFromMib,Nodes,Types,Macros,'SNMPv2-SMI',Line);
@@ -704,7 +707,8 @@ check_trap_name(EnterpriseName, Line, MEs) ->
%% This information is needed to be able to create default instrumentation
%% functions for tables.
%%----------------------------------------------------------------------
-make_table_info(Line, TableName, {augments, SrcTableEntry}, ColumnMEs) ->
+
+make_table_info(Line, TableName, {augments, SrcTableEntry}, _, ColumnMEs) ->
ColMEs = lists:keysort(#me.oid, ColumnMEs),
Nbr_of_Cols = length(ColMEs),
MEs = ColMEs ++ (get(cdata))#cdata.mes,
@@ -723,16 +727,18 @@ make_table_info(Line, TableName, {augments, SrcTableEntry}, ColumnMEs) ->
first_accessible = FirstAcc,
not_accessible = NoAccs,
index_types = Aug};
-make_table_info(Line, TableName, {indexes, []}, _ColumnMEs) ->
+make_table_info(Line, TableName, {indexes, []}, _, _ColumnMEs) ->
print_error("Table ~w lacks indexes.", [TableName],Line),
#table_info{};
-make_table_info(Line, TableName, {indexes, Indexes}, ColumnMEs) ->
+make_table_info(Line, TableName, {indexes, Indexes}, AfterIdxTypes,
+ ColumnMEs) ->
ColMEs = lists:keysort(#me.oid, ColumnMEs),
NonImpliedIndexes = lists:map(fun non_implied_name/1, Indexes),
test_read_create_access(ColMEs, Line, dummy),
NonIndexCol = test_index_positions(Line, NonImpliedIndexes, ColMEs),
Nbr_of_Cols = length(ColMEs),
- ASN1Indexes = find_asn1_types_for_indexes(Indexes, ColMEs, Line),
+ ASN1Indexes = find_asn1_types_for_indexes(Indexes,
+ AfterIdxTypes, ColMEs, Line),
FA = first_accessible(TableName, ColMEs),
StatCol = find_status_col(Line, TableName, ColMEs),
NoAccs = list_not_accessible(NonIndexCol,ColMEs),
@@ -816,11 +822,17 @@ get_defvals(ColMEs) ->
lists:filter(fun drop_undefined/1,
lists:map(fun column_and_defval/1, ColMEs))).
-find_asn1_types_for_indexes(Indexes, ColMEs,Line) ->
- MEs = ColMEs ++ (get(cdata))#cdata.mes,
+find_asn1_types_for_indexes(Indexes, AfterIdxTypes, ColMEs, Line) ->
+ ?vtrace("find_asn1_types_for_indexes -> "
+ "~n Indexes: ~p"
+ "~n ColMEs: ~p"
+ "~n Line: ~p", [Indexes, ColMEs, Line]),
+ MEs = ColMEs ++ (get(cdata))#cdata.mes ++
+ [#me{aliasname = Idx, asn1_type = Type} || {Idx, Type} <-
+ AfterIdxTypes],
test_implied(Indexes, Line),
lists:map(fun (ColumnName) ->
- translate_type(get_asn1_type(ColumnName, MEs,Line))
+ translate_type(get_asn1_type(ColumnName, MEs, Line))
end,
Indexes).
@@ -846,7 +858,11 @@ column_and_defval(#me{oid = Oid, assocList = AssocList}) ->
end.
%% returns: an asn1_type if ColME is an indexfield, otherwise undefined.
-get_asn1_type({implied,ColumnName}, MEs, Line) ->
+get_asn1_type({implied, ColumnName}, MEs, Line) ->
+ ?vtrace("get_asn1_type(implied) -> "
+ "~n ColumnName: ~p"
+ "~n MEs: ~p"
+ "~n Line: ~p", [ColumnName, MEs, Line]),
case lookup(ColumnName, MEs) of
{value,#me{asn1_type=A}} when A#asn1_type.bertype =:=
'OCTET STRING' ->
@@ -859,6 +875,10 @@ get_asn1_type({implied,ColumnName}, MEs, Line) ->
[Shit], Line)
end;
get_asn1_type(ColumnName, MEs, Line) ->
+ ?vtrace("get_asn1_type -> "
+ "~n ColumnName: ~p"
+ "~n MEs: ~p"
+ "~n Line: ~p", [ColumnName, MEs, Line]),
case lookup(ColumnName, MEs) of
{value,ME} -> ME#me.asn1_type;
false -> error("Can't find object ~p. Used as INDEX in table.",
diff --git a/lib/snmp/src/compile/snmpc_mib_gram.yrl b/lib/snmp/src/compile/snmpc_mib_gram.yrl
index 74b9ddaa25..4fd504e34b 100644
--- a/lib/snmp/src/compile/snmpc_mib_gram.yrl
+++ b/lib/snmp/src/compile/snmpc_mib_gram.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -244,16 +244,36 @@ listofdefinitions -> definition : ['$1'] .
listofdefinitions -> listofdefinitions definition : ['$2' | '$1'].
import -> '$empty' : [].
-import -> 'IMPORTS' imports ';' : '$2'.
-
-imports -> imports_from_one_mib : ['$1'].
-imports -> imports_from_one_mib imports : ['$1' | '$2'].
+import -> 'IMPORTS' imports ';' :
+%% i("import ->"
+%% "~n imports: ~p", ['$2']),
+ '$2'.
+
+imports -> imports_from_one_mib :
+%% i("imports ->"
+%% "~n imports_from_one_mib: ~p", ['$1']),
+ ['$1'].
+imports -> imports_from_one_mib imports :
+%% i("imports ->"
+%% "~n imports_from_one_mib: ~p"
+%% "~n imports: ~p", ['$1', '$2']),
+ ['$1' | '$2'].
imports_from_one_mib -> listofimports 'FROM' variable :
+%% i("imports_from_one_mib ->"
+%% "~n listofimports: ~p"
+%% "~n variable: ~p", ['$1', '$3']),
{{val('$3'), lreverse(imports_from_one_mib, '$1')}, line_of('$2')}.
-listofimports -> import_stuff : ['$1'].
-listofimports -> listofimports ',' import_stuff : ['$3' | '$1'].
+listofimports -> import_stuff :
+%% i("listofimports ->"
+%% "~n import_stuff: ~p", ['$1']),
+ ['$1'].
+listofimports -> listofimports ',' import_stuff :
+%% i("listofimports ->"
+%% "~n listofimports: ~p"
+%% "~n import_stuff: ~p", ['$1', '$3']),
+ ['$3' | '$1'].
import_stuff -> 'OBJECT-TYPE' : {builtin, 'OBJECT-TYPE'}.
import_stuff -> 'TRAP-TYPE' : {builtin, 'TRAP-TYPE'}.
@@ -314,6 +334,8 @@ import_stuff -> 'TDomain'
: ensure_ver(2,'$1'), {builtin, 'TDomain'}.
import_stuff -> 'TAddress'
: ensure_ver(2,'$1'), {builtin, 'TAddress'}.
+import_stuff -> 'BITS'
+ : ensure_ver(2,'$1'), {builtin, 'BITS'}.
traptype -> objectname 'TRAP-TYPE' 'ENTERPRISE' objectname varpart
description referpart implies integer :
@@ -748,7 +770,7 @@ statusv1(Tok) ->
obsolete -> obsolete;
deprecated -> deprecated;
Else -> return_error(line_of(Tok),
- "syntax error before: " ++ atom_to_list(Else))
+ "(statusv1) syntax error before: " ++ atom_to_list(Else))
end.
statusv2(Tok) ->
@@ -757,7 +779,7 @@ statusv2(Tok) ->
deprecated -> deprecated;
obsolete -> obsolete;
Else -> return_error(line_of(Tok),
- "syntax error before: " ++ atom_to_list(Else))
+ "(statusv2) syntax error before: " ++ atom_to_list(Else))
end.
ac_status(Tok) ->
@@ -765,7 +787,7 @@ ac_status(Tok) ->
current -> current;
obsolete -> obsolete;
Else -> return_error(line_of(Tok),
- "syntax error before: " ++ atom_to_list(Else))
+ "(ac_status) syntax error before: " ++ atom_to_list(Else))
end.
accessv1(Tok) ->
@@ -775,7 +797,7 @@ accessv1(Tok) ->
'write-only' -> 'write-only';
'not-accessible' -> 'not-accessible';
Else -> return_error(line_of(Tok),
- "syntax error before: " ++ atom_to_list(Else))
+ "(accessv1) syntax error before: " ++ atom_to_list(Else))
end.
accessv2(Tok) ->
@@ -786,7 +808,7 @@ accessv2(Tok) ->
'read-write' -> 'read-write';
'read-create' -> 'read-create';
Else -> return_error(line_of(Tok),
- "syntax error before: " ++ atom_to_list(Else))
+ "(accessv2) syntax error before: " ++ atom_to_list(Else))
end.
ac_access(Tok) ->
@@ -798,7 +820,7 @@ ac_access(Tok) ->
'read-create' -> 'read-create';
'write-only' -> 'write-only'; % for backward-compatibility only
Else -> return_error(line_of(Tok),
- "syntax error before: " ++ atom_to_list(Else))
+ "(ac_access) syntax error before: " ++ atom_to_list(Else))
end.
%% ---------------------------------------------------------------------
diff --git a/lib/snmp/test/snmp_compiler_test.erl b/lib/snmp/test/snmp_compiler_test.erl
index 257fc47952..1840d37dfd 100644
--- a/lib/snmp/test/snmp_compiler_test.erl
+++ b/lib/snmp/test/snmp_compiler_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2003-2012. All Rights Reserved.
+%% Copyright Ericsson AB 2003-2013. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -53,7 +53,9 @@
otp_6150/1,
otp_8574/1,
- otp_8595/1
+ otp_8595/1,
+ otp_10799/1,
+ otp_10808/1
]).
@@ -132,7 +134,7 @@ all() ->
].
groups() ->
- [{tickets, [], [otp_6150, otp_8574, otp_8595]}].
+ [{tickets, [], [otp_6150, otp_8574, otp_8595, otp_10799, otp_10808]}].
init_per_group(_GroupName, Config) ->
Config.
@@ -326,13 +328,14 @@ warnings_as_errors(Config) when is_list(Config) ->
otp_6150(suite) ->
[];
otp_6150(Config) when is_list(Config) ->
- put(tname,otp_6150),
+ put(tname, otp6150),
p("starting with Config: ~p~n", [Config]),
Dir = ?config(case_top_dir, Config),
MibDir = ?config(mib_dir, Config),
MibFile = join(MibDir, "ERICSSON-TOP-MIB.mib"),
- ?line {ok, Mib} = snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
+ ?line {ok, Mib} =
+ snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
io:format("otp_6150 -> Mib: ~n~p~n", [Mib]),
ok.
@@ -342,7 +345,7 @@ otp_6150(Config) when is_list(Config) ->
otp_8574(suite) ->
[];
otp_8574(Config) when is_list(Config) ->
- put(tname,otp_8574),
+ put(tname, otp8574),
p("starting with Config: ~p~n", [Config]),
Dir = ?config(case_top_dir, Config),
@@ -375,7 +378,7 @@ otp_8574(Config) when is_list(Config) ->
otp_8595(suite) ->
[];
otp_8595(Config) when is_list(Config) ->
- put(tname,otp_8595),
+ put(tname, otp8595),
p("starting with Config: ~p~n", [Config]),
Dir = ?config(case_top_dir, Config),
@@ -385,7 +388,43 @@ otp_8595(Config) when is_list(Config) ->
snmpc:compile(MibFile, [{outdir, Dir},
{verbosity, trace},
{group_check, false}]),
- io:format("otp_8595 -> Mib: ~n~p~n", [Mib]),
+ p("Mib: ~n~p~n", [Mib]),
+ ok.
+
+
+%%======================================================================
+
+otp_10799(suite) ->
+ [];
+otp_10799(Config) when is_list(Config) ->
+ put(tname, otp10799),
+ p("starting with Config: ~p~n", [Config]),
+
+ Dir = ?config(case_top_dir, Config),
+ MibDir = ?config(mib_dir, Config),
+ MibFile = join(MibDir, "OTP10799-MIB.mib"),
+ ?line {ok, Mib} =
+ snmpc:compile(MibFile, [{outdir, Dir}, {verbosity, trace}]),
+ p("Mib: ~n~p~n", [Mib]),
+ ok.
+
+
+%%======================================================================
+
+otp_10808(suite) ->
+ [];
+otp_10808(Config) when is_list(Config) ->
+ put(tname, otp10808),
+ p("starting with Config: ~p~n", [Config]),
+
+ Dir = ?config(case_top_dir, Config),
+ MibDir = ?config(mib_dir, Config),
+ MibFile = join(MibDir, "OTP10808-MIB.mib"),
+ ?line {ok, Mib} =
+ snmpc:compile(MibFile, [{outdir, Dir},
+ {verbosity, trace},
+ {group_check, false}]),
+ p("Mib: ~n~p~n", [Mib]),
ok.
diff --git a/lib/snmp/test/snmp_test_data/OTP10799-MIB.mib b/lib/snmp/test/snmp_test_data/OTP10799-MIB.mib
new file mode 100644
index 0000000000..f47bcfd7da
--- /dev/null
+++ b/lib/snmp/test/snmp_test_data/OTP10799-MIB.mib
@@ -0,0 +1,75 @@
+OTP10799-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, snmpModules, mib-2, BITS
+ FROM SNMPv2-SMI
+ MODULE-COMPLIANCE, OBJECT-GROUP
+ FROM SNMPv2-CONF
+ ;
+
+otp10799MIB MODULE-IDENTITY
+ LAST-UPDATED "1004210000Z"
+ ORGANIZATION ""
+ CONTACT-INFO
+ ""
+ DESCRIPTION
+ "Test mib for OTP-10799"
+ ::= { snmpModules 1 }
+
+
+-- Administrative assignments ****************************************
+
+otp10799MIBObjects OBJECT IDENTIFIER ::= { otp10799MIB 1 }
+otp10799MIBConformance OBJECT IDENTIFIER ::= { otp10799MIB 2 }
+
+--
+
+test OBJECT IDENTIFIER ::= { mib-2 16 }
+
+bits1 OBJECT-TYPE
+ SYNTAX BITS {
+ b0(0),
+ b1(1),
+ b2(2),
+ b3(3),
+ b4(4),
+ b5(5),
+ b6(6),
+ b7(7)
+ }
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ ""
+ ::= { test 1 }
+
+-- Conformance Information *******************************************
+
+otp10799MIBCompliances OBJECT IDENTIFIER
+ ::= { otp10799MIBConformance 1 }
+otp10799MIBGroups OBJECT IDENTIFIER
+ ::= { otp10799MIBConformance 2 }
+
+-- Compliance statements
+
+otp10799MIBCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The compliance statement for SNMP engines which
+ implement the SNMP-COMMUNITY-MIB."
+
+ MODULE -- this module
+ MANDATORY-GROUPS { otp10799Group }
+
+ ::= { otp10799Compliances 1 }
+
+otp10799Group OBJECT-GROUP
+ OBJECTS {
+ bits1
+ }
+ STATUS current
+ DESCRIPTION
+ "A group."
+ ::= { otp10799MIBGroups 1 }
+
+END
diff --git a/lib/snmp/test/snmp_test_data/OTP10808-MIB.mib b/lib/snmp/test/snmp_test_data/OTP10808-MIB.mib
new file mode 100644
index 0000000000..99c099e316
--- /dev/null
+++ b/lib/snmp/test/snmp_test_data/OTP10808-MIB.mib
@@ -0,0 +1,137 @@
+OTP10808-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, enterprises, IpAddress FROM SNMPv2-SMI
+ RowStatus FROM SNMPv2-TC
+ ;
+
+otp10808MIB MODULE-IDENTITY
+ LAST-UPDATED "1004200000Z"
+ ORGANIZATION "Erlang/OTP"
+ CONTACT-INFO "www.erlang.org"
+ DESCRIPTION "The MIB module is used for testing a compiler feature"
+ ::= { otpSnmp 1 }
+
+ericsson OBJECT IDENTIFIER ::= { enterprises 193 }
+otp OBJECT IDENTIFIER ::= { ericsson 19 }
+otpApplications OBJECT IDENTIFIER ::= { otp 3 }
+otpSnmp OBJECT IDENTIFIER ::= { otpApplications 3 }
+
+testMIBObjects OBJECT IDENTIFIER ::= { otp10808MIB 1 }
+
+testMIBObjectGroup OBJECT IDENTIFIER ::= { testMIBObjects 1 }
+
+-- Example Table 1
+
+example-Table1 OBJECT-TYPE
+ SYNTAX SEQUENCE OF ExampleEntry1
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Example table 1"
+ ::= { testMIBObjectGroup 1 }
+
+example-Entry1 OBJECT-TYPE
+ SYNTAX ExampleEntry1
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Example table 1 entry"
+ INDEX { exampleIndex2, exampleIndex1 }
+ ::= { example-Table1 1 }
+
+ExampleEntry1 ::= SEQUENCE {
+ exampleIndex1 INTEGER,
+ exampleColumn1 OCTET STRING,
+ exampleNotAccessible1 OCTET STRING,
+ exampleRowStatus1 RowStatus
+}
+
+exampleIndex1 OBJECT-TYPE
+ SYNTAX INTEGER (1..100)
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION "The second index for this entry."
+ ::= { example-Entry1 1 }
+
+exampleColumn1 OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Example table column"
+ ::= { example-Entry1 2 }
+
+exampleNotAccessible1 OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Example table column"
+ ::= { example-Entry1 3 }
+
+exampleRowStatus1 OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Example table RowStatus"
+ ::= { example-Entry1 4 }
+
+
+-- Example Table 2
+
+example-Table2 OBJECT-TYPE
+ SYNTAX SEQUENCE OF ExampleEntry2
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Example table 2"
+ ::= { testMIBObjectGroup 2 }
+
+example-Entry2 OBJECT-TYPE
+ SYNTAX ExampleEntry2
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION "Example table entry"
+ INDEX { exampleIndex2 }
+ ::= { example-Table2 1 }
+
+ExampleEntry2 ::= SEQUENCE {
+ exampleIndex2 INTEGER,
+ exampleColumn2 OCTET STRING,
+ exampleNotAccessible2 OCTET STRING,
+ exampleRowStatus2 RowStatus
+}
+
+exampleIndex2 OBJECT-TYPE
+ SYNTAX INTEGER (1..100)
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The index for this entry of table 2
+ (and first index of table 1)."
+ ::= { example-Entry2 1 }
+
+exampleColumn2 OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Example table column"
+ ::= { example-Entry2 2 }
+
+exampleNotAccessible2 OBJECT-TYPE
+ SYNTAX OCTET STRING
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Example table column"
+ ::= { example-Entry2 3 }
+
+exampleRowStatus2 OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "Example table RowStatus"
+ ::= { example-Entry2 4 }
+
+END
diff --git a/lib/snmp/test/test-mibs/ALARM-MIB.mib b/lib/snmp/test/test-mibs/ALARM-MIB.mib
new file mode 100644
index 0000000000..18e43d4b4b
--- /dev/null
+++ b/lib/snmp/test/test-mibs/ALARM-MIB.mib
@@ -0,0 +1,1214 @@
+ALARM-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
+ Integer32, Unsigned32, Gauge32,
+ TimeTicks, Counter32, Counter64,
+ IpAddress, Opaque, mib-2,
+ zeroDotZero
+ FROM SNMPv2-SMI -- [RFC2578]
+ DateAndTime,
+ RowStatus, RowPointer,
+ TEXTUAL-CONVENTION
+ FROM SNMPv2-TC -- [RFC2579]
+ SnmpAdminString
+ FROM SNMP-FRAMEWORK-MIB -- [RFC3411]
+ InetAddressType, InetAddress
+ FROM INET-ADDRESS-MIB -- [RFC3291]
+ MODULE-COMPLIANCE, OBJECT-GROUP,
+ NOTIFICATION-GROUP
+ FROM SNMPv2-CONF -- [RFC2580]
+ ZeroBasedCounter32
+ FROM RMON2-MIB; -- [RFC2021]
+
+ alarmMIB MODULE-IDENTITY
+ LAST-UPDATED "200409090000Z" -- September 09, 2004
+ ORGANIZATION "IETF Distributed Management Working Group"
+ CONTACT-INFO
+ "WG EMail: [email protected]
+ Subscribe: [email protected]
+ http://www.ietf.org/html.charters/disman-charter.html
+
+
+
+
+ Chair: Randy Presuhn
+
+ Editors: Sharon Chisholm
+ Nortel Networks
+ PO Box 3511 Station C
+ Ottawa, Ont. K1Y 4H7
+ Canada
+
+ Dan Romascanu
+ Avaya
+ Atidim Technology Park, Bldg. #3
+ Tel Aviv, 61131
+ Israel
+ Tel: +972-3-645-8414
+ DESCRIPTION
+ "The MIB module describes a generic solution
+ to model alarms and to store the current list
+ of active alarms.
+
+ Copyright (C) The Internet Society (2004). The
+ initial version of this MIB module was published
+ in RFC 3877. For full legal notices see the RFC
+ itself. Supplementary information may be available on:
+ http://www.ietf.org/copyrights/ianamib.html"
+ REVISION "200409090000Z" -- September 09, 2004
+ DESCRIPTION
+ "Initial version, published as RFC 3877."
+ ::= { mib-2 118 }
+
+alarmObjects OBJECT IDENTIFIER ::= { alarmMIB 1 }
+
+alarmNotifications OBJECT IDENTIFIER ::= { alarmMIB 0 }
+
+alarmModel OBJECT IDENTIFIER ::= { alarmObjects 1 }
+
+alarmActive OBJECT IDENTIFIER ::= { alarmObjects 2 }
+
+alarmClear OBJECT IDENTIFIER ::= { alarmObjects 3 }
+
+-- Textual Conventions
+
+ -- ResourceId is intended to be a general textual convention
+ -- that can be used outside of the set of MIBs related to
+ -- Alarm Management.
+
+
+
+
+
+ResourceId ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "A unique identifier for this resource.
+
+ The type of the resource can be determined by looking
+ at the OID that describes the resource.
+
+ Resources must be identified in a consistent manner.
+ For example, if this resource is an interface, this
+ object MUST point to an ifIndex and if this resource
+ is a physical entity [RFC2737], then this MUST point
+ to an entPhysicalDescr, given that entPhysicalIndex
+ is not accessible. In general, the value is the
+ name of the instance of the first accessible columnar
+ object in the conceptual row of a table that is
+ meaningful for this resource type, which SHOULD
+ be defined in an IETF standard MIB."
+ SYNTAX OBJECT IDENTIFIER
+
+ -- LocalSnmpEngineOrZeroLenStr is intended to be a general
+ -- textual convention that can be used outside of the set of
+ -- MIBs related to Alarm Management.
+
+ LocalSnmpEngineOrZeroLenStr ::= TEXTUAL-CONVENTION
+ STATUS current
+ DESCRIPTION
+ "An SNMP Engine ID or a zero-length string. The
+ instantiation of this textual convention will provide
+ guidance on when this will be an SNMP Engine ID and
+ when it will be a zero lengths string"
+ SYNTAX OCTET STRING (SIZE(0 | 5..32))
+
+-- Alarm Model
+
+alarmModelLastChanged OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime at the time of the last
+ creation, deletion or modification of an entry in
+ the alarmModelTable.
+
+ If the number and content of entries has been unchanged
+ since the last re-initialization of the local network
+ management subsystem, then the value of this object
+ MUST be zero."
+
+
+
+
+ ::= { alarmModel 1 }
+
+alarmModelTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AlarmModelEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of information about possible alarms on the system,
+ and how they have been modelled."
+ ::= { alarmModel 2 }
+
+alarmModelEntry OBJECT-TYPE
+ SYNTAX AlarmModelEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Entries appear in this table for each possible alarm state.
+ This table MUST be persistent across system reboots."
+ INDEX { alarmListName, alarmModelIndex, alarmModelState }
+ ::= { alarmModelTable 1 }
+
+AlarmModelEntry ::= SEQUENCE {
+ alarmModelIndex Unsigned32,
+ alarmModelState Unsigned32,
+ alarmModelNotificationId OBJECT IDENTIFIER,
+ alarmModelVarbindIndex Unsigned32,
+ alarmModelVarbindValue Integer32,
+ alarmModelDescription SnmpAdminString,
+ alarmModelSpecificPointer RowPointer,
+ alarmModelVarbindSubtree OBJECT IDENTIFIER,
+ alarmModelResourcePrefix OBJECT IDENTIFIER,
+ alarmModelRowStatus RowStatus
+ }
+
+alarmModelIndex OBJECT-TYPE
+ SYNTAX Unsigned32 (1..4294967295)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An integer that acts as an alarm Id
+ to uniquely identify each alarm
+ within the named alarm list. "
+ ::= { alarmModelEntry 1 }
+
+alarmModelState OBJECT-TYPE
+ SYNTAX Unsigned32 (1..4294967295)
+ MAX-ACCESS not-accessible
+ STATUS current
+
+
+
+
+ DESCRIPTION
+ "A value of 1 MUST indicate a clear alarm state.
+ The value of this object MUST be less than the
+ alarmModelState of more severe alarm states for
+ this alarm. The value of this object MUST be more
+ than the alarmModelState of less severe alarm states
+ for this alarm."
+ ::= { alarmModelEntry 2 }
+
+alarmModelNotificationId OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The NOTIFICATION-TYPE object identifier of this alarm
+ state transition. If there is no notification associated
+ with this alarm state, the value of this object MUST be
+ '0.0'"
+ DEFVAL { zeroDotZero }
+ ::= { alarmModelEntry 3 }
+
+alarmModelVarbindIndex OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The index into the varbind listing of the notification
+ indicated by alarmModelNotificationId which helps
+ signal that the given alarm has changed state.
+ If there is no applicable varbind, the value of this
+ object MUST be zero.
+
+ Note that the value of alarmModelVarbindIndex acknowledges
+ the existence of the first two obligatory varbinds in
+ the InformRequest-PDU and SNMPv2-Trap-PDU (sysUpTime.0
+ and snmpTrapOID.0). That is, a value of 2 refers to
+ the snmpTrapOID.0.
+
+ If the incoming notification is instead an SNMPv1 Trap-PDU,
+ then an appropriate value for sysUpTime.0 or snmpTrapOID.0
+ shall be determined by using the rules in section 3.1 of
+ [RFC3584]"
+ DEFVAL { 0 }
+ ::= { alarmModelEntry 4 }
+
+alarmModelVarbindValue OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-create
+
+
+
+
+ STATUS current
+ DESCRIPTION
+ "The value that the varbind indicated by
+ alarmModelVarbindIndex takes to indicate
+ that the alarm has entered this state.
+
+ If alarmModelVarbindIndex has a value of 0, so
+ MUST alarmModelVarbindValue.
+ "
+ DEFVAL { 0 }
+ ::= { alarmModelEntry 5 }
+
+alarmModelDescription OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "A brief description of this alarm and state suitable
+ to display to operators."
+ DEFVAL { "" }
+ ::= { alarmModelEntry 6 }
+
+alarmModelSpecificPointer OBJECT-TYPE
+ SYNTAX RowPointer
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "If no additional, model-specific Alarm MIB is supported by
+ the system the value of this object is `0.0'and attempts
+ to set it to any other value MUST be rejected appropriately.
+
+ When a model-specific Alarm MIB is supported, this object
+ MUST refer to the first accessible object in a corresponding
+ row of the model definition in one of these model-specific
+ MIB and attempts to set this object to { 0 0 } or any other
+ value MUST be rejected appropriately."
+ DEFVAL { zeroDotZero }
+ ::= { alarmModelEntry 7 }
+
+ alarmModelVarbindSubtree OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The name portion of each VarBind in the notification,
+ in order, is compared to the value of this object.
+ If the name is equal to or a subtree of the value
+ of this object, for purposes of computing the value
+
+
+
+
+ of AlarmActiveResourceID the 'prefix' will be the
+ matching portion, and the 'indexes' will be any
+ remainder. The examination of varbinds ends with
+ the first match. If the value of this object is 0.0,
+ then the first varbind, or in the case of v2, the
+ first varbind after the timestamp and the trap
+ OID, will always be matched.
+ "
+ DEFVAL { zeroDotZero }
+ ::= { alarmModelEntry 8 }
+
+ alarmModelResourcePrefix OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "The value of AlarmActiveResourceId is computed
+ by appending any indexes extracted in accordance
+ with the description of alarmModelVarbindSubtree
+ onto the value of this object. If this object's
+ value is 0.0, then the 'prefix' extracted is used
+ instead.
+ "
+ DEFVAL { zeroDotZero }
+ ::= { alarmModelEntry 9 }
+
+alarmModelRowStatus OBJECT-TYPE
+ SYNTAX RowStatus
+ MAX-ACCESS read-create
+ STATUS current
+ DESCRIPTION
+ "Control for creating and deleting entries. Entries may be
+ modified while active. Alarms whose alarmModelRowStatus is
+ not active will not appear in either the alarmActiveTable
+ or the alarmClearTable. Setting this object to notInService
+ cannot be used as an alarm suppression mechanism. Entries
+ that are notInService will disappear as described in RFC2579.
+
+ This row can not be modified while it is being
+ referenced by a value of alarmActiveModelPointer. In these
+ cases, an error of `inconsistentValue' will be returned to
+ the manager.
+
+ This entry may be deleted while it is being
+ referenced by a value of alarmActiveModelPointer. This results
+ in the deletion of this entry and entries in the active alarms
+ referencing this entry via an alarmActiveModelPointer.
+
+
+
+
+
+ As all read-create objects in this table have a DEFVAL clause,
+ there is no requirement that any object be explicitly set
+ before this row can become active. Note that a row consisting
+ only of default values is not very meaningful."
+ ::= { alarmModelEntry 10 }
+
+-- Active Alarm Table --
+
+alarmActiveLastChanged OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime at the time of the last
+ creation or deletion of an entry in the alarmActiveTable.
+ If the number of entries has been unchanged since the
+ last re-initialization of the local network management
+ subsystem, then this object contains a zero value."
+ ::= { alarmActive 1 }
+
+ alarmActiveOverflow OBJECT-TYPE
+ SYNTAX Counter32
+ UNITS "active alarms"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of active alarms that have not been put into
+ the alarmActiveTable since system restart as a result
+ of extreme resource constraints."
+ ::= { alarmActive 5 }
+
+alarmActiveTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AlarmActiveEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of Active Alarms entries."
+ ::= { alarmActive 2 }
+
+alarmActiveEntry OBJECT-TYPE
+ SYNTAX AlarmActiveEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Entries appear in this table when alarms are raised. They
+ are removed when the alarm is cleared.
+
+ If under extreme resource constraint the system is unable to
+
+
+
+
+ add any more entries into this table, then the
+ alarmActiveOverflow statistic will be increased by one."
+ INDEX { alarmListName, alarmActiveDateAndTime,
+ alarmActiveIndex }
+ ::= { alarmActiveTable 1 }
+
+AlarmActiveEntry ::= SEQUENCE {
+ alarmListName SnmpAdminString,
+ alarmActiveDateAndTime DateAndTime,
+ alarmActiveIndex Unsigned32,
+ alarmActiveEngineID LocalSnmpEngineOrZeroLenStr,
+ alarmActiveEngineAddressType InetAddressType,
+ alarmActiveEngineAddress InetAddress,
+ alarmActiveContextName SnmpAdminString,
+ alarmActiveVariables Unsigned32,
+ alarmActiveNotificationID OBJECT IDENTIFIER,
+ alarmActiveResourceId ResourceId,
+ alarmActiveDescription SnmpAdminString,
+ alarmActiveLogPointer RowPointer,
+ alarmActiveModelPointer RowPointer,
+ alarmActiveSpecificPointer RowPointer }
+
+alarmListName OBJECT-TYPE
+ SYNTAX SnmpAdminString (SIZE(0..32))
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The name of the list of alarms. This SHOULD be the same as
+ nlmLogName if the Notification Log MIB [RFC3014] is supported.
+ This SHOULD be the same as, or contain as a prefix, the
+ applicable snmpNotifyFilterProfileName if the
+ SNMP-NOTIFICATION-MIB DEFINITIONS [RFC3413] is supported.
+
+ An implementation may allow multiple named alarm lists, up to
+ some implementation-specific limit (which may be none). A
+ zero-length list name is reserved for creation and deletion
+ by the managed system, and MUST be used as the default log
+ name by systems that do not support named alarm lists."
+ ::= { alarmActiveEntry 1 }
+
+alarmActiveDateAndTime OBJECT-TYPE
+ SYNTAX DateAndTime
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The local date and time when the error occurred.
+
+ This object facilitates retrieving all instances of
+
+
+
+
+ alarms that have been raised or have changed state
+ since a given point in time.
+
+ Implementations MUST include the offset from UTC,
+ if available. Implementation in environments in which
+ the UTC offset is not available is NOT RECOMMENDED."
+ ::= { alarmActiveEntry 2 }
+
+alarmActiveIndex OBJECT-TYPE
+ SYNTAX Unsigned32 (1..4294967295)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A strictly monotonically increasing integer which
+ acts as the index of entries within the named alarm
+ list. It wraps back to 1 after it reaches its
+ maximum value."
+ ::= { alarmActiveEntry 3 }
+
+alarmActiveEngineID OBJECT-TYPE
+ SYNTAX LocalSnmpEngineOrZeroLenStr
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The identification of the SNMP engine at which the alarm
+ originated. If the alarm is from an SNMPv1 system this
+ object is a zero length string."
+ ::= { alarmActiveEntry 4 }
+
+alarmActiveEngineAddressType OBJECT-TYPE
+ SYNTAX InetAddressType
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object indicates what type of address is stored in
+ the alarmActiveEngineAddress object - IPv4, IPv6, DNS, etc."
+ ::= { alarmActiveEntry 5 }
+
+alarmActiveEngineAddress OBJECT-TYPE
+ SYNTAX InetAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The address of the SNMP engine on which the alarm is
+ occurring.
+
+ This object MUST always be instantiated, even if the list
+ can contain alarms from only one engine."
+
+
+
+
+ ::= { alarmActiveEntry 6 }
+
+alarmActiveContextName OBJECT-TYPE
+ SYNTAX SnmpAdminString (SIZE(0..32))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the SNMP MIB context from which the alarm came.
+ For SNMPv1 alarms this is the community string from the Trap.
+ Note that care MUST be taken when selecting community
+ strings to ensure that these can be represented as a
+ well-formed SnmpAdminString. Community or Context names
+ that are not well-formed SnmpAdminStrings will be mapped
+ to zero length strings.
+
+ If the alarm's source SNMP engine is known not to support
+ multiple contexts, this object is a zero length string."
+ ::= { alarmActiveEntry 7 }
+
+alarmActiveVariables OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The number of variables in alarmActiveVariableTable for this
+ alarm."
+ ::= { alarmActiveEntry 8 }
+
+alarmActiveNotificationID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The NOTIFICATION-TYPE object identifier of the alarm
+ state transition that is occurring."
+ ::= { alarmActiveEntry 9 }
+
+alarmActiveResourceId OBJECT-TYPE
+ SYNTAX ResourceId
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object identifies the resource under alarm.
+
+ If there is no corresponding resource, then
+ the value of this object MUST be 0.0."
+ ::= { alarmActiveEntry 10 }
+
+
+
+
+
+alarmActiveDescription OBJECT-TYPE
+ SYNTAX SnmpAdminString
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object provides a textual description of the
+ active alarm. This text is generated dynamically by the
+ notification generator to provide useful information
+ to the human operator. This information SHOULD
+ provide information allowing the operator to locate
+ the resource for which this alarm is being generated.
+ This information is not intended for consumption by
+ automated tools."
+ ::= { alarmActiveEntry 11 }
+
+alarmActiveLogPointer OBJECT-TYPE
+ SYNTAX RowPointer
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A pointer to the corresponding row in a
+ notification logging MIB where the state change
+ notification for this active alarm is logged.
+ If no log entry applies to this active alarm,
+ then this object MUST have the value of 0.0"
+ ::= { alarmActiveEntry 12 }
+
+alarmActiveModelPointer OBJECT-TYPE
+ SYNTAX RowPointer
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A pointer to the corresponding row in the
+ alarmModelTable for this active alarm. This
+ points not only to the alarm model being
+ instantiated, but also to the specific alarm
+ state that is active."
+ ::= { alarmActiveEntry 13 }
+
+alarmActiveSpecificPointer OBJECT-TYPE
+ SYNTAX RowPointer
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "If no additional, model-specific, Alarm MIB is supported by
+ the system this object is `0.0'. When a model-specific Alarm
+ MIB is supported, this object is the instance pointer to the
+ specific model-specific active alarm list."
+
+
+
+
+ ::= { alarmActiveEntry 14 }
+
+-- Active Alarm Variable Table --
+
+alarmActiveVariableTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AlarmActiveVariableEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A table of variables to go with active alarm entries."
+ ::= { alarmActive 3 }
+
+alarmActiveVariableEntry OBJECT-TYPE
+ SYNTAX AlarmActiveVariableEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Entries appear in this table when there are variables in
+ the varbind list of a corresponding alarm in
+ alarmActiveTable.
+
+ Entries appear in this table as though
+ the trap/notification had been transported using a
+ SNMPv2-Trap-PDU, as defined in [RFC3416] - i.e., the
+ alarmActiveVariableIndex 1 will always be sysUpTime
+ and alarmActiveVariableIndex 2 will always be
+ snmpTrapOID.
+
+ If the incoming notification is instead an SNMPv1 Trap-PDU and
+ the value of alarmModelVarbindIndex is 1 or 2, an appropriate
+ value for sysUpTime.0 or snmpTrapOID.0 shall be determined
+ by using the rules in section 3.1 of [RFC3584]."
+ INDEX { alarmListName, alarmActiveIndex,
+ alarmActiveVariableIndex }
+ ::= { alarmActiveVariableTable 1 }
+
+AlarmActiveVariableEntry ::= SEQUENCE {
+ alarmActiveVariableIndex Unsigned32,
+ alarmActiveVariableID OBJECT IDENTIFIER,
+ alarmActiveVariableValueType INTEGER,
+ alarmActiveVariableCounter32Val Counter32,
+ alarmActiveVariableUnsigned32Val Unsigned32,
+ alarmActiveVariableTimeTicksVal TimeTicks,
+ alarmActiveVariableInteger32Val Integer32,
+ alarmActiveVariableOctetStringVal OCTET STRING,
+ alarmActiveVariableIpAddressVal IpAddress,
+ alarmActiveVariableOidVal OBJECT IDENTIFIER,
+ alarmActiveVariableCounter64Val Counter64,
+
+
+
+
+ alarmActiveVariableOpaqueVal Opaque }
+
+alarmActiveVariableIndex OBJECT-TYPE
+ SYNTAX Unsigned32 (1..4294967295)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "A strictly monotonically increasing integer, starting at
+ 1 for a given alarmActiveIndex, for indexing variables
+ within the active alarm variable list. "
+ ::= { alarmActiveVariableEntry 1 }
+
+alarmActiveVariableID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The alarm variable's object identifier."
+ ::= { alarmActiveVariableEntry 2 }
+
+alarmActiveVariableValueType OBJECT-TYPE
+ SYNTAX INTEGER {
+ counter32(1),
+ unsigned32(2),
+ timeTicks(3),
+ integer32(4),
+ ipAddress(5),
+ octetString(6),
+ objectId(7),
+ counter64(8),
+ opaque(9)
+ }
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The type of the value. One and only one of the value
+ objects that follow is used for a given row in this table,
+ based on this type."
+ ::= { alarmActiveVariableEntry 3 }
+
+alarmActiveVariableCounter32Val OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'counter32'."
+ ::= { alarmActiveVariableEntry 4 }
+
+
+
+
+
+alarmActiveVariableUnsigned32Val OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'unsigned32'."
+ ::= { alarmActiveVariableEntry 5 }
+
+alarmActiveVariableTimeTicksVal OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'timeTicks'."
+ ::= { alarmActiveVariableEntry 6 }
+
+alarmActiveVariableInteger32Val OBJECT-TYPE
+ SYNTAX Integer32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'integer32'."
+ ::= { alarmActiveVariableEntry 7 }
+
+alarmActiveVariableOctetStringVal OBJECT-TYPE
+ SYNTAX OCTET STRING (SIZE(0..65535))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'octetString'."
+ ::= { alarmActiveVariableEntry 8 }
+
+alarmActiveVariableIpAddressVal OBJECT-TYPE
+ SYNTAX IpAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'ipAddress'."
+ ::= { alarmActiveVariableEntry 9 }
+
+alarmActiveVariableOidVal OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'objectId'."
+ ::= { alarmActiveVariableEntry 10 }
+
+
+
+
+
+alarmActiveVariableCounter64Val OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'counter64'."
+ ::= { alarmActiveVariableEntry 11 }
+
+alarmActiveVariableOpaqueVal OBJECT-TYPE
+ SYNTAX Opaque
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value when alarmActiveVariableType is 'opaque'.
+
+ Note that although RFC2578 [RFC2578] forbids the use
+ of Opaque in 'standard' MIB modules, this particular
+ usage is driven by the need to be able to accurately
+ represent any well-formed notification, and justified
+ by the need for backward compatibility."
+ ::= { alarmActiveVariableEntry 12 }
+
+-- Statistics --
+
+alarmActiveStatsTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AlarmActiveStatsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This table represents the alarm statistics
+ information."
+ ::= { alarmActive 4 }
+
+alarmActiveStatsEntry OBJECT-TYPE
+ SYNTAX AlarmActiveStatsEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Statistics on the current active alarms."
+ INDEX { alarmListName }
+
+ ::= { alarmActiveStatsTable 1 }
+
+AlarmActiveStatsEntry ::=
+ SEQUENCE {
+ alarmActiveStatsActiveCurrent Gauge32,
+ alarmActiveStatsActives ZeroBasedCounter32,
+ alarmActiveStatsLastRaise TimeTicks,
+
+
+
+
+ alarmActiveStatsLastClear TimeTicks
+ }
+
+alarmActiveStatsActiveCurrent OBJECT-TYPE
+ SYNTAX Gauge32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of currently active alarms on the system."
+ ::= { alarmActiveStatsEntry 1 }
+
+alarmActiveStatsActives OBJECT-TYPE
+ SYNTAX ZeroBasedCounter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The total number of active alarms since system restarted."
+ ::= { alarmActiveStatsEntry 2 }
+
+alarmActiveStatsLastRaise OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime at the time of the last
+ alarm raise for this alarm list.
+ If no alarm raises have occurred since the
+ last re-initialization of the local network management
+ subsystem, then this object contains a zero value."
+ ::= { alarmActiveStatsEntry 3 }
+
+alarmActiveStatsLastClear OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The value of sysUpTime at the time of the last
+ alarm clear for this alarm list.
+ If no alarm clears have occurred since the
+ last re-initialization of the local network management
+ subsystem, then this object contains a zero value."
+ ::= { alarmActiveStatsEntry 4 }
+
+-- Alarm Clear
+
+alarmClearMaximum OBJECT-TYPE
+ SYNTAX Unsigned32
+ MAX-ACCESS read-write
+
+
+
+
+ STATUS current
+ DESCRIPTION
+ "This object specifies the maximum number of cleared
+ alarms to store in the alarmClearTable. When this
+ number is reached, the cleared alarms with the
+ earliest clear time will be removed from the table."
+ ::= { alarmClear 1 }
+
+alarmClearTable OBJECT-TYPE
+ SYNTAX SEQUENCE OF AlarmClearEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "This table contains information on
+ cleared alarms."
+ ::= { alarmClear 2 }
+
+alarmClearEntry OBJECT-TYPE
+ SYNTAX AlarmClearEntry
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "Information on a cleared alarm."
+ INDEX { alarmListName, alarmClearDateAndTime,
+alarmClearIndex }
+
+ ::= { alarmClearTable 1 }
+
+AlarmClearEntry ::=
+ SEQUENCE {
+ alarmClearIndex Unsigned32,
+ alarmClearDateAndTime DateAndTime,
+ alarmClearEngineID LocalSnmpEngineOrZeroLenStr,
+ alarmClearEngineAddressType InetAddressType,
+ alarmClearEngineAddress InetAddress,
+ alarmClearContextName SnmpAdminString,
+ alarmClearNotificationID OBJECT IDENTIFIER,
+ alarmClearResourceId ResourceId,
+ alarmClearLogIndex Unsigned32,
+ alarmClearModelPointer RowPointer
+ }
+
+alarmClearIndex OBJECT-TYPE
+ SYNTAX Unsigned32 (1..4294967295)
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "An integer which acts as the index of entries within
+
+
+
+
+ the named alarm list. It wraps back to 1 after it
+ reaches its maximum value.
+
+ This object has the same value as the alarmActiveIndex that
+ this alarm instance had when it was active."
+ ::= { alarmClearEntry 1 }
+
+alarmClearDateAndTime OBJECT-TYPE
+ SYNTAX DateAndTime
+ MAX-ACCESS not-accessible
+ STATUS current
+ DESCRIPTION
+ "The local date and time when the alarm cleared.
+
+ This object facilitates retrieving all instances of
+ alarms that have been cleared since a given point in time.
+
+ Implementations MUST include the offset from UTC,
+ if available. Implementation in environments in which
+ the UTC offset is not available is NOT RECOMMENDED."
+ ::= { alarmClearEntry 2 }
+
+alarmClearEngineID OBJECT-TYPE
+ SYNTAX LocalSnmpEngineOrZeroLenStr
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The identification of the SNMP engine at which the alarm
+ originated. If the alarm is from an SNMPv1 system this
+ object is a zero length string."
+ ::= { alarmClearEntry 3 }
+
+alarmClearEngineAddressType OBJECT-TYPE
+ SYNTAX InetAddressType
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object indicates what type of address is stored in
+ the alarmActiveEngineAddress object - IPv4, IPv6, DNS, etc."
+ ::= { alarmClearEntry 4 }
+
+alarmClearEngineAddress OBJECT-TYPE
+ SYNTAX InetAddress
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The Address of the SNMP engine on which the alarm was
+ occurring. This is used to identify the source of an SNMPv1
+
+
+
+
+ trap, since an alarmActiveEngineId cannot be extracted from the
+ SNMPv1 trap PDU.
+
+ This object MUST always be instantiated, even if the list
+ can contain alarms from only one engine."
+ ::= { alarmClearEntry 5 }
+
+alarmClearContextName OBJECT-TYPE
+ SYNTAX SnmpAdminString (SIZE(0..32))
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The name of the SNMP MIB context from which the alarm came.
+ For SNMPv1 traps this is the community string from the Trap.
+ Note that care needs to be taken when selecting community
+ strings to ensure that these can be represented as a
+ well-formed SnmpAdminString. Community or Context names
+ that are not well-formed SnmpAdminStrings will be mapped
+ to zero length strings.
+
+ If the alarm's source SNMP engine is known not to support
+ multiple contexts, this object is a zero length string."
+ ::= { alarmClearEntry 6 }
+
+alarmClearNotificationID OBJECT-TYPE
+ SYNTAX OBJECT IDENTIFIER
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The NOTIFICATION-TYPE object identifier of the alarm
+ clear."
+ ::= { alarmClearEntry 7 }
+
+alarmClearResourceId OBJECT-TYPE
+ SYNTAX ResourceId
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "This object identifies the resource that was under alarm.
+
+ If there is no corresponding resource, then
+ the value of this object MUST be 0.0."
+ ::= { alarmClearEntry 8 }
+
+alarmClearLogIndex OBJECT-TYPE
+ SYNTAX Unsigned32 (0..4294967295)
+ MAX-ACCESS read-only
+ STATUS current
+
+
+
+
+ DESCRIPTION
+ "This number MUST be the same as the log index of the
+ applicable row in the notification log MIB, if it exists.
+ If no log index applies to the trap, then this object
+ MUST have the value of 0."
+ ::= { alarmClearEntry 9 }
+
+alarmClearModelPointer OBJECT-TYPE
+ SYNTAX RowPointer
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "A pointer to the corresponding row in the
+ alarmModelTable for this cleared alarm."
+ ::= { alarmClearEntry 10 }
+
+-- Notifications
+
+alarmActiveState NOTIFICATION-TYPE
+ OBJECTS { alarmActiveModelPointer,
+ alarmActiveResourceId }
+ STATUS current
+ DESCRIPTION
+ "An instance of the alarm indicated by
+ alarmActiveModelPointer has been raised
+ against the entity indicated by
+ alarmActiveResourceId.
+
+ The agent must throttle the generation of
+ consecutive alarmActiveState traps so that there is at
+ least a two-second gap between traps of this
+ type against the same alarmActiveModelPointer and
+ alarmActiveResourceId. When traps are throttled,
+ they are dropped, not queued for sending at a future time.
+
+ A management application should periodically check
+ the value of alarmActiveLastChanged to detect any
+ missed alarmActiveState notification-events, e.g.,
+ due to throttling or transmission loss."
+ ::= { alarmNotifications 2 }
+
+alarmClearState NOTIFICATION-TYPE
+ OBJECTS { alarmActiveModelPointer,
+ alarmActiveResourceId }
+ STATUS current
+ DESCRIPTION
+ "An instance of the alarm indicated by
+ alarmActiveModelPointer has been cleared against
+
+
+
+
+ the entity indicated by alarmActiveResourceId.
+
+ The agent must throttle the generation of
+ consecutive alarmActiveClear traps so that there is at
+ least a two-second gap between traps of this
+ type against the same alarmActiveModelPointer and
+ alarmActiveResourceId. When traps are throttled,
+ they are dropped, not queued for sending at a future time.
+
+ A management application should periodically check
+ the value of alarmActiveLastChanged to detect any
+ missed alarmClearState notification-events, e.g.,
+ due to throttling or transmission loss."
+ ::= { alarmNotifications 3 }
+
+-- Conformance
+
+alarmConformance OBJECT IDENTIFIER ::= { alarmMIB 2 }
+
+alarmCompliances OBJECT IDENTIFIER ::= { alarmConformance 1 }
+
+alarmCompliance MODULE-COMPLIANCE
+ STATUS current
+ DESCRIPTION
+ "The compliance statement for systems supporting
+ the Alarm MIB."
+ MODULE -- this module
+ MANDATORY-GROUPS {
+ alarmActiveGroup,
+ alarmModelGroup
+ }
+ GROUP alarmActiveStatsGroup
+ DESCRIPTION
+ "This group is optional."
+ GROUP alarmClearGroup
+ DESCRIPTION
+ "This group is optional."
+ GROUP alarmNotificationsGroup
+ DESCRIPTION
+ "This group is optional."
+ ::= { alarmCompliances 1 }
+
+alarmGroups OBJECT IDENTIFIER ::= { alarmConformance 2 }
+
+alarmModelGroup OBJECT-GROUP
+ OBJECTS {
+ alarmModelLastChanged,
+ alarmModelNotificationId,
+
+
+
+
+ alarmModelVarbindIndex,
+ alarmModelVarbindValue,
+ alarmModelDescription,
+ alarmModelSpecificPointer,
+ alarmModelVarbindSubtree,
+ alarmModelResourcePrefix,
+ alarmModelRowStatus
+ }
+ STATUS current
+ DESCRIPTION
+ "Alarm model group."
+ ::= { alarmGroups 1}
+
+alarmActiveGroup OBJECT-GROUP
+ OBJECTS {
+ alarmActiveLastChanged,
+ alarmActiveOverflow,
+ alarmActiveEngineID,
+ alarmActiveEngineAddressType,
+ alarmActiveEngineAddress,
+ alarmActiveContextName,
+ alarmActiveVariables,
+ alarmActiveNotificationID,
+ alarmActiveResourceId,
+ alarmActiveDescription,
+ alarmActiveLogPointer,
+ alarmActiveModelPointer,
+ alarmActiveSpecificPointer,
+ alarmActiveVariableID,
+ alarmActiveVariableValueType,
+ alarmActiveVariableCounter32Val,
+ alarmActiveVariableUnsigned32Val,
+ alarmActiveVariableTimeTicksVal,
+ alarmActiveVariableInteger32Val,
+ alarmActiveVariableOctetStringVal,
+ alarmActiveVariableIpAddressVal,
+ alarmActiveVariableOidVal,
+ alarmActiveVariableCounter64Val,
+ alarmActiveVariableOpaqueVal
+ }
+ STATUS current
+ DESCRIPTION
+ "Active Alarm list group."
+ ::= { alarmGroups 2}
+
+ alarmActiveStatsGroup OBJECT-GROUP
+ OBJECTS {
+ alarmActiveStatsActives,
+
+
+
+
+ alarmActiveStatsActiveCurrent,
+ alarmActiveStatsLastRaise,
+ alarmActiveStatsLastClear
+ }
+ STATUS current
+ DESCRIPTION
+ "Active alarm summary group."
+ ::= { alarmGroups 3}
+
+alarmClearGroup OBJECT-GROUP
+ OBJECTS {
+ alarmClearMaximum,
+ alarmClearEngineID,
+ alarmClearEngineAddressType,
+ alarmClearEngineAddress,
+ alarmClearContextName,
+ alarmClearNotificationID,
+ alarmClearResourceId,
+ alarmClearLogIndex,
+ alarmClearModelPointer
+ }
+ STATUS current
+ DESCRIPTION
+ "Cleared alarm group."
+ ::= { alarmGroups 4}
+
+alarmNotificationsGroup NOTIFICATION-GROUP
+ NOTIFICATIONS { alarmActiveState, alarmClearState }
+ STATUS current
+ DESCRIPTION
+ "The collection of notifications that can be used to
+ model alarms for faults lacking pre-existing
+ notification definitions."
+ ::= { alarmGroups 6 }
+
+END
diff --git a/lib/snmp/test/test-mibs/RFC1271-MIB.mib b/lib/snmp/test/test-mibs/RFC1271-MIB.mib
index 25778dede8..b1b3367667 100644
--- a/lib/snmp/test/test-mibs/RFC1271-MIB.mib
+++ b/lib/snmp/test/test-mibs/RFC1271-MIB.mib
@@ -3,7 +3,8 @@
IMPORTS
Counter FROM RFC1155-SMI
mib-2,DisplayString FROM RFC1213-MIB
- OBJECT-TYPE FROM RFC-1212;
+ OBJECT-TYPE FROM RFC-1212
+ TimeTicks FROM SNMPv2-SMI;
-- This MIB module uses the extended OBJECT-TYPE macro as
-- defined in [9].
diff --git a/lib/snmp/test/test-mibs/RMON2-MIB.mib b/lib/snmp/test/test-mibs/RMON2-MIB.mib
index 827bb38ff9..50c7e6657a 100644
--- a/lib/snmp/test/test-mibs/RMON2-MIB.mib
+++ b/lib/snmp/test/test-mibs/RMON2-MIB.mib
@@ -1,7 +1,7 @@
RMON2-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, Counter32, Integer32,
- Gauge32, IpAddress, TimeTicks FROM SNMPv2-SMI
+ Gauge32, IpAddress, TimeTicks, BITS FROM SNMPv2-SMI
TEXTUAL-CONVENTION, RowStatus, DisplayString, TimeStamp
FROM SNMPv2-TC
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF
diff --git a/lib/snmp/vsn.mk b/lib/snmp/vsn.mk
index 8145e415f3..fb7aa52402 100644
--- a/lib/snmp/vsn.mk
+++ b/lib/snmp/vsn.mk
@@ -2,7 +2,7 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 1997-2012. All Rights Reserved.
+# Copyright Ericsson AB 1997-2013. All Rights Reserved.
#
# The contents of this file are subject to the Erlang Public License,
# Version 1.1, (the "License"); you may not use this file except in
@@ -18,6 +18,6 @@
# %CopyrightEnd%
APPLICATION = snmp
-SNMP_VSN = 4.23
+SNMP_VSN = 4.23.1
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(SNMP_VSN)$(PRE_VSN)"