snmp_mgr_tests.erl and udp or gen_udp start() function

Philippe Strauss philou@REDACTED
Mon Apr 8 21:36:46 CEST 2002


Hello,

I'm starting to learn Erlang, and I would like to have something
interesting to cut my tooth against, and since I'm in SNMP managers
right now, I try to run snmp_mgr_tests.erl
BUT a compile warning tell me to use gen_udp instead of

from snmp_mgr_tests.erl:
...
-compile(export_all).
-import(snmp_mgr, [gn/1, g/1, s/1, expect/2, expect/4, expect/6]).

start() ->
    udp:start(), <--- warning tells use gen_udp instead !!
    snmp_mgr:start([{agent,"192.168.x.x"},{community,"nopublic"},
%                   {mibs,["STANDARD-MIB.bin"]},
                    quiet]),
    simple_standard_test().
...


BUT neither udp nor gen_udp have a start() function exported,

4> c(snmp_mgr_tests).
{ok,snmp_mgr_tests}
5> snmp_mgr_tests:start().
** exited: {undef,[{gen_udp,start,[]},
                   {snmp_mgr_tests,start,0},
                   {erl_eval,expr,3},
                   {erl_eval,exprs,4},
                   {shell,eval_loop,2}]} **


if I comment out the (gen)_udp:start(), line, I can run
the manager but it only timeout, tcpdumping the loopback show
this:

21:30:19.902606 195.202.200.121.5000 > 195.202.200.121.4000:  udp 41
(DF)
21:30:19.902653 195.202.200.121 > 195.202.200.121: icmp: 195.202.200.121
udp port 4000 unreachable [tos 0xc0] 
...
21:30:23.412972 195.202.200.121.5000 > 195.202.200.121.4000:  udp 42
(DF)
21:30:23.413029 195.202.200.121 > 195.202.200.121: icmp: 195.202.200.121
udp port 4000 unreachable [tos 0xc0] 


so how do we start this udp layer? is there an up-to-date
snmp_mgr_tests.erl?

thanks a lot.

-- 
Philippe Strauss
http://philou.ch/

L'indifférence est le plus grand risque de notre temps,
la forme civilisée de la cruauté.  -- Zenta Maurina
--



More information about the erlang-questions mailing list