From pascal.brisset@REDACTED Fri Feb 21 19:35:52 2003 From: pascal.brisset@REDACTED (Pascal Brisset) Date: Fri, 21 Feb 2003 19:35:52 +0100 Subject: [PATCH] SNMP: OTP MIBs and ucd-snmp Message-ID: <3E26DA8D014C7363@mel-rta9.wanadoo.fr> (added by postmaster@wanadoo.fr) Still posting patches here, until all interested parties have had time to subscribe to erlang-patches... Version 4.2.1 of the popular UCD SNMP tools (snmpwalk etc) fail to parse some OTP MIBs. Fixes can be found below. Most of the patches are for obvious typos; someone please check whether the changes to IMPORTS clauses are correct. -- Pascal Brisset [pascal.brisset@REDACTED] -- -- Cellicium | 157 r des Blains | F-92220 Bagneux -- --- sasl/mibs/OTP-MIB.mib Sun Nov 9 23:54:48 1997 +++ sasl/mibs/OTP-MIB.mib Fri Feb 7 18:58:11 2003 @@ -77,5 +77,5 @@ "A conceptual row in the erlNodeTable." INDEX { erlNodeId } - :: = { erlNodeTable 1 } + ::= { erlNodeTable 1 } ErlNodeEntry ::= SEQUENCE { @@ -99,5 +99,5 @@ DESCRIPTION "An integer that uniquely identifies the erlang node." - :: = { erlNodeEntry 1 } + ::= { erlNodeEntry 1 } erlNodeName OBJECT-TYPE @@ -107,5 +107,5 @@ DESCRIPTION "The symbolic name of the erlang node." - :: = { erlNodeEntry 2 } + ::= { erlNodeEntry 2 } erlNodeMachine OBJECT-TYPE --- eva/mibs/OTP-LOG-MIB.mib Sun Nov 9 23:44:24 1997 +++ eva/mibs/OTP-LOG-MIB.mib Fri Feb 7 18:25:18 2003 @@ -526,5 +526,5 @@ ::= { otpLogMIBGroups 2 } -logAlarmssGroup NOTIFICATION-GROUP +logAlarmsGroup NOTIFICATION-GROUP NOTIFICATIONS { logWrapAlarm, logMediaErrorAlarm } STATUS current --- eva/mibs/OTP-EVA-LOG-MIB.mib Sun Nov 9 23:44:22 1997 +++ eva/mibs/OTP-EVA-LOG-MIB.mib Fri Feb 7 21:52:42 2003 @@ -11,5 +11,5 @@ otpModules FROM OTP-REG - otpEvaMIBObjects, otpEvaMIBCompliances + otpEvaMIBObjects, otpEvaMIBCompliances, otpEvaMIBGroups FROM OTP-EVA-MIB logIndex --- eva/mibs/OTP-SNMPEA-LOG-MIB.mib Sun Nov 9 23:44:27 1997 +++ eva/mibs/OTP-SNMPEA-LOG-MIB.mib Fri Feb 7 21:51:45 2003 @@ -9,5 +9,5 @@ otpModules FROM OTP-REG - otpSnmpeaMIBObjects, otpSnmpeaMIBCompliances + otpSnmpeaMIBObjects, otpSnmpeaMIBCompliances, otpSnmpeaMIBGroups FROM OTP-SNMPEA-MIB logTransferIndex From james@REDACTED Sat Feb 22 17:39:43 2003 From: james@REDACTED (James Hague) Date: Sat, 22 Feb 2003 10:39:43 -0600 Subject: Non-exported driver functions in Windows build In-Reply-To: Message-ID: <3E57536F.19994.5E28B@localhost> At least the following functions, declared in erl_driver.h, should be exported from beam.dll under Windows, but aren't: driver_output_term driver_send_term driver_mk_atom driver_mk_port driver_connected driver_caller driver_term_nil This can be fixed by adding the above lines to erl.def. It only requires relinking. James From kent@REDACTED Sun Feb 23 00:32:47 2003 From: kent@REDACTED (Kent Boortz) Date: 23 Feb 2003 00:32:47 +0100 Subject: Non-exported driver functions in Windows build In-Reply-To: <3E57536F.19994.5E28B@localhost> References: <3E57536F.19994.5E28B@localhost> Message-ID: "James Hague" writes: > At least the following functions, declared in erl_driver.h, should be > exported from beam.dll under Windows, but aren't: > > driver_output_term > driver_send_term > driver_mk_atom > driver_mk_port > driver_connected > driver_caller > driver_term_nil > > This can be fixed by adding the above lines to erl.def. It only > requires relinking. Thanks, these are added to the source, kent From etxuwig@REDACTED Mon Feb 24 19:29:34 2003 From: etxuwig@REDACTED (Ulf Wiger) Date: Mon, 24 Feb 2003 19:29:34 +0100 (MET) Subject: suggested patch: file:script() Message-ID: I've attached a diff to file.erl in kernel-2.8.1 that adds the following functions for evaluating scripts (and being able to capture a return value -- something file:eval/1 will not let you do.) /Uffe script(File) -> {ok, ReturnValue} | {error, Reason} evaluates the expressions in File. Returns the result of the last expression. The expressions can create bindings to be reused in following expressions, just like in the Erlang shell. script(File, Bindings) -> {ok, ReturnValue} | {error, Reason} Like script/1, but with predefined bindings. Use the functions in erl_eval.erl to manage bindings. path_script(Path, File [, Bindings]) -> {ok, ReturnValue, Fullname} | {error, Reason} Analogous to path_eval/2, but for script/[2,3] above. Example, using two "script" files: eval1.txt: ---------- Cwd = fun() -> {ok,D} = file:get_cwd(), D end, [{cwd, Cwd()}]. eval2.txt: (assuming that the variable Var is bound) ---------- Cwd = fun() -> {ok,D} = file:get_cwd(), D end, [{var, Var}, {cwd, Cwd()}]. erl -boot start_clean -pa ../ebin -nostick Erlang (BEAM) emulator version 5.2.3.1 [hipe] [threads:0] Eshell V5.2.3.1 (abort with ^G) 1> file:script("eval1.txt"). {ok,[{cwd,"/home/etxuwig/work/erlang/open_source/contribs/mine/not_ready/builder-0.5/src"}]} 2> file:script("eval2.txt"). {error,[{7,file,{{unbound,'Var'},[{erl_eval,expr,3}]}}, {error,undefined_script}]} 3> file:script("eval2.txt",erl_eval:add_binding('Var',the_value,erl_eval:new_bindings())). {ok,[{var,the_value}, {cwd,"/home/etxuwig/work/erlang/open_source/contribs/mine/not_ready/builder-0.5/src"}]} 4> -- Ulf Wiger, Senior Specialist, / / / Architecture & Design of Carrier-Class Software / / / Strategic Product & System Management / / / Ericsson AB, Connectivity and Control Nodes -------------- next part -------------- 44d43 < -export([script/1, script/2, path_script/2, path_script/3]). 833c832 < R = eval_stream(Fd, ignore, erl_eval:new_bindings()), --- > R = eval_stream(Fd, erl_eval:new_bindings()), 843c842 < case eval_stream(Fd, ignore, erl_eval:new_bindings()) of --- > case eval_stream(Fd, erl_eval:new_bindings()) of 855,891d853 < script(File) -> < script(File, erl_eval:new_bindings()). < < script(File, Bs) -> < case open(File, [read]) of < {ok, Fd} -> < R = case eval_stream(Fd, return, Bs) of < {ok, Result} -> < Result; < Error1 -> < Error1 < end, < close(Fd), < R; < Error -> < Error < end. < < path_script(Path, File) -> < path_script(Path, File, erl_eval:new_bindings()). < < path_script(Path, File, Bs) -> < case path_open(Path, File, [read]) of < {ok,Fd,Full} -> < case eval_stream(Fd, return, Bs) of < {error,E} -> < close(Fd), < {error,E}; < {ok, R} -> < close(Fd), < {R,Full} < end; < Error -> < Error < end. < < 961,962c923,927 < eval_stream(Fd, Handling, Bs) -> < eval_stream(Fd, Handling, undefined, [], Bs). --- > eval_stream(Fd, Bs) -> > case eval_stream(Fd, [], Bs) of > [] -> ok; > [Error1 | _] -> {error,Error1} > end. 964,965c929,930 < eval_stream(Fd, Handling, Last, E, Bs) -> < eval_stream(io:parse_erl_exprs(Fd, ''), Fd, Handling, Last, E, Bs). --- > eval_stream(Fd, E, Bs) -> > eval_stream(io:parse_erl_exprs(Fd, ''), Fd, E, Bs). 967,968c932 < < eval_stream({ok,Form,EndLine}, Fd, Handling, Last, E, Bs0) -> --- > eval_stream({ok,Form,EndLine}, Fd, E, Bs0) -> 971c935 < eval_stream(Fd, Handling, {V}, E, Bs); --- > eval_stream(Fd, E, Bs); 973c937 < eval_stream(Fd, Handling, Last, [{EndLine,?MODULE,Reason}|E], Bs0) --- > eval_stream(Fd, [{EndLine,?MODULE,Reason}|E], Bs0) 975,987c939,942 < eval_stream({error,What,EndLine}, Fd, H, L, E, Bs) -> < eval_stream(Fd, H, L, [What | E], Bs); < eval_stream({eof,EndLine}, Fd, H, Last, E, Bs) -> < case {H, Last, E} of < {return, {Val}, []} -> < {ok, Val}; < {return, undefined, E} -> < {error, lists:reverse([{error, undefined_script}|E])}; < {ignore, _, []} -> < ok; < {_, _, [_|_] = E} -> < {error, lists:reverse(E)} < end. --- > eval_stream({error,What,EndLine}, Fd, E, Bs) -> > eval_stream(Fd, [What | E], Bs); > eval_stream({eof,EndLine}, Fd, E, Bs) -> > lists:reverse(E).