Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

test: add test for setting linktype

  • Loading branch information...
commit 81ebd191a488dafd9f91e83a30f0e163a23ec9e9 1 parent 589f606
Michael Santos authored

Showing 1 changed file with 34 additions and 1 deletion. Show diff stats Hide diff stats

  1. 35  test/epcap_compile_tests.erl
35  test/epcap_compile_tests.erl
@@ -34,7 +34,6 @@
34 34
 
35 35
 -include_lib("eunit/include/eunit.hrl").
36 36
 
37  
-
38 37
 compile_test() ->
39 38
     {ok,[<<40,0,0,0,12,0,0,0>>,
40 39
          <<21,0,0,5,0,8,0,0>>,
@@ -46,3 +45,37 @@ compile_test() ->
46 45
          <<6,0,0,0,0,0,0,0>>]} = epcap_compile:compile(
47 46
             "ip and ( src host 192.168.10.1 or dst host 192.168.10.1 )"
48 47
             ).
  48
+
  49
+compile_linktype_test() ->
  50
+    DLT_SLIP = 8,
  51
+    Filter = "inbound or ( outbound and portrange 40000-41000 )",
  52
+
  53
+    {ok,[<<48,0,0,0,0,0,0,0>>,
  54
+         <<21,0,25,0,0,0,0,0>>,
  55
+         <<84,0,0,0,240,0,0,0>>,
  56
+         <<21,0,0,9,96,0,0,0>>,
  57
+         <<48,0,0,0,22,0,0,0>>,
  58
+         <<21,0,2,0,132,0,0,0>>,
  59
+         <<21,0,1,0,6,0,0,0>>,
  60
+         <<21,0,0,20,17,0,0,0>>,
  61
+         <<40,0,0,0,56,0,0,0>>,
  62
+         <<53,0,0,1,64,156,0,0>>,
  63
+         <<37,0,0,16,40,160,0,0>>,
  64
+         <<40,0,0,0,58,0,0,0>>,
  65
+         <<53,0,13,15,64,156,0,0>>,
  66
+         <<21,0,0,14,64,0,0,0>>,
  67
+         <<48,0,0,0,25,0,0,0>>,
  68
+         <<21,0,2,0,132,0,0,0>>,
  69
+         <<21,0,1,0,6,0,0,0>>,
  70
+         <<21,0,0,10,17,0,0,0>>,
  71
+         <<40,0,0,0,22,0,0,0>>,
  72
+         <<69,0,8,0,255,31,0,0>>,
  73
+         <<177,0,0,0,16,0,0,0>>,
  74
+         <<72,0,0,0,16,0,0,0>>,
  75
+         <<53,0,0,1,64,156,0,0>>,
  76
+         <<37,0,0,3,40,160,0,0>>,
  77
+         <<72,0,0,0,18,0,0,0>>,
  78
+         <<53,0,0,2,64,156,0,0>>,
  79
+         <<37,0,1,0,40,160,0,0>>,
  80
+         <<6,0,0,0,255,255,0,0>>,
  81
+         <<6,0,0,0,0,0,0,0>>]} = epcap_compile:compile(Filter, [{dlt, DLT_SLIP}]).

0 notes on commit 81ebd19

Please sign in to comment.
Something went wrong with that request. Please try again.