Closed alexshavelev closed 7 years ago
Thanks @alexshavelev !
rebar3 eunit
-record(organizationally_specific, { value = <<>> :: binary(), oui :: atom(), subtype :: pkt:uint8_t() }).
ok, i will look into it, now i get only
Failed to fetch and copy dep: {git,"https://github.com/ates/pcapfile.git",
{branch,"master"}}
not familiar with rebar3, cause switched from rebar2 to erlang.mk
Just do rebar3 eunit and pcapfile will be downloaded:
$ rebar3 eunit
===> Verifying dependencies...
===> Fetching pcapfile ({git,"https://github.com/ates/pcapfile.git",
{branch,"master"}})
===> Compiling pcapfile
===> Compiling pkt
===> Performing EUnit tests...
........................................................................................................
Top 10 slowest tests (0.003 seconds, 0.9% of total time):
pkt_sctp_tests:abort_chunk/0:224
0.003 seconds
pkt_tests:decapsulate_1/0:35
0.000 seconds
pkt_ipv6_tests:ipv6_udp_verify_checksum_2/0:266
0.000 seconds
pkt_802_1q_tests:decode/0:46
0.000 seconds
pkt_tcp_tests:tcp_checksum4/0:29
0.000 seconds
pkt_tests:makesum_1/0:120
0.000 seconds
pkt_ipv6_tests:ipv6_udp_build_checksum_1/0:316
0.000 seconds
pkt_ether_tests:encode/0:32
0.000 seconds
pkt_lldp_tests:encode/0:69
0.000 seconds
pkt_sctp_tests:shutdown_chunk/0:242
0.000 seconds
Finished in 0.329 seconds
104 tests, 0 failures
Also it would be great if you add the tests to this pull request (including pcap files with that specific tlvs)
@ates it wasn't work just with R16. now everything is ok. okey, i add
alex_shavelev@lucky:~/projects/pkt$ rebar3 eunit
===> Verifying dependencies...
===> Fetching pcapfile ({git,"https://github.com/ates/pcapfile.git",
{branch,"master"}})
===> Failed to fetch and copy dep: {git,"https://github.com/ates/pcapfile.git",
{branch,"master"}}
alex_shavelev@lucky:~/projects/pkt$
alex_shavelev@lucky:~/projects/pkt$
alex_shavelev@lucky:~/projects/pkt$ rebar3 --version
rebar 3.1.1+build.3438.ref8284b55 on Erlang/OTP R16B03 Erts 5.10.4
alex_shavelev@lucky:~/projects/pkt$ . /home/alex_shavelev/projects/activate
alex_shavelev@lucky:~/projects/pkt$ rebar3 --version
rebar 3.1.1+build.3438.ref8284b55 on Erlang/OTP 18 Erts 7.3
alex_shavelev@lucky:~/projects/pkt$
alex_shavelev@lucky:~/projects/pkt$
alex_shavelev@lucky:~/projects/pkt$ rebar3 --version
rebar 3.1.1+build.3438.ref8284b55 on Erlang/OTP 18 Erts 7.3
alex_shavelev@lucky:~/projects/pkt$ rebar3 eunit
===> Verifying dependencies...
===> Fetching pcapfile ({git,"https://github.com/ates/pcapfile.git",
{branch,"master"}})
===> Compiling pcapfile
===> Compiling pkt
Try running with debug enabled:
DEBUG=1 rebar3 eunit
My guess is that your version of git is too old.
BTW, if it is a problem with your git version, you can checkout pcapfile manually:
mkdir _checkouts
cd _checkouts
git clone https://github.com/ates/pcapfile.git
cd ..
rebar3 eunit
no, everything is fine with git version (git version 1.9.1) . problem was with old erlang, i switched to 18.2 and it started work.
Hi @msantos ! I was writing tests for improvements and took a look on test packets, it seems some packets aren't classic organizationally specific TLVs. Don't want to change tests before you can look
The oui/subtype need to be removed from the value in the tests:
{organizationally_specific, <<0,18,15,2,7,1,0>>, undefined,undefined},
% should be
{organizationally_specific,<<7,1,0>>,'ieee 802.3',2},
{organizationally_specific,<<7,1,0>>,'ieee 802.3',2},
{organizationally_specific,
<<3,108,0,0,16>>,
'ieee 802.3',1},
{organizationally_specific,
<<1,0,0,0,0>>,
'ieee 802.3',3},
{organizationally_specific,<<5,242>>,'ieee 802.3',4},
{organizationally_specific,<<1,232>>,'ieee 802.1',1},
{organizationally_specific,<<1,0,0>>,'ieee 802.1',2},
{organizationally_specific,
<<1,232,16,118,50,45,48,52,56,56,45,48,51,45,48,53,
48,53,0>>,
'ieee 802.1',3},
{organizationally_specific,<<0>>,'ieee 802.1',4},
The oui's should also be encoded in a type:
% name of type? ieee802_1ab_oui()?
% space in atoms?
-type lldp_oui() :: 'ieee 802.1'
| 'ieee 802.3'
| tr-41
| profibus
| gmbh
-record(organizationally_specific, { value = <<>> :: binary(), oui :: lldp_oui(), subtype = 0 :: pkt:uint8_t() }).
hello, I'm pkt_lldp user, too. let me just make few comments, for your code. I apologize if I've interpreted that incorrectly.
just for interesting, what do you use these org specific for?
thanks in advance.
according to wiki, some customs TLVs can exists, so add support for some published TLVs