Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c2f476c869 | ||
|
|
e6c3c0139a | ||
|
|
aad896c2a8 | ||
|
|
1a6a9593fb | ||
|
|
6cb40ac75e | ||
|
|
50591238e5 | ||
|
|
291acb9459 | ||
|
|
47c2ad1b5f | ||
|
|
6491568e15 | ||
|
|
28ac30d827 | ||
|
|
db74459ca2 | ||
|
|
d2bc3ea209 | ||
|
|
cd9d456994 | ||
|
|
579f1b05db | ||
|
|
7e41309fa9 | ||
|
|
3091dc3c48 | ||
|
|
01bf295a19 | ||
|
|
f88648fbc8 | ||
|
|
18b9589e50 | ||
|
|
9847c2ccbb | ||
|
|
335b336968 | ||
|
|
70eb619b86 | ||
|
|
b3b8feabf1 | ||
|
|
d9cf798753 | ||
|
|
cbb2eb8c8f | ||
|
|
6474125c93 | ||
|
|
5100cc0eae | ||
|
|
49ed41142c | ||
|
|
659649d2e9 | ||
|
|
5246656ae0 | ||
|
|
f828dfc202 | ||
|
|
591158bb92 | ||
|
|
667e77c609 | ||
|
|
a499f369a5 | ||
|
|
fbf6bd2be8 | ||
|
|
212598b45e | ||
|
|
8b0e735f67 | ||
|
|
d9c963061b | ||
|
|
30b72eae64 | ||
|
|
475f54e9d1 | ||
|
|
34dfe7d375 | ||
|
|
06789406ad | ||
|
|
1ebc510bcb | ||
|
|
90ffa1fc2c | ||
|
|
f942cef2f1 | ||
|
|
7fce8f02d2 | ||
|
|
3986a951d8 | ||
|
|
22356fa69b | ||
|
|
e00b06926e | ||
|
|
dc9409ae12 | ||
|
|
2b4321b5c3 | ||
|
|
6b16ad709e | ||
|
|
3407db11cd | ||
|
|
326a2fb7ed | ||
|
|
eef175e579 | ||
|
|
9af00fdb4c | ||
|
|
6c2cfb34f7 | ||
|
|
5171309c43 | ||
|
|
c77ec63ed8 | ||
|
|
30afa082e4 | ||
|
|
ea64f8b0da | ||
|
|
e2310751f1 | ||
|
|
47b5e45f13 | ||
|
|
31275398aa | ||
|
|
c1166c37d1 | ||
|
|
5420b6359b | ||
|
|
5e47871256 | ||
|
|
1585503809 | ||
|
|
60636a9a88 | ||
|
|
fcf4b25bc3 | ||
|
|
0efc4a706d | ||
|
|
fb7416cb9d | ||
|
|
32c62faa78 | ||
|
|
363deeb23d | ||
|
|
131f68117b | ||
|
|
05cef1d69a | ||
|
|
71ef54f561 | ||
|
|
f9c217e42a | ||
|
|
36c1b72118 | ||
|
|
6dd42d19f7 | ||
|
|
5d3ac78250 | ||
|
|
f56b083bc3 | ||
|
|
79be44ddea | ||
|
|
dcdd7562f4 | ||
|
|
66b759ca69 | ||
|
|
529492e81f | ||
|
|
1076455c01 | ||
|
|
2d486aeed8 | ||
|
|
00c35e48a2 | ||
|
|
8380b505f4 | ||
|
|
564d622cc9 | ||
|
|
a067350098 | ||
|
|
50216991bd | ||
|
|
3707553906 | ||
|
|
b8fec1e3ce | ||
|
|
979330392e | ||
|
|
11898f0268 | ||
|
|
78176d2b7b | ||
|
|
64633939e0 | ||
|
|
f717be19cb | ||
|
|
9c6c15cd6b | ||
|
|
3adccc98f7 | ||
|
|
79f3199339 | ||
|
|
23042b3c9a | ||
|
|
e819899221 | ||
|
|
b92541a08e | ||
|
|
c54a8f8cfa | ||
|
|
3b5f32f261 | ||
|
|
7798b964fe | ||
|
|
44e2e0beea | ||
|
|
32a9b8fd14 | ||
|
|
5a7f58d23f | ||
|
|
6aaca82d0e | ||
|
|
07a81f5e15 | ||
|
|
c9a2eb54c1 | ||
|
|
8a59581668 | ||
|
|
5950ad7ef8 | ||
|
|
4b720c4f3c | ||
|
|
480791a057 | ||
|
|
076bd3d1f4 | ||
|
|
d8e4111a9d | ||
|
|
9c1029ff6c | ||
|
|
56f14ebee4 | ||
|
|
aa5d06bb1a | ||
|
|
025ca46981 | ||
|
|
521afe7e1f | ||
|
|
c7e53724dc | ||
|
|
85f25fad6d | ||
|
|
b63279af8d | ||
|
|
5281fcf3cd | ||
|
|
462da90a21 | ||
|
|
a2acd09263 | ||
|
|
957b01aa71 | ||
|
|
ac31c1ba98 | ||
|
|
3aaae46c66 | ||
|
|
53882ef736 | ||
|
|
21da70fd75 | ||
|
|
d4a20ba6a8 | ||
|
|
4204e2f614 | ||
|
|
38199a589f | ||
|
|
b19cd086b4 | ||
|
|
e935ee77bf | ||
|
|
6a9fc935eb | ||
|
|
06bb9a9c57 | ||
|
|
6e7a1022b2 | ||
|
|
76d058360e | ||
|
|
9fa6119f14 | ||
|
|
be38c3d90e | ||
|
|
6ba79afc23 | ||
|
|
12a1b0d7a3 | ||
|
|
029ca0797a | ||
|
|
a5dd00eedb | ||
|
|
b98f79eaa6 | ||
|
|
16e57f64cd | ||
|
|
9e47e49ade | ||
|
|
df54e8b926 | ||
|
|
01949c47da | ||
|
|
52a2c0589e | ||
|
|
12368ba2d5 | ||
|
|
053dbd73a6 | ||
|
|
8f631fa19d | ||
|
|
344392868b | ||
|
|
0624afd422 | ||
|
|
c3f5307a3d | ||
|
|
e6412949f1 | ||
|
|
ea74d87fd8 | ||
|
|
5e0880dac6 | ||
|
|
26e36a19bf | ||
|
|
aea81e4a1a | ||
|
|
39b9f6752c | ||
|
|
73b4019561 | ||
|
|
3b5d8177f7 | ||
|
|
f8c6e9d714 | ||
|
|
da588f6a30 | ||
|
|
ee7a30385b | ||
|
|
809535e0a2 | ||
|
|
57fb117571 | ||
|
|
78feabfad7 | ||
|
|
54306411a4 | ||
|
|
f2280c90a4 | ||
|
|
e09ebab0c2 | ||
|
|
d18824a73f | ||
|
|
d2d20a8aa4 | ||
|
|
fbf7fe2424 | ||
|
|
ced9658c63 | ||
|
|
d896ce7469 | ||
|
|
77cb8ccaea | ||
|
|
35dc6e27ae | ||
|
|
61e297b851 | ||
|
|
1d1082342f | ||
|
|
f5e366d8c4 | ||
|
|
8d52491508 | ||
|
|
caf602c4a9 | ||
|
|
bf8c9c2625 | ||
|
|
f024e72eff | ||
|
|
9561f37998 | ||
|
|
13e592275a | ||
|
|
3f9434b81d | ||
|
|
00e6ee3dc3 | ||
|
|
a06c399530 | ||
|
|
cd12a86088 | ||
|
|
61bc528159 | ||
|
|
811717e7c1 | ||
|
|
cb8f4f87bf | ||
|
|
dfd8cbc4e1 | ||
|
|
d88a73397d | ||
|
|
90ec8040e6 | ||
|
|
f1f8afdddf | ||
|
|
7fd8406916 | ||
|
|
b5a8c6bae8 | ||
|
|
a6c56b5682 | ||
|
|
e5546eb988 | ||
|
|
3577072b12 | ||
|
|
5b03443693 | ||
|
|
8af18763cc | ||
|
|
840dab894f | ||
|
|
df7015f3a5 | ||
|
|
8547b50be7 | ||
|
|
7090ef838c | ||
|
|
950f5db3dd | ||
|
|
8eaf0cefa1 | ||
|
|
8b1f8636d1 | ||
|
|
1b5c90cfbe | ||
|
|
33e0be73f7 | ||
|
|
6e62367b56 | ||
|
|
d6176ff668 | ||
|
|
2831d64f6a | ||
|
|
a4532a4999 | ||
|
|
3caac691d5 | ||
|
|
ee957e0831 | ||
|
|
c9f32ee76d | ||
|
|
a488c9b7dc | ||
|
|
50645e11d8 | ||
|
|
3e53577936 | ||
|
|
a0980228ef | ||
|
|
6e6b623057 | ||
|
|
159e6228fe | ||
|
|
cf07c92538 | ||
|
|
23e08c93b6 | ||
|
|
169aa11adc | ||
|
|
7e38a4f790 | ||
|
|
2787c2390c | ||
|
|
441e43c167 | ||
|
|
4f72b954da | ||
|
|
5dbe705dd3 | ||
|
|
2155dd9153 | ||
|
|
f7e95b4ee8 | ||
|
|
36adc23507 | ||
|
|
2ee871f5e6 | ||
|
|
39d7738042 | ||
|
|
75993242b0 | ||
|
|
83d5a46ec4 | ||
|
|
7f197d12dd | ||
|
|
d273b67fd7 | ||
|
|
aefd16647e | ||
|
|
98d1c762cd | ||
|
|
2476c3c1b6 | ||
|
|
ed830d2474 | ||
|
|
8bcafff569 | ||
|
|
9b91623d57 | ||
|
|
27d66f6845 | ||
|
|
b10e526364 | ||
|
|
cf26e8429e | ||
|
|
094ddc2048 | ||
|
|
25a4569e67 | ||
|
|
47f922fa7b | ||
|
|
82c244b04f | ||
|
|
f80f0eedc0 | ||
|
|
1b162234f0 | ||
|
|
3ac47a5104 | ||
|
|
b2f0558080 | ||
|
|
50624b390e | ||
|
|
1dd93590e4 | ||
|
|
662ef2f65b | ||
|
|
83104eb8b6 | ||
|
|
cd2a328cc5 | ||
|
|
f255b10524 | ||
|
|
4ba6ba70c5 | ||
|
|
0827a6bf8b | ||
|
|
4348109931 | ||
|
|
59097a2d30 | ||
|
|
b129487636 | ||
|
|
2c014c5693 | ||
|
|
80fa0b5f98 | ||
|
|
688d7c33e4 | ||
|
|
b0f3852fed | ||
|
|
cd595caf8d | ||
|
|
c115903fbb | ||
|
|
807db80afc | ||
|
|
8939a72ea8 | ||
|
|
baae16ec2f | ||
|
|
41b40ddf18 | ||
|
|
8cc2b04f3c | ||
|
|
98b3268bfb | ||
|
|
f575959cd2 | ||
|
|
c2002cd48f | ||
|
|
9fb5981128 | ||
|
|
1a4e57e736 | ||
|
|
d6f7dd9c08 | ||
|
|
4176fd5068 | ||
|
|
1808519b5b | ||
|
|
83b1b34c18 | ||
|
|
b4d535e184 | ||
|
|
f7e9264c36 | ||
|
|
d4d4f2a17c | ||
|
|
d3d6a95da7 | ||
|
|
8a6a8ea07e | ||
|
|
ecb048a7bc | ||
|
|
8e8445e02f | ||
|
|
0e3248b0f7 | ||
|
|
0e8756ab46 | ||
|
|
b2bc6039da | ||
|
|
22beb7714d | ||
|
|
299b9435d0 | ||
|
|
31478703c2 | ||
|
|
a1367a9d39 | ||
|
|
7dc20134c0 | ||
|
|
63c97753a1 | ||
|
|
5515c3a109 | ||
|
|
5547ef06b3 | ||
|
|
65b39240aa | ||
|
|
449e06df77 | ||
|
|
c4885fe260 | ||
|
|
5a8aa3d72d | ||
|
|
7ad04a2184 | ||
|
|
d8ed5b1005 | ||
|
|
93ceb14302 | ||
|
|
0326442faf | ||
|
|
89f1e663fa | ||
|
|
5e2f75f5f0 | ||
|
|
7cab6efcd5 | ||
|
|
d79c5ffc24 | ||
|
|
3ba3a08141 | ||
|
|
1d4eeaa328 | ||
|
|
b1f6ac1a84 | ||
|
|
a90b97bc10 | ||
|
|
f336f1a340 | ||
|
|
fbfe3e004c | ||
|
|
9a809bf673 | ||
|
|
baa761a2e2 | ||
|
|
ad401c4192 | ||
|
|
5ebc85e705 | ||
|
|
b021f5bce1 | ||
|
|
5f1131cae2 | ||
|
|
f664aee00b | ||
|
|
01649f097c | ||
|
|
abf5bea425 | ||
|
|
6ca6d96821 | ||
|
|
e6b594a626 | ||
|
|
c15f2bda97 | ||
|
|
41c720d951 | ||
|
|
be52d4e9ad | ||
|
|
7ec3af2156 | ||
|
|
bab373f992 | ||
|
|
55d1362924 | ||
|
|
6e85b93442 | ||
|
|
2e13e44b9c | ||
|
|
0b72c2fce3 | ||
|
|
6d7f5552de | ||
|
|
c5bc91145f | ||
|
|
cfa9a79f67 | ||
|
|
d66e473a2c | ||
|
|
9bfab472e4 | ||
|
|
1a605e2b77 | ||
|
|
5c39d65f8f | ||
|
|
5bf6be7eb8 | ||
|
|
e857c5fb41 | ||
|
|
4a1ced3709 | ||
|
|
dbb9724c4e | ||
|
|
100062a156 | ||
|
|
a40507b8b2 | ||
|
|
592b769f67 | ||
|
|
5b8d566a79 | ||
|
|
7235c9a73a | ||
|
|
8395bdac97 | ||
|
|
e2119896db | ||
|
|
68f1653dec | ||
|
|
30d29f7ac3 | ||
|
|
117e61c34b | ||
|
|
412cb2e6e8 | ||
|
|
b11390429c | ||
|
|
5a08303c43 | ||
|
|
5fef520d0e | ||
|
|
6edece628e | ||
|
|
be749e75a5 | ||
|
|
ac5cb53066 | ||
|
|
684c924587 | ||
|
|
090dc752bd | ||
|
|
348159dc3a | ||
|
|
d4ca57884b | ||
|
|
8ec2867433 | ||
|
|
0aa5ebde5d | ||
|
|
6029510ee7 | ||
|
|
7d39ba2124 | ||
|
|
ae959f2d78 | ||
|
|
968085c965 | ||
|
|
62a65aa4cc | ||
|
|
bc7f0b3686 | ||
|
|
87b49c5249 | ||
|
|
ef1a84fb39 | ||
|
|
c46af1291a | ||
|
|
f3f83f2eee | ||
|
|
d9bef8fa46 | ||
|
|
af3086fb82 | ||
|
|
e0366a9965 | ||
|
|
88d47399b5 | ||
|
|
05912a49ae | ||
|
|
b462a0845f | ||
|
|
39dc99443c | ||
|
|
c2f51cf7ab | ||
|
|
9c4a446c76 | ||
|
|
e49c9f36e8 | ||
|
|
1467ad68d4 | ||
|
|
9a4634adbb | ||
|
|
984eedc5ea | ||
|
|
7bf508df0a | ||
|
|
5570e6cbee | ||
|
|
3e529dd042 | ||
|
|
2049e3d655 | ||
|
|
2d72e2a2ae | ||
|
|
67aa9f2350 | ||
|
|
a5268b1137 | ||
|
|
6b5f640849 | ||
|
|
1b5b38a3ba | ||
|
|
e1b5b54c4c | ||
|
|
22b7b407c3 | ||
|
|
284bb21d61 | ||
|
|
f6eebb9c81 | ||
|
|
b08fbe46c0 | ||
|
|
4a751f9d05 | ||
|
|
c5c417e526 | ||
|
|
46284e1537 | ||
|
|
694bc039e8 | ||
|
|
d21dbee102 | ||
|
|
2b9f8f6a89 | ||
|
|
61f8f56719 | ||
|
|
d67d3eed3c | ||
|
|
4829222e73 | ||
|
|
554278e678 | ||
|
|
b1ecc45e4f | ||
|
|
d17ea73273 | ||
|
|
07b1a93026 | ||
|
|
98dcfd8393 | ||
|
|
e1efee8594 | ||
|
|
993605d4f3 | ||
|
|
904210e87c | ||
|
|
50e26ca400 | ||
|
|
c723f7e668 | ||
|
|
1a20029c82 | ||
|
|
26bd42a71c | ||
|
|
601f7f59ff | ||
|
|
b39eb67836 | ||
|
|
cb6aabbf19 | ||
|
|
b89a2dce6f | ||
|
|
97a57ac68d | ||
|
|
a487a58884 | ||
|
|
ccfe37870c | ||
|
|
867acf717a | ||
|
|
6f27a48721 | ||
|
|
185cd4fb30 | ||
|
|
73b3ee51d1 | ||
|
|
b579408711 | ||
|
|
ec0e6f98d4 | ||
|
|
b4b682a4bf | ||
|
|
167732cae4 | ||
|
|
2b128a2f1b | ||
|
|
f4bba23ba7 | ||
|
|
724d182939 | ||
|
|
ebb6d4499a | ||
|
|
b2282a49b5 | ||
|
|
a044178b47 | ||
|
|
a874e7869c | ||
|
|
cef42b4050 | ||
|
|
0a2cbe4926 | ||
|
|
99c9f1d36b | ||
|
|
0091f35e02 | ||
|
|
f2730f06a0 | ||
|
|
5271233774 | ||
|
|
5da83360aa | ||
|
|
cd26942edf | ||
|
|
8a7dc10f51 | ||
|
|
c2bbe79a3e | ||
|
|
e6dc092b73 | ||
|
|
5c1954012b | ||
|
|
21567e8686 | ||
|
|
1af3d571d9 | ||
|
|
442adce51d | ||
|
|
3f5e4cb7ee | ||
|
|
4c6f9d5c25 | ||
|
|
a43244e493 | ||
|
|
5c2fa2d2e7 | ||
|
|
aa6167bb42 | ||
|
|
205b82f6ba | ||
|
|
a03a343723 | ||
|
|
92d19ae2ed | ||
|
|
32d02836f0 | ||
|
|
4030b52ecb | ||
|
|
064b50df81 | ||
|
|
af5021d571 | ||
|
|
e1b905124f | ||
|
|
6cae3a7dce | ||
|
|
d4a16d9e55 | ||
|
|
6c2c885176 | ||
|
|
43f18ddb0f | ||
|
|
b9a2511ea8 | ||
|
|
c96507b7a4 | ||
|
|
e2f2111637 | ||
|
|
9a94c34b91 | ||
|
|
6581579d37 | ||
|
|
4cc54cceb5 | ||
|
|
a9c01ded17 | ||
|
|
cbc08f7e50 | ||
|
|
45582194cf | ||
|
|
56b6c7ed93 | ||
|
|
c1db9a830d | ||
|
|
4c5de9ef8e | ||
|
|
3a21152f4c | ||
|
|
b97e3ee51a | ||
|
|
2b0809f3dc | ||
|
|
29cd6ef994 | ||
|
|
d8b2189cc3 | ||
|
|
3a8c2d0b6f | ||
|
|
eed3ba5d1e | ||
|
|
bc68949c76 | ||
|
|
e4ef2d8140 | ||
|
|
0659f9b592 | ||
|
|
0390c8ccfb | ||
|
|
281ba768ec | ||
|
|
806fae6596 | ||
|
|
65359e53d8 | ||
|
|
92b1b46fa6 | ||
|
|
760d468aca | ||
|
|
6a5b380bc7 | ||
|
|
689d3e7602 | ||
|
|
4300208642 | ||
|
|
149818671d | ||
|
|
dc1f005823 | ||
|
|
eeb6f9334a | ||
|
|
3add72c686 | ||
|
|
5de6a96af5 | ||
|
|
1e014aa95b | ||
|
|
9962eb1f08 | ||
|
|
6bc35b92d3 | ||
|
|
40aaa05456 | ||
|
|
e17f62d261 | ||
|
|
65cde78f6d | ||
|
|
9a5402518c | ||
|
|
11fc826e52 | ||
|
|
249b5d6783 | ||
|
|
7a2dcf0f9f | ||
|
|
710d528215 | ||
|
|
ce0a3e858a | ||
|
|
d178bec60e | ||
|
|
fba88e225f | ||
|
|
7bac815938 | ||
|
|
18916e682f | ||
|
|
fbe1fb285d | ||
|
|
04014d73d9 | ||
|
|
1aa10f5211 | ||
|
|
35fe91116a | ||
|
|
fa34be1a00 | ||
|
|
7bb615a262 | ||
|
|
c51f88e62a | ||
|
|
120e3473f8 | ||
|
|
4a5407feb7 | ||
|
|
d332370298 | ||
|
|
d5b15c498b | ||
|
|
66e93da6f5 | ||
|
|
f8fed9be7e | ||
|
|
3dbb97413c | ||
|
|
47f9f54b89 | ||
|
|
e89ce717ba | ||
|
|
0645625585 | ||
|
|
e115e0b89e | ||
|
|
6a7ad10ae0 | ||
|
|
5a2f556ff7 | ||
|
|
b0e0b29201 | ||
|
|
616b6ce4d5 | ||
|
|
6a27b6262d | ||
|
|
940c185c5d | ||
|
|
f831f30556 | ||
|
|
fd93036b79 | ||
|
|
889cdbff3c | ||
|
|
a787287bfa | ||
|
|
c2c92b2e9b | ||
|
|
e68aeb69eb | ||
|
|
846f457db4 | ||
|
|
35ab1b5d1c | ||
|
|
76e1bed466 | ||
|
|
100acbbe7b | ||
|
|
66044578c2 | ||
|
|
eb92c6b676 | ||
|
|
af04f78bd7 | ||
|
|
b35c1ab696 | ||
|
|
5c1c8b80e2 | ||
|
|
787ca096e6 | ||
|
|
363b38ceb0 | ||
|
|
e2cfc96577 | ||
|
|
b16769ddbe | ||
|
|
ffbe5d1e22 | ||
|
|
1d2e67d38c | ||
|
|
b6eecd7d0c | ||
|
|
b229b89c78 | ||
|
|
b161a6d7f7 | ||
|
|
799e39227c | ||
|
|
38820ec916 | ||
|
|
be1ee30fa8 | ||
|
|
beb069df64 | ||
|
|
9941045468 | ||
|
|
8fa2d8f0d6 | ||
|
|
a3d32d9d80 | ||
|
|
bf35300817 | ||
|
|
ff9af3166f | ||
|
|
8805d8523b | ||
|
|
0610ae2d21 | ||
|
|
5972fca190 | ||
|
|
9f8fedb3b1 | ||
|
|
048ab4b5d3 | ||
|
|
8aa1d770f0 | ||
|
|
4e6dda6361 | ||
|
|
e44834e0c5 | ||
|
|
1a3ee31865 | ||
|
|
721af38aed | ||
|
|
2ac04dba4d | ||
|
|
e7fbcc690b | ||
|
|
f4ce6a8023 | ||
|
|
773dbf4ef2 | ||
|
|
5486dcd1f9 | ||
|
|
61f0eb062e | ||
|
|
b68f197fea | ||
|
|
39e475b4ea | ||
|
|
f5b8855fed | ||
|
|
03e8111e1b | ||
|
|
e26b64a0fc | ||
|
|
8b1aa4a7bd | ||
|
|
b2b36be6cf | ||
|
|
7d82948bd1 | ||
|
|
f7515514bd | ||
|
|
12a3d80f71 | ||
|
|
ef69a1610a | ||
|
|
483eb63408 | ||
|
|
b019dcd11a | ||
|
|
163945f4b4 | ||
|
|
22ee439215 | ||
|
|
582f5e0f72 | ||
|
|
5f672dfb42 | ||
|
|
6f31ae722e | ||
|
|
cc5167c09a | ||
|
|
c6eb41b7bf | ||
|
|
eeef26ae59 | ||
|
|
d53b655c32 | ||
|
|
be81d33495 | ||
|
|
035a290ab5 | ||
|
|
c041a723c1 | ||
|
|
45ca2ace0b | ||
|
|
424fbb710c | ||
|
|
169a8fb97f | ||
|
|
098812d3cc | ||
|
|
4eb5297a79 | ||
|
|
c52c738408 | ||
|
|
797eb2c3ca | ||
|
|
d9a2d9a6bd | ||
|
|
4da4db1e73 | ||
|
|
4c23c3fec9 | ||
|
|
2ab1faf05a | ||
|
|
f670eefd84 | ||
|
|
4e1c301b2a | ||
|
|
b25e3e0917 | ||
|
|
f571d7ed3a | ||
|
|
9abbef7e05 | ||
|
|
1fbe25f91e | ||
|
|
19ad081bb1 | ||
|
|
911be714e5 | ||
|
|
f51fef6027 | ||
|
|
8761e3a869 | ||
|
|
b9a1eba152 | ||
|
|
1e19b689c4 | ||
|
|
0f94a46f86 | ||
|
|
d9659617e9 | ||
|
|
edf0b2fbfe | ||
|
|
61c8dca469 | ||
|
|
d86e504779 | ||
|
|
3d6b4d4dff | ||
|
|
45bcb9927d | ||
|
|
612a07f420 | ||
|
|
d129abcde0 | ||
|
|
6fad364daa | ||
|
|
dc7a85ee76 | ||
|
|
26aec8714e | ||
|
|
65f61fd5b1 | ||
|
|
57ad066e66 | ||
|
|
2a2a0d4aeb | ||
|
|
1082a234fe | ||
|
|
141bb48d76 | ||
|
|
85bb227b45 | ||
|
|
2005979f46 | ||
|
|
48a206a434 | ||
|
|
3a6d2c7c5f | ||
|
|
800ad1737c | ||
|
|
c7eb8d1082 | ||
|
|
4564b973df | ||
|
|
2586618c1b | ||
|
|
7758bc821e | ||
|
|
78f7f19359 | ||
|
|
04e45f503b | ||
|
|
58e97c966c | ||
|
|
e3d15ef4e7 | ||
|
|
61f1ace43f | ||
|
|
087ca9d0d5 | ||
|
|
002b8b04e9 | ||
|
|
6f0232763c | ||
|
|
8169b35fa6 | ||
|
|
097ba22a59 | ||
|
|
78ebb3445a | ||
|
|
b8fb5fb403 | ||
|
|
93f01e614f | ||
|
|
e9f00a4e8a | ||
|
|
7d0397a8fb | ||
|
|
2682ab6791 | ||
|
|
b60e82c702 | ||
|
|
bac82eeb8e | ||
|
|
94c134318b | ||
|
|
6fd334dcd7 | ||
|
|
df6b71c5ea | ||
|
|
4c467d7cad | ||
|
|
db794beb84 | ||
|
|
3b95cd9a11 | ||
|
|
bbe4717075 | ||
|
|
2c47dca086 | ||
|
|
a17553cbf1 | ||
|
|
7e8e243e68 | ||
|
|
cf470ec038 | ||
|
|
016623decb | ||
|
|
a0a8c0294d | ||
|
|
9fe92f6145 | ||
|
|
9f3804444e | ||
|
|
67ac0b431c | ||
|
|
1f807a1348 | ||
|
|
bf778d6df1 | ||
|
|
f8a9faf2fa | ||
|
|
054f8376e4 | ||
|
|
d601b0ce20 | ||
|
|
730c8d6879 | ||
|
|
dbb3d8280e | ||
|
|
36956ebf68 | ||
|
|
3c8d5bb788 | ||
|
|
9e9b64a7e7 | ||
|
|
0a73a9bd9c | ||
|
|
d9addc9245 | ||
|
|
6b4b7a9083 | ||
|
|
afcf567538 | ||
|
|
2b67b3bc81 | ||
|
|
3cd6456349 | ||
|
|
c10052764b | ||
|
|
2ae4db34b0 | ||
|
|
9ddaccbae0 | ||
|
|
f7ca670ce0 | ||
|
|
ce3493952b | ||
|
|
ac8aaf0e08 | ||
|
|
3ceb19a9c6 | ||
|
|
95974b0d24 | ||
|
|
ba3bf6c3d9 | ||
|
|
7300e88cdb | ||
|
|
7364fcc7df | ||
|
|
562b90d93c | ||
|
|
210602476f | ||
|
|
58e37f8130 | ||
|
|
b6802767aa | ||
|
|
76f7454049 | ||
|
|
fb687b7217 | ||
|
|
b34d418b57 | ||
|
|
45f8f72bae | ||
|
|
11ca0a01d3 | ||
|
|
5f4bbe311e | ||
|
|
305e310f0a | ||
|
|
ed35c466ae | ||
|
|
48341094a3 | ||
|
|
fb73ab95ea | ||
|
|
9c4f80449b | ||
|
|
dc88cc4e64 | ||
|
|
bee9090a92 | ||
|
|
d1bf5d2bb6 | ||
|
|
9c2eba2009 | ||
|
|
44271e7bb8 | ||
|
|
5e399498c3 | ||
|
|
3bfa021760 | ||
|
|
7853c4a90b | ||
|
|
e7613a3851 | ||
|
|
b34e9bf42a | ||
|
|
6e1341c148 | ||
|
|
92cac451c8 | ||
|
|
0e04068952 | ||
|
|
0a06b3b208 | ||
|
|
8bccfa5b10 | ||
|
|
5e1e6a48a4 | ||
|
|
4981005572 | ||
|
|
9e207f7f24 | ||
|
|
5ec1b685d8 | ||
|
|
c41571879b | ||
|
|
62a5f2350b | ||
|
|
82f10ddc6a | ||
|
|
4fa76bee78 | ||
|
|
384dee1f95 | ||
|
|
3e5033ff13 | ||
|
|
01ac65eee4 | ||
|
|
da80bd8bb4 | ||
|
|
470901dc58 | ||
|
|
32e6a79e9c | ||
|
|
d1f0b56adc | ||
|
|
77fc4be458 | ||
|
|
3dec8d1880 | ||
|
|
b102caf482 | ||
|
|
7ec9e78e4d | ||
|
|
b6237bc39d | ||
|
|
54935e4aa3 | ||
|
|
18b9addc85 | ||
|
|
abdccaa8eb | ||
|
|
a93c83fe6b | ||
|
|
4fe8d350a2 | ||
|
|
72e3930e08 | ||
|
|
31140c8da7 | ||
|
|
47bb46176b | ||
|
|
0e49eb1d17 | ||
|
|
87717dd77f | ||
|
|
6fb81f146e | ||
|
|
ff6b193821 | ||
|
|
96623c0e4f | ||
|
|
0f089bd49a | ||
|
|
b318d191a5 | ||
|
|
d0665bb301 | ||
|
|
adbba69988 | ||
|
|
539ab241cd | ||
|
|
f18b7c5e14 | ||
|
|
19324f2904 | ||
|
|
6c83cd627f | ||
|
|
ed09d78ed9 | ||
|
|
0b7a392b30 | ||
|
|
2379443ef5 | ||
|
|
8c50b9692e | ||
|
|
787be6ec08 | ||
|
|
72efa329db | ||
|
|
a79b338208 | ||
|
|
08b2899676 | ||
|
|
074e489fe3 | ||
|
|
f8badefa90 | ||
|
|
d113f8db5a | ||
|
|
db36040fe1 | ||
|
|
f0c1688b1b | ||
|
|
67d3c9e9c8 | ||
|
|
ac664940da | ||
|
|
8eb0829267 | ||
|
|
f8ecdc004f | ||
|
|
c088672632 | ||
|
|
552076a36c | ||
|
|
a0fe6665b2 | ||
|
|
b05907f592 | ||
|
|
bae6a09a7c | ||
|
|
8bc1ed7d86 | ||
|
|
9935cb0e3b | ||
|
|
594f7074f7 | ||
|
|
a6c9d33c09 | ||
|
|
e0e1ed6936 | ||
|
|
7fb4b42092 | ||
|
|
1b3055faef | ||
|
|
cf905d0c7f | ||
|
|
f084bbb6d0 | ||
|
|
a2843084d6 | ||
|
|
3d23ee0e23 | ||
|
|
92718c4def | ||
|
|
e1d3a8ea7d | ||
|
|
2f7a9bb789 | ||
|
|
ef2cb860a3 | ||
|
|
1e37916156 | ||
|
|
f3fb445166 | ||
|
|
ac55d8dd8b | ||
|
|
f517a6a373 | ||
|
|
ccdcf9d82b | ||
|
|
b7863e2dc2 | ||
|
|
6edb280cc7 | ||
|
|
32847fcfd0 | ||
|
|
69bdc44441 | ||
|
|
4d58e55781 | ||
|
|
90843a4228 | ||
|
|
d233459195 | ||
|
|
6dab2b8c62 | ||
|
|
86893a2984 | ||
|
|
3618f066bb | ||
|
|
5c149e0363 | ||
|
|
22e03ee98a | ||
|
|
18901ca4d6 | ||
|
|
d5f77e92f7 | ||
|
|
d139c31972 | ||
|
|
53550d8bb4 | ||
|
|
356f9914cc | ||
|
|
6e57c4618e | ||
|
|
9b0bef50de | ||
|
|
c957a12742 | ||
|
|
1b9aa2ab71 | ||
|
|
1d17ece9ce | ||
|
|
34ce35dcfa | ||
|
|
f66cfca2a9 | ||
|
|
7c1e8ba2bf | ||
|
|
e23446389c | ||
|
|
8cb6172e4b | ||
|
|
d427647ce7 | ||
|
|
8a4c15ecf5 | ||
|
|
1be9194734 | ||
|
|
792d2fc79a | ||
|
|
5386aede36 | ||
|
|
4e1317cd0f | ||
|
|
9ee6442004 | ||
|
|
6f84b85358 | ||
|
|
d7548e72b2 | ||
|
|
7964e11c7f | ||
|
|
a4d0af1f96 | ||
|
|
282bc16243 | ||
|
|
4ba106a525 | ||
|
|
1d54092c7d | ||
|
|
4b50045ecd | ||
|
|
a6e715f574 | ||
|
|
18f5362a34 | ||
|
|
a71f525a2b | ||
|
|
efae85de84 | ||
|
|
da811fbdd0 | ||
|
|
d7a2515093 | ||
|
|
885cc3864e | ||
|
|
c22d3d3cae | ||
|
|
fb3fc0c6de | ||
|
|
624f61193c | ||
|
|
5a37ee9976 | ||
|
|
6a63ea46a4 | ||
|
|
f437fac412 | ||
|
|
afea67e303 | ||
|
|
3d46f3df61 | ||
|
|
697617622c | ||
|
|
7e9e3903d8 | ||
|
|
7b66fcff37 | ||
|
|
40b219c397 | ||
|
|
b5e74ee3f1 | ||
|
|
6f95182751 | ||
|
|
41d7430442 | ||
|
|
aa86387ba9 | ||
|
|
2a1f44610f | ||
|
|
4704f48daa | ||
|
|
8dacc91d51 | ||
|
|
a594273989 | ||
|
|
d9264e415c | ||
|
|
b3df389bd6 | ||
|
|
2998b78797 | ||
|
|
46a526ce26 | ||
|
|
95fffec172 | ||
|
|
323912371e | ||
|
|
3213d2205a | ||
|
|
3dde80ed0f | ||
|
|
6f428c03e2 | ||
|
|
2d5d39db7b | ||
|
|
28806f3187 | ||
|
|
5349d33abf | ||
|
|
a499da00ba | ||
|
|
a4d9c8cc3b | ||
|
|
27d09c33ce | ||
|
|
5b86186e85 | ||
|
|
3b399f62f4 | ||
|
|
7c511fb2f2 | ||
|
|
4370781b49 | ||
|
|
1cf4926b4e | ||
|
|
7ae06a114d | ||
|
|
8321b2fa66 | ||
|
|
ba966634f5 | ||
|
|
dd12757493 | ||
|
|
7ea37edfbf | ||
|
|
462368f959 | ||
|
|
73833e0ef0 | ||
|
|
7d699ade0c | ||
|
|
bc52b8f310 | ||
|
|
ecb8d117ac | ||
|
|
ead8c4933e | ||
|
|
20374b542d | ||
|
|
6df31099c2 | ||
|
|
b7e2d8f019 | ||
|
|
80a35226c5 | ||
|
|
e025d696f6 | ||
|
|
245ca20eea | ||
|
|
8f60ad8874 | ||
|
|
d18a1edb67 | ||
|
|
a8050635fa | ||
|
|
33fa1989bc | ||
|
|
7d3ab6d0b4 | ||
|
|
237102b5f2 | ||
|
|
407b4fd1d5 | ||
|
|
882cbd8b4e | ||
|
|
4c3d9788dd | ||
|
|
59c65118e1 | ||
|
|
84976ed5dc | ||
|
|
15ccb70ae6 | ||
|
|
e1481f3a90 | ||
|
|
01413c8d9f | ||
|
|
392a14241f | ||
|
|
16a5c6995c | ||
|
|
c7334e7c56 | ||
|
|
cc4ceb88a0 | ||
|
|
7ee464709b | ||
|
|
ee5e7449ac | ||
|
|
278a067d43 | ||
|
|
e9f7df081f | ||
|
|
d0b83a7196 | ||
|
|
bc48b770de | ||
|
|
e7cb3d324a | ||
|
|
0f3222e489 | ||
|
|
a08a0077e6 | ||
|
|
5336aecde7 | ||
|
|
a2c51a586e | ||
|
|
3aa506eb1b | ||
|
|
60e7e19dab | ||
|
|
1b2702df24 | ||
|
|
6d37ee2970 | ||
|
|
2aa007fbad | ||
|
|
bfded90875 | ||
|
|
e0c6d80c09 | ||
|
|
237de95285 | ||
|
|
357d8c98a3 | ||
|
|
5f40394501 | ||
|
|
41c6d2d031 | ||
|
|
d2c355bdb0 | ||
|
|
6f3d5a7b33 | ||
|
|
34491f4be1 | ||
|
|
34e0a74c07 | ||
|
|
587f156557 | ||
|
|
f04c3c6acb | ||
|
|
80171b7c54 | ||
|
|
cb68d4d00a | ||
|
|
98ef945d2e | ||
|
|
12b47fece0 | ||
|
|
bfb44934b7 | ||
|
|
08ca34f5d0 | ||
|
|
a46c12c014 | ||
|
|
d24093c4a6 | ||
|
|
ec034da5c9 | ||
|
|
d5b9e4ccd5 | ||
|
|
169c837613 | ||
|
|
33f38dd437 | ||
|
|
bd7004ecd7 | ||
|
|
8babee0efb | ||
|
|
a407da79a9 | ||
|
|
8399afa607 | ||
|
|
68091c7cdb | ||
|
|
e62be406ce | ||
|
|
dd3a79dac2 | ||
|
|
a4f170604c | ||
|
|
349e0b6fd2 | ||
|
|
78eceb43a1 | ||
|
|
0cd8d939f1 | ||
|
|
9fa2c7404f | ||
|
|
8cd0a8838a | ||
|
|
d92ffa6771 | ||
|
|
63cab68a96 | ||
|
|
f6eb2724e2 | ||
|
|
fc6980e0c9 | ||
|
|
7a95a21e09 | ||
|
|
8edd628973 | ||
|
|
50e7e959fe | ||
|
|
b5f70d02b2 | ||
|
|
76c2fb3de7 | ||
|
|
27ea5c0026 | ||
|
|
59d0af33b8 | ||
|
|
25631a25f7 | ||
|
|
ac9b4f8135 | ||
|
|
46694ece47 | ||
|
|
74b016c8b6 | ||
|
|
7242b08609 | ||
|
|
ee0954c8cb | ||
|
|
fd9f4753bb | ||
|
|
dc9ad66fe2 | ||
|
|
247acce949 | ||
|
|
91b2e0bff2 | ||
|
|
17ad351386 | ||
|
|
72eafff843 | ||
|
|
4ec03b7e87 | ||
|
|
88d466e58e | ||
|
|
cf2c59b1d7 | ||
|
|
93f02c08dc | ||
|
|
efac255821 | ||
|
|
06515b43d8 | ||
|
|
0e436e66de | ||
|
|
3f2eec75c7 | ||
|
|
6519a1e326 | ||
|
|
a2ff20990c | ||
|
|
0a6d43c5f6 | ||
|
|
64a368dd8e | ||
|
|
1dc03d5741 | ||
|
|
e5c2fee022 | ||
|
|
00bfba1d77 | ||
|
|
76c963a70c | ||
|
|
f78f6b59cc | ||
|
|
faf3c81be3 | ||
|
|
a994722bb1 | ||
|
|
b383475282 | ||
|
|
ce7866a6a6 | ||
|
|
0dfd6d3986 | ||
|
|
50757e7afe | ||
|
|
df64a1069e | ||
|
|
9450226675 | ||
|
|
8f8052735c | ||
|
|
aa6640e1c0 | ||
|
|
5f1b82d696 | ||
|
|
19e96f7dd2 | ||
|
|
591d6df489 | ||
|
|
8fe318495f | ||
|
|
569c055389 | ||
|
|
26ce076f61 | ||
|
|
07c7d63d44 |
+42
-25
@@ -1,37 +1,54 @@
|
||||
*.[oa]
|
||||
*~
|
||||
*o.cmd
|
||||
*.lo
|
||||
*.obj
|
||||
*o.cmd
|
||||
*.ko
|
||||
*.swp
|
||||
*.in
|
||||
*.la
|
||||
.libs
|
||||
.dirstamp
|
||||
stamp-h1
|
||||
/configure
|
||||
/aclocal.m4
|
||||
/autom4te.cache/
|
||||
.autotools
|
||||
compile
|
||||
/compile
|
||||
/config.guess
|
||||
/config.h
|
||||
/config.h.in
|
||||
/config.sub
|
||||
/config.log
|
||||
/config.status
|
||||
/config.sub
|
||||
/configure
|
||||
/configure.ac
|
||||
/configure.tmp
|
||||
.cproject
|
||||
/depcomp
|
||||
/install-sh
|
||||
/ltmain.sh
|
||||
/missing
|
||||
/Makefile
|
||||
/libndpi.pc
|
||||
/libtool
|
||||
/src/lib/Makefile
|
||||
/src/include/Makefile
|
||||
/example/ndpiReader
|
||||
.dirstamp
|
||||
/example/.deps/
|
||||
/example/Makefile
|
||||
/aclocal.m4
|
||||
/example/ndpiReader
|
||||
*.in
|
||||
/install-sh
|
||||
*.ko
|
||||
*.la
|
||||
/libndpi.pc
|
||||
.libs
|
||||
/libtool
|
||||
*.lo
|
||||
/ltmain.sh
|
||||
/m4/libtool.m4
|
||||
/m4/lt~obsolete.m4
|
||||
/m4/ltoptions.m4
|
||||
/m4/ltsugar.m4
|
||||
/m4/ltversion.m4
|
||||
/m4/lt~obsolete.m4
|
||||
/Makefile
|
||||
/missing
|
||||
*.[oa]
|
||||
*.obj
|
||||
*o.cmd
|
||||
*o.cmd
|
||||
.project
|
||||
.settings
|
||||
/src/include/Makefile
|
||||
/src/include/ndpi_config.h
|
||||
/src/include/ndpi_define.h
|
||||
/src/lib/.deps/
|
||||
/src/lib/Makefile
|
||||
/src/lib/protocols/.deps/
|
||||
/src/lib/third_party/src/.deps/
|
||||
stamp-h1
|
||||
*.swp
|
||||
/test-driver
|
||||
/tests/Makefile
|
||||
|
||||
+31
-4
@@ -1,16 +1,30 @@
|
||||
language: c
|
||||
|
||||
os:
|
||||
- osx
|
||||
- linux
|
||||
|
||||
compiler:
|
||||
- clang
|
||||
- gcc
|
||||
|
||||
matrix:
|
||||
exclude:
|
||||
# osx use always clang for build...
|
||||
- os: osx
|
||||
compiler: gcc
|
||||
|
||||
install:
|
||||
- sudo apt-get update || true
|
||||
- sudo apt-get install build-essential
|
||||
- sudo apt-get install libpcap-dev libtool autoconf automake autogen
|
||||
#macos
|
||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update; fi
|
||||
#linux
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update || true; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install build-essential; fi
|
||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libpcap-dev libtool autoconf automake autogen; fi
|
||||
|
||||
before_script:
|
||||
- ./autogen.sh
|
||||
# - lcov --directory . --zerocounters
|
||||
|
||||
script:
|
||||
- ./configure
|
||||
@@ -19,4 +33,17 @@ script:
|
||||
after_script:
|
||||
- cd tests
|
||||
- ./do.sh
|
||||
|
||||
|
||||
#after_success:
|
||||
#- cd ${TRAVIS_BUILD_DIR}
|
||||
#- lcov --directory . --capture --output-file coverage.info # capture coverage info
|
||||
#- lcov --remove coverage.info 'tests/*' 'packages/*' 'm4/*' 'doc/*' --output-file coverage.info
|
||||
#- lcov --list coverage.info # debug before upload
|
||||
#- coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info # uploads to coveralls
|
||||
|
||||
notifications:
|
||||
email:
|
||||
recipients:
|
||||
- packager@ntop.org
|
||||
on_success: never
|
||||
on_failure: always
|
||||
|
||||
+209
@@ -0,0 +1,209 @@
|
||||
# CHANGELOG
|
||||
|
||||
#### nDPI 2.4 (August 2018)
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* Showmax.com
|
||||
* Musical.ly
|
||||
* RapidVideo
|
||||
* VidTO streaming service
|
||||
* Apache JServ Protocol
|
||||
* Facebook Messenger
|
||||
* FacebookZero protocol
|
||||
|
||||
## Improvements
|
||||
|
||||
* Improved YouTube support
|
||||
* Improved Netflix support
|
||||
* Updated Google Hangout detection
|
||||
* Updated Twitter address range
|
||||
* Updated Viber ports, subnet and domain
|
||||
* Updated AmazonVideo detection
|
||||
* Updated list of FaceBook sites
|
||||
* Initial Skype in/out support
|
||||
* Improved Tor detection
|
||||
* Improved hyperscan support and category definition
|
||||
* Custom categories loading, extended ndpiReader (`-c <file>`) for loading name-based categories
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixes for Instagram flows classified as Facebook
|
||||
* Fixed Spotify detection
|
||||
* Fixed minimum packet payload length for SSDP
|
||||
* Fixed length check in MSN, x-steam-sid, Tor certificate name
|
||||
* Increase client's maximum payload length for SSH
|
||||
* Fixed end-of-line bounds handling
|
||||
* Fixed substring matching
|
||||
* Fix for handling IP address based custom categories
|
||||
* Repaired wrong timestamp calculation
|
||||
* Fixed memory leak
|
||||
* Optimized memory usage
|
||||
|
||||
## Other/Changes
|
||||
|
||||
* New API calls:
|
||||
* `ndpi_set_detection_preferences()`
|
||||
* `ndpi_load_hostname_category()`
|
||||
* `ndpi_enable_loaded_categories()`
|
||||
* `ndpi_fill_protocol_category()`
|
||||
* `ndpi_process_extra_packet()`
|
||||
* Skype CallIn/CallOut are now set as Skype.SkypeCallOut Skype.SkypeCallIn
|
||||
* Added support for SMTPS on port 587
|
||||
* Changed RTP from VoIP to Media category
|
||||
* Added site unavailable category
|
||||
* Added custom categories CUSTOM_CATEGORY_MINING, CUSTOM_CATEGORY_MALWARE, CUSTOM_CATEGORY_ADVERTISEMENT, CUSTOM_CATEGORY_BANNED_SITE
|
||||
* Implemented hash-based categories
|
||||
* Converted some not popular protocols to NDPI_PROTOCOL_GENERIC with category detection
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.2.2 (April 2018)
|
||||
|
||||
## Main New Features
|
||||
|
||||
* Hyperscan support
|
||||
* `ndpi_get_api_version` API call to be used in applications that are dynamically linking with nDPI
|
||||
* `--enable-debug-messages` to enable debug information output
|
||||
* Increased number of protocols to 512
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* GoogleDocs
|
||||
* GoogleServices
|
||||
* AmazonVideo
|
||||
* ApplePush
|
||||
* Diameter
|
||||
* GooglePlus
|
||||
* WhatsApp file exchage
|
||||
|
||||
## Improvements
|
||||
|
||||
* WhatsApp detection
|
||||
* Amazon detection
|
||||
* Improved Google Drive
|
||||
* Improved Spotify support
|
||||
* Improved SNI matching when using office365
|
||||
* Improved HostShield VPN
|
||||
|
||||
## Fixes
|
||||
|
||||
* Fixed invalid RTP/Skype detection
|
||||
* Fixed possible out-of-bounds due to malformed DHCP packets
|
||||
* Fixed buffer overflow in function `ndpi_debug_printf`
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.2 (December 2017)
|
||||
|
||||
## Main New Features
|
||||
|
||||
* Custom protocol categories to allow personalization of protocols-categories mappings
|
||||
* DHCP fingerprinting
|
||||
* HTTP User Agent discovery
|
||||
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* ICQ (instant messaging client)
|
||||
* YouTube Upload
|
||||
* LISP
|
||||
* SoundCloud
|
||||
* Sony PlayStation
|
||||
* Nintendo (switch) gaming protocol
|
||||
|
||||
|
||||
## Improvements
|
||||
|
||||
* Windows 10 detection from UA and indentation
|
||||
* Determine STUN flows that turn into RTP
|
||||
* Fixes for iQIYI and 1kxun
|
||||
* Android fingerprint
|
||||
* Added DHCP class identifier support
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
#### nDPI 2.0 (May 2017)
|
||||
|
||||
## Main New Features
|
||||
|
||||
* nDPI Wireshark plugin for Layer-7 protocol dissection. The plugin, available via an extcap interface, passes Wireshark the nDPI-detected protocols by adding an ethernet packet trailer that is then interpreted and displayed inside the Wireshark GUI. Readme: https://github.com/ntop/nDPI/blob/dev/wireshark/README.md
|
||||
|
||||
|
||||
## New Supported Protocols and Services
|
||||
|
||||
* STARTTLS
|
||||
* IMAPS
|
||||
* DNScrypt
|
||||
* QUIC (Quick UDP Internet Connections)
|
||||
* AMQP (Advanced Message Queueing Protocol)
|
||||
* Ookla (SpeedTest)
|
||||
* BJNP
|
||||
* AFP (Apple Filing Protocol)
|
||||
* SMPP (Short Message Peer-to-Peer)
|
||||
* VNC
|
||||
* OpenVPN
|
||||
* OpenDNS
|
||||
* RX protocol (used by AFS)
|
||||
* CoAP and MQTT (IoT specific protocols)
|
||||
* Cloudflare
|
||||
* Office 365
|
||||
* OCS
|
||||
* MS Lync
|
||||
* Ubiquity AirControl 2
|
||||
* HEP (Extensible Encapsulation Protocol)
|
||||
* WhatsApp Voice vs WhatsApp (chat, no voice)
|
||||
* Viber
|
||||
* Wechat
|
||||
* Github
|
||||
* Hotmail
|
||||
* Slack
|
||||
* Instagram
|
||||
* Snapchat
|
||||
* MPEG TS protocol
|
||||
* Twitch
|
||||
* KakaoTalk Voice and Chat
|
||||
* Meu
|
||||
* EAQ
|
||||
* iQIYI media service
|
||||
* Weibo
|
||||
* PPStream
|
||||
|
||||
|
||||
## Improvements
|
||||
|
||||
* SSH client/server version dissection
|
||||
* Improved SSL dissection
|
||||
* SSL server certificate detection
|
||||
* Added double tagging 802.1Q in dissection of vlan-tagged packets
|
||||
* Improved netBIOS dissection
|
||||
* Improved Skype detection
|
||||
* Improved Netflix traffic detection
|
||||
* Improved HTTP subprotocol matching
|
||||
* Implemented DHCP host name extraction
|
||||
* Updated Facebook detection by ip server ranges
|
||||
* Updated Twitter networks
|
||||
* Improved Microsoft detection
|
||||
* Enhanced Google detection
|
||||
* Improved BT-uTP protocol dissection
|
||||
* Added detection of Cisco datalink layer (Cisco hDLC and Cisco SLARP)
|
||||
|
||||
|
||||
#### Older releases
|
||||
|
||||
#### 2014-03-21
|
||||
* improved support for eDonkey/eMule/Kademlia
|
||||
* improved support for PPLive
|
||||
|
||||
#### 2014-03-20
|
||||
* code optimizations
|
||||
* consistency improvements
|
||||
* added support for new applications: Pando Media Booster
|
||||
* improved support for Steam
|
||||
* added support for new web services: Wikipedia, MSN, Amazon, eBay, CNN
|
||||
|
||||
#### 2014-03-19
|
||||
* added new protocols: FTP, code improvements
|
||||
|
||||
#### 2014-03-17
|
||||
* added new protocols: SOCKSv4, SOCKSv5, RTMP
|
||||
@@ -1,16 +0,0 @@
|
||||
2014-03-21:
|
||||
- improved support for eDonkey/eMule/Kademlia
|
||||
- improved support for PPLive
|
||||
|
||||
2014-03-20:
|
||||
- code optimizations
|
||||
- consistency improvements
|
||||
- added support for new applications: Pando Media Booster
|
||||
- improved support for Steam
|
||||
- added support for new web services: Wikipedia, MSN, Amazon, eBay, CNN
|
||||
|
||||
2014-03-19:
|
||||
- added new protocols: FTP, code improvements
|
||||
|
||||
2014-03-17:
|
||||
- added new protocols: SOCKSv4, SOCKSv5, RTMP
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
SUBDIRS = src/lib example
|
||||
SUBDIRS = src/lib example tests
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libndpi.pc
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
# What is nDPI ?
|
||||
![ntop][ntopng_logo] ![ntop][ntop_logo]
|
||||
# nDPI
|
||||
|
||||
[](https://travis-ci.org/ntop/nDPI)
|
||||
|
||||
## What is nDPI ?
|
||||
|
||||
nDPI is an open source LGPLv3 library for deep-packet inspection. Based on OpenDPI it includes ntop extensions. We have tried to push them into the OpenDPI source tree but nobody answered emails so we have decided to create our own source tree
|
||||
|
||||
# How To Compile nDPI
|
||||
### How To Compile nDPI
|
||||
|
||||
In order to compile this library do
|
||||
|
||||
@@ -10,17 +15,21 @@ In order to compile this library do
|
||||
- ./configure
|
||||
- make
|
||||
|
||||
To run tests do additionally:
|
||||
|
||||
- cd tests; ./do.sh
|
||||
|
||||
Please note that the pre-requisites for compilation include:
|
||||
- GNU tools (autogen, automake, autoconf, libtool)
|
||||
- GNU C compiler (gcc)
|
||||
|
||||
# How To Add A New Protocol Dissector
|
||||
### How To Add A New Protocol Dissector
|
||||
|
||||
The entire procedure of adding new protocols in detail:
|
||||
|
||||
1. Add new protocol together with its unique ID to: src/include/ndpi_protocols_osdpi.h
|
||||
1. Add new protocol together with its unique ID to: src/include/ndpi_protocol_ids.h
|
||||
2. Create a new protocol in: src/lib/protocols/
|
||||
3. Variables to be kept for the duration of the entire flow (as state variables) needs to be placed in: /include/ndpi_structs.h in ndpi_flow_tcp_struct (for TCP only), ndpi_flow_udp_struct (for UDP only), or ndpi_flow_struct (for both).
|
||||
3. Variables to be kept for the duration of the entire flow (as state variables) need to be placed in: src/include/ndpi_typedefs.h in ndpi_flow_tcp_struct (for TCP only), ndpi_flow_udp_struct (for UDP only), or ndpi_flow_struct (for both).
|
||||
4. Add a new entry for the search function for the new protocol in: src/include/ndpi_protocols.h
|
||||
5. Choose (do not change anything) a selection bitmask from: src/include/ndpi_define.h
|
||||
6. Add a new entry in ndpi_set_protocol_detection_bitmask2 in: src/lib/ndpi_main.c
|
||||
@@ -29,14 +38,25 @@ The entire procedure of adding new protocols in detail:
|
||||
9. ./autogen.sh
|
||||
10. ./configure
|
||||
11. make
|
||||
12. make check
|
||||
|
||||
# Creating A Source File Tar Ball
|
||||
### How to use nDPI to Block Selected Traffic
|
||||
|
||||
You can use nDPI to selectively block selected Internet traffic by embedding it onto an application (remember that nDPI us just a library). Both [ntopng](https://github.com/ntop/ntopng) and [nProbe cento](http://www.ntop.org/products/netflow/nprobe-cento/) can do this.
|
||||
|
||||
### DISCLAIMER
|
||||
While we do our best to detect network protocols, we cannot guarantee that our software is error free and 100% accurate in protocol detection. Please make sure that you respect the privacy of users and you have proper authorization to listen, capture and inspect network traffic.
|
||||
|
||||
### Creating A Source File Tar Ball
|
||||
|
||||
If you want to distribute a source tar file of nDPI do:
|
||||
|
||||
- make dist
|
||||
|
||||
To ensure that a tar file includes all necessary files and to run tests on distribution do:
|
||||
|
||||
# Acknowledgements
|
||||
- make distcheck
|
||||
|
||||
Many thanks to <A HREF=http://www.radcom.com>Radcom</A> Ltd for supporting the development of nDPI.
|
||||
[ntopng_logo]: https://camo.githubusercontent.com/0f789abcef232035c05e0d2e82afa3cc3be46485/687474703a2f2f7777772e6e746f702e6f72672f77702d636f6e74656e742f75706c6f6164732f323031312f30382f6e746f706e672d69636f6e2d313530783135302e706e67
|
||||
|
||||
[ntop_logo]: https://camo.githubusercontent.com/58e2a1ecfff62d8ecc9d74633bd1013f26e06cba/687474703a2f2f7777772e6e746f702e6f72672f77702d636f6e74656e742f75706c6f6164732f323031352f30352f6e746f702e706e67
|
||||
|
||||
+2
-1
@@ -1,9 +1,10 @@
|
||||
rerequisites for Compilation
|
||||
Prerequisites for Compilation
|
||||
-----------------------------
|
||||
|
||||
Prerequisites
|
||||
- GNU autotools/libtool
|
||||
- libpcap or PF_RING (optional but recommended)
|
||||
- apt-get install libjson-c-dev (for JSON support)
|
||||
|
||||
On Ubuntu/Debian
|
||||
- apt-get install build-essential
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ TCP 172.16.253.130:2021 <-> 75.147.140.249:443 [VLAN: 0][proto: 91/SSL][28 pkts/
|
||||
TCP 172.16.253.130:2077 <-> 77.247.181.163:443 [VLAN: 0][proto: 91/SSL][136 pkts/94329 bytes][SSL client: www.fk4pprq42hsvl2wey.com]
|
||||
|
||||
It can be detected by analyzing the SSL client certificate and checking the name that does not match to a real host in
|
||||
addition of begin a bit weird. As doing DNS resolution is not a task for nDPI we let applications do and then recognize
|
||||
addition of being a bit weird. As doing DNS resolution is not a task for nDPI we let applications do and then recognize
|
||||
SSL-tunnelled connections.
|
||||
|
||||
See http://www.netresec.com/?page=Blog&month=2013-04&post=Detecting-TOR-Communication-in-Network-Traffic
|
||||
|
||||
+22
-7
@@ -1,13 +1,17 @@
|
||||
#!/bin/sh
|
||||
|
||||
NDPI_MAJOR="2"
|
||||
NDPI_MINOR="4"
|
||||
NDPI_PATCH="0"
|
||||
NDPI_VERSION_SHORT="$NDPI_MAJOR.$NDPI_MINOR.$NDPI_PATCH"
|
||||
|
||||
/bin/rm -f configure config.h config.h.in src/lib/Makefile.in
|
||||
rm -f configure config.h config.h.in src/lib/Makefile.in
|
||||
|
||||
AUTOCONF=$(which autoconf)
|
||||
AUTOMAKE=$(which automake)
|
||||
LIBTOOL=$(which libtool)
|
||||
LIBTOOLIZE=$(which libtoolize)
|
||||
AUTORECONF=$(which autoreconf)
|
||||
AUTOCONF=$(command -v autoconf)
|
||||
AUTOMAKE=$(command -v automake)
|
||||
LIBTOOL=$(command -v libtool)
|
||||
LIBTOOLIZE=$(command -v libtoolize)
|
||||
AUTORECONF=$(command -v autoreconf)
|
||||
|
||||
if test -z $AUTOCONF; then
|
||||
echo "autoconf is missing: please install it and try again"
|
||||
@@ -29,5 +33,16 @@ if test -z $AUTORECONF; then
|
||||
exit
|
||||
fi
|
||||
|
||||
cat configure.seed | sed \
|
||||
-e "s/@NDPI_MAJOR@/$NDPI_MAJOR/g" \
|
||||
-e "s/@NDPI_MINOR@/$NDPI_MINOR/g" \
|
||||
-e "s/@NDPI_PATCH@/$NDPI_PATCH/g" \
|
||||
-e "s/@NDPI_VERSION_SHORT@/$NDPI_VERSION_SHORT/g" \
|
||||
> configure.ac
|
||||
|
||||
autoreconf -ivf
|
||||
./configure
|
||||
cat configure | sed "s/#define PACKAGE/#define NDPI_PACKAGE/g" | sed "s/#define VERSION/#define NDPI_VERSION/g" > configure.tmp
|
||||
cat configure.tmp > configure
|
||||
|
||||
chmod +x configure
|
||||
./configure $*
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
AC_INIT([libndpi], [1.7.1])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
LT_INIT
|
||||
|
||||
AC_PROG_CC
|
||||
AX_PTHREAD
|
||||
|
||||
if test -d ".git"; then :
|
||||
GIT_TAG=`git log -1 --format=%h`
|
||||
GIT_DATE=`git log -1 --format=%cd`
|
||||
#
|
||||
# On CentOS 6 `git rev-list HEAD --count` does not work
|
||||
#
|
||||
#
|
||||
GIT_NUM=`git log --pretty=oneline | wc -l | tr -d '[[:space:]]'`
|
||||
GIT_BRANCH=`git rev-parse --abbrev-ref HEAD`
|
||||
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_BRANCH}-${GIT_NUM}-${GIT_TAG}"
|
||||
else
|
||||
GIT_RELEASE="${PACKAGE_VERSION}"
|
||||
GIT_DATE=`date`
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
||||
|
||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
||||
|
||||
PCAP_HOME=$HOME/PF_RING/userland
|
||||
|
||||
if test -d $PCAP_HOME; then :
|
||||
echo -n ""
|
||||
else
|
||||
PCAP_HOME=`pwd`/../../PF_RING/userland
|
||||
fi
|
||||
SHORT_MACHINE=`uname -m | cut -b1-3`
|
||||
if test $SHORT_MACHINE = "arm"; then
|
||||
LIBNUMA=""
|
||||
else
|
||||
LIBNUMA="-lnuma"
|
||||
fi
|
||||
|
||||
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
||||
echo "Using libpcap from $PCAP_HOME"
|
||||
PCAP_INC="-I $PCAP_HOME/libpcap"
|
||||
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA"
|
||||
|
||||
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
|
||||
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
|
||||
else
|
||||
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
|
||||
|
||||
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
|
||||
echo ""
|
||||
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
|
||||
echo "ERROR: Please install it and try again"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
PKG_CONFIG=$(which pkg-config)
|
||||
|
||||
if test -d /usr/local/include/json-c/; then :
|
||||
CFLAGS="$CFLAGS -I/usr/local/include/json-c/"
|
||||
LDFLAGS="$LDFLAGS -L/usr/local/lib -ljson-c"
|
||||
else
|
||||
if ! test -z "$PKG_CONFIG"; then :
|
||||
CFLAGS="$CFLAGS $(pkg-config --cflags json-c)"
|
||||
LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)"
|
||||
fi
|
||||
fi
|
||||
|
||||
OLD_LIBS=$LIBS
|
||||
LIBS="-L/opt/napatech3/lib $LIBS"
|
||||
AC_CHECK_LIB([ntapi],
|
||||
[NT_Init],
|
||||
[PCAP_LIB="$PCAP_LIB -L/opt/napatech3/lib -lntapi"],
|
||||
[], [] )
|
||||
LIBS=$OLD_LIBS
|
||||
|
||||
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||
|
||||
AC_CONFIG_FILES([Makefile src/lib/Makefile example/Makefile libndpi.pc])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AC_SUBST(GIT_RELEASE)
|
||||
AC_SUBST(SVN_DATE)
|
||||
AC_SUBST(JSON_C_LIB)
|
||||
AC_SUBST(PCAP_INC)
|
||||
AC_SUBST(PCAP_LIB)
|
||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
|
||||
AC_OUTPUT
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
AC_INIT([libndpi], [@NDPI_VERSION_SHORT@])
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
LT_INIT
|
||||
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AX_PTHREAD
|
||||
|
||||
NDPI_MAJOR="@NDPI_MAJOR@"
|
||||
NDPI_MINOR="@NDPI_MINOR@"
|
||||
NDPI_PATCH="@NDPI_PATCH@"
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_MAJOR_RELEASE, "${NDPI_MAJOR}", [nDPI major release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_MINOR_RELEASE, "${NDPI_MINOR}", [nDPI minor release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_PATCH_LEVEL, "${NDPI_PATCH}", [nDPI patch level])
|
||||
|
||||
if test -d ".git"; then :
|
||||
GIT_TAG=`git log -1 --format=%h`
|
||||
GIT_DATE=`git log -1 --format=%cd`
|
||||
#
|
||||
# On CentOS 6 `git rev-list HEAD --count` does not work
|
||||
#
|
||||
#
|
||||
GIT_NUM=`git log --pretty=oneline | wc -l | tr -d '[[:space:]]'`
|
||||
GIT_RELEASE="${PACKAGE_VERSION}-${GIT_NUM}-${GIT_TAG}"
|
||||
else
|
||||
GIT_RELEASE="${PACKAGE_VERSION}"
|
||||
GIT_DATE=`date`
|
||||
fi
|
||||
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_RELEASE, "${GIT_RELEASE}", [GIT Release])
|
||||
AC_DEFINE_UNQUOTED(NDPI_GIT_DATE, "${GIT_DATE}", [Last GIT change])
|
||||
|
||||
AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h unistd.h])
|
||||
|
||||
PCAP_HOME=$HOME/PF_RING/userland
|
||||
|
||||
if test -d $PCAP_HOME; then :
|
||||
echo -n ""
|
||||
else
|
||||
PCAP_HOME=`pwd`/../../PF_RING/userland
|
||||
fi
|
||||
SHORT_MACHINE=`uname -m | cut -b1-3`
|
||||
if test $SHORT_MACHINE = "arm"; then
|
||||
LIBNUMA=""
|
||||
else
|
||||
AC_CHECK_LIB([numa], [numa_available], [LIBNUMA="-lnuma"])
|
||||
fi
|
||||
|
||||
|
||||
HS_LIB=
|
||||
HS_INC=
|
||||
|
||||
AC_ARG_WITH(hyperscan, [ --with-hyperscan Enable nDPI build with Intel Hyperscan])
|
||||
|
||||
if test "${with_hyperscan+set}" = set; then
|
||||
BKP=$LIBS
|
||||
LIBS="$LIBS -lstdc++ -lm"
|
||||
AC_CHECK_LIB([hs], [hs_compile_multi], AC_DEFINE_UNQUOTED(HAVE_HYPERSCAN, 1, [Intel Hyperscan is present]))
|
||||
LIBS=$BKP
|
||||
|
||||
if test "x$ac_cv_lib_hs_hs_compile_multi" = xyes; then :
|
||||
AC_CHECK_LIB([m], [pow])
|
||||
AC_CHECK_LIB([stdc++], [main])
|
||||
HS_INC=`pkg-config --cflags libhs`
|
||||
HS_LIB=`pkg-config --libs libhs`
|
||||
else
|
||||
AC_MSG_RESULT([Intel Hyperscan not found, exiting. See https://github.com/intel/hyperscan/blob/master/doc/dev-reference/getting_started.rst for install/build instructions])
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
|
||||
echo "Using libpcap from $PCAP_HOME"
|
||||
PCAP_INC="-I $PCAP_HOME/libpcap"
|
||||
PCAP_LIB="$PCAP_HOME/libpcap/libpcap.a $PCAP_HOME/lib/libpfring.a $LIBNUMA `$PCAP_HOME/lib/pfring_config --libs`"
|
||||
|
||||
AC_CHECK_LIB([rt], [clock_gettime], [PCAP_LIB="$PCAP_LIB -lrt"])
|
||||
AC_CHECK_LIB([nl], [nl_handle_alloc], [PCAP_LIB="$PCAP_LIB -lnl"])
|
||||
# The dlopen() function is in libdl on GLIBC-based systems
|
||||
# and in the C library for *BSD systems
|
||||
AC_CHECK_LIB([dl], [dlopen, dlsym], [DL_LIB="-ldl"],
|
||||
[AC_CHECK_LIB([c], [dlopen, dlsym], [DL_LIB="-lc"],
|
||||
[AC_MSG_ERROR([unable to find the dlopen(), dlsym() functions]) ]) ])
|
||||
else
|
||||
AC_CHECK_LIB([pcap], [pcap_open_live], [PCAP_LIB="-lpcap"])
|
||||
|
||||
if test $ac_cv_lib_pcap_pcap_open_live = "no"; then :
|
||||
echo ""
|
||||
echo "ERROR: Missing libpcap(-dev) library required to compile the example application"
|
||||
echo "ERROR: Please install it and try again"
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
dnl> https://github.com/json-c/json-c
|
||||
AC_ARG_ENABLE([json-c],
|
||||
AS_HELP_STRING([--disable-json-c], [Disable json-c support]))
|
||||
|
||||
AS_IF([test "x$enable_json_c" != "xno"], [
|
||||
PKG_CONFIG_PATH=/usr/local/share/pkgconfig:$PKG_CONFIG_PATH
|
||||
pkg-config --exists json-c
|
||||
AS_IF([test "$?" == "0"],
|
||||
[
|
||||
CFLAGS="$CFLAGS $(pkg-config --cflags json-c)"
|
||||
LDFLAGS="$LDFLAGS $(pkg-config --libs json-c)"
|
||||
AC_CHECK_LIB(json-c, json_object_new_object, AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present]))
|
||||
],
|
||||
[
|
||||
JSONC_HOME="$HOME/json-c"
|
||||
if test -d "$JSONC_HOME"; then :
|
||||
CFLAGS="$CFLAGS -I $JSONC_HOME"
|
||||
LDFLAGS="$LDFLAGS $JSONC_HOME/.libs/libjson-c.a"
|
||||
AC_MSG_RESULT([Found json-c in $JSONC_HOME])
|
||||
AC_DEFINE_UNQUOTED(HAVE_JSON_C, 1, [The JSON-C library is present])
|
||||
fi
|
||||
])
|
||||
])
|
||||
|
||||
AC_ARG_ENABLE([debug-messages],
|
||||
AS_HELP_STRING([--enable-debug-messages], [Define NDPI_ENABLE_DEBUG_MESSAGES=1]), [
|
||||
AC_DEFINE(NDPI_ENABLE_DEBUG_MESSAGES, 1, [Enable ndpi_debug_messages]) ])
|
||||
|
||||
AC_CHECK_LIB(pthread, pthread_setaffinity_np, AC_DEFINE_UNQUOTED(HAVE_PTHREAD_SETAFFINITY_NP, 1, [libc has pthread_setaffinity_np]))
|
||||
|
||||
AC_CONFIG_FILES([Makefile example/Makefile tests/Makefile libndpi.pc src/include/ndpi_define.h])
|
||||
AC_CONFIG_HEADERS(src/include/ndpi_config.h)
|
||||
AC_SUBST(GIT_RELEASE)
|
||||
AC_SUBST(NDPI_MAJOR)
|
||||
AC_SUBST(NDPI_MINOR)
|
||||
AC_SUBST(NDPI_PATCH)
|
||||
AC_SUBST(SVN_DATE)
|
||||
AC_SUBST(JSON_C_LIB)
|
||||
AC_SUBST(PCAP_INC)
|
||||
AC_SUBST(PCAP_LIB)
|
||||
AC_SUBST(DL_LIB)
|
||||
AC_SUBST(HS_LIB)
|
||||
AC_SUBST(HS_INC)
|
||||
AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
|
||||
|
||||
AC_OUTPUT
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
|
||||
# How to use?
|
||||
|
||||
You need to first compile the nDPI library as usual:
|
||||
|
||||
- ./autogen.sh
|
||||
- ./configure
|
||||
- make
|
||||
|
||||
Then open the Xcode project and you are ready to go. The default behavior is to analyze an embeded pcap file `capture.pcap`. You can change the behavior by changing command line input in `ViewController.m` file.
|
||||
|
||||
# What does the XCode project do?
|
||||
|
||||
It's a dummy Mac App project with a **Run** button. It doesn't modify any nDPI code except that it renamed the `main` function to `orginal_main` in `ndpiReader.c` (because the Mac App has it's own main function) and call the `orginal_main` with synthetic command line input from `ViewController.m` file when the **Run** button is clicked.
|
||||
|
||||
It also fixes some problems when compiling with Xcode. Some are listed below:
|
||||
- Add missed `NDPI_LOG_DEBUG2` macro definition implementation (defined as `NDPI_LOG_DEBUG2_XCODE_PROJ` in `ViewController.m`)
|
||||
- Add an empty ndpi_utils.h file to make `protocols/attic/ftp.c` and `protocols/attic/secondlife.c` can compile
|
||||
- Specially treat `ndpi_patricia.c` by not adding it into compilation source, since it's directly included in `ndpi_main.c`
|
||||
File diff suppressed because it is too large
Load Diff
Generated
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:ndpiExample.xcodeproj">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface AppDelegate : NSObject <NSApplicationDelegate>
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@interface AppDelegate ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
// Insert code here to initialize your application
|
||||
}
|
||||
|
||||
|
||||
- (void)applicationWillTerminate:(NSNotification *)aNotification {
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,732 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="ndpiExample" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="ndpiExample" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About ndpiExample" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
|
||||
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
|
||||
<menuItem title="Services" id="NMo-om-nkz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
|
||||
<menuItem title="Hide ndpiExample" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit ndpiExample" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="dMs-cI-mzQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="File" id="bib-Uj-vzu">
|
||||
<items>
|
||||
<menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
|
||||
<connections>
|
||||
<action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Open Recent" id="tXI-mr-wws">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
|
||||
<items>
|
||||
<menuItem title="Clear Menu" id="vNY-rz-j42">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
|
||||
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
|
||||
<connections>
|
||||
<action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
|
||||
<connections>
|
||||
<action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
|
||||
<connections>
|
||||
<action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
|
||||
<connections>
|
||||
<action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
|
||||
<menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
|
||||
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
|
||||
<connections>
|
||||
<action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Edit" id="5QF-Oa-p0T">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
|
||||
<items>
|
||||
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
|
||||
<connections>
|
||||
<action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
|
||||
<connections>
|
||||
<action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
|
||||
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
|
||||
<connections>
|
||||
<action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
|
||||
<connections>
|
||||
<action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
|
||||
<connections>
|
||||
<action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Delete" id="pa3-QI-u2k">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
|
||||
<connections>
|
||||
<action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
|
||||
<menuItem title="Find" id="4EN-yA-p0u">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Find" id="1b7-l0-nxx">
|
||||
<items>
|
||||
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
|
||||
<connections>
|
||||
<action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
|
||||
<connections>
|
||||
<action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
|
||||
<items>
|
||||
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
|
||||
<connections>
|
||||
<action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
|
||||
<connections>
|
||||
<action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
|
||||
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Substitutions" id="9ic-FL-obx">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
|
||||
<items>
|
||||
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
|
||||
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smart Links" id="cwL-P1-jid">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Data Detectors" id="tRr-pd-1PS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Transformations" id="2oI-Rn-ZJC">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
|
||||
<items>
|
||||
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Speech" id="xrE-MZ-jX0">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
|
||||
<items>
|
||||
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Format" id="jxT-CU-nIS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Format" id="GEO-Iw-cKr">
|
||||
<items>
|
||||
<menuItem title="Font" id="Gi5-1S-RQB">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
|
||||
<items>
|
||||
<menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
|
||||
<connections>
|
||||
<action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
|
||||
<connections>
|
||||
<action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
|
||||
<connections>
|
||||
<action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
|
||||
<menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
|
||||
<connections>
|
||||
<action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
|
||||
<menuItem title="Kern" id="jBQ-r6-VK2">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Kern" id="tlD-Oa-oAM">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="GUa-eO-cwY">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="cDB-IK-hbR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Tighten" id="46P-cB-AYj">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Loosen" id="ogc-rX-tC1">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Ligatures" id="o6e-r0-MWq">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="agt-UL-0e3">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use None" id="J7y-lM-qPV">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Use All" id="xQD-1f-W4t">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Baseline" id="OaQ-X3-Vso">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Baseline" id="ijk-EB-dga">
|
||||
<items>
|
||||
<menuItem title="Use Default" id="3Om-Ey-2VK">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Superscript" id="Rqc-34-cIF">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Subscript" id="I0S-gh-46l">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Raise" id="2h7-ER-AoG">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Lower" id="1tx-W0-xDw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
|
||||
<menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
|
||||
<connections>
|
||||
<action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
|
||||
<menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Text" id="Fal-I4-PZk">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Text" id="d9c-me-L2H">
|
||||
<items>
|
||||
<menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
|
||||
<connections>
|
||||
<action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
|
||||
<connections>
|
||||
<action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Justify" id="J5U-5w-g23">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
|
||||
<connections>
|
||||
<action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
|
||||
<menuItem title="Writing Direction" id="H1b-Si-o9J">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
|
||||
<items>
|
||||
<menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="YGs-j5-SAR">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="Lbh-J2-qVU">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="jFq-tB-4Kx">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
|
||||
<menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem id="Nop-cj-93Q">
|
||||
<string key="title"> Default</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="BgM-ve-c93">
|
||||
<string key="title"> Left to Right</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem id="RB4-Sm-HuC">
|
||||
<string key="title"> Right to Left</string>
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
|
||||
<menuItem title="Show Ruler" id="vLm-3I-IUL">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="View" id="H8h-7b-M4v">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="View" id="HyV-fh-RgO">
|
||||
<items>
|
||||
<menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
|
||||
<menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleSourceList:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="aUF-d1-5bR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="ndpiExample Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate"/>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="0.0"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" sceneMemberID="viewController">
|
||||
<view key="view" wantsLayer="YES" id="m2S-Jp-Qdl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jdf-YK-4JB">
|
||||
<rect key="frame" x="23" y="173" width="64" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Run" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="1eG-Fb-Ybk">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="onRunButtonClicked:" target="XfG-lQ-9wD" id="zyK-t7-vwt"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
</viewController>
|
||||
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="655"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2018年 ZengYingpei. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface ViewController : NSViewController
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import "ViewController.h"
|
||||
#include "ndpi_api.h"
|
||||
|
||||
// Declare the orginal_main defined in ndpiReader.c here
|
||||
extern int orginal_main(int argc, char **argv);
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
- (void)setRepresentedObject:(id)representedObject {
|
||||
[super setRepresentedObject:representedObject];
|
||||
|
||||
// Update the view, if already loaded.
|
||||
}
|
||||
|
||||
|
||||
- (IBAction)onRunButtonClicked:(id)sender
|
||||
{
|
||||
char* args[10];
|
||||
|
||||
extern int optind;
|
||||
optind = 1; // reset the parse of getopt_long
|
||||
|
||||
// Check the "nDPI_QuickStartGuide.pdf" for comand option explanation.
|
||||
|
||||
/* Following code it to execute below command (remember to change args[2] to
|
||||
* absolute path):
|
||||
* ./ndpiReader -i capture.pcap
|
||||
*/
|
||||
args[0] = (char*)"ndpiReader";
|
||||
args[1] = (char*)"-i";
|
||||
NSString* pcap_file = [[NSBundle mainBundle]pathForResource:@"capture" ofType:@"pcap"];
|
||||
args[2] = (char*)[pcap_file cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
// Change to you pcap file path if you want.
|
||||
//args[2] = (char*)"/Users/zengyingpei/Documents/code/nDPI/example/MacOS/ndpiExample/ndpiExample/capture.pcap";
|
||||
// Remember to change below number of args when you change to other command inputs.
|
||||
orginal_main(3, args);
|
||||
|
||||
|
||||
|
||||
/* Following code it to execute below command:
|
||||
* ./ndpiReader -i en1 -s 10 -p protos.txt
|
||||
* The process seems to be not support re-entering. You may have to re-run the App.
|
||||
*/
|
||||
/*
|
||||
args[0] = (char*)"ndpiReader";
|
||||
args[1] = (char*)"-i";
|
||||
args[2] = (char*)"en0";
|
||||
args[3] = (char*)"-s";
|
||||
args[4] = (char*)"10";
|
||||
args[5] = (char*)"-p";
|
||||
NSString* proto_file = [[NSBundle mainBundle]pathForResource:@"protos" ofType:@"txt"];
|
||||
args[6] = (char*)[proto_file cStringUsingEncoding:NSUTF8StringEncoding];
|
||||
//args[6] = (char*)"/Users/zengyingpei/Documents/code/nDPI/example/protos.txt";
|
||||
orginal_main(7, args);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
// In order to fix the missing of NDPI_LOG_DEBUG2 (used in ndpi_main.c), we define
|
||||
// NDPI_LOG_DEBUG2 as NDPI_LOG_DEBUG2_XCODE_PROJ.
|
||||
|
||||
void vNDPI_LOG_DEBUG2_XCODE_PROJ(struct ndpi_detection_module_struct * ndpi_struct,
|
||||
const char *format, va_list ap)
|
||||
{
|
||||
vprintf(format, ap);
|
||||
}
|
||||
|
||||
void NDPI_LOG_DEBUG2_XCODE_PROJ(struct ndpi_detection_module_struct * ndpi_struct,
|
||||
const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start (ap, format);
|
||||
vNDPI_LOG_DEBUG2_XCODE_PROJ(ndpi_struct, format, ap);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
@end
|
||||
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, const char * argv[]) {
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
</plist>
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ndpi_utils_h
|
||||
#define ndpi_utils_h
|
||||
|
||||
// Empty placeholder head file. Just to make the compilations of protocols/attic/ftp.c and
|
||||
// protocols/attic/secondlife.c don't break.
|
||||
|
||||
#endif /* ndpi_utils_h */
|
||||
+5
-5
@@ -1,12 +1,12 @@
|
||||
bin_PROGRAMS = ndpiReader
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src/include @PCAP_INC@
|
||||
AM_CFLAGS = @PTHREAD_CFLAGS@
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/src/include -I$(top_srcdir)/src/lib/third_party/include @PCAP_INC@ @HS_INC@
|
||||
AM_CFLAGS = @PTHREAD_CFLAGS@ # --coverage
|
||||
|
||||
LDADD = $(top_builddir)/src/lib/libndpi.la @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@
|
||||
AM_LDFLAGS = -static
|
||||
LDADD = $(top_builddir)/src/lib/libndpi.a @JSON_C_LIB@ @PTHREAD_LIBS@ @PCAP_LIB@ @DL_LIB@ @HS_LIB@ -lm
|
||||
AM_LDFLAGS = -static @DL_LIB@ @HS_LIB@
|
||||
|
||||
ndpiReader_SOURCES = ndpiReader.c
|
||||
ndpiReader_SOURCES = ndpiReader.c ndpi_util.c ndpi_util.h uthash.h
|
||||
|
||||
ndpiReader.o: ndpiReader.c
|
||||
|
||||
|
||||
@@ -0,0 +1,262 @@
|
||||
# NoCoin Filter List
|
||||
# Blocking Web Browser Bitcoin Mining
|
||||
#
|
||||
# Homepage: https://github.com/hoshsadiq/adblock-nocoin-list/
|
||||
# Contribute: https://github.com/hoshsadiq/adblock-nocoin-list/issues
|
||||
# Changelog: https://github.com/hoshsadiq/adblock-nocoin-list/commits/master/hosts.txt
|
||||
# License: https://mit-license.org/
|
||||
#
|
||||
# Last modified: 24 April 2018
|
||||
#
|
||||
|
||||
cnhv.co 99
|
||||
coin-hive.com 99
|
||||
coinhive.com 99
|
||||
authedmine.com 99
|
||||
gus.host 99
|
||||
load.jsecoin.com 99
|
||||
miner.pr0gramm.com 99
|
||||
minemytraffic.com 99
|
||||
ppoi.org 99
|
||||
projectpoi.com 99
|
||||
crypto-loot.com 99
|
||||
coinerra.com 99
|
||||
coin-have.com 99
|
||||
minero.pw 99
|
||||
minero-proxy-01.now.sh 99
|
||||
minero-proxy-02.now.sh 99
|
||||
minero-proxy-03.now.sh 99
|
||||
api.inwemo.com 99
|
||||
rocks.io 99
|
||||
adminer.com 99
|
||||
ad-miner.com 99
|
||||
jsccnn.com 99
|
||||
jscdndel.com 99
|
||||
coinhiveproxy.com 99
|
||||
coinblind.com 99
|
||||
coinnebula.com 99
|
||||
monerominer.rocks 99
|
||||
cdn.cloudcoins.co 99
|
||||
coinlab.biz 99
|
||||
go.megabanners.cf 99
|
||||
baiduccdn1.com 99
|
||||
wsp.marketgid.com 99
|
||||
papoto.com 99
|
||||
flare-analytics.com 99
|
||||
www.sparechange.io 99
|
||||
static.sparechange.io 99
|
||||
miner.nablabee.com 99
|
||||
m.anyfiles.ovh 99
|
||||
www.freecontent.bid 99
|
||||
www.freecontent.loan 99
|
||||
www.freecontent.win 99
|
||||
www.cryptonoter.com 99
|
||||
www.mutuza.win 99
|
||||
cryweb.github.io 99
|
||||
crywebber.github.io 99
|
||||
crypto-webminer.com 99
|
||||
cdn.adless.io 99
|
||||
hegrinhar.com 99
|
||||
verresof.com 99
|
||||
hemnes.win 99
|
||||
tidafors.xyz 99
|
||||
moneone.ga 99
|
||||
plexcoin.info 99
|
||||
www.monkeyminer.net 99
|
||||
go2.mercy.ga 99
|
||||
coinpirate.cf 99
|
||||
d.cpufan.club 99
|
||||
krb.devphp.org.ua 99
|
||||
nfwebminer.com 99
|
||||
cfcdist.gdn 99
|
||||
node.cfcdist.gdn 99
|
||||
webxmr.com 99
|
||||
xmr.mining.best 99
|
||||
webminepool.com 99
|
||||
webminepool.tk 99
|
||||
hive.tubetitties.com 99
|
||||
playerassets.info 99
|
||||
tokyodrift.ga 99
|
||||
webassembly.stream 99
|
||||
okeyletsgo.ml 99
|
||||
candid.zone 99
|
||||
webmine.pro 99
|
||||
andlache.com 99
|
||||
bablace.com 99
|
||||
bewaslac.com 99
|
||||
biberukalap.com 99
|
||||
bowithow.com 99
|
||||
butcalve.com 99
|
||||
evengparme.com 99
|
||||
gridiogrid.com 99
|
||||
hatcalter.com 99
|
||||
kedtise.com 99
|
||||
ledinund.com 99
|
||||
nathetsof.com 99
|
||||
renhertfo.com 99
|
||||
rintindown.com 99
|
||||
sparnove.com 99
|
||||
witthethim.com 99
|
||||
1q2w3.fun 99
|
||||
1q2w3.me 99
|
||||
cryptoloot.pro 99
|
||||
bjorksta.men 99
|
||||
crypto.csgocpu.com 99
|
||||
noblock.pro 99
|
||||
miner.cryptobara.com 99
|
||||
digger.cryptobara.com 99
|
||||
dev.cryptobara.com 99
|
||||
reservedoffers.club 99
|
||||
mine.torrent.pw 99
|
||||
host.d-ns.ga 99
|
||||
abc.pema.cl 99
|
||||
mine.nahnoji.cz 99
|
||||
webmine.cz 99
|
||||
intactoffers.club 99
|
||||
analytics.blue 99
|
||||
smectapop12.pl 99
|
||||
berserkpl.net.pl 99
|
||||
hodlers.party 99
|
||||
hodling.faith 99
|
||||
chainblock.science 99
|
||||
minescripts.info 99
|
||||
cdn.minescripts.info 99
|
||||
miner.nablabee.com 99
|
||||
wss.nablabee.com 99
|
||||
clickwith.bid 99
|
||||
dronml.ml 99
|
||||
niematego.tk 99
|
||||
tulip18.com 99
|
||||
p.estream.to 99
|
||||
didnkinrab.com 99
|
||||
ledhenone.com 99
|
||||
losital.ru 99
|
||||
mebablo.com 99
|
||||
moonsade.com 99
|
||||
nebabrop.com 99
|
||||
pearno.com 99
|
||||
rintinwa.com 99
|
||||
willacrit.com 99
|
||||
www2.adfreetv.ch 99
|
||||
minr.pw 99
|
||||
new.minr.pw 99
|
||||
test.minr.pw 99
|
||||
staticsfs.host 99
|
||||
cdn-code.host 99
|
||||
g-content.bid 99
|
||||
ad.g-content.bid 99
|
||||
cdn.static-cnt.bid 99
|
||||
cnt.statistic.date 99
|
||||
cdn.jquery-uim.download 99
|
||||
cdn-jquery.host 99
|
||||
p1.interestingz.pw 99
|
||||
kippbeak.cf 99
|
||||
pasoherb.gq 99
|
||||
axoncoho.tk 99
|
||||
depttake.ga 99
|
||||
flophous.cf 99
|
||||
pr0gram.org 99
|
||||
authedmine.eu 99
|
||||
www.monero-miner.com 99
|
||||
www.datasecu.download 99
|
||||
www.jquery-cdn.download 99
|
||||
www.etzbnfuigipwvs.ru 99
|
||||
www.terethat.ru 99
|
||||
freshrefresher.com 99
|
||||
api.pzoifaum.info 99
|
||||
ws.pzoifaum.info 99
|
||||
api.bhzejltg.info 99
|
||||
ws.bhzejltg.info 99
|
||||
d.cfcnet.top 99
|
||||
vip.cfcnet.top 99
|
||||
eu.cfcnet.top 99
|
||||
as.cfcnet.top 99
|
||||
us.cfcnet.top 99
|
||||
eu.cfcdist.loan 99
|
||||
as.cfcdist.loan 99
|
||||
us.cfcdist.loan 99
|
||||
gustaver.ddns.net 99
|
||||
worker.salon.com 99
|
||||
s2.appelamule.com 99
|
||||
mepirtedic.com 99
|
||||
cdn.streambeam.io 99
|
||||
adzjzewsma.cf 99
|
||||
ffinwwfpqi.gq 99
|
||||
ininmacerad.pro 99
|
||||
mhiobjnirs.gq 99
|
||||
open-hive-server-1.pp.ua 99
|
||||
pool.hws.ru 99
|
||||
pool.etn.spacepools.org 99
|
||||
api.aalbbh84.info 99
|
||||
www.aymcsx.ru 99
|
||||
aeros01.tk 99
|
||||
aeros02.tk 99
|
||||
aeros03.tk 99
|
||||
aeros04.tk 99
|
||||
aeros05.tk 99
|
||||
aeros06.tk 99
|
||||
aeros07.tk 99
|
||||
aeros08.tk 99
|
||||
aeros09.tk 99
|
||||
aeros10.tk 99
|
||||
aeros11.tk 99
|
||||
aeros12.tk 99
|
||||
npcdn1.now.sh 99
|
||||
mxcdn2.now.sh 99
|
||||
sxcdn6.now.sh 99
|
||||
mxcdn1.now.sh 99
|
||||
sxcdn02.now.sh 99
|
||||
sxcdn4.now.sh 99
|
||||
jqcdn2.herokuapp.com 99
|
||||
sxcdn1.herokuapp.com 99
|
||||
sxcdn5.herokuapp.com 99
|
||||
wpcdn1.herokuapp.com 99
|
||||
jqcdn01.herokuapp.com 99
|
||||
jqcdn03.herokuapp.com 99
|
||||
1q2w3.website 99
|
||||
video.videos.vidto.me 99
|
||||
video.streaming.estream.to 99
|
||||
eth-pocket.de 99
|
||||
xvideosharing.site 99
|
||||
bestcoinsignals.com 99
|
||||
eucsoft.com 99
|
||||
traviilo.com 99
|
||||
wasm24.ru 99
|
||||
xmr.cool 99
|
||||
api.netflare.info 99
|
||||
cdnjs.cloudflane.com 99
|
||||
www.cloudflane.com 99
|
||||
hide.ovh 99
|
||||
graftpool.ovh 99
|
||||
encoding.ovh 99
|
||||
altavista.ovh 99
|
||||
scaleway.ovh 99
|
||||
nexttime.ovh 99
|
||||
never.ovh 99
|
||||
2giga.download 99
|
||||
support.2giga.link 99
|
||||
webminerpool.com 99
|
||||
minercry.pt 99
|
||||
adplusplus.fr 99
|
||||
|
||||
# Does not seem to work anymore, but keeping it here just in case it gets revived
|
||||
azvjudwr.info 99
|
||||
jroqvbvw.info 99
|
||||
jyhfuqoh.info 99
|
||||
kdowqlpt.info 99
|
||||
xbasfbno.info 99
|
||||
|
||||
# These were Obfuscated
|
||||
1beb2a44.space 99
|
||||
300ca0d0.space 99
|
||||
310ca263.space 99
|
||||
320ca3f6.space 99
|
||||
330ca589.space 99
|
||||
340ca71c.space 99
|
||||
360caa42.space 99
|
||||
370cabd5.space 99
|
||||
3c0cb3b4.space 99
|
||||
3d0cb547.space 99
|
||||
|
||||
imageshack.us 99
|
||||
img265.imageshack.us 99
|
||||
+2496
-1034
File diff suppressed because it is too large
Load Diff
+1078
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,185 @@
|
||||
/*
|
||||
* ndpi_util.h
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* This module contains routines to help setup a simple nDPI program.
|
||||
*
|
||||
* If you concern about performance or have to integrate nDPI in your
|
||||
* application, you could need to reimplement them yourself.
|
||||
*
|
||||
* WARNING: this API is just a demo od nDPI usage: Use it at your own risk!
|
||||
*/
|
||||
#ifndef __NDPI_UTIL_H__
|
||||
#define __NDPI_UTIL_H__
|
||||
|
||||
#include <pcap.h>
|
||||
|
||||
#define MAX_NUM_READER_THREADS 16
|
||||
#define IDLE_SCAN_PERIOD 10 /* msec (use TICK_RESOLUTION = 1000) */
|
||||
#define MAX_IDLE_TIME 30000
|
||||
#define IDLE_SCAN_BUDGET 1024
|
||||
#define NUM_ROOTS 512
|
||||
#define MAX_EXTRA_PACKETS_TO_CHECK 7
|
||||
#define MAX_NDPI_FLOWS 200000000
|
||||
#define TICK_RESOLUTION 1000
|
||||
#define MAX_NUM_IP_ADDRESS 5 /* len of ip address array */
|
||||
#define UPDATED_TREE 1
|
||||
#define AGGRESSIVE_PERCENT 95.00
|
||||
#define DIR_SRC 10
|
||||
#define DIR_DST 20
|
||||
#define PORT_ARRAY_SIZE 20
|
||||
#define HOST_ARRAY_SIZE 20
|
||||
#define FLOWS_PACKETS_THRESHOLD 0.9
|
||||
#define FLOWS_PERCENT_THRESHOLD 1.0
|
||||
#define FLOWS_PERCENT_THRESHOLD_2 0.2
|
||||
#define FLOWS_THRESHOLD 1000
|
||||
#define PKTS_PERCENT_THRESHOLD 0.1
|
||||
#define MAX_TABLE_SIZE_1 4096
|
||||
#define MAX_TABLE_SIZE_2 8192
|
||||
#define INIT_VAL -1
|
||||
|
||||
// flow tracking
|
||||
typedef struct ndpi_flow_info {
|
||||
u_int32_t hashval;
|
||||
u_int32_t src_ip;
|
||||
u_int32_t dst_ip;
|
||||
u_int16_t src_port;
|
||||
u_int16_t dst_port;
|
||||
u_int8_t detection_completed, protocol, bidirectional, check_extra_packets;
|
||||
u_int16_t vlan_id;
|
||||
struct ndpi_flow_struct *ndpi_flow;
|
||||
char src_name[48], dst_name[48];
|
||||
u_int8_t ip_version;
|
||||
u_int64_t last_seen;
|
||||
u_int64_t src2dst_bytes, dst2src_bytes;
|
||||
u_int32_t src2dst_packets, dst2src_packets;
|
||||
|
||||
// result only, not used for flow identification
|
||||
ndpi_protocol detected_protocol;
|
||||
|
||||
char info[96];
|
||||
char host_server_name[256];
|
||||
char bittorent_hash[41];
|
||||
|
||||
struct {
|
||||
char client_info[48], server_info[48];
|
||||
} ssh_ssl;
|
||||
|
||||
void *src_id, *dst_id;
|
||||
} ndpi_flow_info_t;
|
||||
|
||||
|
||||
// flow statistics info
|
||||
typedef struct ndpi_stats {
|
||||
u_int32_t guessed_flow_protocols;
|
||||
u_int64_t raw_packet_count;
|
||||
u_int64_t ip_packet_count;
|
||||
u_int64_t total_wire_bytes, total_ip_bytes, total_discarded_bytes;
|
||||
u_int64_t protocol_counter[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int64_t protocol_counter_bytes[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int32_t protocol_flows[NDPI_MAX_SUPPORTED_PROTOCOLS + NDPI_MAX_NUM_CUSTOM_PROTOCOLS + 1];
|
||||
u_int32_t ndpi_flow_count;
|
||||
u_int64_t tcp_count, udp_count;
|
||||
u_int64_t mpls_count, pppoe_count, vlan_count, fragmented_count;
|
||||
u_int64_t packet_len[6];
|
||||
u_int16_t max_packet_len;
|
||||
} ndpi_stats_t;
|
||||
|
||||
|
||||
// flow preferences
|
||||
typedef struct ndpi_workflow_prefs {
|
||||
u_int8_t decode_tunnels;
|
||||
u_int8_t quiet_mode;
|
||||
u_int32_t num_roots;
|
||||
u_int32_t max_ndpi_flows;
|
||||
} ndpi_workflow_prefs_t;
|
||||
|
||||
struct ndpi_workflow;
|
||||
|
||||
/** workflow, flow, user data */
|
||||
typedef void (*ndpi_workflow_callback_ptr) (struct ndpi_workflow *, struct ndpi_flow_info *, void *);
|
||||
|
||||
|
||||
// workflow main structure
|
||||
typedef struct ndpi_workflow {
|
||||
u_int64_t last_time;
|
||||
|
||||
struct ndpi_workflow_prefs prefs;
|
||||
struct ndpi_stats stats;
|
||||
|
||||
ndpi_workflow_callback_ptr __flow_detected_callback;
|
||||
void * __flow_detected_udata;
|
||||
ndpi_workflow_callback_ptr __flow_giveup_callback;
|
||||
void * __flow_giveup_udata;
|
||||
|
||||
/* outside referencies */
|
||||
pcap_t *pcap_handle;
|
||||
|
||||
/* allocated by prefs */
|
||||
void **ndpi_flows_root;
|
||||
struct ndpi_detection_module_struct *ndpi_struct;
|
||||
u_int32_t num_allocated_flows;
|
||||
} ndpi_workflow_t;
|
||||
|
||||
|
||||
/* TODO: remove wrappers parameters and use ndpi global, when their initialization will be fixed... */
|
||||
struct ndpi_workflow * ndpi_workflow_init(const struct ndpi_workflow_prefs * prefs, pcap_t * pcap_handle);
|
||||
|
||||
|
||||
/* workflow main free function */
|
||||
void ndpi_workflow_free(struct ndpi_workflow * workflow);
|
||||
|
||||
|
||||
/** Free flow_info ndpi support structures but not the flow_info itself
|
||||
*
|
||||
* TODO remove! Half freeing things is bad!
|
||||
*/
|
||||
void ndpi_free_flow_info_half(struct ndpi_flow_info *flow);
|
||||
|
||||
|
||||
/* Process a packet and update the workflow */
|
||||
struct ndpi_proto ndpi_workflow_process_packet(struct ndpi_workflow * workflow,
|
||||
const struct pcap_pkthdr *header,
|
||||
const u_char *packet);
|
||||
|
||||
|
||||
/* flow callbacks for complete detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_detected_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_detected_callback = callback;
|
||||
workflow->__flow_detected_udata = udata;
|
||||
}
|
||||
|
||||
/* flow callbacks for sufficient detected flow
|
||||
(ndpi_flow_info will be freed right after) */
|
||||
static inline void ndpi_workflow_set_flow_giveup_callback(struct ndpi_workflow * workflow, ndpi_workflow_callback_ptr callback, void * udata) {
|
||||
workflow->__flow_giveup_callback = callback;
|
||||
workflow->__flow_giveup_udata = udata;
|
||||
}
|
||||
|
||||
/* compare two nodes in workflow */
|
||||
int ndpi_workflow_node_cmp(const void *a, const void *b);
|
||||
void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_flow_info *flow);
|
||||
u_int32_t ethernet_crc32(const void* data, size_t n_bytes);
|
||||
void ndpi_flow_info_freer(void *node);
|
||||
|
||||
extern int nDPI_LogLevel;
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -10,7 +10,7 @@ tcp:3000@ntop
|
||||
# Format:
|
||||
# host:"<value>",host:"<value>",.....@<subproto>
|
||||
|
||||
host:"googlesyndacation.com"@Google
|
||||
host:"googlesyndication.com"@Google
|
||||
host:"venere.com"@Venere
|
||||
host:"kataweb.it",host:"repubblica.it"@Repubblica
|
||||
host:"ntop"@ntop
|
||||
|
||||
+1096
File diff suppressed because it is too large
Load Diff
+45
@@ -1,6 +1,9 @@
|
||||
ndpi_dump_protocols
|
||||
ndpi_strnstr
|
||||
ndpi_detection_giveup
|
||||
ndpi_get_proto_name
|
||||
ndpi_free
|
||||
ndpi_flow_free
|
||||
ndpi_guess_undetected_protocol
|
||||
ndpi_tfind
|
||||
ndpi_tsearch
|
||||
@@ -10,7 +13,9 @@ ndpi_detection_get_sizeof_ndpi_flow_struct
|
||||
ndpi_load_protocols_file
|
||||
ndpi_tdestroy
|
||||
ndpi_exit_detection_module
|
||||
ndpi_l4_detection_process_packet
|
||||
ndpi_detection_process_packet
|
||||
ndpi_process_extra_packet
|
||||
ndpi_twalk
|
||||
ndpi_tdelete
|
||||
ndpi_revision
|
||||
@@ -18,6 +23,7 @@ ndpi_init_detection_module
|
||||
ndpi_get_num_supported_protocols
|
||||
ndpi_set_proto_defaults
|
||||
ndpi_get_protocol_id
|
||||
ndpi_get_category_id
|
||||
ndpi_find_port_based_protocol
|
||||
ndpi_get_http_method
|
||||
ndpi_get_http_url
|
||||
@@ -26,5 +32,44 @@ ndpi_free_flow
|
||||
ndpi_get_proto_breed
|
||||
ndpi_get_proto_breed_name
|
||||
ndpi_get_proto_by_id
|
||||
ndpi_get_proto_by_name
|
||||
ndpi_get_protocol_id_master_proto
|
||||
ndpi_guess_protocol_id
|
||||
ndpi_protocol2name
|
||||
ndpi_get_lower_proto
|
||||
ndpi_is_proto
|
||||
ndpi_malloc
|
||||
ndpi_calloc
|
||||
ndpi_set_detected_protocol
|
||||
ndpi_match_string_subprotocol
|
||||
ndpi_init_automa
|
||||
ndpi_free_automa
|
||||
ndpi_add_string_value_to_automa
|
||||
ndpi_add_string_to_automa
|
||||
ndpi_finalize_automa
|
||||
ndpi_match_string
|
||||
ndpi_match_string_id
|
||||
set_ndpi_malloc
|
||||
set_ndpi_flow_malloc
|
||||
set_ndpi_free
|
||||
set_ndpi_flow_free
|
||||
set_ndpi_debug_function
|
||||
ndpi_category_str
|
||||
ndpi_get_proto_category
|
||||
ndpi_netbios_name_interpret
|
||||
ndpi_category_set_name
|
||||
ndpi_category_get_name
|
||||
ndpi_is_custom_category
|
||||
ndpi_is_subprotocol_informative
|
||||
ndpi_set_proto_category
|
||||
ndpi_get_api_version
|
||||
ndpi_network_ptree_match
|
||||
ndpi_check_flow_func
|
||||
ndpi_fill_protocol_category
|
||||
ndpi_load_hostname_category
|
||||
ndpi_enable_loaded_categories
|
||||
ndpi_set_detection_preferences
|
||||
ndpi_get_proto_defaults
|
||||
ndpi_get_ndpi_num_supported_protocols
|
||||
ndpi_get_ndpi_num_custom_protocols
|
||||
ndpi_get_ndpi_detection_module_size
|
||||
|
||||
+270
-117
@@ -19,10 +19,10 @@
|
||||
# is necessary on AIX to use the special cc_r compiler alias.)
|
||||
#
|
||||
# NOTE: You are assumed to not only compile your program with these flags,
|
||||
# but also link it with them as well. e.g. you should link with
|
||||
# but also to link with them as well. For example, you might link with
|
||||
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
|
||||
#
|
||||
# If you are only building threads programs, you may wish to use these
|
||||
# If you are only building threaded programs, you may wish to use these
|
||||
# variables in your default LIBS, CFLAGS, and CC:
|
||||
#
|
||||
# LIBS="$PTHREAD_LIBS $LIBS"
|
||||
@@ -30,8 +30,8 @@
|
||||
# CC="$PTHREAD_CC"
|
||||
#
|
||||
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
|
||||
# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
|
||||
# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
|
||||
# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
|
||||
#
|
||||
# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
|
||||
# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
|
||||
@@ -82,35 +82,40 @@
|
||||
# modified version of the Autoconf Macro, you may extend this special
|
||||
# exception to the GPL to apply to your modified version as well.
|
||||
|
||||
#serial 21
|
||||
#serial 23
|
||||
|
||||
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
|
||||
AC_DEFUN([AX_PTHREAD], [
|
||||
AC_REQUIRE([AC_CANONICAL_HOST])
|
||||
AC_REQUIRE([AC_PROG_CC])
|
||||
AC_REQUIRE([AC_PROG_SED])
|
||||
AC_LANG_PUSH([C])
|
||||
ax_pthread_ok=no
|
||||
|
||||
# We used to check for pthread.h first, but this fails if pthread.h
|
||||
# requires special compiler flags (e.g. on True64 or Sequent).
|
||||
# requires special compiler flags (e.g. on Tru64 or Sequent).
|
||||
# It gets checked for in the link test anyway.
|
||||
|
||||
# First of all, check if the user has set any of the PTHREAD_LIBS,
|
||||
# etcetera environment variables, and if threads linking works using
|
||||
# them:
|
||||
if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
|
||||
save_CFLAGS="$CFLAGS"
|
||||
if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
|
||||
ax_pthread_save_CC="$CC"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
|
||||
AC_TRY_LINK_FUNC([pthread_join], [ax_pthread_ok=yes])
|
||||
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
|
||||
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
if test "x$ax_pthread_ok" = "xno"; then
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
fi
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CC="$ax_pthread_save_CC"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
LIBS="$ax_pthread_save_LIBS"
|
||||
fi
|
||||
|
||||
# We must check for the threads library under a number of different
|
||||
@@ -123,7 +128,7 @@ fi
|
||||
# which indicates that we try without any flags at all, and "pthread-config"
|
||||
# which is a program returning the flags for the Pth emulation library.
|
||||
|
||||
ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
|
||||
|
||||
# The ordering *is* (sometimes) important. Some notes on the
|
||||
# individual items follow:
|
||||
@@ -132,82 +137,225 @@ ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mt
|
||||
# none: in case threads are in libc; should be tried before -Kthread and
|
||||
# other compiler flags to prevent continual compiler warnings
|
||||
# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
|
||||
# -pthreads: Solaris/gcc
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
|
||||
# (Note: HP C rejects this with "bad form for `-t' option")
|
||||
# -pthreads: Solaris/gcc (Note: HP C also rejects)
|
||||
# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
|
||||
# doesn't hurt to check since this sometimes defines pthreads too;
|
||||
# also defines -D_REENTRANT)
|
||||
# ... -mt is also the pthreads flag for HP/aCC
|
||||
# doesn't hurt to check since this sometimes defines pthreads and
|
||||
# -D_REENTRANT too), HP C (must be checked before -lpthread, which
|
||||
# is present but should not be used directly; and before -mthreads,
|
||||
# because the compiler interprets this as "-mt" + "-hreads")
|
||||
# -mthreads: Mingw32/gcc, Lynx/gcc
|
||||
# pthread: Linux, etcetera
|
||||
# --thread-safe: KAI C++
|
||||
# pthread-config: use pthread-config program (for GNU Pth library)
|
||||
|
||||
case ${host_os} in
|
||||
case $host_os in
|
||||
|
||||
freebsd*)
|
||||
|
||||
# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
|
||||
# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
|
||||
|
||||
ax_pthread_flags="-kthread lthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
hpux*)
|
||||
|
||||
# From the cc(1) man page: "[-mt] Sets various -D flags to enable
|
||||
# multi-threading and also sets -lpthread."
|
||||
|
||||
ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
openedition*)
|
||||
|
||||
# IBM z/OS requires a feature-test macro to be defined in order to
|
||||
# enable POSIX threads at all, so give the user a hint if this is
|
||||
# not set. (We don't define these ourselves, as they can affect
|
||||
# other portions of the system API in unpredictable ways.)
|
||||
|
||||
AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
|
||||
[
|
||||
# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
|
||||
AX_PTHREAD_ZOS_MISSING
|
||||
# endif
|
||||
],
|
||||
[AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
|
||||
;;
|
||||
|
||||
solaris*)
|
||||
|
||||
# On Solaris (at least, for some versions), libc contains stubbed
|
||||
# (non-functional) versions of the pthreads routines, so link-based
|
||||
# tests will erroneously succeed. (We need to link with -pthreads/-mt/
|
||||
# -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
|
||||
# a function called by this macro, so we could check for that, but
|
||||
# who knows whether they'll stub that too in a future libc.) So,
|
||||
# we'll just look for -pthreads and -lpthread first:
|
||||
# tests will erroneously succeed. (N.B.: The stubs are missing
|
||||
# pthread_cleanup_push, or rather a function called by this macro,
|
||||
# so we could check for that, but who knows whether they'll stub
|
||||
# that too in a future libc.) So we'll check first for the
|
||||
# standard Solaris way of linking pthreads (-mt -lpthread).
|
||||
|
||||
ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
|
||||
;;
|
||||
|
||||
darwin*)
|
||||
ax_pthread_flags="-pthread $ax_pthread_flags"
|
||||
ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Clang doesn't consider unrecognized options an error unless we specify
|
||||
# -Werror. We throw in some extra Clang-specific options to ensure that
|
||||
# this doesn't happen for GCC, which also accepts -Werror.
|
||||
# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
|
||||
|
||||
AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
|
||||
save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_extra_flags="-Werror"
|
||||
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
|
||||
[AC_MSG_RESULT([yes])],
|
||||
[ax_pthread_extra_flags=
|
||||
AC_MSG_RESULT([no])])
|
||||
CFLAGS="$save_CFLAGS"
|
||||
AS_IF([test "x$GCC" = "xyes"],
|
||||
[ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"])
|
||||
|
||||
if test x"$ax_pthread_ok" = xno; then
|
||||
for flag in $ax_pthread_flags; do
|
||||
# The presence of a feature test macro requesting re-entrant function
|
||||
# definitions is, on some systems, a strong hint that pthreads support is
|
||||
# correctly enabled
|
||||
|
||||
case $flag in
|
||||
case $host_os in
|
||||
darwin* | hpux* | linux* | osf* | solaris*)
|
||||
ax_pthread_check_macro="_REENTRANT"
|
||||
;;
|
||||
|
||||
aix*)
|
||||
ax_pthread_check_macro="_THREAD_SAFE"
|
||||
;;
|
||||
|
||||
*)
|
||||
ax_pthread_check_macro="--"
|
||||
;;
|
||||
esac
|
||||
AS_IF([test "x$ax_pthread_check_macro" = "x--"],
|
||||
[ax_pthread_check_cond=0],
|
||||
[ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
|
||||
|
||||
# Are we compiling with Clang?
|
||||
|
||||
AC_CACHE_CHECK([whether $CC is Clang],
|
||||
[ax_cv_PTHREAD_CLANG],
|
||||
[ax_cv_PTHREAD_CLANG=no
|
||||
# Note that Autoconf sets GCC=yes for Clang as well as GCC
|
||||
if test "x$GCC" = "xyes"; then
|
||||
AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
|
||||
[/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
|
||||
# if defined(__clang__) && defined(__llvm__)
|
||||
AX_PTHREAD_CC_IS_CLANG
|
||||
# endif
|
||||
],
|
||||
[ax_cv_PTHREAD_CLANG=yes])
|
||||
fi
|
||||
])
|
||||
ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
|
||||
|
||||
ax_pthread_clang_warning=no
|
||||
|
||||
# Clang needs special handling, because older versions handle the -pthread
|
||||
# option in a rather... idiosyncratic way
|
||||
|
||||
if test "x$ax_pthread_clang" = "xyes"; then
|
||||
|
||||
# Clang takes -pthread; it has never supported any other flag
|
||||
|
||||
# (Note 1: This will need to be revisited if a system that Clang
|
||||
# supports has POSIX threads in a separate library. This tends not
|
||||
# to be the way of modern systems, but it's conceivable.)
|
||||
|
||||
# (Note 2: On some systems, notably Darwin, -pthread is not needed
|
||||
# to get POSIX threads support; the API is always present and
|
||||
# active. We could reasonably leave PTHREAD_CFLAGS empty. But
|
||||
# -pthread does define _REENTRANT, and while the Darwin headers
|
||||
# ignore this macro, third-party headers might not.)
|
||||
|
||||
PTHREAD_CFLAGS="-pthread"
|
||||
PTHREAD_LIBS=
|
||||
|
||||
ax_pthread_ok=yes
|
||||
|
||||
# However, older versions of Clang make a point of warning the user
|
||||
# that, in an invocation where only linking and no compilation is
|
||||
# taking place, the -pthread option has no effect ("argument unused
|
||||
# during compilation"). They expect -pthread to be passed in only
|
||||
# when source code is being compiled.
|
||||
#
|
||||
# Problem is, this is at odds with the way Automake and most other
|
||||
# C build frameworks function, which is that the same flags used in
|
||||
# compilation (CFLAGS) are also used in linking. Many systems
|
||||
# supported by AX_PTHREAD require exactly this for POSIX threads
|
||||
# support, and in fact it is often not straightforward to specify a
|
||||
# flag that is used only in the compilation phase and not in
|
||||
# linking. Such a scenario is extremely rare in practice.
|
||||
#
|
||||
# Even though use of the -pthread flag in linking would only print
|
||||
# a warning, this can be a nuisance for well-run software projects
|
||||
# that build with -Werror. So if the active version of Clang has
|
||||
# this misfeature, we search for an option to squash it.
|
||||
|
||||
AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
|
||||
[ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
|
||||
# Create an alternate version of $ac_link that compiles and
|
||||
# links in two steps (.c -> .o, .o -> exe) instead of one
|
||||
# (.c -> exe), because the warning occurs only in the second
|
||||
# step
|
||||
ax_pthread_save_ac_link="$ac_link"
|
||||
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
|
||||
ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
|
||||
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
|
||||
AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
|
||||
CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[ac_link="$ax_pthread_2step_ac_link"
|
||||
AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
|
||||
[break])
|
||||
])
|
||||
done
|
||||
ac_link="$ax_pthread_save_ac_link"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
|
||||
ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
|
||||
])
|
||||
|
||||
case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
|
||||
no | unknown) ;;
|
||||
*) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
|
||||
esac
|
||||
|
||||
fi # $ax_pthread_clang = yes
|
||||
|
||||
if test "x$ax_pthread_ok" = "xno"; then
|
||||
for ax_pthread_try_flag in $ax_pthread_flags; do
|
||||
|
||||
case $ax_pthread_try_flag in
|
||||
none)
|
||||
AC_MSG_CHECKING([whether pthreads work without any flags])
|
||||
;;
|
||||
|
||||
-mt,pthread)
|
||||
AC_MSG_CHECKING([whether pthreads work with -mt -lpthread])
|
||||
PTHREAD_CFLAGS="-mt"
|
||||
PTHREAD_LIBS="-lpthread"
|
||||
;;
|
||||
|
||||
-*)
|
||||
AC_MSG_CHECKING([whether pthreads work with $flag])
|
||||
PTHREAD_CFLAGS="$flag"
|
||||
AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
|
||||
PTHREAD_CFLAGS="$ax_pthread_try_flag"
|
||||
;;
|
||||
|
||||
pthread-config)
|
||||
AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
|
||||
if test x"$ax_pthread_config" = xno; then continue; fi
|
||||
AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
|
||||
PTHREAD_CFLAGS="`pthread-config --cflags`"
|
||||
PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
|
||||
;;
|
||||
|
||||
*)
|
||||
AC_MSG_CHECKING([for the pthreads library -l$flag])
|
||||
PTHREAD_LIBS="-l$flag"
|
||||
AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
|
||||
PTHREAD_LIBS="-l$ax_pthread_try_flag"
|
||||
;;
|
||||
esac
|
||||
|
||||
save_LIBS="$LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS $ax_pthread_extra_flags"
|
||||
|
||||
# Check for various functions. We must include pthread.h,
|
||||
# since some functions may be macros. (On the Sequent, we
|
||||
@@ -218,7 +366,11 @@ for flag in $ax_pthread_flags; do
|
||||
# pthread_cleanup_push because it is one of the few pthread
|
||||
# functions on Solaris that doesn't have a non-functional libc stub.
|
||||
# We try pthread_create on general principles.
|
||||
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>
|
||||
# if $ax_pthread_check_cond
|
||||
# error "$ax_pthread_check_macro must be defined"
|
||||
# endif
|
||||
static void routine(void *a) { a = 0; }
|
||||
static void *start_routine(void *a) { return a; }],
|
||||
[pthread_t th; pthread_attr_t attr;
|
||||
@@ -227,16 +379,14 @@ for flag in $ax_pthread_flags; do
|
||||
pthread_attr_init(&attr);
|
||||
pthread_cleanup_push(routine, 0);
|
||||
pthread_cleanup_pop(0) /* ; */])],
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
[ax_pthread_ok=yes],
|
||||
[])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
LIBS="$ax_pthread_save_LIBS"
|
||||
|
||||
AC_MSG_RESULT([$ax_pthread_ok])
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
break;
|
||||
fi
|
||||
AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
|
||||
|
||||
PTHREAD_LIBS=""
|
||||
PTHREAD_CFLAGS=""
|
||||
@@ -244,71 +394,74 @@ done
|
||||
fi
|
||||
|
||||
# Various other checks:
|
||||
if test "x$ax_pthread_ok" = xyes; then
|
||||
save_LIBS="$LIBS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
save_CFLAGS="$CFLAGS"
|
||||
if test "x$ax_pthread_ok" = "xyes"; then
|
||||
ax_pthread_save_CFLAGS="$CFLAGS"
|
||||
ax_pthread_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LIBS="$PTHREAD_LIBS $LIBS"
|
||||
|
||||
# Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
|
||||
AC_MSG_CHECKING([for joinable pthread attribute])
|
||||
attr_name=unknown
|
||||
for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $attr; return attr /* ; */])],
|
||||
[attr_name=$attr; break],
|
||||
[])
|
||||
done
|
||||
AC_MSG_RESULT([$attr_name])
|
||||
if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
|
||||
AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], [$attr_name],
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
fi
|
||||
AC_CACHE_CHECK([for joinable pthread attribute],
|
||||
[ax_cv_PTHREAD_JOINABLE_ATTR],
|
||||
[ax_cv_PTHREAD_JOINABLE_ATTR=unknown
|
||||
for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
||||
[int attr = $ax_pthread_attr; return attr /* ; */])],
|
||||
[ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
|
||||
[])
|
||||
done
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
|
||||
test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
|
||||
test "x$ax_pthread_joinable_attr_defined" != "xyes"],
|
||||
[AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
|
||||
[$ax_cv_PTHREAD_JOINABLE_ATTR],
|
||||
[Define to necessary symbol if this constant
|
||||
uses a non-standard name on your system.])
|
||||
ax_pthread_joinable_attr_defined=yes
|
||||
])
|
||||
|
||||
AC_MSG_CHECKING([if more special flags are required for pthreads])
|
||||
flag=no
|
||||
case ${host_os} in
|
||||
aix* | freebsd* | darwin*) flag="-D_THREAD_SAFE";;
|
||||
osf* | hpux*) flag="-D_REENTRANT";;
|
||||
solaris*)
|
||||
if test "$GCC" = "yes"; then
|
||||
flag="-D_REENTRANT"
|
||||
else
|
||||
# TODO: What about Clang on Solaris?
|
||||
flag="-mt -D_REENTRANT"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$flag])
|
||||
if test "x$flag" != xno; then
|
||||
PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
|
||||
fi
|
||||
AC_CACHE_CHECK([whether more special flags are required for pthreads],
|
||||
[ax_cv_PTHREAD_SPECIAL_FLAGS],
|
||||
[ax_cv_PTHREAD_SPECIAL_FLAGS=no
|
||||
case $host_os in
|
||||
solaris*)
|
||||
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
|
||||
;;
|
||||
esac
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
|
||||
test "x$ax_pthread_special_flags_added" != "xyes"],
|
||||
[PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
|
||||
ax_pthread_special_flags_added=yes])
|
||||
|
||||
AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT], [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>]],
|
||||
[[int i = PTHREAD_PRIO_INHERIT;]])],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=yes],
|
||||
[ax_cv_PTHREAD_PRIO_INHERIT=no])
|
||||
])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes"],
|
||||
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])])
|
||||
AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
|
||||
test "x$ax_pthread_prio_inherit_defined" != "xyes"],
|
||||
[AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
|
||||
ax_pthread_prio_inherit_defined=yes
|
||||
])
|
||||
|
||||
LIBS="$save_LIBS"
|
||||
CFLAGS="$save_CFLAGS"
|
||||
CFLAGS="$ax_pthread_save_CFLAGS"
|
||||
LIBS="$ax_pthread_save_LIBS"
|
||||
|
||||
# More AIX lossage: compile with *_r variant
|
||||
if test "x$GCC" != xyes; then
|
||||
if test "x$GCC" != "xyes"; then
|
||||
case $host_os in
|
||||
aix*)
|
||||
AS_CASE(["x/$CC"],
|
||||
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
||||
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
|
||||
[#handle absolute path differently from PATH based program lookup
|
||||
AS_CASE(["x$CC"],
|
||||
[x/*],
|
||||
[AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
|
||||
[AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
@@ -321,7 +474,7 @@ AC_SUBST([PTHREAD_CFLAGS])
|
||||
AC_SUBST([PTHREAD_CC])
|
||||
|
||||
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
|
||||
if test x"$ax_pthread_ok" = xyes; then
|
||||
if test "x$ax_pthread_ok" = "xyes"; then
|
||||
ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
|
||||
:
|
||||
else
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
This package is a GPL implementation of an iptables and netfilter module for
|
||||
nDPI integration into the Linux kernel.
|
||||
|
||||
https://github.com/ewildgoose/ndpi-netfilter
|
||||
@@ -1,14 +1,15 @@
|
||||
class Ndpi < Formula
|
||||
desc "Deep Packet Inspection (DPI) library"
|
||||
homepage "http://www.ntop.org/products/ndpi/"
|
||||
url "https://downloads.sourceforge.net/project/ntop/nDPI/nDPI-1.7.tar.gz"
|
||||
sha256 "714b745103a072462130b0e14cf31b2eb5270f580b7c839da5cf5ea75150262d"
|
||||
url "https://downloads.sourceforge.net/project/ntop/nDPI/nDPI-1.8.tgz"
|
||||
sha256 "f490137a7387b69d0d55e990f2150b86d7b5eaae870e5326e8c2f18c17412443"
|
||||
|
||||
bottle do
|
||||
cellar :any
|
||||
sha256 "e9464d314479ba3e7a91422e0bc606cfd5f6e72e94d6441cc4fa30e9c925da5c" => :yosemite
|
||||
sha256 "1d6b1d860669b42766baa276ed948c342e2fa4fd28663ba64a90fd0e200ba9c4" => :mavericks
|
||||
sha256 "b814918b4fb9588de7126061ce4ac3eb41a5c3eee27c7432b669f6dc6921bfde" => :mountain_lion
|
||||
sha256 "05053767fc3c70557745c348c7352e7c2716c040ca54c5cf8d5306167c878fcb" => :el_capitan
|
||||
sha256 "34c0269039a0079820eeed862daa28158d9291f73f640a9415da60746d69a662" => :yosemite
|
||||
sha256 "a2af4dc62c24313593b3a20e45ca9d2d49f8efc0ea5e52fd064001ea441b93e4" => :mavericks
|
||||
sha256 "1bb200268a4d9df9bbe5d33bc773ee3bcf4b5d4fa00c76a040f16318438c284f" => :mountain_lion
|
||||
end
|
||||
|
||||
depends_on "autoconf" => :build
|
||||
@@ -17,6 +18,8 @@ class Ndpi < Formula
|
||||
depends_on "libtool" => :build
|
||||
depends_on "json-c"
|
||||
|
||||
head "https://github.com/ntop/nDPI.git", :branch => "dev"
|
||||
|
||||
def install
|
||||
system "./autogen.sh"
|
||||
system "./configure", "--prefix=#{prefix}"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#
|
||||
# debian/compat
|
||||
# We should use at least comparibily version 5
|
||||
# We should use at least compatibility version 5
|
||||
# but this requires the whole building process
|
||||
# to be remade and this is something we leave
|
||||
# to when we will have more time
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
|
||||
library_includedir=$(includedir)/libndpi-1.4/libndpi
|
||||
library_includedir=$(includedir)/libndpi-@VERSION@/libndpi
|
||||
|
||||
library_include_HEADERS = ndpi_api.h \
|
||||
ndpi_debug_functions.h \
|
||||
ndpi_define.h \
|
||||
ndpi_macros.h \
|
||||
ndpi_protocols_osdpi.h \
|
||||
ndpi_public_functions.h
|
||||
ndpi_define.h \
|
||||
ndpi_typedefs.h \
|
||||
ndpi_main.h \
|
||||
ndpi_protocol_ids.h \
|
||||
ndpi_protocols.h \
|
||||
ndpi_win32.h \
|
||||
ndpi_includes.h
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
/*
|
||||
* linux_compat.h
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NDPI_LINUX_COMPAT_H__
|
||||
#define __NDPI_LINUX_COMPAT_H__
|
||||
|
||||
#include "ndpi_define.h"
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#include <machine/endian.h>
|
||||
|
||||
#if _BYTE_ORDER == _LITTLE_ENDIAN
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
#define __LITTLE_ENDIAN__ 1
|
||||
#endif
|
||||
#else
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define __BIG_ENDIAN__ 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 1) /* push current alignment to stack */
|
||||
#pragma pack(1) /* set alignment to 1 byte boundary */
|
||||
|
||||
#pragma pack(pop) /* restore original alignment from stack */
|
||||
|
||||
struct ndpi_ethhdr {
|
||||
u_char h_dest[6]; /* destination eth addr */
|
||||
u_char h_source[6]; /* source ether addr */
|
||||
u_int16_t h_proto; /* packet type ID field */
|
||||
};
|
||||
|
||||
struct ndpi_80211q {
|
||||
u_int16_t vlanId;
|
||||
u_int16_t protoType;
|
||||
};
|
||||
|
||||
struct ndpi_iphdr {
|
||||
#if defined(__LITTLE_ENDIAN__)
|
||||
u_int8_t ihl:4, version:4;
|
||||
#elif defined(__BIG_ENDIAN__)
|
||||
u_int8_t version:4, ihl:4;
|
||||
#else
|
||||
# error "Byte order must be defined"
|
||||
#endif
|
||||
u_int8_t tos;
|
||||
u_int16_t tot_len;
|
||||
u_int16_t id;
|
||||
u_int16_t frag_off;
|
||||
u_int8_t ttl;
|
||||
u_int8_t protocol;
|
||||
u_int16_t check;
|
||||
u_int32_t saddr;
|
||||
u_int32_t daddr;
|
||||
};
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long u_long;
|
||||
typedef u_char u_int8_t;
|
||||
typedef u_short u_int16_t;
|
||||
typedef uint u_int32_t;
|
||||
|
||||
#define _WS2TCPIP_H_ /* Avoid compilation problems */
|
||||
#define HAVE_SIN6_LEN
|
||||
|
||||
|
||||
/* IPv6 address */
|
||||
/* Already defined in WS2tcpip.h */
|
||||
struct ndpi_win_in6_addr
|
||||
{
|
||||
union
|
||||
{
|
||||
u_int8_t u6_addr8[16];
|
||||
u_int16_t u6_addr16[8];
|
||||
u_int32_t u6_addr32[4];
|
||||
} in6_u;
|
||||
#ifdef s6_addr
|
||||
#undef s6_addr
|
||||
#endif
|
||||
|
||||
#ifdef s6_addr16
|
||||
#undef s6_addr16
|
||||
#endif
|
||||
|
||||
#ifdef s6_addr32
|
||||
#undef s6_addr32
|
||||
#endif
|
||||
|
||||
#define s6_addr in6_u.u6_addr8
|
||||
// #define s6_addr16 in6_u.u6_addr16
|
||||
// #define s6_addr32 in6_u.u6_addr32
|
||||
|
||||
};
|
||||
|
||||
#define in6_addr win_in6_addr
|
||||
|
||||
/* Generic extension header. */
|
||||
struct ndpi_ip6_ext
|
||||
{
|
||||
u_int8_t ip6e_nxt; /* next header. */
|
||||
u_int8_t ip6e_len; /* length in units of 8 octets. */
|
||||
};
|
||||
|
||||
#define s6_addr16 __u6_addr.__u6_addr16
|
||||
#define s6_addr32 __u6_addr.__u6_addr32
|
||||
#else
|
||||
#ifndef __KERNEL__
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
struct ndpi_in6_addr {
|
||||
union {
|
||||
u_int8_t __u6_addr8[16];
|
||||
u_int16_t __u6_addr16[8];
|
||||
u_int32_t __u6_addr32[4];
|
||||
} __u6_addr; /* 128-bit IP6 address */
|
||||
};
|
||||
|
||||
struct ndpi_ip6_hdr {
|
||||
union {
|
||||
struct ndpi_ip6_hdrctl {
|
||||
u_int32_t ip6_un1_flow;
|
||||
u_int16_t ip6_un1_plen;
|
||||
u_int8_t ip6_un1_nxt;
|
||||
u_int8_t ip6_un1_hlim;
|
||||
} ip6_un1;
|
||||
u_int8_t ip6_un2_vfc;
|
||||
} ip6_ctlun;
|
||||
struct ndpi_in6_addr ip6_src;
|
||||
struct ndpi_in6_addr ip6_dst;
|
||||
};
|
||||
|
||||
struct ndpi_tcphdr {
|
||||
u_int16_t source;
|
||||
u_int16_t dest;
|
||||
u_int32_t seq;
|
||||
u_int32_t ack_seq;
|
||||
#if defined(__LITTLE_ENDIAN__)
|
||||
u_int16_t res1:4, doff:4, fin:1, syn:1, rst:1, psh:1, ack:1, urg:1, ece:1, cwr:1;
|
||||
#elif defined(__BIG_ENDIAN__)
|
||||
u_int16_t doff:4, res1:4, cwr:1, ece:1, urg:1, ack:1, psh:1, rst:1, syn:1, fin:1;
|
||||
#else
|
||||
# error "Byte order must be defined"
|
||||
#endif
|
||||
u_int16_t window;
|
||||
u_int16_t check;
|
||||
u_int16_t urg_ptr;
|
||||
};
|
||||
|
||||
struct ndpi_udphdr {
|
||||
u_int16_t source;
|
||||
u_int16_t dest;
|
||||
u_int16_t len;
|
||||
u_int16_t check;
|
||||
};
|
||||
|
||||
#endif
|
||||
+658
-142
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* ndpi_api.h
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-17 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,8 +22,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NDPI_PUBLIC_FUNCTIONS_H__
|
||||
#define __NDPI_PUBLIC_FUNCTIONS_H__
|
||||
#ifndef __NDPI_API_H__
|
||||
#define __NDPI_API_H__
|
||||
|
||||
#include "ndpi_main.h"
|
||||
|
||||
@@ -32,96 +31,230 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* The #define below is used for apps that dynamically link with nDPI to make
|
||||
sure that datastructures and in sync across versions
|
||||
*/
|
||||
#define NDPI_API_VERSION 1
|
||||
|
||||
#define SIZEOF_ID_STRUCT ( sizeof(struct ndpi_id_struct) )
|
||||
#define SIZEOF_FLOW_STRUCT ( sizeof(struct ndpi_flow_struct) )
|
||||
|
||||
#define NDPI_DETECTION_ONLY_IPV4 ( 1 << 0 )
|
||||
#define NDPI_DETECTION_ONLY_IPV6 ( 1 << 1 )
|
||||
|
||||
#define ADD_TO_DETECTION_BITMASK 1
|
||||
#define NO_ADD_TO_DETECTION_BITMASK 0
|
||||
#define SAVE_DETECTION_BITMASK_AS_UNKNOWN 1
|
||||
#define NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN 0
|
||||
|
||||
|
||||
/**
|
||||
* This function returns the size of the flow struct
|
||||
* Check if a string is encoded with punycode
|
||||
* ( https://tools.ietf.org/html/rfc3492 )
|
||||
*
|
||||
* @par buff = pointer to the string to ckeck
|
||||
* @par len = len of the string
|
||||
* @return 1 if the string is punycoded;
|
||||
* else 0
|
||||
*
|
||||
*/
|
||||
int check_punycode_string(char *buff, int len);
|
||||
|
||||
|
||||
/**
|
||||
* Get the size of the flow struct
|
||||
*
|
||||
* @return the size of the flow struct
|
||||
*
|
||||
*/
|
||||
u_int32_t ndpi_detection_get_sizeof_ndpi_flow_struct(void);
|
||||
|
||||
|
||||
/**
|
||||
* This function returns the size of the id struct
|
||||
* Get the size of the id struct
|
||||
*
|
||||
* @return the size of the id struct
|
||||
*
|
||||
*/
|
||||
u_int32_t ndpi_detection_get_sizeof_ndpi_id_struct(void);
|
||||
|
||||
/**
|
||||
* nDPI personal allocation and free functions
|
||||
**/
|
||||
void * ndpi_malloc(size_t size);
|
||||
void * ndpi_calloc(unsigned long count, size_t size);
|
||||
void * ndpi_realloc(void *ptr, size_t old_size, size_t new_size);
|
||||
char * ndpi_strdup(const char *s);
|
||||
void ndpi_free(void *ptr);
|
||||
void * ndpi_flow_malloc(size_t size);
|
||||
void ndpi_flow_free(void *ptr);
|
||||
|
||||
/* Public malloc/free */
|
||||
void* ndpi_malloc(unsigned long size);
|
||||
void* ndpi_calloc(unsigned long count, unsigned long size);
|
||||
void ndpi_free(void *ptr);
|
||||
void *ndpi_realloc(void *ptr, size_t old_size, size_t new_size);
|
||||
char *ndpi_strdup(const char *s);
|
||||
/*
|
||||
* Find the first occurrence of find in s, where the search is limited to the
|
||||
* first slen characters of s.
|
||||
/**
|
||||
* Search the first occurrence of substring -find- in -s-
|
||||
* The search is limited to the first -slen- characters of the string
|
||||
*
|
||||
* @par s = string to parse
|
||||
* @par find = string to match with -s-
|
||||
* @par slen = max length to match between -s- and -find-
|
||||
* @return a pointer to the beginning of the located substring;
|
||||
* NULL if the substring is not found
|
||||
*
|
||||
*/
|
||||
char* ndpi_strnstr(const char *s, const char *find, size_t slen);
|
||||
|
||||
/**
|
||||
* This function returns the nDPI protocol id for IP-based protocol detection
|
||||
* Same as ndpi_strnstr but case insensitive
|
||||
*
|
||||
* @par s = string to parse
|
||||
* @par find = string to match with -s-
|
||||
* @par slen = max length to match between -s- and -find-
|
||||
* @return a pointer to the beginning of the located substring;
|
||||
* NULL if the substring is not found
|
||||
*
|
||||
*/
|
||||
u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_struct, struct in_addr *pin);
|
||||
char* ndpi_strncasestr(const char *s, const char *find, size_t slen);
|
||||
|
||||
/**
|
||||
* Same as ndpi_network_ptree_match
|
||||
* Returns the nDPI protocol id for IP-based protocol detection
|
||||
*
|
||||
* @par ndpi_struct = the struct created for the protocol detection
|
||||
* @par pin = IP host address (MUST BE in network byte order):
|
||||
* See man(7) ip for details
|
||||
* @return the nDPI protocol ID
|
||||
*
|
||||
*/
|
||||
u_int16_t ndpi_host_ptree_match(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t host);
|
||||
u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct in_addr *pin);
|
||||
|
||||
/**
|
||||
* This function returns a new initialized detection module.
|
||||
* @param ticks_per_second the timestamp resolution per second (like 1000 for millisecond resolution)
|
||||
* @param ndpi_malloc function pointer to a memory allocator
|
||||
* @param ndpi_debug_printf a function pointer to a debug output function, use NULL in productive envionments
|
||||
* @return the initialized detection module
|
||||
* Init single protocol match
|
||||
*
|
||||
* @par ndpi_mod = the struct created for the protocol detection
|
||||
* @par match = the struct passed to match the protocol
|
||||
*
|
||||
*/
|
||||
struct ndpi_detection_module_struct *ndpi_init_detection_module(u_int32_t ticks_per_second,
|
||||
void* (*__ndpi_malloc)(unsigned long size),
|
||||
void (*__ndpi_free)(void *ptr),
|
||||
ndpi_debug_function_ptr ndpi_debug_printf);
|
||||
void ndpi_init_protocol_match(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol_match *match);
|
||||
|
||||
|
||||
/**
|
||||
* This function frees the memory allocated in the specified flow
|
||||
* @param flow to free
|
||||
* Returns a new initialized detection module
|
||||
*
|
||||
* @return the initialized detection module
|
||||
*
|
||||
*/
|
||||
struct ndpi_detection_module_struct *ndpi_init_detection_module(void);
|
||||
|
||||
/**
|
||||
* Frees the memory allocated in the specified flow
|
||||
*
|
||||
* @par flow = the flow to deallocate
|
||||
*
|
||||
*/
|
||||
void ndpi_free_flow(struct ndpi_flow_struct *flow);
|
||||
|
||||
/**
|
||||
* This function enables cache support in nDPI used for some protocol such as Skype
|
||||
* @param cache host name
|
||||
* @param cache port
|
||||
* Enables cache support.
|
||||
* In nDPI is used for some protocol (i.e. Skype)
|
||||
*
|
||||
* @par ndpi_mod = the struct created for the protocol detection
|
||||
* @par host = string for the host name
|
||||
* @par port = unsigned int for the port number
|
||||
*
|
||||
*/
|
||||
void ndpi_enable_cache(struct ndpi_detection_module_struct *ndpi_mod, char* host, u_int port);
|
||||
void ndpi_enable_cache(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
char* host, u_int port);
|
||||
|
||||
/**
|
||||
* This function destroys the detection module
|
||||
* @param ndpi_struct the to clearing detection module
|
||||
* @param ndpi_free function pointer to a memory free function
|
||||
* Destroys the detection module
|
||||
*
|
||||
* @par ndpi_struct = the struct to clearing for the detection module
|
||||
*
|
||||
*/
|
||||
void
|
||||
ndpi_exit_detection_module(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, void (*ndpi_free) (void *ptr));
|
||||
void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct);
|
||||
|
||||
/**
|
||||
* This function sets the protocol bitmask2
|
||||
* @param ndpi_struct the detection module
|
||||
* @param detection_bitmask the protocol bitmask
|
||||
* Sets a single protocol bitmask
|
||||
* This function does not increment the index of the callback_buffer
|
||||
*
|
||||
* @par label = string for the protocol name
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par detection_bitmask = the protocol bitmask
|
||||
* @par idx = the index of the callback_buffer
|
||||
* @par func = function pointer of the protocol search
|
||||
* @par ndpi_selection_bitmask = the protocol selected bitmask
|
||||
* @par b_save_bitmask_unknow = if set as "true" save the detection bitmask as unknow
|
||||
* @par b_add_detection_bitmask = if set as "true" add the protocol bitmask to the detection bitmask
|
||||
*
|
||||
*/
|
||||
void
|
||||
ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const NDPI_PROTOCOL_BITMASK * detection_bitmask);
|
||||
void ndpi_set_bitmask_protocol_detection(char *label,
|
||||
struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const NDPI_PROTOCOL_BITMASK *detection_bitmask,
|
||||
const u_int32_t idx,
|
||||
u_int16_t ndpi_protocol_id,
|
||||
void (*func) (struct ndpi_detection_module_struct *,
|
||||
struct ndpi_flow_struct *flow),
|
||||
const NDPI_SELECTION_BITMASK_PROTOCOL_SIZE ndpi_selection_bitmask,
|
||||
u_int8_t b_save_bitmask_unknow,
|
||||
u_int8_t b_add_detection_bitmask);
|
||||
|
||||
/**
|
||||
* Sets the protocol bitmask2
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par detection_bitmask = the protocol bitmask to set
|
||||
*
|
||||
*/
|
||||
void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const NDPI_PROTOCOL_BITMASK * detection_bitmask);
|
||||
|
||||
/**
|
||||
* Function to be called before we give up with detection for a given flow.
|
||||
* This function reduces the NDPI_UNKNOWN_PROTOCOL detection
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the flow given for the detection module
|
||||
* @return the detected protocol even if the flow is not completed;
|
||||
*
|
||||
*/
|
||||
ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
/**
|
||||
* Processes an extra packet in order to get more information for a given protocol
|
||||
* (like SSL getting both client and server certificate even if we already know after
|
||||
* seeing the client certificate what the protocol is)
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = pointer to the connection state machine
|
||||
* @par packet = unsigned char pointer to the Layer 3 (IP header)
|
||||
* @par packetlen = the length of the packet
|
||||
* @par current_tick = the current timestamp for the packet
|
||||
* @par src = pointer to the source subscriber state machine
|
||||
* @par dst = pointer to the destination subscriber state machine
|
||||
* @return void
|
||||
*
|
||||
*/
|
||||
void ndpi_process_extra_packet(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
const unsigned char *packet,
|
||||
const unsigned short packetlen,
|
||||
const u_int64_t current_tick,
|
||||
struct ndpi_id_struct *src,
|
||||
struct ndpi_id_struct *dst);
|
||||
|
||||
/**
|
||||
* This function will processes one packet and returns the ID of the detected protocol.
|
||||
* This is the main packet processing function.
|
||||
* Processes one packet and returns the ID of the detected protocol.
|
||||
* This is the MAIN PACKET PROCESSING FUNCTION.
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = pointer to the connection state machine
|
||||
* @par packet = unsigned char pointer to the Layer 3 (IP header)
|
||||
* @par packetlen = the length of the packet
|
||||
* @par current_tick = the current timestamp for the packet
|
||||
* @par src = pointer to the source subscriber state machine
|
||||
* @par dst = pointer to the destination subscriber state machine
|
||||
* @return the detected ID of the protocol
|
||||
*
|
||||
* @param ndpi_struct the detection module
|
||||
* @param flow void pointer to the connection state machine
|
||||
* @param packet the packet as unsigned char pointer with the length of packetlen. the pointer must point to the Layer 3 (IP header)
|
||||
* @param packetlen the length of the packet
|
||||
* @param current_tick the current timestamp for the packet
|
||||
* @param src void pointer to the source subscriber state machine
|
||||
* @param dst void pointer to the destination subscriber state machine
|
||||
* @return returns the detected ID of the protocol
|
||||
*/
|
||||
ndpi_protocol ndpi_detection_process_packet(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
@@ -130,118 +263,501 @@ extern "C" {
|
||||
const u_int64_t current_tick,
|
||||
struct ndpi_id_struct *src,
|
||||
struct ndpi_id_struct *dst);
|
||||
|
||||
/**
|
||||
* Get the main protocol of the passed flows for the detected module
|
||||
*
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the flow given for the detection module
|
||||
* @return the ID of the master protocol detected
|
||||
*
|
||||
*/
|
||||
u_int16_t ndpi_get_flow_masterprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
#define NDPI_DETECTION_ONLY_IPV4 ( 1 << 0 )
|
||||
#define NDPI_DETECTION_ONLY_IPV6 ( 1 << 1 )
|
||||
|
||||
/**
|
||||
* API call that is called internally by ndpi_detection_process_packet or by apps
|
||||
* that want to avoid calling ndpi_detection_process_packet as they have already
|
||||
* parsed the packet and thus want to avoid this.
|
||||
*
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the flow given for the detection module
|
||||
* @par ndpi_selection_bitmask = the protocol selected bitmask
|
||||
*
|
||||
*/
|
||||
void ndpi_check_flow_func(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_SIZE *ndpi_selection_packet);
|
||||
|
||||
/**
|
||||
* query the pointer to the layer 4 packet
|
||||
* Query the pointer to the layer 4 packet
|
||||
*
|
||||
* @param l3 pointer to the layer 3 data
|
||||
* @param l3_len length of the layer 3 data
|
||||
* @param l4_return filled with the pointer the layer 4 data if return value == 0, undefined otherwise
|
||||
* @param l4_len_return filled with the length of the layer 4 data if return value == 0, undefined otherwise
|
||||
* @param l4_protocol_return filled with the protocol of the layer 4 data if return value == 0, undefined otherwise
|
||||
* @param flags limit operation on ipv4 or ipv6 packets, possible values are NDPI_DETECTION_ONLY_IPV4 or NDPI_DETECTION_ONLY_IPV6; 0 means any
|
||||
* @return 0 if correct layer 4 data could be found, != 0 otherwise
|
||||
*/
|
||||
u_int8_t ndpi_detection_get_l4(const u_int8_t * l3, u_int16_t l3_len, const u_int8_t ** l4_return, u_int16_t * l4_len_return,
|
||||
u_int8_t * l4_protocol_return, u_int32_t flags);
|
||||
/**
|
||||
* returns the real protocol for the flow of the last packet given to the detection.
|
||||
* if no real protocol could be found, the unknown protocol will be returned.
|
||||
* @par l3 = pointer to the layer 3 data
|
||||
* @par l3_len = length of the layer 3 data
|
||||
* @par l4_return = address to the pointer of the layer 4 data if return value == 0, else undefined
|
||||
* @par l4_len_return = length of the layer 4 data if return value == 0, else undefined
|
||||
* @par l4_protocol_return = protocol of the layer 4 data if return value == 0, undefined otherwise
|
||||
* @par flags = limit operation on ipv4 or ipv6 packets. Possible values: NDPI_DETECTION_ONLY_IPV4 - NDPI_DETECTION_ONLY_IPV6 - 0 (any)
|
||||
* @return 0 if layer 4 data could be found correctly;
|
||||
else != 0
|
||||
*
|
||||
* @param ndpi_struct the detection module
|
||||
* @return the protocol id of the last real protocol found in the protocol history of the flow
|
||||
*/
|
||||
/* u_int16_t ndpi_detection_get_real_protocol_of_flow(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow); */
|
||||
u_int8_t ndpi_detection_get_l4(const u_int8_t *l3, u_int16_t l3_len, const u_int8_t **l4_return, u_int16_t *l4_len_return,
|
||||
u_int8_t *l4_protocol_return, u_int32_t flags);
|
||||
|
||||
/**
|
||||
* returns true if the protocol history of the flow of the last packet given to the detection
|
||||
* contains the given protocol.
|
||||
* Search and return the protocol based on matched ports
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par shost = source address in host byte order
|
||||
* @par sport = source port number
|
||||
* @par dhost = destination address in host byte order
|
||||
* @par dport = destination port number
|
||||
* @return the struct ndpi_protocol that match the port base protocol
|
||||
*
|
||||
*/
|
||||
ndpi_protocol ndpi_find_port_based_protocol(struct ndpi_detection_module_struct *ndpi_struct/* , u_int8_t proto */,
|
||||
u_int32_t shost,
|
||||
u_int16_t sport,
|
||||
u_int32_t dhost,
|
||||
u_int16_t dport);
|
||||
/**
|
||||
* Search and return the protocol guessed that is undetected
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par proto = the l4 protocol number
|
||||
* @par shost = source address in host byte order
|
||||
* @par sport = source port number
|
||||
* @par dhost = destination address in host byte order
|
||||
* @par dport = destination port number
|
||||
* @return the struct ndpi_protocol that match the port base protocol
|
||||
*
|
||||
* @param ndpi_struct the detection module
|
||||
* @return 1 if protocol has been found, 0 otherwise
|
||||
*/
|
||||
u_int8_t ndpi_detection_flow_protocol_history_contains_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t protocol_id);
|
||||
ndpi_protocol ndpi_find_port_based_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int8_t proto, u_int32_t shost, u_int16_t sport, u_int32_t dhost, u_int16_t dport);
|
||||
ndpi_protocol ndpi_guess_undetected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int8_t proto, u_int32_t shost, u_int16_t sport, u_int32_t dhost, u_int16_t dport);
|
||||
u_int8_t proto,
|
||||
u_int32_t shost,
|
||||
u_int16_t sport,
|
||||
u_int32_t dhost,
|
||||
u_int16_t dport);
|
||||
/**
|
||||
* Check if the string passed match with a protocol
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par string_to_match = the string to match
|
||||
* @par string_to_match_len = the length of the string
|
||||
* @par ret_match = completed returned match information
|
||||
* @par is_host_match = value of the second field of struct ndpi_automa
|
||||
* @return the ID of the matched subprotocol
|
||||
*
|
||||
*/
|
||||
int ndpi_match_string_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
char *string_to_match,
|
||||
u_int string_to_match_len,
|
||||
ndpi_protocol_match_result *ret_match,
|
||||
u_int8_t is_host_match);
|
||||
/**
|
||||
* Check if the host passed match with a protocol
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the flow where match the host
|
||||
* @par string_to_match = the string to match
|
||||
* @par string_to_match_len = the length of the string
|
||||
* @par ret_match = completed returned match information
|
||||
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
||||
* @return the ID of the matched subprotocol
|
||||
*
|
||||
*/
|
||||
int ndpi_match_host_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow, char *string_to_match, u_int string_to_match_len,
|
||||
struct ndpi_flow_struct *flow,
|
||||
char *string_to_match,
|
||||
u_int string_to_match_len,
|
||||
ndpi_protocol_match_result *ret_match,
|
||||
u_int16_t master_protocol_id);
|
||||
|
||||
|
||||
/**
|
||||
* Check if the string content passed match with a protocol
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the flow where match the host
|
||||
* @par string_to_match = the string to match
|
||||
* @par string_to_match_len = the length of the string
|
||||
* @par ret_match = completed returned match information
|
||||
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
||||
* @return the ID of the matched subprotocol
|
||||
*
|
||||
*/
|
||||
int ndpi_match_content_subprotocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
char *string_to_match, u_int string_to_match_len,
|
||||
char *string_to_match,
|
||||
u_int string_to_match_len,
|
||||
ndpi_protocol_match_result *ret_match,
|
||||
u_int16_t master_protocol_id);
|
||||
int ndpi_match_bigram(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ndpi_automa *automa, char *bigram_to_match);
|
||||
char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol proto, char *buf, u_int buf_len);
|
||||
char* ndpi_get_proto_name(struct ndpi_detection_module_struct *mod, u_int16_t proto_id);
|
||||
ndpi_protocol_breed_t ndpi_get_proto_breed(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t proto);
|
||||
char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *ndpi_struct, ndpi_protocol_breed_t breed_id);
|
||||
int ndpi_get_protocol_id(struct ndpi_detection_module_struct *ndpi_mod, char *proto);
|
||||
void ndpi_dump_protocols(struct ndpi_detection_module_struct *mod);
|
||||
int matchStringProtocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
|
||||
char *string_to_match, u_int string_to_match_len);
|
||||
|
||||
int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod, char* path);
|
||||
u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||
char* ndpi_revision(void);
|
||||
void ndpi_set_automa(struct ndpi_detection_module_struct *ndpi_struct, void* automa);
|
||||
|
||||
#define ADD_TO_DETECTION_BITMASK 1
|
||||
#define NO_ADD_TO_DETECTION_BITMASK 0
|
||||
#define SAVE_DETECTION_BITMASK_AS_UNKNOWN 1
|
||||
#define NO_SAVE_DETECTION_BITMASK_AS_UNKNOWN 0
|
||||
/**
|
||||
* Exclude protocol from search
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the flow where match the host
|
||||
* @par master_protocol_id = value of the ID associated to the master protocol detected
|
||||
*
|
||||
*/
|
||||
void ndpi_exclude_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t master_protocol_id,
|
||||
const char *_file, const char *_func,int _line);
|
||||
/**
|
||||
* Check if the string -bigram_to_match- match with a bigram of -automa-
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par automa = the struct ndpi_automa for the bigram
|
||||
* @par bigram_to_match = the bigram string to match
|
||||
* @return 0
|
||||
*
|
||||
*/
|
||||
int ndpi_match_bigram(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_automa *automa,
|
||||
char *bigram_to_match);
|
||||
|
||||
/**
|
||||
* This function sets a single protocol bitmask
|
||||
* @param label Protocol name
|
||||
* @param ndpi_struct the detection module
|
||||
* @param detection_bitmask the protocol bitmask
|
||||
* @param idx the index of the callback_buffer
|
||||
* @param func void function point of the protocol search
|
||||
* @param ndpi_selection_bitmask the protocol selected bitmask
|
||||
* @param b_save_bitmask_unknow set true if you want save the detection bitmask as unknow
|
||||
* @param b_add_detection_bitmask set true if you want add the protocol bitmask to the detection bitmask
|
||||
* NB: this function does not increment the index of the callback_buffer
|
||||
* Write the protocol name in the buffer -buf- as master_protocol.protocol
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par proto = the struct ndpi_protocol contain the protocols name
|
||||
* @par buf = the buffer to write the name of the protocols
|
||||
* @par buf_len = the length of the buffer
|
||||
* @return the buffer contains the master_protocol and protocol name
|
||||
*
|
||||
*/
|
||||
void ndpi_set_bitmask_protocol_detection(char * label, struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const NDPI_PROTOCOL_BITMASK * detection_bitmask,
|
||||
const u_int32_t idx,
|
||||
u_int16_t ndpi_protocol_id,
|
||||
void (*func) (struct ndpi_detection_module_struct *, struct ndpi_flow_struct *flow),
|
||||
const NDPI_SELECTION_BITMASK_PROTOCOL_SIZE ndpi_selection_bitmask,
|
||||
u_int8_t b_save_bitmask_unknow,
|
||||
u_int8_t b_add_detection_bitmask);
|
||||
char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol proto, char *buf, u_int buf_len);
|
||||
|
||||
#ifdef NDPI_PROTOCOL_HTTP
|
||||
/*
|
||||
API used to retrieve information for HTTP flows
|
||||
/**
|
||||
* Find out if a given category is custom/user-defined
|
||||
*
|
||||
* @par category = the category associated to the protocol
|
||||
* @return 1 if this is a custom user category, 0 otherwise
|
||||
*
|
||||
*/
|
||||
int ndpi_is_custom_category(ndpi_protocol_category_t category);
|
||||
|
||||
/**
|
||||
* Overwrite a protocol category defined by nDPI with the custom category
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par protoId = the protocol identifier to overwrite
|
||||
* @par breed = the breed to be associated to the protocol
|
||||
*
|
||||
*/
|
||||
void ndpi_set_proto_breed(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
u_int16_t protoId, ndpi_protocol_breed_t breed);
|
||||
|
||||
/**
|
||||
* Overwrite a protocol category defined by nDPI with the custom category
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par protoId = the protocol identifier to overwrite
|
||||
* @par category = the category associated to the protocol
|
||||
*
|
||||
*/
|
||||
void ndpi_set_proto_category(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
u_int16_t protoId, ndpi_protocol_category_t protoCategory);
|
||||
|
||||
/**
|
||||
* Check if subprotocols of the specified master protocol are just
|
||||
* informative (and not real)
|
||||
*
|
||||
* @par mod = the detection module
|
||||
* @par protoId = the (master) protocol identifier to query
|
||||
* @return 1 = the subprotocol is informative, 0 otherwise.
|
||||
*
|
||||
*/
|
||||
u_int8_t ndpi_is_subprotocol_informative(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
u_int16_t protoId);
|
||||
|
||||
/**
|
||||
* Get protocol category as string
|
||||
*
|
||||
* @par mod = the detection module
|
||||
* @par category = the category associated to the protocol
|
||||
* @return the string name of the category
|
||||
*
|
||||
*/
|
||||
const char* ndpi_category_get_name(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol_category_t category);
|
||||
|
||||
/**
|
||||
* Set protocol category string
|
||||
*
|
||||
* @par mod = the detection module
|
||||
* @par category = the category associated to the protocol
|
||||
* @paw name = the string name of the category
|
||||
*
|
||||
*/
|
||||
void ndpi_category_set_name(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol_category_t category, char *name);
|
||||
|
||||
/**
|
||||
* Get protocol category
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par proto = the struct ndpi_protocol contain the protocols name
|
||||
* @return the protocol category
|
||||
*/
|
||||
ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol proto);
|
||||
|
||||
/**
|
||||
* Get the protocol name associated to the ID
|
||||
*
|
||||
* @par mod = the detection module
|
||||
* @par proto_id = the ID of the protocol
|
||||
* @return the buffer contains the master_protocol and protocol name
|
||||
*
|
||||
*/
|
||||
char* ndpi_get_proto_name(struct ndpi_detection_module_struct *mod, u_int16_t proto_id);
|
||||
|
||||
|
||||
/**
|
||||
* Return the protocol breed ID associated to the protocol
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par proto = the ID of the protocol
|
||||
* @return the breed ID associated to the protocol
|
||||
*
|
||||
*/
|
||||
ndpi_protocol_breed_t ndpi_get_proto_breed(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int16_t proto);
|
||||
|
||||
/**
|
||||
* Return the string name of the protocol breed
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par breed_id = the breed ID associated to the protocol
|
||||
* @return the string name of the breed ID
|
||||
*
|
||||
*/
|
||||
char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ndpi_protocol_breed_t breed_id);
|
||||
|
||||
/**
|
||||
* Return the ID of the protocol
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par proto = the protocol name
|
||||
* @return the ID of the protocol
|
||||
*
|
||||
*/
|
||||
int ndpi_get_protocol_id(struct ndpi_detection_module_struct *ndpi_mod, char *proto);
|
||||
|
||||
/**
|
||||
* Return the ID of the category
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par proto = the category name
|
||||
* @return the ID of the category
|
||||
*
|
||||
*/
|
||||
int ndpi_get_category_id(struct ndpi_detection_module_struct *ndpi_mod, char *cat);
|
||||
|
||||
/**
|
||||
* Write the list of the supported protocols
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
*/
|
||||
void ndpi_dump_protocols(struct ndpi_detection_module_struct *mod);
|
||||
|
||||
/**
|
||||
* Read a file and load the protocols
|
||||
*
|
||||
* Format: <tcp|udp>:<port>,<tcp|udp>:<port>,.....@<proto>
|
||||
*
|
||||
* Example:
|
||||
* tcp:80,tcp:3128@HTTP
|
||||
* udp:139@NETBIOS
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par path = the path of the file
|
||||
* @return 0 if the file is loaded correctly;
|
||||
* -1 else
|
||||
*
|
||||
*/
|
||||
int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
char* path);
|
||||
|
||||
/**
|
||||
* Get the total number of the supported protocols
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @return the number of protocols
|
||||
*
|
||||
*/
|
||||
u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||
|
||||
/**
|
||||
* Get the nDPI version release
|
||||
*
|
||||
* @return the NDPI_GIT_RELEASE
|
||||
*
|
||||
*/
|
||||
char* ndpi_revision(void);
|
||||
|
||||
/**
|
||||
* Set the automa for the protocol search
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par automa = the automa to match
|
||||
*
|
||||
*/
|
||||
void ndpi_set_automa(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
void* automa);
|
||||
|
||||
/* NDPI_PROTOCOL_HTTP */
|
||||
/**
|
||||
* Retrieve information for HTTP flows
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par flow = the detected flow
|
||||
* @return the HTTP method information about the flow
|
||||
*
|
||||
*/
|
||||
ndpi_http_method ndpi_get_http_method(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_http_method ndpi_get_http_method(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
char* ndpi_get_http_url(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
char* ndpi_get_http_content_type(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
struct ndpi_flow_struct *flow);
|
||||
#endif
|
||||
|
||||
#ifdef NDPI_PROTOCOL_TOR
|
||||
/**
|
||||
* Get the HTTP url
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par flow = the detected flow
|
||||
* @return the HTTP method information about the flow
|
||||
*
|
||||
*/
|
||||
char* ndpi_get_http_url(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
/**
|
||||
* Get the HTTP content-type
|
||||
*
|
||||
* @par ndpi_mod = the detection module
|
||||
* @par flow = the detected flow
|
||||
* @return the HTTP method information about the flow
|
||||
*
|
||||
*/
|
||||
char* ndpi_get_http_content_type(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
/* NDPI_PROTOCOL_TOR */
|
||||
/**
|
||||
* Check if the flow could be detected as TOR protocol
|
||||
*
|
||||
* @par ndpi_struct = the detection module
|
||||
* @par flow = the detected flow
|
||||
* @par certificate = the ssl certificate
|
||||
* @return 1 if the flow is TOR;
|
||||
* 0 else
|
||||
*
|
||||
*/
|
||||
int ndpi_is_ssl_tor(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow, char *certificate);
|
||||
#endif
|
||||
|
||||
/* Wrappers functions */
|
||||
/**
|
||||
* Init Aho-Corasick automata
|
||||
*
|
||||
* @return The requested automata, or NULL if an error occurred
|
||||
*
|
||||
*/
|
||||
void* ndpi_init_automa(void);
|
||||
|
||||
/**
|
||||
* Free Aho-Corasick automata allocated with ndpi_init_automa();
|
||||
*
|
||||
* @par The automata initialized with ndpi_init_automa();
|
||||
*
|
||||
*/
|
||||
void ndpi_free_automa(void *_automa);
|
||||
|
||||
/**
|
||||
* Add a string to match to an automata
|
||||
*
|
||||
* @par The automata initialized with ndpi_init_automa();
|
||||
* @par The (sub)string to search
|
||||
* @par The number associated with this string
|
||||
* @return 0 in case of no error, or -1 if an error occurred.
|
||||
*
|
||||
*/
|
||||
int ndpi_add_string_value_to_automa(void *_automa, char *str, unsigned long num);
|
||||
|
||||
/**
|
||||
* Add a string to match to an automata. Same as ndpi_add_string_value_to_automa() with num set to 1
|
||||
*
|
||||
* @par The automata initialized with ndpi_init_automa();
|
||||
* @par The (sub)string to search
|
||||
* @return 0 in case of no error, or -1 if an error occurred.
|
||||
*
|
||||
*/
|
||||
int ndpi_add_string_to_automa(void *_automa, char *str);
|
||||
|
||||
/**
|
||||
* Finalize the automa (necessary before start searching)
|
||||
*
|
||||
* @par The automata initialized with ndpi_init_automa();
|
||||
*
|
||||
*/
|
||||
void ndpi_finalize_automa(void *_automa);
|
||||
|
||||
/**
|
||||
* Add a string to match to an automata
|
||||
*
|
||||
* @par The automata initialized with ndpi_init_automa();
|
||||
* @par The (sub)string to search
|
||||
* @return 0 in case of match, or -1 if no match, or -2 if an error occurred.
|
||||
*
|
||||
*/
|
||||
int ndpi_match_string(void *_automa, char *string_to_match);
|
||||
|
||||
void ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
char *ip_address_and_mask, ndpi_protocol_category_t category);
|
||||
int ndpi_load_hostname_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
char *name, ndpi_protocol_category_t category);
|
||||
int ndpi_enable_loaded_categories(struct ndpi_detection_module_struct *ndpi_struct);
|
||||
void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
ndpi_protocol *ret);
|
||||
int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_detection_preference pref,
|
||||
int value);
|
||||
|
||||
ndpi_proto_defaults_t* ndpi_get_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod);
|
||||
u_int ndpi_get_ndpi_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||
u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod);
|
||||
u_int ndpi_get_ndpi_detection_module_size();
|
||||
void ndpi_set_log_level(struct ndpi_detection_module_struct *ndpi_mod, u_int l);
|
||||
|
||||
/**
|
||||
* Add a string to match to an automata
|
||||
*
|
||||
* @par The automata initialized with ndpi_init_automa();
|
||||
* @par The (sub)string to search
|
||||
* @par The id associated with the matched string or 0 id not found.
|
||||
* @return 0 in case of match, or -1 if no match, or -2 if an error occurred.
|
||||
*
|
||||
*/
|
||||
int ndpi_match_string_id(void *_automa, char *string_to_match, unsigned long *id);
|
||||
|
||||
/* Utility functions to set ndpi malloc/free/print wrappers */
|
||||
void set_ndpi_malloc(void* (*__ndpi_malloc)(size_t size));
|
||||
void set_ndpi_free(void (*__ndpi_free)(void *ptr));
|
||||
void set_ndpi_flow_malloc(void* (*__ndpi_flow_malloc)(size_t size));
|
||||
void set_ndpi_flow_free(void (*__ndpi_flow_free)(void *ptr));
|
||||
void set_ndpi_debug_function(struct ndpi_detection_module_struct *ndpi_str,
|
||||
ndpi_debug_function_ptr ndpi_debug_printf);
|
||||
void * ndpi_malloc(size_t size);
|
||||
void * ndpi_calloc(unsigned long count, size_t size);
|
||||
void ndpi_free(void *ptr);
|
||||
u_int8_t ndpi_get_api_version();
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __NDPI_API_H__ */
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-17 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -42,15 +41,22 @@
|
||||
#endif/* BYTE_ORDER */
|
||||
#endif/* __OPENBSD__ */
|
||||
|
||||
#if 0
|
||||
#ifndef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
#define NDPI_ENABLE_DEBUG_MESSAGES
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
#define __LITTLE_ENDIAN__
|
||||
#endif
|
||||
#else
|
||||
#ifndef __BIG_ENDIAN__
|
||||
#define __BIG_ENDIAN__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#ifndef __LITTLE_ENDIAN__
|
||||
#define __LITTLE_ENDIAN__ 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(defined(__LITTLE_ENDIAN__) || defined(__BIG_ENDIAN__))
|
||||
#if defined(__mips__)
|
||||
@@ -59,13 +65,6 @@
|
||||
#define __BIG_ENDIAN__
|
||||
#endif
|
||||
|
||||
/* Kernel modules */
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
#define __LITTLE_ENDIAN__
|
||||
#endif
|
||||
#if defined(__BIG_ENDIAN)
|
||||
#define __BIG_ENDIAN__
|
||||
#endif
|
||||
/* Everything else */
|
||||
#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__))
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
@@ -77,7 +76,7 @@
|
||||
|
||||
#endif
|
||||
|
||||
#define NDPI_USE_ASYMMETRIC_DETECTION 0
|
||||
#define NDPI_USE_ASYMMETRIC_DETECTION 0
|
||||
#define NDPI_SELECTION_BITMASK_PROTOCOL_SIZE u_int32_t
|
||||
|
||||
#define NDPI_SELECTION_BITMASK_PROTOCOL_IP (1<<0)
|
||||
@@ -160,53 +159,88 @@
|
||||
/* TODO: rebuild all memory areas to have a more aligned memory block here */
|
||||
|
||||
/* DEFINITION OF MAX LINE NUMBERS FOR line parse algorithm */
|
||||
#define NDPI_MAX_PARSE_LINES_PER_PACKET 64
|
||||
#define NDPI_MAX_PARSE_LINES_PER_PACKET 64
|
||||
|
||||
#define MAX_PACKET_COUNTER 65000
|
||||
#define MAX_DEFAULT_PORTS 5
|
||||
|
||||
/**********************
|
||||
* detection features *
|
||||
**********************/
|
||||
/* #define NDPI_SELECT_DETECTION_WITH_REAL_PROTOCOL ( 1 << 0 ) */
|
||||
|
||||
#define NDPI_DIRECTCONNECT_CONNECTION_IP_TICK_TIMEOUT 600
|
||||
#define NDPI_IRC_CONNECTION_TIMEOUT 120
|
||||
#define NDPI_GNUTELLA_CONNECTION_TIMEOUT 60
|
||||
#define NDPI_BATTLEFIELD_CONNECTION_TIMEOUT 60
|
||||
#define NDPI_THUNDER_CONNECTION_TIMEOUT 30
|
||||
#define NDPI_RTSP_CONNECTION_TIMEOUT 5
|
||||
#define NDPI_TVANTS_CONNECTION_TIMEOUT 5
|
||||
#define NDPI_YAHOO_DETECT_HTTP_CONNECTIONS 1
|
||||
#define NDPI_YAHOO_LAN_VIDEO_TIMEOUT 30
|
||||
#define NDPI_GNUTELLA_CONNECTION_TIMEOUT 60
|
||||
#define NDPI_BATTLEFIELD_CONNECTION_TIMEOUT 60
|
||||
#define NDPI_THUNDER_CONNECTION_TIMEOUT 30
|
||||
#define NDPI_RTSP_CONNECTION_TIMEOUT 5
|
||||
#define NDPI_TVANTS_CONNECTION_TIMEOUT 5
|
||||
#define NDPI_YAHOO_DETECT_HTTP_CONNECTIONS 1
|
||||
#define NDPI_YAHOO_LAN_VIDEO_TIMEOUT 30
|
||||
#define NDPI_ZATTOO_CONNECTION_TIMEOUT 120
|
||||
#define NDPI_ZATTOO_FLASH_TIMEOUT 5
|
||||
#define NDPI_JABBER_STUN_TIMEOUT 30
|
||||
#define NDPI_JABBER_FT_TIMEOUT 5
|
||||
#define NDPI_ZATTOO_FLASH_TIMEOUT 5
|
||||
#define NDPI_JABBER_STUN_TIMEOUT 30
|
||||
#define NDPI_JABBER_FT_TIMEOUT 5
|
||||
#define NDPI_SOULSEEK_CONNECTION_IP_TICK_TIMEOUT 600
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
|
||||
#define NDPI_LOG(proto, mod, log_level, args...) \
|
||||
{ \
|
||||
if(mod != NULL) { \
|
||||
mod->ndpi_debug_print_file=__FILE__; \
|
||||
mod->ndpi_debug_print_function=__FUNCTION__; \
|
||||
mod->ndpi_debug_print_line=__LINE__; \
|
||||
mod->ndpi_debug_printf(proto, mod, log_level, args); \
|
||||
} \
|
||||
#define NDPI_LOG(proto, m, log_level, args...) \
|
||||
{ \
|
||||
struct ndpi_detection_module_struct *mod = (struct ndpi_detection_module_struct*) m; \
|
||||
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||
(*(mod->ndpi_debug_printf))(proto, mod, log_level, __FILE__, __FUNCTION__, __LINE__, args); \
|
||||
}
|
||||
|
||||
#else /* NDPI_ENABLE_DEBUG_MESSAGES */
|
||||
/* We must define NDPI_CURRENT_PROTO before include ndpi_main.h !!!
|
||||
*
|
||||
* #include "ndpi_protocol_ids.h"
|
||||
* #define NDPI_CURRENT_PROTO NDPI_PROTOCOL_XXXX
|
||||
* #include "ndpi_api.h"
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(WIN32)
|
||||
#define NDPI_LOG(...) {}
|
||||
#else
|
||||
#define NDPI_LOG(proto, mod, log_level, args...) {}
|
||||
#endif
|
||||
#ifndef NDPI_CURRENT_PROTO
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTO_UNKNOWN
|
||||
#endif
|
||||
|
||||
#define NDPI_LOG_ERR(mod, args...) \
|
||||
if(mod && mod->ndpi_log_level >= NDPI_LOG_ERROR) { \
|
||||
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_ERROR , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||
}
|
||||
|
||||
#define NDPI_LOG_INFO(mod, args...) \
|
||||
if(mod && mod->ndpi_log_level >= NDPI_LOG_TRACE) { \
|
||||
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_TRACE , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||
}
|
||||
|
||||
#define NDPI_LOG_DBG(mod, args...) \
|
||||
if(mod && mod->ndpi_log_level >= NDPI_LOG_DEBUG) { \
|
||||
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_DEBUG , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||
}
|
||||
|
||||
#define NDPI_LOG_DBG2(mod, args...) \
|
||||
if(mod && mod->ndpi_log_level >= NDPI_LOG_DEBUG_EXTRA) { \
|
||||
if(mod != NULL && mod->ndpi_debug_printf != NULL) \
|
||||
(*(mod->ndpi_debug_printf))(NDPI_CURRENT_PROTO, mod, NDPI_LOG_DEBUG_EXTRA , __FILE__, __FUNCTION__, __LINE__, args); \
|
||||
}
|
||||
|
||||
#else /* not defined NDPI_ENABLE_DEBUG_MESSAGES */
|
||||
# ifdef WIN32
|
||||
# define NDPI_LOG(...) {}
|
||||
# define NDPI_LOG_ERR(...) {}
|
||||
# define NDPI_LOG_INFO(...) {}
|
||||
# define NDPI_LOG_DBG(...) {}
|
||||
# define NDPI_LOG_DBG2(...) {}
|
||||
# else
|
||||
# define NDPI_LOG(proto, mod, log_level, args...) { /* printf(args); */ }
|
||||
# define NDPI_LOG_ERR(mod, args...) { printf(args); }
|
||||
# define NDPI_LOG_INFO(mod, args...) { /* printf(args); */ }
|
||||
# define NDPI_LOG_DBG(mod, args...) { /* printf(args); */ }
|
||||
# define NDPI_LOG_DBG2(mod, args...) { /* printf(args); */ }
|
||||
# endif
|
||||
#endif /* NDPI_ENABLE_DEBUG_MESSAGES */
|
||||
|
||||
#define NDPI_EXCLUDE_PROTO(mod,flow) ndpi_exclude_protocol(mod, flow, NDPI_CURRENT_PROTO, __FILE__, __FUNCTION__, __LINE__)
|
||||
|
||||
/**
|
||||
* macro for getting the string len of a static string
|
||||
*
|
||||
@@ -218,27 +252,22 @@
|
||||
#define NDPI_COMPARE_IPV6_ADDRESS_STRUCTS(x,y) \
|
||||
((((u_int64_t *)(x))[0]) < (((u_int64_t *)(y))[0]) || ( (((u_int64_t *)(x))[0]) == (((u_int64_t *)(y))[0]) && (((u_int64_t *)(x))[1]) < (((u_int64_t *)(y))[1])) )
|
||||
|
||||
#if !defined(__KERNEL__) && !defined(NDPI_IPTABLES_EXT)
|
||||
#define NDPI_NUM_BITS 256
|
||||
#else
|
||||
/* custom protocols not supported */
|
||||
#define NDPI_NUM_BITS 192
|
||||
#endif
|
||||
#define NDPI_NUM_BITS 512
|
||||
|
||||
#define NDPI_BITS /* 32 */ (sizeof(ndpi_ndpi_mask) * 8 /* number of bits in a byte */) /* bits per mask */
|
||||
#define howmanybits(x, y) (((x)+((y)-1))/(y))
|
||||
|
||||
|
||||
#define NDPI_SET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] |= (1 << (((u_int32_t)n) % NDPI_BITS)))
|
||||
#define NDPI_CLR(p, n) ((p)->fds_bits[(n)/NDPI_BITS] &= ~(1 << (((u_int32_t)n) % NDPI_BITS)))
|
||||
#define NDPI_ISSET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] & (1 << (((u_int32_t)n) % NDPI_BITS)))
|
||||
#define NDPI_SET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] |= (1ul << (((u_int32_t)n) % NDPI_BITS)))
|
||||
#define NDPI_CLR(p, n) ((p)->fds_bits[(n)/NDPI_BITS] &= ~(1ul << (((u_int32_t)n) % NDPI_BITS)))
|
||||
#define NDPI_ISSET(p, n) ((p)->fds_bits[(n)/NDPI_BITS] & (1ul << (((u_int32_t)n) % NDPI_BITS)))
|
||||
#define NDPI_ZERO(p) memset((char *)(p), 0, sizeof(*(p)))
|
||||
#define NDPI_ONE(p) memset((char *)(p), 0xFF, sizeof(*(p)))
|
||||
|
||||
#define NDPI_NUM_FDS_BITS howmanybits(NDPI_NUM_BITS, NDPI_BITS)
|
||||
|
||||
#define NDPI_PROTOCOL_BITMASK ndpi_protocol_bitmask_struct_t
|
||||
|
||||
|
||||
#define NDPI_BITMASK_ADD(a,b) NDPI_SET(&a,b)
|
||||
#define NDPI_BITMASK_DEL(a,b) NDPI_CLR(&a,b)
|
||||
#define NDPI_BITMASK_RESET(a) NDPI_ZERO(&a)
|
||||
@@ -246,7 +275,7 @@
|
||||
#define NDPI_BITMASK_SET(a, b) { memcpy(&a, &b, sizeof(NDPI_PROTOCOL_BITMASK)); }
|
||||
|
||||
/* this is a very very tricky macro *g*,
|
||||
* the compiler will remove all shifts here if the protocol is static...
|
||||
* the compiler will remove all shifts here if the protocol is static...
|
||||
*/
|
||||
#define NDPI_ADD_PROTOCOL_TO_BITMASK(bmask,value) NDPI_SET(&bmask,value)
|
||||
#define NDPI_DEL_PROTOCOL_FROM_BITMASK(bmask,value) NDPI_CLR(&bmask,value)
|
||||
@@ -289,21 +318,23 @@
|
||||
#define get_l32(X,O) get_u_int32_t(X,O)
|
||||
#elif defined(__BIG_ENDIAN__) || defined(__BIG_ENDIAN)
|
||||
/* convert the bytes from big to little endian */
|
||||
#ifndef __KERNEL__
|
||||
# define get_l16(X,O) bswap_16(get_u_int16_t(X,O))
|
||||
# define get_l32(X,O) bswap_32(get_u_int32_t(X,O))
|
||||
#else
|
||||
# define get_l16(X,O) __cpu_to_le16(get_u_int16_t(X,O))
|
||||
# define get_l32(X,O) __cpu_to_le32(get_u_int32_t(X,O))
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#error "__BYTE_ORDER MUST BE DEFINED !"
|
||||
|
||||
#endif /* __BYTE_ORDER */
|
||||
|
||||
/* define memory callback function */
|
||||
#define match_first_bytes(payload,st) (memcmp((payload),(st),(sizeof(st)-1))==0)
|
||||
|
||||
#if defined(WIN32) && !defined(snprintf)
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#define NDPI_MAX_DNS_REQUESTS 16
|
||||
|
||||
#define NDPI_MAJOR @NDPI_MAJOR@
|
||||
#define NDPI_MINOR @NDPI_MINOR@
|
||||
#define NDPI_PATCH @NDPI_PATCH@
|
||||
|
||||
#endif /* __NDPI_DEFINE_INCLUDE_FILE__ */
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* ndpi_includes.h
|
||||
*
|
||||
* Copyright (C) 2011-16 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __NDPI_INCLUDES_H__
|
||||
#define __NDPI_INCLUDES_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <limits.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include "ndpi_win32.h"
|
||||
#else
|
||||
#include <sys/types.h>
|
||||
#include <sys/param.h>
|
||||
#include <pthread.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/udp.h>
|
||||
|
||||
#if !defined __APPLE__ && !defined __FreeBSD__ && !defined __NetBSD__ && !defined __OpenBSD__
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
|
||||
#if defined __FreeBSD__ || defined __NetBSD__ || defined __OpenBSD__
|
||||
#include <netinet/in.h>
|
||||
|
||||
#if defined __NetBSD__ || defined __OpenBSD__
|
||||
#include <netinet/in_systm.h>
|
||||
|
||||
#ifdef __OpenBSD__
|
||||
#include <pthread.h>
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* Win32 */
|
||||
|
||||
#endif /* __NDPI_INCLUDES_H__ */
|
||||
+124
-129
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* ndpi_main.h
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,139 +21,135 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __NDPI_MAIN_INCLUDE_FILE__
|
||||
#define __NDPI_MAIN_INCLUDE_FILE__
|
||||
#ifndef __NDPI_MAIN_H__
|
||||
#define __NDPI_MAIN_H__
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
#ifndef WIN32
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef __KERNEL__
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
#if !defined __APPLE__ && !defined __FreeBSD__ && !defined __NetBSD__ && !defined __OpenBSD__
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include <endian.h>
|
||||
#include <byteswap.h>
|
||||
#else
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/ctype.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/* default includes */
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include <sys/param.h>
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "ndpi_win32.h"
|
||||
#include "ndpi_unix.h"
|
||||
#include "ndpi_includes.h"
|
||||
#include "ndpi_define.h"
|
||||
#include "ndpi_protocol_ids.h"
|
||||
#include "ndpi_typedefs.h"
|
||||
#include "ndpi_api.h"
|
||||
#include "ndpi_protocols.h"
|
||||
|
||||
|
||||
void *ndpi_tdelete(const void * __restrict, void ** __restrict,
|
||||
int (*)(const void *, const void *));
|
||||
void *ndpi_tfind(const void *, void *, int (*)(const void *, const void *));
|
||||
void *ndpi_tsearch(const void *, void**, int (*)(const void *, const void *));
|
||||
void ndpi_twalk(const void *, void (*)(const void *, ndpi_VISIT, int, void*), void *user_data);
|
||||
void ndpi_tdestroy(void *vrootp, void (*freefct)(void *));
|
||||
|
||||
int NDPI_BITMASK_COMPARE(NDPI_PROTOCOL_BITMASK a, NDPI_PROTOCOL_BITMASK b);
|
||||
int NDPI_BITMASK_IS_EMPTY(NDPI_PROTOCOL_BITMASK a);
|
||||
void NDPI_DUMP_BITMASK(NDPI_PROTOCOL_BITMASK a);
|
||||
|
||||
extern u_int8_t ndpi_net_match(u_int32_t ip_to_check,
|
||||
u_int32_t net,
|
||||
u_int32_t num_bits);
|
||||
|
||||
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
|
||||
u_int32_t net, u_int32_t num_bits);
|
||||
|
||||
u_int16_t ntohs_ndpi_bytestream_to_number(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
||||
|
||||
u_int32_t ndpi_bytestream_to_number(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
||||
u_int64_t ndpi_bytestream_to_number64(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
||||
u_int32_t ndpi_bytestream_dec_or_hex_to_number(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
||||
u_int64_t ndpi_bytestream_dec_or_hex_to_number64(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
||||
u_int32_t ndpi_bytestream_to_ipv4(const u_int8_t * str, u_int16_t max_chars_to_read, u_int16_t * bytes_read);
|
||||
|
||||
|
||||
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
|
||||
|
||||
/* function to parse a packet which has line based information into a line based structure
|
||||
* this function will also set some well known line pointers like:
|
||||
* - host, user agent, empty line,....
|
||||
*/
|
||||
extern void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
extern void ndpi_parse_packet_line_info_any(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
extern u_int16_t ndpi_check_for_email_address(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, u_int16_t counter);
|
||||
extern void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol_breed_t protoBreed, u_int16_t protoId,
|
||||
u_int16_t tcp_alias_protoId[2], u_int16_t udp_alias_protoId[2],
|
||||
char *protoName,
|
||||
ndpi_port_range *tcpDefPorts, ndpi_port_range *udpDefPorts);
|
||||
extern void ndpi_int_reset_packet_protocol(struct ndpi_packet_struct *packet);
|
||||
extern void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow);
|
||||
extern int ndpi_packet_src_ip_eql(const struct ndpi_packet_struct *packet, const ndpi_ip_addr_t * ip);
|
||||
extern int ndpi_packet_dst_ip_eql(const struct ndpi_packet_struct *packet, const ndpi_ip_addr_t * ip);
|
||||
extern void ndpi_packet_src_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
||||
extern void ndpi_packet_dst_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
||||
extern char *ndpi_get_ip_string(struct ndpi_detection_module_struct *ndpi_struct, const ndpi_ip_addr_t * ip);
|
||||
extern char *ndpi_get_packet_src_ip_string(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const struct ndpi_packet_struct *packet);
|
||||
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
|
||||
extern u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int8_t proto, u_int16_t sport, u_int16_t dport);
|
||||
extern u_int8_t ndpi_is_proto(ndpi_protocol p, u_int16_t proto);
|
||||
extern u_int16_t ndpi_get_lower_proto(ndpi_protocol p);
|
||||
extern int ndpi_get_protocol_id_master_proto(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int16_t protocol_id,
|
||||
u_int16_t** tcp_master_proto,
|
||||
u_int16_t** udp_master_proto);
|
||||
|
||||
extern u_int8_t ndpi_net_match(u_int32_t ip_to_check,
|
||||
u_int32_t net,
|
||||
u_int32_t num_bits);
|
||||
|
||||
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
|
||||
u_int32_t net, u_int32_t num_bits);
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const char **file, const char **func, u_int32_t * line);
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ndpi_api.h"
|
||||
void *ndpi_tdelete(const void * __restrict, void ** __restrict,
|
||||
int (*)(const void *, const void *));
|
||||
void *ndpi_tfind(const void *, void *, int (*)(const void *, const void *));
|
||||
void *ndpi_tsearch(const void *, void**, int (*)(const void *, const void *));
|
||||
void ndpi_twalk(const void *, void (*)(const void *, ndpi_VISIT, int, void*), void *user_data);
|
||||
void ndpi_tdestroy(void *vrootp, void (*freefct)(void *));
|
||||
|
||||
#endif /* __NDPI_MAIN_INCLUDE_FILE__ */
|
||||
int NDPI_BITMASK_COMPARE(NDPI_PROTOCOL_BITMASK a, NDPI_PROTOCOL_BITMASK b);
|
||||
int NDPI_BITMASK_IS_EMPTY(NDPI_PROTOCOL_BITMASK a);
|
||||
void NDPI_DUMP_BITMASK(NDPI_PROTOCOL_BITMASK a);
|
||||
|
||||
extern u_int8_t ndpi_net_match(u_int32_t ip_to_check,
|
||||
u_int32_t net,
|
||||
u_int32_t num_bits);
|
||||
|
||||
extern u_int8_t ndpi_ips_match(u_int32_t src, u_int32_t dst,
|
||||
u_int32_t net, u_int32_t num_bits);
|
||||
|
||||
u_int16_t ntohs_ndpi_bytestream_to_number(const u_int8_t * str,
|
||||
u_int16_t max_chars_to_read,
|
||||
u_int16_t * bytes_read);
|
||||
|
||||
u_int32_t ndpi_bytestream_to_number(const u_int8_t * str, u_int16_t max_chars_to_read,
|
||||
u_int16_t * bytes_read);
|
||||
u_int64_t ndpi_bytestream_to_number64(const u_int8_t * str, u_int16_t max_chars_to_read,
|
||||
u_int16_t * bytes_read);
|
||||
u_int32_t ndpi_bytestream_dec_or_hex_to_number(const u_int8_t * str,
|
||||
u_int16_t max_chars_to_read,
|
||||
u_int16_t * bytes_read);
|
||||
u_int64_t ndpi_bytestream_dec_or_hex_to_number64(const u_int8_t * str,
|
||||
u_int16_t max_chars_to_read,
|
||||
u_int16_t * bytes_read);
|
||||
u_int32_t ndpi_bytestream_to_ipv4(const u_int8_t * str, u_int16_t max_chars_to_read,
|
||||
u_int16_t * bytes_read);
|
||||
|
||||
void ndpi_set_detected_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
|
||||
extern void ndpi_parse_packet_line_info(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow);
|
||||
extern void ndpi_parse_packet_line_info_any(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow);
|
||||
|
||||
extern u_int16_t ndpi_check_for_email_address(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow, u_int16_t counter);
|
||||
|
||||
extern void ndpi_int_change_packet_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
extern void ndpi_int_change_protocol(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int16_t upper_detected_protocol,
|
||||
u_int16_t lower_detected_protocol);
|
||||
extern void ndpi_int_change_category(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
ndpi_protocol_category_t protocol_category);
|
||||
|
||||
extern void ndpi_set_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod,
|
||||
ndpi_protocol_breed_t protoBreed, u_int16_t protoId,
|
||||
u_int16_t tcp_alias_protoId[2],
|
||||
u_int16_t udp_alias_protoId[2], char *protoName,
|
||||
ndpi_protocol_category_t protoCategory,
|
||||
ndpi_port_range *tcpDefPorts,
|
||||
ndpi_port_range *udpDefPorts);
|
||||
|
||||
extern void ndpi_int_reset_packet_protocol(struct ndpi_packet_struct *packet);
|
||||
extern void ndpi_int_reset_protocol(struct ndpi_flow_struct *flow);
|
||||
|
||||
extern int ndpi_packet_src_ip_eql(const struct ndpi_packet_struct *packet, const ndpi_ip_addr_t * ip);
|
||||
extern int ndpi_packet_dst_ip_eql(const struct ndpi_packet_struct *packet, const ndpi_ip_addr_t * ip);
|
||||
extern void ndpi_packet_src_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
||||
extern void ndpi_packet_dst_ip_get(const struct ndpi_packet_struct *packet, ndpi_ip_addr_t * ip);
|
||||
|
||||
extern char *ndpi_get_ip_string(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const ndpi_ip_addr_t * ip);
|
||||
extern char *ndpi_get_packet_src_ip_string(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const struct ndpi_packet_struct *packet);
|
||||
extern char* ndpi_get_proto_by_id(struct ndpi_detection_module_struct *ndpi_mod, u_int id);
|
||||
u_int16_t ndpi_get_proto_by_name(struct ndpi_detection_module_struct *ndpi_mod, const char *name);
|
||||
|
||||
extern u_int16_t ndpi_guess_protocol_id(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int8_t proto, u_int16_t sport, u_int16_t dport,
|
||||
u_int8_t *user_defined_proto);
|
||||
|
||||
extern u_int8_t ndpi_is_proto(ndpi_protocol p, u_int16_t proto);
|
||||
|
||||
extern u_int16_t ndpi_get_lower_proto(ndpi_protocol p);
|
||||
extern int ndpi_get_protocol_id_master_proto(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int16_t protocol_id,
|
||||
u_int16_t** tcp_master_proto,
|
||||
u_int16_t** udp_master_proto);
|
||||
#/* NDPI_PROTOCOL_NETBIOS */
|
||||
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
|
||||
|
||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
const char **file, const char **func, u_int32_t * line);
|
||||
#endif
|
||||
|
||||
/** Checks when the @p payload starts with the string literal @p str.
|
||||
* When the string is larger than the payload, check fails.
|
||||
* @return non-zero if check succeeded
|
||||
*/
|
||||
int ndpi_match_prefix(const u_int8_t *payload, size_t payload_len,
|
||||
const char *str, size_t str_len);
|
||||
|
||||
/* version of ndpi_match_prefix with string literal */
|
||||
#define ndpi_match_strprefix(payload, payload_len, str) \
|
||||
ndpi_match_prefix((payload), (payload_len), (str), (sizeof(str)-1))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __NDPI_MAIN_H__ */
|
||||
|
||||
+263
-236
@@ -1,8 +1,8 @@
|
||||
|
||||
/*
|
||||
* ndpi_protocol_ids.h
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-11 - ipoque GmbH
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,7 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NDPI_API_INCLUDE_FILE__
|
||||
#ifndef __NDPI_API_H__
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,240 +31,267 @@
|
||||
#define __NDPI_PROTOCOLS_DEFAULT_H__
|
||||
|
||||
#define NDPI_DETECTION_SUPPORT_IPV6
|
||||
#define NDPI_PROTOCOL_HISTORY_SIZE 2
|
||||
#define NDPI_PROTOCOL_SIZE 2
|
||||
|
||||
#define NDPI_PROTOCOL_UNKNOWN 0
|
||||
typedef enum {
|
||||
NDPI_PROTOCOL_UNKNOWN = 0,
|
||||
NDPI_PROTOCOL_FTP_CONTROL = 1, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_MAIL_POP = 2,
|
||||
NDPI_PROTOCOL_MAIL_SMTP = 3,
|
||||
NDPI_PROTOCOL_MAIL_IMAP = 4,
|
||||
NDPI_PROTOCOL_DNS = 5,
|
||||
NDPI_PROTOCOL_IPP = 6,
|
||||
NDPI_PROTOCOL_HTTP = 7,
|
||||
NDPI_PROTOCOL_MDNS = 8,
|
||||
NDPI_PROTOCOL_NTP = 9,
|
||||
NDPI_PROTOCOL_NETBIOS = 10,
|
||||
NDPI_PROTOCOL_NFS = 11,
|
||||
NDPI_PROTOCOL_SSDP = 12,
|
||||
NDPI_PROTOCOL_BGP = 13,
|
||||
NDPI_PROTOCOL_SNMP = 14,
|
||||
NDPI_PROTOCOL_XDMCP = 15,
|
||||
NDPI_PROTOCOL_SMB = 16,
|
||||
NDPI_PROTOCOL_SYSLOG = 17,
|
||||
NDPI_PROTOCOL_DHCP = 18,
|
||||
NDPI_PROTOCOL_POSTGRES = 19,
|
||||
NDPI_PROTOCOL_MYSQL = 20,
|
||||
NDPI_PROTOCOL_HOTMAIL = 21,
|
||||
NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK = 22,
|
||||
NDPI_PROTOCOL_MAIL_POPS = 23,
|
||||
NDPI_PROTOCOL_APPLEJUICE = 24,
|
||||
NDPI_PROTOCOL_DIRECTCONNECT = 25,
|
||||
NDPI_PROTOCOL_NTOP = 26,
|
||||
NDPI_PROTOCOL_COAP = 27,
|
||||
NDPI_PROTOCOL_VMWARE = 28,
|
||||
NDPI_PROTOCOL_MAIL_SMTPS = 29,
|
||||
NDPI_PROTOCOL_FBZERO = 30,
|
||||
NDPI_PROTOCOL_UBNTAC2 = 31, /* Ubiquity UBNT AirControl = 2 - Thomas Fjellstrom <thomas+ndpi@fjellstrom.ca> */
|
||||
NDPI_PROTOCOL_KONTIKI = 32,
|
||||
NDPI_PROTOCOL_OPENFT = 33,
|
||||
NDPI_PROTOCOL_FASTTRACK = 34,
|
||||
NDPI_PROTOCOL_GNUTELLA = 35,
|
||||
NDPI_PROTOCOL_EDONKEY = 36, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_BITTORRENT = 37,
|
||||
NDPI_PROTOCOL_SKYPE_CALL_OUT = 38,
|
||||
NDPI_PROTOCOL_MUSICALLY = 39,
|
||||
NDPI_PROTOCOL_MEMCACHED = 40, /* Memcached - Darryl Sokoloski <darryl@egloo.ca> */
|
||||
|
||||
#define NDPI_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
|
||||
NDPI_PROTOCOL_FREE_41 = 41, /* Free */
|
||||
NDPI_PROTOCOL_FREE_42 = 42, /* Free */
|
||||
NDPI_PROTOCOL_FREE_43 = 43, /* Free */
|
||||
NDPI_PROTOCOL_FREE_44 = 44, /* Free */
|
||||
NDPI_PROTOCOL_FREE_45 = 45, /* Free */
|
||||
NDPI_PROTOCOL_FREE_46 = 46, /* Free */
|
||||
|
||||
NDPI_PROTOCOL_XBOX = 47,
|
||||
NDPI_PROTOCOL_QQ = 48,
|
||||
NDPI_PROTOCOL_SKYPE_CALL_IN = 49,
|
||||
NDPI_PROTOCOL_RTSP = 50,
|
||||
NDPI_PROTOCOL_MAIL_IMAPS = 51,
|
||||
NDPI_PROTOCOL_ICECAST = 52,
|
||||
NDPI_PROTOCOL_PPLIVE = 53, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_PPSTREAM = 54,
|
||||
NDPI_PROTOCOL_ZATTOO = 55,
|
||||
NDPI_PROTOCOL_SHOUTCAST = 56,
|
||||
NDPI_PROTOCOL_SOPCAST = 57,
|
||||
NDPI_PROTOCOL_TVANTS = 58,
|
||||
NDPI_PROTOCOL_TVUPLAYER = 59,
|
||||
NDPI_PROTOCOL_HTTP_DOWNLOAD = 60,
|
||||
NDPI_PROTOCOL_QQLIVE = 61,
|
||||
NDPI_PROTOCOL_THUNDER = 62,
|
||||
NDPI_PROTOCOL_SOULSEEK = 63,
|
||||
NDPI_PROTOCOL_SSL_NO_CERT = 64,
|
||||
NDPI_PROTOCOL_IRC = 65,
|
||||
NDPI_PROTOCOL_AYIYA = 66,
|
||||
NDPI_PROTOCOL_UNENCRYPTED_JABBER = 67,
|
||||
NDPI_PROTOCOL_MSN = 68,
|
||||
NDPI_PROTOCOL_OSCAR = 69,
|
||||
NDPI_PROTOCOL_YAHOO = 70,
|
||||
NDPI_PROTOCOL_BATTLEFIELD = 71,
|
||||
NDPI_PROTOCOL_GOOGLE_PLUS = 72,
|
||||
NDPI_PROTOCOL_IP_VRRP = 73,
|
||||
NDPI_PROTOCOL_STEAM = 74, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_HALFLIFE2 = 75,
|
||||
NDPI_PROTOCOL_WORLDOFWARCRAFT = 76,
|
||||
NDPI_PROTOCOL_TELNET = 77,
|
||||
NDPI_PROTOCOL_STUN = 78,
|
||||
NDPI_PROTOCOL_IP_IPSEC = 79,
|
||||
NDPI_PROTOCOL_IP_GRE = 80,
|
||||
NDPI_PROTOCOL_IP_ICMP = 81,
|
||||
NDPI_PROTOCOL_IP_IGMP = 82,
|
||||
NDPI_PROTOCOL_IP_EGP = 83,
|
||||
NDPI_PROTOCOL_IP_SCTP = 84,
|
||||
NDPI_PROTOCOL_IP_OSPF = 85,
|
||||
NDPI_PROTOCOL_IP_IP_IN_IP = 86,
|
||||
NDPI_PROTOCOL_RTP = 87,
|
||||
NDPI_PROTOCOL_RDP = 88,
|
||||
NDPI_PROTOCOL_VNC = 89,
|
||||
NDPI_PROTOCOL_PCANYWHERE = 90,
|
||||
NDPI_PROTOCOL_SSL = 91,
|
||||
NDPI_PROTOCOL_SSH = 92,
|
||||
NDPI_PROTOCOL_USENET = 93,
|
||||
NDPI_PROTOCOL_MGCP = 94,
|
||||
NDPI_PROTOCOL_IAX = 95,
|
||||
NDPI_PROTOCOL_TFTP = 96,
|
||||
NDPI_PROTOCOL_AFP = 97,
|
||||
NDPI_PROTOCOL_STEALTHNET = 98,
|
||||
NDPI_PROTOCOL_AIMINI = 99,
|
||||
NDPI_PROTOCOL_SIP = 100,
|
||||
NDPI_PROTOCOL_TRUPHONE = 101,
|
||||
NDPI_PROTOCOL_IP_ICMPV6 = 102,
|
||||
NDPI_PROTOCOL_DHCPV6 = 103,
|
||||
NDPI_PROTOCOL_ARMAGETRON = 104,
|
||||
NDPI_PROTOCOL_CROSSFIRE = 105,
|
||||
NDPI_PROTOCOL_DOFUS = 106,
|
||||
NDPI_PROTOCOL_FIESTA = 107,
|
||||
NDPI_PROTOCOL_FLORENSIA = 108,
|
||||
NDPI_PROTOCOL_GUILDWARS = 109,
|
||||
NDPI_PROTOCOL_HTTP_ACTIVESYNC = 110,
|
||||
NDPI_PROTOCOL_KERBEROS = 111,
|
||||
NDPI_PROTOCOL_LDAP = 112,
|
||||
NDPI_PROTOCOL_MAPLESTORY = 113,
|
||||
NDPI_PROTOCOL_MSSQL_TDS = 114,
|
||||
NDPI_PROTOCOL_PPTP = 115,
|
||||
NDPI_PROTOCOL_WARCRAFT3 = 116,
|
||||
NDPI_PROTOCOL_WORLD_OF_KUNG_FU = 117,
|
||||
NDPI_PROTOCOL_SLACK = 118,
|
||||
NDPI_PROTOCOL_FACEBOOK = 119,
|
||||
NDPI_PROTOCOL_TWITTER = 120,
|
||||
NDPI_PROTOCOL_DROPBOX = 121,
|
||||
NDPI_PROTOCOL_GMAIL = 122,
|
||||
NDPI_PROTOCOL_GOOGLE_MAPS = 123,
|
||||
NDPI_PROTOCOL_YOUTUBE = 124,
|
||||
NDPI_PROTOCOL_SKYPE = 125,
|
||||
NDPI_PROTOCOL_GOOGLE = 126,
|
||||
NDPI_PROTOCOL_DCERPC = 127,
|
||||
NDPI_PROTOCOL_NETFLOW = 128,
|
||||
NDPI_PROTOCOL_SFLOW = 129,
|
||||
NDPI_PROTOCOL_HTTP_CONNECT = 130,
|
||||
NDPI_PROTOCOL_HTTP_PROXY = 131,
|
||||
NDPI_PROTOCOL_CITRIX = 132, /* It also includes the old NDPI_PROTOCOL_CITRIX_ONLINE */
|
||||
NDPI_PROTOCOL_NETFLIX = 133,
|
||||
NDPI_PROTOCOL_LASTFM = 134,
|
||||
NDPI_PROTOCOL_WAZE = 135,
|
||||
NDPI_PROTOCOL_YOUTUBE_UPLOAD = 136, /* Upload files to youtube */
|
||||
NDPI_PROTOCOL_GENERIC = 137, /* Generic protocol used for category matching */
|
||||
NDPI_PROTOCOL_CHECKMK = 138,
|
||||
NDPI_PROTOCOL_AJP = 139, /* Leonn Paiva <leonn.paiva@gmail.com> */
|
||||
NDPI_PROTOCOL_APPLE = 140,
|
||||
NDPI_PROTOCOL_WEBEX = 141,
|
||||
NDPI_PROTOCOL_WHATSAPP = 142,
|
||||
NDPI_PROTOCOL_APPLE_ICLOUD = 143,
|
||||
NDPI_PROTOCOL_VIBER = 144,
|
||||
NDPI_PROTOCOL_APPLE_ITUNES = 145,
|
||||
NDPI_PROTOCOL_RADIUS = 146,
|
||||
NDPI_PROTOCOL_WINDOWS_UPDATE = 147,
|
||||
NDPI_PROTOCOL_TEAMVIEWER = 148, /* xplico.org */
|
||||
NDPI_PROTOCOL_TUENTI = 149,
|
||||
NDPI_PROTOCOL_LOTUS_NOTES = 150,
|
||||
NDPI_PROTOCOL_SAP = 151,
|
||||
NDPI_PROTOCOL_GTP = 152,
|
||||
NDPI_PROTOCOL_UPNP = 153,
|
||||
NDPI_PROTOCOL_LLMNR = 154,
|
||||
NDPI_PROTOCOL_REMOTE_SCAN = 155,
|
||||
NDPI_PROTOCOL_SPOTIFY = 156,
|
||||
NDPI_PROTOCOL_MESSENGER = 157,
|
||||
NDPI_PROTOCOL_H323 = 158, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_OPENVPN = 159, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_NOE = 160, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_CISCOVPN = 161, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_TEAMSPEAK = 162, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_TOR = 163, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_SKINNY = 164, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_RTCP = 165, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_RSYNC = 166, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_ORACLE = 167, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_CORBA = 168, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_UBUNTUONE = 169, /* Remy Mudingay <mudingay@ill.fr> */
|
||||
NDPI_PROTOCOL_WHOIS_DAS = 170,
|
||||
NDPI_PROTOCOL_COLLECTD = 171,
|
||||
NDPI_PROTOCOL_SOCKS = 172, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_NINTENDO = 173,
|
||||
NDPI_PROTOCOL_RTMP = 174, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_FTP_DATA = 175, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_WIKIPEDIA = 176, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_ZMQ = 177,
|
||||
NDPI_PROTOCOL_AMAZON = 178, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_EBAY = 179, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_CNN = 180, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_MEGACO = 181, /* Gianluca Costa <g.costa@xplico.org> */
|
||||
NDPI_PROTOCOL_REDIS = 182,
|
||||
NDPI_PROTOCOL_PANDO = 183, /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
NDPI_PROTOCOL_VHUA = 184,
|
||||
NDPI_PROTOCOL_TELEGRAM = 185, /* Gianluca Costa <g.costa@xplico.org> */
|
||||
NDPI_PROTOCOL_VEVO = 186,
|
||||
NDPI_PROTOCOL_PANDORA = 187,
|
||||
NDPI_PROTOCOL_QUIC = 188, /* Andrea Buscarinu <andrea.buscarinu@gmail.com> - Michele Campus <michelecampus5@gmail.com> */
|
||||
NDPI_PROTOCOL_WHATSAPP_VOICE = 189,
|
||||
NDPI_PROTOCOL_EAQ = 190,
|
||||
NDPI_PROTOCOL_OOKLA = 191,
|
||||
NDPI_PROTOCOL_AMQP = 192,
|
||||
NDPI_PROTOCOL_KAKAOTALK = 193, /* KakaoTalk Chat (no voice call) */
|
||||
NDPI_PROTOCOL_KAKAOTALK_VOICE = 194, /* KakaoTalk Voice */
|
||||
NDPI_PROTOCOL_TWITCH = 195, /* Edoardo Dominici <edoaramis@gmail.com> */
|
||||
NDPI_PROTOCOL_FREE_196 = 196, /* Free */
|
||||
NDPI_PROTOCOL_WECHAT = 197,
|
||||
NDPI_PROTOCOL_MPEGTS = 198,
|
||||
NDPI_PROTOCOL_SNAPCHAT = 199,
|
||||
NDPI_PROTOCOL_SINA = 200,
|
||||
NDPI_PROTOCOL_HANGOUT = 201,
|
||||
NDPI_PROTOCOL_IFLIX = 202, /* www.vizuamatix.com R&D team & M.Mallawaarachchie <manoj_ws@yahoo.com> */
|
||||
NDPI_PROTOCOL_GITHUB = 203,
|
||||
NDPI_PROTOCOL_BJNP = 204,
|
||||
NDPI_PROTOCOL_FREE_205 = 205, /* Free */
|
||||
NDPI_PROTOCOL_VIDTO = 206,
|
||||
NDPI_PROTOCOL_SMPP = 207, /* Damir Franusic <df@release14.org> */
|
||||
NDPI_PROTOCOL_DNSCRYPT = 208,
|
||||
NDPI_PROTOCOL_TINC = 209, /* William Guglielmo <william@deselmo.com> */
|
||||
NDPI_PROTOCOL_DEEZER = 210,
|
||||
NDPI_PROTOCOL_INSTAGRAM = 211, /* Andrea Buscarinu <andrea.buscarinu@gmail.com> */
|
||||
NDPI_PROTOCOL_MICROSOFT = 212,
|
||||
NDPI_PROTOCOL_STARCRAFT = 213, /* Matteo Bracci <matteobracci1@gmail.com> */
|
||||
NDPI_PROTOCOL_TEREDO = 214,
|
||||
NDPI_PROTOCOL_HOTSPOT_SHIELD = 215,
|
||||
NDPI_PROTOCOL_HEP = 216, /* sipcapture.org QXIP BV */
|
||||
NDPI_PROTOCOL_GOOGLE_DRIVE = 217,
|
||||
NDPI_PROTOCOL_OCS = 218,
|
||||
NDPI_PROTOCOL_OFFICE_365 = 219,
|
||||
NDPI_PROTOCOL_CLOUDFLARE = 220,
|
||||
NDPI_PROTOCOL_MS_ONE_DRIVE = 221,
|
||||
NDPI_PROTOCOL_MQTT = 222,
|
||||
NDPI_PROTOCOL_RX = 223,
|
||||
NDPI_PROTOCOL_APPLESTORE = 224,
|
||||
NDPI_PROTOCOL_OPENDNS = 225,
|
||||
NDPI_PROTOCOL_GIT = 226,
|
||||
NDPI_PROTOCOL_DRDA = 227,
|
||||
NDPI_PROTOCOL_PLAYSTORE = 228,
|
||||
NDPI_PROTOCOL_SOMEIP = 229,
|
||||
NDPI_PROTOCOL_FIX = 230,
|
||||
NDPI_PROTOCOL_PLAYSTATION = 231,
|
||||
NDPI_PROTOCOL_PASTEBIN = 232, /* Paulo Angelo <pa@pauloangelo.com> */
|
||||
NDPI_PROTOCOL_LINKEDIN = 233, /* Paulo Angelo <pa@pauloangelo.com> */
|
||||
NDPI_PROTOCOL_SOUNDCLOUD = 234,
|
||||
NDPI_PROTOCOL_CSGO = 235, /* Counter-Strike Global Offensive, Dota = 2 */
|
||||
NDPI_PROTOCOL_LISP = 236,
|
||||
NDPI_PROTOCOL_DIAMETER = 237,
|
||||
NDPI_PROTOCOL_APPLE_PUSH = 238,
|
||||
NDPI_PROTOCOL_GOOGLE_SERVICES = 239,
|
||||
NDPI_PROTOCOL_AMAZON_VIDEO = 240,
|
||||
NDPI_PROTOCOL_GOOGLE_DOCS = 241,
|
||||
NDPI_PROTOCOL_WHATSAPP_FILES = 242, /* Videos, pictures, voice messages... */
|
||||
/*
|
||||
IMPORTANT
|
||||
before allocating a new identifier please fill up
|
||||
one of those named NDPI_PROTOCOL_FREE_XXX and not used
|
||||
(placeholders to avoid protocol renumbering)
|
||||
*/
|
||||
|
||||
|
||||
/* IMPORTANT:NDPI_LAST_IMPLEMENTED_PROTOCOL MUST BE THE LAST ELEMENT */
|
||||
NDPI_LAST_IMPLEMENTED_PROTOCOL
|
||||
} ndpi_protocol_id_t;
|
||||
|
||||
#define NDPI_PROTOCOL_IP_VRRP 73
|
||||
#define NDPI_PROTOCOL_IP_IPSEC 79
|
||||
#define NDPI_PROTOCOL_IP_GRE 80
|
||||
#define NDPI_PROTOCOL_IP_ICMP 81
|
||||
#define NDPI_PROTOCOL_IP_IGMP 82
|
||||
#define NDPI_PROTOCOL_IP_EGP 83
|
||||
#define NDPI_PROTOCOL_IP_SCTP 84
|
||||
#define NDPI_PROTOCOL_IP_OSPF 85
|
||||
#define NDPI_PROTOCOL_IP_IP_IN_IP 86
|
||||
#define NDPI_PROTOCOL_IP_ICMPV6 102
|
||||
|
||||
#define NDPI_PROTOCOL_HTTP 7
|
||||
#define NDPI_PROTOCOL_HTTP_APPLICATION_VEOHTV 60
|
||||
#define NDPI_PROTOCOL_SSL_NO_CERT 64 /* SSL without certificate (Skype, Ultrasurf?) - ntop.org */
|
||||
#define NDPI_PROTOCOL_SSL 91
|
||||
#define NDPI_PROTOCOL_HTTP_APPLICATION_ACTIVESYNC 110
|
||||
#define NDPI_PROTOCOL_HTTP_CONNECT 130
|
||||
#define NDPI_PROTOCOL_HTTP_PROXY 131
|
||||
#define NDPI_PROTOCOL_SOCKS5 172 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_SOCKS4 173 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
|
||||
#define NDPI_PROTOCOL_FTP_CONTROL 1 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_MAIL_POP 2
|
||||
#define NDPI_PROTOCOL_MAIL_SMTP 3
|
||||
#define NDPI_PROTOCOL_MAIL_IMAP 4
|
||||
#define NDPI_PROTOCOL_DNS 5
|
||||
#define NDPI_PROTOCOL_IPP 6
|
||||
#define NDPI_PROTOCOL_MDNS 8
|
||||
#define NDPI_PROTOCOL_NTP 9
|
||||
#define NDPI_PROTOCOL_NETBIOS 10
|
||||
#define NDPI_PROTOCOL_NFS 11
|
||||
#define NDPI_PROTOCOL_SSDP 12
|
||||
#define NDPI_PROTOCOL_BGP 13
|
||||
#define NDPI_PROTOCOL_SNMP 14
|
||||
#define NDPI_PROTOCOL_XDMCP 15
|
||||
#define NDPI_PROTOCOL_SMB 16
|
||||
#define NDPI_PROTOCOL_SYSLOG 17
|
||||
#define NDPI_PROTOCOL_DHCP 18
|
||||
#define NDPI_PROTOCOL_POSTGRES 19
|
||||
#define NDPI_PROTOCOL_MYSQL 20
|
||||
#define NDPI_PROTOCOL_TDS 21
|
||||
#define NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK 22
|
||||
#define NDPI_PROTOCOL_MAIL_POPS 23
|
||||
#define NDPI_PROTOCOL_APPLEJUICE 24
|
||||
#define NDPI_PROTOCOL_DIRECTCONNECT 25
|
||||
#define NDPI_PROTOCOL_SOCRATES 26
|
||||
#define NDPI_PROTOCOL_WINMX 27
|
||||
#define NDPI_PROTOCOL_VMWARE 28
|
||||
#define NDPI_PROTOCOL_MAIL_SMTPS 29
|
||||
#define NDPI_PROTOCOL_FILETOPIA 30
|
||||
#define NDPI_PROTOCOL_IMESH 31
|
||||
#define NDPI_PROTOCOL_KONTIKI 32
|
||||
#define NDPI_PROTOCOL_OPENFT 33
|
||||
#define NDPI_PROTOCOL_FASTTRACK 34
|
||||
#define NDPI_PROTOCOL_GNUTELLA 35
|
||||
#define NDPI_PROTOCOL_EDONKEY 36 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_BITTORRENT 37
|
||||
#define NDPI_PROTOCOL_EPP 38
|
||||
#define NDPI_PROTOCOL_XBOX 47
|
||||
#define NDPI_PROTOCOL_QQ 48
|
||||
#define NDPI_PROTOCOL_MOVE 49
|
||||
#define NDPI_PROTOCOL_RTSP 50
|
||||
#define NDPI_PROTOCOL_MAIL_IMAPS 51
|
||||
#define NDPI_PROTOCOL_ICECAST 52
|
||||
#define NDPI_PROTOCOL_PPLIVE 53 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_PPSTREAM 54
|
||||
#define NDPI_PROTOCOL_ZATTOO 55
|
||||
#define NDPI_PROTOCOL_SHOUTCAST 56
|
||||
#define NDPI_PROTOCOL_SOPCAST 57
|
||||
#define NDPI_PROTOCOL_TVANTS 58
|
||||
#define NDPI_PROTOCOL_TVUPLAYER 59
|
||||
#define NDPI_PROTOCOL_QQLIVE 61
|
||||
#define NDPI_PROTOCOL_THUNDER 62
|
||||
#define NDPI_PROTOCOL_SOULSEEK 63
|
||||
#define NDPI_PROTOCOL_IRC 65
|
||||
#define NDPI_PROTOCOL_AYIYA 66
|
||||
#define NDPI_PROTOCOL_UNENCRYPED_JABBER 67
|
||||
#define NDPI_PROTOCOL_MSN 68
|
||||
#define NDPI_PROTOCOL_OSCAR 69
|
||||
#define NDPI_PROTOCOL_YAHOO 70
|
||||
#define NDPI_PROTOCOL_BATTLEFIELD 71
|
||||
#define NDPI_PROTOCOL_QUAKE 72
|
||||
#define NDPI_PROTOCOL_STEAM 74 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_HALFLIFE2 75
|
||||
#define NDPI_PROTOCOL_WORLDOFWARCRAFT 76
|
||||
#define NDPI_PROTOCOL_TELNET 77
|
||||
#define NDPI_PROTOCOL_STUN 78
|
||||
#define NDPI_PROTOCOL_RTP 87
|
||||
#define NDPI_PROTOCOL_RDP 88
|
||||
#define NDPI_PROTOCOL_VNC 89
|
||||
#define NDPI_PROTOCOL_PCANYWHERE 90
|
||||
#define NDPI_PROTOCOL_SSH 92
|
||||
#define NDPI_PROTOCOL_USENET 93
|
||||
#define NDPI_PROTOCOL_MGCP 94
|
||||
#define NDPI_PROTOCOL_IAX 95
|
||||
#define NDPI_PROTOCOL_TFTP 96
|
||||
#define NDPI_PROTOCOL_AFP 97
|
||||
#define NDPI_PROTOCOL_STEALTHNET 98
|
||||
#define NDPI_PROTOCOL_AIMINI 99
|
||||
#define NDPI_PROTOCOL_SIP 100
|
||||
#define NDPI_PROTOCOL_TRUPHONE 101
|
||||
#define NDPI_PROTOCOL_DHCPV6 103
|
||||
#define NDPI_PROTOCOL_ARMAGETRON 104
|
||||
#define NDPI_PROTOCOL_CROSSFIRE 105
|
||||
#define NDPI_PROTOCOL_DOFUS 106
|
||||
#define NDPI_PROTOCOL_FIESTA 107
|
||||
#define NDPI_PROTOCOL_FLORENSIA 108
|
||||
#define NDPI_PROTOCOL_GUILDWARS 109
|
||||
#define NDPI_PROTOCOL_KERBEROS 111
|
||||
#define NDPI_PROTOCOL_LDAP 112
|
||||
#define NDPI_PROTOCOL_MAPLESTORY 113
|
||||
#define NDPI_PROTOCOL_MSSQL 114
|
||||
#define NDPI_PROTOCOL_PPTP 115
|
||||
#define NDPI_PROTOCOL_WARCRAFT3 116
|
||||
#define NDPI_PROTOCOL_WORLD_OF_KUNG_FU 117
|
||||
#define NDPI_PROTOCOL_MEEBO 118
|
||||
#define NDPI_PROTOCOL_DROPBOX 121
|
||||
#define NDPI_PROTOCOL_SKYPE 125
|
||||
#define NDPI_PROTOCOL_DCERPC 127
|
||||
#define NDPI_PROTOCOL_NETFLOW 128
|
||||
#define NDPI_PROTOCOL_SFLOW 129
|
||||
#define NDPI_PROTOCOL_CITRIX 132
|
||||
#define NDPI_PROTOCOL_SKYFILE_PREPAID 136
|
||||
#define NDPI_PROTOCOL_SKYFILE_RUDICS 137
|
||||
#define NDPI_PROTOCOL_SKYFILE_POSTPAID 138
|
||||
#define NDPI_PROTOCOL_CITRIX_ONLINE 139
|
||||
#define NDPI_PROTOCOL_WEBEX 141
|
||||
#define NDPI_PROTOCOL_VIBER 144
|
||||
#define NDPI_PROTOCOL_RADIUS 146
|
||||
#define NDPI_SERVICE_WINDOWS_UPDATE 147
|
||||
#define NDPI_PROTOCOL_TEAMVIEWER 148 /* xplico.org */
|
||||
#define NDPI_PROTOCOL_LOTUS_NOTES 150
|
||||
#define NDPI_PROTOCOL_SAP 151
|
||||
#define NDPI_PROTOCOL_GTP 152
|
||||
#define NDPI_PROTOCOL_UPNP 153
|
||||
#define NDPI_PROTOCOL_LLMNR 154
|
||||
#define NDPI_PROTOCOL_REMOTE_SCAN 155
|
||||
#define NDPI_PROTOCOL_SPOTIFY 156
|
||||
#define NDPI_PROTOCOL_H323 158 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_OPENVPN 159 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_NOE 160 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_CISCOVPN 161 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_TEAMSPEAK 162 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_TOR 163 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_SKINNY 164 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_RTCP 165 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_RSYNC 166 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_ORACLE 167 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_CORBA 168 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_UBUNTUONE 169 /* Remy Mudingay <mudingay@ill.fr> */
|
||||
#define NDPI_PROTOCOL_WHOIS_DAS 170
|
||||
#define NDPI_PROTOCOL_COLLECTD 171
|
||||
#define NDPI_PROTOCOL_RTMP 174 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_FTP_DATA 175 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_ZMQ 177
|
||||
#define NDPI_PROTOCOL_MEGACO 181 /* Gianluca Costa <g.costa@xplico.org> */
|
||||
#define NDPI_PROTOCOL_REDIS 182
|
||||
#define NDPI_PROTOCOL_PANDO 183 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_PROTOCOL_VHUA 184
|
||||
#define NDPI_PROTOCOL_TELEGRAM 185 /* Gianluca Costa <g.costa@xplico.org> */
|
||||
#define NDPI_PROTOCOL_QUIC 188 /* Andrea Buscarinu <andrea.buscarinu@gmail.com> - Michele Campus <michelecampus5@gmail.com> */
|
||||
#define NDPI_PROTOCOL_WHATSAPP_VOICE 189
|
||||
#define NDPI_PROTOCOL_STARCRAFT 213 /* Matteo Bracci <matteobracci1@gmail.com> */
|
||||
#define NDPI_PROTOCOL_TEREDO 214
|
||||
|
||||
#define NDPI_CONTENT_AVI 39
|
||||
#define NDPI_CONTENT_FLASH 40
|
||||
#define NDPI_CONTENT_OGG 41
|
||||
#define NDPI_CONTENT_MPEG 42
|
||||
#define NDPI_CONTENT_QUICKTIME 43
|
||||
#define NDPI_CONTENT_REALMEDIA 44
|
||||
#define NDPI_CONTENT_WINDOWSMEDIA 45
|
||||
#define NDPI_CONTENT_MMS 46
|
||||
#define NDPI_CONTENT_WEBM 157
|
||||
|
||||
#define NDPI_SERVICE_FACEBOOK 119
|
||||
#define NDPI_SERVICE_TWITTER 120
|
||||
#define NDPI_SERVICE_GMAIL 122
|
||||
#define NDPI_SERVICE_GOOGLE_MAPS 123
|
||||
#define NDPI_SERVICE_YOUTUBE 124
|
||||
#define NDPI_SERVICE_VEVO 186
|
||||
#define NDPI_SERVICE_GOOGLE 126
|
||||
#define NDPI_SERVICE_NETFLIX 133
|
||||
#define NDPI_SERVICE_LASTFM 134
|
||||
#define NDPI_SERVICE_WAZE 135
|
||||
#define NDPI_SERVICE_APPLE 140
|
||||
#define NDPI_SERVICE_WHATSAPP 142
|
||||
#define NDPI_SERVICE_APPLE_ICLOUD 143
|
||||
#define NDPI_SERVICE_APPLE_ITUNES 145
|
||||
#define NDPI_SERVICE_TUENTI 149
|
||||
#define NDPI_SERVICE_WIKIPEDIA 176 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_MSN NDPI_PROTOCOL_MSN /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_AMAZON 178 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_EBAY 179 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_CNN 180 /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_DROPBOX NDPI_PROTOCOL_DROPBOX /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_SKYPE NDPI_PROTOCOL_SKYPE /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_VIBER NDPI_PROTOCOL_VIBER /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_YAHOO NDPI_PROTOCOL_YAHOO /* Tomasz Bujlow <tomasz@skatnet.dk> */
|
||||
#define NDPI_SERVICE_PANDORA 187
|
||||
#define NDPI_PROTOCOL_EAQ 190
|
||||
#define NDPI_SERVICE_TIMMEU 191
|
||||
#define NDPI_SERVICE_TORCEDOR 192
|
||||
#define NDPI_SERVICE_KAKAOTALK 193 /* KakaoTalk Chat (no voice call) */
|
||||
#define NDPI_SERVICE_KAKAOTALK_VOICE 194 /* KakaoTalk Voice */
|
||||
#define NDPI_SERVICE_TWITCH 195 /* Edoardo Dominici <edoaramis@gmail.com> */
|
||||
#define NDPI_SERVICE_QUICKPLAY 196 /* Streaming service used by various services such as hooq.tv */
|
||||
#define NDPI_SERVICE_TIM 197 /* Traffic for tim.com.br and tim.it */
|
||||
#define NDPI_PROTOCOL_MPEGTS 198
|
||||
#define NDPI_SERVICE_SNAPCHAT 199
|
||||
#define NDPI_SERVICE_SIMET 200
|
||||
#define NDPI_SERVICE_OPENSIGNAL 201
|
||||
#define NDPI_SERVICE_99TAXI 202
|
||||
#define NDPI_SERVICE_EASYTAXI 203
|
||||
#define NDPI_SERVICE_GLOBOTV 204
|
||||
#define NDPI_SERVICE_TIMSOMDECHAMADA 205
|
||||
#define NDPI_SERVICE_TIMMENU 206
|
||||
#define NDPI_SERVICE_TIMPORTASABERTAS 207
|
||||
#define NDPI_SERVICE_TIMRECARGA 208
|
||||
#define NDPI_SERVICE_TIMBETA 209
|
||||
#define NDPI_SERVICE_DEEZER 210
|
||||
#define NDPI_SERVICE_INSTAGRAM 211 /* Andrea Buscarinu <andrea.buscarinu@gmail.com> */
|
||||
#define NDPI_SERVICE_MICROSOFT 212
|
||||
#define NDPI_SERVICE_HOTSPOT_SHIELD 215
|
||||
|
||||
/* UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE UPDATE */
|
||||
#define NDPI_LAST_IMPLEMENTED_PROTOCOL NDPI_SERVICE_HOTSPOT_SHIELD
|
||||
|
||||
#define NDPI_MAX_SUPPORTED_PROTOCOLS (NDPI_LAST_IMPLEMENTED_PROTOCOL + 1)
|
||||
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
|
||||
#define NDPI_PROTOCOL_NO_MASTER_PROTO NDPI_PROTOCOL_UNKNOWN
|
||||
#define NDPI_MAX_SUPPORTED_PROTOCOLS NDPI_LAST_IMPLEMENTED_PROTOCOL
|
||||
#define NDPI_MAX_NUM_CUSTOM_PROTOCOLS (NDPI_NUM_BITS-NDPI_LAST_IMPLEMENTED_PROTOCOL)
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* ndpi_protocols.h
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,8 +22,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __NDPI_PROTOCOLS_INCLUDE_FILE__
|
||||
#define __NDPI_PROTOCOLS_INCLUDE_FILE__
|
||||
#ifndef __NDPI_PROTOCOLS_H__
|
||||
#define __NDPI_PROTOCOLS_H__
|
||||
|
||||
#include "ndpi_main.h"
|
||||
|
||||
@@ -45,6 +44,7 @@ ndpi_port_range* ndpi_build_default_ports(ndpi_port_range *ports,
|
||||
|
||||
/* TCP/UDP protocols */
|
||||
u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int8_t protocol,
|
||||
u_int32_t saddr, u_int32_t daddr,
|
||||
u_int16_t sport, u_int16_t dport);
|
||||
@@ -52,15 +52,12 @@ u_int ndpi_search_tcp_or_udp_raw(struct ndpi_detection_module_struct *ndpi_struc
|
||||
void ndpi_search_tcp_or_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
|
||||
/* Applications and other protocols. */
|
||||
void ndpi_search_diameter(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_bittorrent_init(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t size,u_int32_t timeout);
|
||||
void ndpi_bittorrent_done(struct ndpi_detection_module_struct *ndpi_struct);
|
||||
int ndpi_bittorrent_gc(struct hash_ip4p_table *ht,int key,time_t now);
|
||||
|
||||
void ndpi_search_lisp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_winmx_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_directconnect(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_i23v5(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
@@ -72,6 +69,7 @@ void ndpi_search_oscar(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_sip(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_hep(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_direct_download_link_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mail_pop_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mail_imap_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
@@ -85,7 +83,6 @@ void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
void ndpi_search_rtsp_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_vmware(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_imesh_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_ssl_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mms_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_icecast_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
@@ -131,7 +128,6 @@ void ndpi_search_rdp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
void ndpi_search_snmp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_kontiki(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_syslog(struct ndpi_detection_module_struct*ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_tds_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mdns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_ipp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
@@ -140,12 +136,12 @@ void ndpi_search_warcraft3(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_xdmcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_tftp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mssql(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mssql_tds(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_pptp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_stealthnet(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_meebo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_checkmk(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_maplestory(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
@@ -187,7 +183,6 @@ void ndpi_search_pando(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
void ndpi_search_megaco(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_redis(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_zmq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_twitter(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_vhua(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_telegram(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_quic(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
@@ -195,17 +190,32 @@ void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
void ndpi_search_kakaotalk_voice(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mpegts(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_starcraft(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
|
||||
|
||||
void ndpi_search_ubntac2(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_coap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_mqtt (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_someip (struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_rx(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_git(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_drda(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_bjnp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_smpp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_tinc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_csgo(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_ajp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
void ndpi_search_memcached(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow);
|
||||
/* --- INIT FUNCTIONS --- */
|
||||
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_applejuice_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_armagetron_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ayiya_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_amqp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_battlefield_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_bgp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_bittorrent_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_lisp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_teredo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ciscovpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_citrix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -223,7 +233,6 @@ void init_eaq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
||||
void init_edonkey_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_fasttrack_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_fiesta_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_filetopia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_florensia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ftp_control_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ftp_data_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -236,7 +245,6 @@ void init_http_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
||||
void init_http_activesync_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_iax_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_icecast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_imesh_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ipp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_irc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_jabber_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -250,13 +258,12 @@ void init_mail_pop_dissector(struct ndpi_detection_module_struct *ndpi_struct, u
|
||||
void init_mail_smtp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_maplestory_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mdns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_meebo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_megaco_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mgpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mms_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_msn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mpegts_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mssql_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mssql_tds_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mysql_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_netbios_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_netflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -288,6 +295,7 @@ void init_rtsp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
||||
void init_sflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_shoutcast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_sip_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_hep_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_skinny_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_skype_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_smb_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -295,6 +303,7 @@ void init_snmp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
||||
void init_socrates_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_sopcast_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_soulseek_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_socks_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_spotify_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ssh_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ssl_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -304,7 +313,6 @@ void init_steam_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
||||
void init_stun_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_syslog_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ssdp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_tds_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_teamspeak_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_teamviewer_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_telegram_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -314,7 +322,6 @@ void init_thunder_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
||||
void init_tor_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_tvants_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_tvuplayer_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_twitter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_usenet_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_veohtv_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_vhua_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -323,7 +330,6 @@ void init_vmware_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
||||
void init_vnc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_warcraft3_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_whois_das_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_winmx_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_world_of_warcraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_world_of_kung_fu_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_xbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
@@ -332,5 +338,24 @@ void init_yahoo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
||||
void init_zattoo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_zmq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_stracraft_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
|
||||
#endif /* __NDPI_PROTOCOLS_INCLUDE_FILE__ */
|
||||
void init_ubntac2_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_coap_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_mqtt_dissector (struct ndpi_detection_module_struct *ndpi_struct,u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_someip_dissector (struct ndpi_detection_module_struct *ndpi_struct,u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_rx_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_git_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_hangout_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_drda_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_bjnp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_smpp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_tinc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_fix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_nintendo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_checkmk_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_apple_push_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_whatsapp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_ajp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_fbzero_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
void init_memcached_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask);
|
||||
#endif /* __NDPI_PROTOCOLS_H__ */
|
||||
|
||||
+735
-338
File diff suppressed because it is too large
Load Diff
+1
-11
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* ndpi_unix.h
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-16 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -25,8 +24,6 @@
|
||||
#ifndef __NDPI_UNIX_INCLUDE_FILE__
|
||||
#define __NDPI_UNIX_INCLUDE_FILE__
|
||||
|
||||
#include "linux_compat.h"
|
||||
|
||||
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#include <netinet/in.h>
|
||||
#if defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
@@ -38,16 +35,9 @@
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
#ifndef __KERNEL__
|
||||
|
||||
#include <netinet/ip.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <netinet/udp.h>
|
||||
#else
|
||||
#include <linux/ip.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/udp.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __NDPI_UNIX_INCLUDE_FILE__ */
|
||||
|
||||
+30
-23
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* ndpi_win32.h
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-16 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,36 +21,44 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __NDPI_WIN32_INCLUDE_FILE__
|
||||
#define __NDPI_WIN32_INCLUDE_FILE__
|
||||
#ifndef __NDPI_WIN32_H__
|
||||
#define __NDPI_WIN32_H__
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Winsock2.h> /* winsock.h is included automatically */
|
||||
// fix a MinGW build issue "error: multiple storage classes in declaration specifiers" due to MinGW
|
||||
// defining extern for __forceinline types
|
||||
#if (defined(__MINGW32__) || defined(__MINGW64__)) && defined(__GNUC__)
|
||||
#define MINGW_GCC
|
||||
#define __mingw_forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||
#endif
|
||||
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <process.h>
|
||||
#include <io.h>
|
||||
#include <getopt.h> /* getopt from: http://www.pwilson.net/sample.html. */
|
||||
#include <process.h> /* for getpid() and the exec..() family */
|
||||
#include <getopt.h> /* getopt from: http://www.pwilson.net/sample.html. */
|
||||
#include <process.h> /* for getpid() and the exec..() family */
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#define snprintf _snprintf
|
||||
|
||||
extern char* strsep(char **stringp, const char *delim);
|
||||
#define _WS2TCPIP_H_ /* Avoid compilation problems */
|
||||
|
||||
#define IPVERSION 4 /* on *nix it is defined in netinet/ip.h */
|
||||
|
||||
extern char* strsep(char **sp, char *sep);
|
||||
|
||||
#define __attribute__(x)
|
||||
#include <stdint.h>
|
||||
#ifndef __GNUC__
|
||||
typedef unsigned char u_char;
|
||||
typedef unsigned short u_short;
|
||||
typedef unsigned int uint;
|
||||
typedef unsigned long u_long;
|
||||
#endif
|
||||
typedef u_char u_int8_t;
|
||||
typedef u_short u_int16_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
typedef unsigned __int64 u_int64_t;
|
||||
|
||||
typedef u_char u_int8_t;
|
||||
typedef u_short u_int16_t;
|
||||
typedef uint u_int32_t;
|
||||
typedef uint u_int;
|
||||
typedef unsigned __int64 u_int64_t;
|
||||
|
||||
#define pthread_t HANDLE
|
||||
#define pthread_mutex_t HANDLE
|
||||
@@ -62,12 +69,12 @@ typedef unsigned __int64 u_int64_t;
|
||||
#define pthread_rwlock_unlock pthread_mutex_unlock
|
||||
#define pthread_rwlock_destroy pthread_mutex_destroy
|
||||
|
||||
#define gmtime_r(a, b) gmtime(a) /* Already thread safe on windows */
|
||||
#define gmtime_r(a, b) memcpy(b, gmtime(a), sizeof(struct tm))
|
||||
|
||||
#define in_addr_t unsigned long
|
||||
|
||||
extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */);
|
||||
|
||||
#define sleep(a /* sec */) waitForNextEvent(1000*a /* ms */)
|
||||
|
||||
#endif /* Win32 */
|
||||
|
||||
#endif /* __NDPI_WIN32_INCLUDE_FILE__ */
|
||||
#endif /* __NDPI_WIN32_H__ */
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# Simple non-autotools dependent makefile
|
||||
#
|
||||
# ./autogen.sh
|
||||
# cd src/lib
|
||||
# make -f Makefile.simple
|
||||
#
|
||||
CFLAGS += -fPIC -DPIC -I../include -Ithird_party/include -DNDPI_LIB_COMPILATION -g
|
||||
RANLIB = ranlib
|
||||
|
||||
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
|
||||
HEADERS = $(wildcard ../include/*.h)
|
||||
|
||||
all: libndpi.a
|
||||
|
||||
ndpi_main.c: ndpi_content_match.c.inc
|
||||
|
||||
libndpi.a: $(OBJECTS)
|
||||
ar rc $@ $(OBJECTS)
|
||||
$(RANLIB) $@
|
||||
|
||||
%.o: %.c $(HEADERS) Makefile
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
/bin/rm -f libndpi.a $(OBJECTS)
|
||||
@@ -1,164 +0,0 @@
|
||||
lib_LTLIBRARIES = libndpi.la
|
||||
|
||||
CFLAGS += -fPIC -DPIC
|
||||
libndpi_la_CPPFLAGS = -I$(top_srcdir)/src/include/ -I$(top_srcdir)/src/lib/third_party/include/
|
||||
libndpi_la_LDFLAGS = -version-info 1:0:0 -export-symbols $(top_srcdir)/libndpi.sym
|
||||
|
||||
libndpi_la_includedir = $(includedir)/libndpi-@VERSION@/libndpi
|
||||
|
||||
libndpi_la_include_HEADERS = ../include/ndpi_api.h \
|
||||
../include/linux_compat.h \
|
||||
../include/ndpi_define.h \
|
||||
../include/ndpi_main.h \
|
||||
../include/ndpi_protocol_ids.h \
|
||||
../include/ndpi_protocols.h \
|
||||
../include/ndpi_typedefs.h \
|
||||
../include/ndpi_unix.h \
|
||||
../include/ndpi_win32.h
|
||||
|
||||
libndpi_la_SOURCES = ndpi_content_match.c.inc \
|
||||
ndpi_main.c \
|
||||
protocols/afp.c \
|
||||
protocols/aimini.c \
|
||||
protocols/applejuice.c \
|
||||
protocols/armagetron.c \
|
||||
protocols/ayiya.c \
|
||||
protocols/battlefield.c \
|
||||
protocols/bgp.c \
|
||||
protocols/bittorrent.c \
|
||||
protocols/ciscovpn.c \
|
||||
protocols/citrix.c \
|
||||
protocols/collectd.c \
|
||||
protocols/corba.c \
|
||||
protocols/crossfire.c \
|
||||
protocols/dcerpc.c \
|
||||
protocols/dhcp.c \
|
||||
protocols/dhcpv6.c \
|
||||
protocols/directconnect.c \
|
||||
protocols/directdownloadlink.c \
|
||||
protocols/dns.c \
|
||||
protocols/dofus.c \
|
||||
protocols/dropbox.c \
|
||||
protocols/eaq.c \
|
||||
protocols/edonkey.c \
|
||||
protocols/fasttrack.c \
|
||||
protocols/fiesta.c \
|
||||
protocols/filetopia.c \
|
||||
protocols/florensia.c \
|
||||
protocols/ftp_control.c \
|
||||
protocols/ftp_data.c \
|
||||
protocols/gnutella.c \
|
||||
protocols/gtp.c \
|
||||
protocols/guildwars.c \
|
||||
protocols/h323.c \
|
||||
protocols/halflife2_and_mods.c \
|
||||
protocols/http_activesync.c \
|
||||
protocols/http.c \
|
||||
protocols/iax.c \
|
||||
protocols/icecast.c \
|
||||
protocols/imesh.c \
|
||||
protocols/ipp.c \
|
||||
protocols/irc.c \
|
||||
protocols/jabber.c \
|
||||
protocols/kakaotalk_voice.c \
|
||||
protocols/kerberos.c \
|
||||
protocols/kontiki.c \
|
||||
protocols/ldap.c \
|
||||
protocols/lotus_notes.c \
|
||||
protocols/mail_imap.c \
|
||||
protocols/mail_pop.c \
|
||||
protocols/mail_smtp.c \
|
||||
protocols/maplestory.c \
|
||||
protocols/mdns.c \
|
||||
protocols/meebo.c \
|
||||
protocols/megaco.c \
|
||||
protocols/mgcp.c \
|
||||
protocols/mms.c \
|
||||
protocols/mpegts.c \
|
||||
protocols/msn.c \
|
||||
protocols/mssql.c \
|
||||
protocols/mysql.c \
|
||||
protocols/netbios.c \
|
||||
protocols/netflow.c \
|
||||
protocols/nfs.c \
|
||||
protocols/noe.c \
|
||||
protocols/non_tcp_udp.c \
|
||||
protocols/ntp.c \
|
||||
protocols/openft.c \
|
||||
protocols/openvpn.c \
|
||||
protocols/oracle.c \
|
||||
protocols/oscar.c \
|
||||
protocols/pando.c \
|
||||
protocols/pcanywhere.c \
|
||||
protocols/postgres.c \
|
||||
protocols/pplive.c \
|
||||
protocols/ppstream.c \
|
||||
protocols/pptp.c \
|
||||
protocols/qq.c \
|
||||
protocols/quake.c \
|
||||
protocols/quic.c \
|
||||
protocols/radius.c \
|
||||
protocols/rdp.c \
|
||||
protocols/redis_net.c \
|
||||
protocols/rsync.c \
|
||||
protocols/rtcp.c \
|
||||
protocols/rtmp.c \
|
||||
protocols/rtp.c \
|
||||
protocols/rtsp.c \
|
||||
protocols/sflow.c \
|
||||
protocols/shoutcast.c \
|
||||
protocols/sip.c \
|
||||
protocols/skinny.c \
|
||||
protocols/skype.c \
|
||||
protocols/smb.c \
|
||||
protocols/snmp.c \
|
||||
protocols/socks4.c \
|
||||
protocols/socks5.c \
|
||||
protocols/socrates.c \
|
||||
protocols/sopcast.c \
|
||||
protocols/soulseek.c \
|
||||
protocols/spotify.c \
|
||||
protocols/ssdp.c \
|
||||
protocols/ssh.c \
|
||||
protocols/ssl.c \
|
||||
protocols/starcraft.c \
|
||||
protocols/stealthnet.c \
|
||||
protocols/steam.c \
|
||||
protocols/stun.c \
|
||||
protocols/syslog.c \
|
||||
protocols/tcp_udp.c \
|
||||
protocols/tds.c \
|
||||
protocols/teamspeak.c \
|
||||
protocols/teamviewer.c \
|
||||
protocols/telegram.c \
|
||||
protocols/telnet.c \
|
||||
protocols/tftp.c \
|
||||
protocols/thunder.c \
|
||||
protocols/tor.c \
|
||||
protocols/teredo.c \
|
||||
protocols/tvants.c \
|
||||
protocols/tvuplayer.c \
|
||||
protocols/twitter.c \
|
||||
protocols/usenet.c \
|
||||
protocols/veohtv.c \
|
||||
protocols/viber.c \
|
||||
protocols/vhua.c \
|
||||
protocols/vmware.c \
|
||||
protocols/vnc.c \
|
||||
protocols/warcraft3.c \
|
||||
protocols/whoisdas.c \
|
||||
protocols/winmx.c \
|
||||
protocols/world_of_kung_fu.c \
|
||||
protocols/world_of_warcraft.c \
|
||||
protocols/xbox.c \
|
||||
protocols/xdmcp.c \
|
||||
protocols/yahoo.c \
|
||||
protocols/zattoo.c \
|
||||
protocols/zeromq.c \
|
||||
third_party/include/actypes.h \
|
||||
third_party/include/ahocorasick.h \
|
||||
third_party/include/node.h \
|
||||
third_party/include/sort.h \
|
||||
third_party/src/ahocorasick.c \
|
||||
third_party/src/node.c \
|
||||
third_party/src/sort.c
|
||||
+8393
-7379
File diff suppressed because it is too large
Load Diff
+2556
-1272
File diff suppressed because it is too large
Load Diff
+49
-36
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* afp.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2009-11 by ipoque GmbH
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,9 +23,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_AFP
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AFP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
struct afpHeader {
|
||||
u_int8_t flags, command;
|
||||
u_int16_t requestId;
|
||||
u_int32_t dataOffset, length, reserved;
|
||||
};
|
||||
|
||||
static void ndpi_int_afp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
@@ -36,39 +44,46 @@ static void ndpi_int_afp_add_connection(struct ndpi_detection_module_struct *ndp
|
||||
void ndpi_search_afp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
// struct ndpi_id_struct *src = flow->src;
|
||||
// struct ndpi_id_struct *dst = flow->dst;
|
||||
|
||||
/*
|
||||
* this will detect the OpenSession command of the Data Stream Interface (DSI) protocol
|
||||
* which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks
|
||||
*/
|
||||
if (packet->payload_packet_len >= 22 && get_u_int16_t(packet->payload, 0) == htons(0x0004) &&
|
||||
get_u_int16_t(packet->payload, 2) == htons(0x0001) && get_u_int32_t(packet->payload, 4) == 0 &&
|
||||
get_u_int32_t(packet->payload, 8) == htonl(packet->payload_packet_len - 16) &&
|
||||
get_u_int32_t(packet->payload, 12) == 0 && get_u_int16_t(packet->payload, 16) == htons(0x0104)) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP: DSI OpenSession detected.\n");
|
||||
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
NDPI_LOG_DBG(ndpi_struct, "search AFP\n");
|
||||
|
||||
if (packet->payload_packet_len >= sizeof(struct afpHeader)) {
|
||||
struct afpHeader *h = (struct afpHeader*)packet->payload;
|
||||
|
||||
if(packet->payload_packet_len > 128) {
|
||||
/*
|
||||
When we transfer a large data chunk, unless we have observed
|
||||
the initial connection, we need to discard these packets
|
||||
as they are not an indication that this flow is not AFP
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* this will detect the OpenSession command of the Data Stream Interface (DSI) protocol
|
||||
* which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks
|
||||
*/
|
||||
if (packet->payload_packet_len >= 22 && get_u_int16_t(packet->payload, 0) == htons(0x0004) &&
|
||||
get_u_int16_t(packet->payload, 2) == htons(0x0001) && get_u_int32_t(packet->payload, 4) == 0 &&
|
||||
get_u_int32_t(packet->payload, 8) == htonl(packet->payload_packet_len - 16) &&
|
||||
get_u_int32_t(packet->payload, 12) == 0 && get_u_int16_t(packet->payload, 16) == htons(0x0104)) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found AFP: DSI OpenSession\n");
|
||||
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
if((h->flags <= 1)
|
||||
&& ((h->command >= 1) && (h->command <= 8))
|
||||
&& (h->reserved == 0)
|
||||
&& (packet->payload_packet_len >= (sizeof(struct afpHeader)+ntohl(h->length)))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found AFP: DSI\n");
|
||||
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* detection of GetStatus command of DSI protocl
|
||||
*/
|
||||
if (packet->payload_packet_len >= 18 && get_u_int16_t(packet->payload, 0) == htons(0x0003) &&
|
||||
get_u_int16_t(packet->payload, 2) == htons(0x0001) && get_u_int32_t(packet->payload, 4) == 0 &&
|
||||
get_u_int32_t(packet->payload, 8) == htonl(packet->payload_packet_len - 16) &&
|
||||
get_u_int32_t(packet->payload, 12) == 0 && get_u_int16_t(packet->payload, 16) == htons(0x0f00)) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP: DSI GetStatus detected.\n");
|
||||
ndpi_int_afp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_AFP, ndpi_struct, NDPI_LOG_DEBUG, "AFP excluded.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AFP);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,5 +98,3 @@ void init_afp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+37
-41
@@ -2,7 +2,7 @@
|
||||
* aimini.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,9 +23,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_AIMINI
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AIMINI
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_aimini_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow/* , */
|
||||
@@ -50,43 +52,40 @@ static u_int8_t is_special_aimini_host(struct ndpi_int_one_line_struct host_line
|
||||
void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "search aimini.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search aimini\n");
|
||||
|
||||
if (packet->udp != NULL) {
|
||||
if (flow->l4.udp.aimini_stage == 0) {
|
||||
if (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b) {
|
||||
flow->l4.udp.aimini_stage = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 1.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 1\n");
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 136
|
||||
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
|
||||
flow->l4.udp.aimini_stage = 4;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 4.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 4\n");
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
|
||||
flow->l4.udp.aimini_stage = 7;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 7.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 7\n");
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
|
||||
flow->l4.udp.aimini_stage = 10;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 10.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 10\n");
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
|
||||
flow->l4.udp.aimini_stage = 13;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 13.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 13\n");
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
|
||||
flow->l4.udp.aimini_stage = 16;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 16.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 16\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -96,7 +95,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (flow->l4.udp.aimini_stage == 1 && packet->payload_packet_len > 100
|
||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115) {
|
||||
flow->l4.udp.aimini_stage = 2;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 2.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 2\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 2 &&
|
||||
@@ -104,14 +103,14 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
(packet->payload_packet_len == 64 && get_u_int16_t(packet->payload, 0) == htons(0x010b)) ||
|
||||
(packet->payload_packet_len == 88 && get_u_int16_t(packet->payload, 0) == ntohs(0x0115)))) {
|
||||
flow->l4.udp.aimini_stage = 3;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 3.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 3\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 3
|
||||
&& ((packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)
|
||||
|| (packet->payload_packet_len == 64 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010b)
|
||||
|| (packet->payload_packet_len > 100 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0115))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "found aimini (64, 0x010b), (>300, 0x0115), "
|
||||
NDPI_LOG_INFO(ndpi_struct, "found aimini (64, 0x010b), (>300, 0x0115), "
|
||||
"(16, 0x010c || 64, 0x010b), (16, 0x010c || 64, 0x010b || >100, 0x0115).\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
@@ -122,14 +121,14 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (flow->l4.udp.aimini_stage == 4 && packet->payload_packet_len == 136
|
||||
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9 || ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165)) {
|
||||
flow->l4.udp.aimini_stage = 5;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 5.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 5\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 5 && (packet->payload_packet_len == 136
|
||||
&& (ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9
|
||||
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x0165))) {
|
||||
flow->l4.udp.aimini_stage = 6;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 6.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 6\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 6 && ((packet->payload_packet_len == 136
|
||||
@@ -137,7 +136,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
|| ntohs(get_u_int16_t(packet->payload, 0)) == 0x01c9))
|
||||
|| (packet->payload_packet_len == 32
|
||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found aimini (136, 0x01c9), (136, 0x01c9)," "(136, 0x01c9),(136, 0x01c9 || 32, 0x01ca).\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
@@ -148,18 +147,18 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (flow->l4.udp.aimini_stage == 7 && packet->payload_packet_len == 88
|
||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101) {
|
||||
flow->l4.udp.aimini_stage = 8;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 8.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 8\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 8
|
||||
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
|
||||
flow->l4.udp.aimini_stage = 9;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 9.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 9\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 9
|
||||
&& (packet->payload_packet_len == 88 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0101)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found aimini (88, 0x0101), (88, 0x0101)," "(88, 0x0101),(88, 0x0101).\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
@@ -170,19 +169,19 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (flow->l4.udp.aimini_stage == 10 && packet->payload_packet_len == 104
|
||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102) {
|
||||
flow->l4.udp.aimini_stage = 11;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 11.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 11\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 11
|
||||
&& (packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)) {
|
||||
flow->l4.udp.aimini_stage = 12;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 12.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 12\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 12
|
||||
&& ((packet->payload_packet_len == 104 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0102)
|
||||
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found aimini (104, 0x0102), (104, 0x0102), " "(104, 0x0102), (104, 0x0102).\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
@@ -193,20 +192,20 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (flow->l4.udp.aimini_stage == 13 && packet->payload_packet_len == 32
|
||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca) {
|
||||
flow->l4.udp.aimini_stage = 14;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 14.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 14\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 14
|
||||
&& ((packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca)
|
||||
|| (packet->payload_packet_len == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166))) {
|
||||
flow->l4.udp.aimini_stage = 15;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 15.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 15\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 15
|
||||
&& ((packet->payload_packet_len == 136 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x0166)
|
||||
|| (packet->payload_packet_len == 32 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x01ca))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found aimini (32,0x01ca), (32,0x01ca), (32,0x01ca), ((136, 0x0166)||(32,0x01ca)).\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
@@ -217,18 +216,18 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (flow->l4.udp.aimini_stage == 16 && packet->payload_packet_len == 16
|
||||
&& ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c) {
|
||||
flow->l4.udp.aimini_stage = 17;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 17.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 17\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 17
|
||||
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
|
||||
flow->l4.udp.aimini_stage = 18;
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "stage = 18.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage = 18\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.udp.aimini_stage == 18
|
||||
&& (packet->payload_packet_len == 16 && ntohs(get_u_int16_t(packet->payload, 0)) == 0x010c)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found aimini (16, 0x010c), (16, 0x010c), (16, 0x010c), (16, 0x010c).\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
@@ -238,11 +237,11 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
(memcmp(packet->payload, "GET /player/", NDPI_STATICSTRING_LEN("GET /player/")) == 0)) ||
|
||||
(packet->payload_packet_len > NDPI_STATICSTRING_LEN("GET /play/?fid=") &&
|
||||
(memcmp(packet->payload, "GET /play/?fid=", NDPI_STATICSTRING_LEN("GET /play/?fid=")) == 0))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "HTTP packet detected.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "HTTP packet detected\n");
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
if (packet->host_line.ptr != NULL && packet->host_line.len > 11
|
||||
&& (memcmp(&packet->host_line.ptr[packet->host_line.len - 11], ".aimini.net", 11) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "AIMINI HTTP traffic detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found AIMINI HTTP traffic\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -255,8 +254,8 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
NDPI_STATICSTRING_LEN("download/")) == 0) {
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
if (is_special_aimini_host(packet->host_line) == 1) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"AIMINI HTTP traffic detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found AIMINI HTTP traffic\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -266,8 +265,8 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
NDPI_STATICSTRING_LEN("upload/")) == 0) {
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
if (is_special_aimini_host(packet->host_line) == 1) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"AIMINI HTTP traffic detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found AIMINI HTTP traffic detected.\n");
|
||||
ndpi_int_aimini_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -276,8 +275,7 @@ void ndpi_search_aimini(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_AIMINI, ndpi_struct, NDPI_LOG_DEBUG, "exclude aimini.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AIMINI);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
|
||||
}
|
||||
|
||||
@@ -293,5 +291,3 @@ void init_aimini_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
/*
|
||||
* ajp.c
|
||||
*
|
||||
* Copyright (C) 2018 by Leonn Paiva <leonn.paiva@gmail.com>
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AJP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
enum ajp_direction {
|
||||
AJP_SERVER_TO_CONTAINER = 0x1234,
|
||||
AJP_CONTAINER_TO_SERVER = 0x4142
|
||||
};
|
||||
|
||||
enum ajp_packet_type {
|
||||
AJP_UNKNOWN = 0,
|
||||
|
||||
/* packet types */
|
||||
AJP_FORWARD_REQUEST = 2,
|
||||
AJP_SEND_BODY_CHUNK = 3,
|
||||
AJP_SEND_HEADERS = 4,
|
||||
AJP_END_RESPONSE = 5,
|
||||
AJP_GET_BODY_CHUNK = 6,
|
||||
AJP_SHUTDOWN = 7,
|
||||
AJP_PING = 8,
|
||||
AJP_CPONG = 9,
|
||||
AJP_CPING = 10,
|
||||
AJP_BODY = 11
|
||||
};
|
||||
|
||||
struct ajp_header {
|
||||
uint16_t magic;
|
||||
uint16_t len;
|
||||
uint8_t code;
|
||||
};
|
||||
|
||||
static void set_ajp_detected(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
|
||||
if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
||||
ndpi_search_tcp_or_udp(ndpi_struct, flow);
|
||||
|
||||
/* If no custom protocol has been detected */
|
||||
/* if(flow->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) */
|
||||
ndpi_int_reset_protocol(flow);
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_AJP);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************************************/
|
||||
|
||||
static void ndpi_check_ajp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ajp_header ajp_hdr;
|
||||
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
if (packet->payload_packet_len < 5 /* ajp_header size*/) {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
ajp_hdr = *((struct ajp_header *) (packet->payload));
|
||||
ajp_hdr.magic = ntohs(ajp_hdr.magic);
|
||||
ajp_hdr.len = ntohs(ajp_hdr.len);
|
||||
|
||||
if (ajp_hdr.len > 0 && ajp_hdr.magic == AJP_SERVER_TO_CONTAINER) {
|
||||
if (ajp_hdr.code == AJP_FORWARD_REQUEST || ajp_hdr.code == AJP_SHUTDOWN
|
||||
|| ajp_hdr.code == AJP_PING || ajp_hdr.code == AJP_CPING) {
|
||||
|
||||
set_ajp_detected(ndpi_struct, flow);
|
||||
|
||||
} else {
|
||||
NDPI_LOG_DBG(ndpi_struct, "Invalid AJP request type");
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
} else if (ajp_hdr.len > 0 && ajp_hdr.magic == AJP_CONTAINER_TO_SERVER) {
|
||||
if (ajp_hdr.code == AJP_SEND_BODY_CHUNK || ajp_hdr.code == AJP_SEND_HEADERS
|
||||
|| ajp_hdr.code == AJP_END_RESPONSE || ajp_hdr.code == AJP_GET_BODY_CHUNK
|
||||
|| ajp_hdr.code == AJP_CPONG) {
|
||||
|
||||
set_ajp_detected(ndpi_struct, flow);
|
||||
|
||||
} else {
|
||||
NDPI_LOG_DBG(ndpi_struct, "Invalid AJP response type");
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
} else {
|
||||
NDPI_LOG_DBG(ndpi_struct,"Invalid AJP packet\n");
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
|
||||
void ndpi_search_ajp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// Break after 20 packets.
|
||||
if(flow->packet_counter > 20) {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search AJP\n");
|
||||
ndpi_check_ajp(ndpi_struct, flow);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/* ********************************* */
|
||||
|
||||
|
||||
void init_ajp_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("AJP", ndpi_struct, detection_bitmask,
|
||||
*id, NDPI_PROTOCOL_AJP, ndpi_search_ajp,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* amqp.c
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AMQP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
PACK_ON
|
||||
struct amqp_header {
|
||||
u_int8_t ptype;
|
||||
u_int16_t channel;
|
||||
u_int32_t length;
|
||||
u_int16_t class_id, method;
|
||||
} PACK_OFF;
|
||||
|
||||
static void ndpi_int_amqp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMQP, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search amqp\n");
|
||||
|
||||
if (packet->tcp != NULL) {
|
||||
if(packet->payload_packet_len > sizeof(struct amqp_header)) {
|
||||
struct amqp_header *h = (struct amqp_header*)packet->payload;
|
||||
|
||||
if(h->ptype <= 3) {
|
||||
u_int32_t length = htonl(h->length);
|
||||
|
||||
if(((length+8) >= packet->payload_packet_len)
|
||||
&& (length < 32768) /* Upper bound */) {
|
||||
u_int16_t class_id = htons(h->class_id);
|
||||
|
||||
if((class_id >= 10) /* Connection */
|
||||
&& (class_id <= 110) /* Tunnel */) {
|
||||
u_int16_t method = htons(h->method);
|
||||
|
||||
if(method <= 120 /* Method basic NACK */) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found amqp over tcp\n");
|
||||
ndpi_int_amqp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_amqp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||
ndpi_set_bitmask_protocol_detection("AMQP", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_AMQP,
|
||||
ndpi_search_amqp,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* apple_push.c
|
||||
*
|
||||
* Copyright (C) 2018 by ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_APPLE_PUSH
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
static void ndpi_check_apple_push(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
/* https://support.apple.com/en-us/HT203609 */
|
||||
if(((ntohl(packet->iph->saddr) & 0xFF000000 /* 255.0.0.0 */) == 0x11000000 /* 17.0.0.0/8 */)
|
||||
|| ((ntohl(packet->iph->daddr) & 0xFF000000 /* 255.0.0.0 */) == 0x11000000 /* 17.0.0.0/8 */)) {
|
||||
u_int16_t apple_push_port = ntohs(5223);
|
||||
u_int16_t notification_apn_port = ntohs(2195);
|
||||
u_int16_t apn_feedback_port = ntohs(2196);
|
||||
|
||||
if(((packet->tcp->source == apple_push_port) || (packet->tcp->dest == apple_push_port))
|
||||
|| ((packet->tcp->source == notification_apn_port) || (packet->tcp->dest == notification_apn_port))
|
||||
|| ((packet->tcp->source == apn_feedback_port) || (packet->tcp->dest == apn_feedback_port))
|
||||
) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found apple_push\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_APPLE_PUSH, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
void ndpi_search_apple_push(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search apple_push\n");
|
||||
|
||||
/* skip marked packets */
|
||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_APPLE_PUSH)
|
||||
ndpi_check_apple_push(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
void init_apple_push_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("APPLE_PUSH", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_APPLE_PUSH,
|
||||
ndpi_search_apple_push,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_TCP,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* applejuice.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,9 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_APPLEJUICE
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_APPLEJUICE
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_applejuice_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
@@ -37,21 +39,18 @@ void ndpi_search_applejuice_tcp(struct ndpi_detection_module_struct *ndpi_struct
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "search applejuice.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search applejuice\n");
|
||||
|
||||
if ((packet->payload_packet_len > 7) && (packet->payload[6] == 0x0d)
|
||||
&& (packet->payload[7] == 0x0a)
|
||||
&& (memcmp(packet->payload, "ajprot", 6) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "detected applejuice.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found applejuice\n");
|
||||
ndpi_int_applejuice_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_APPLEJUICE, ndpi_struct, NDPI_LOG_DEBUG, "exclude applejuice.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_APPLEJUICE);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,5 +65,3 @@ void init_applejuice_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* armagetron.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,26 +22,24 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* include files */
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_ARMAGETRON
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_ARMAGETRON
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_armagetron_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ARMAGETRON, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "search armagetron.\n");
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search armagetron\n");
|
||||
|
||||
if (packet->payload_packet_len > 10) {
|
||||
/* login request */
|
||||
@@ -51,7 +49,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
||||
goto exclude;
|
||||
if (get_u_int16_t(packet->payload, 6) == htons(0x0008)
|
||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "detected armagetron.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found armagetron\n");
|
||||
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -64,7 +62,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
||||
goto exclude;
|
||||
if (get_u_int32_t(packet->payload, 6) == htonl(0x00000500) && get_u_int32_t(packet->payload, 6 + 4) == htonl(0x00010000)
|
||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "detected armagetron.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found armagetron\n");
|
||||
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -84,7 +82,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
||||
&& (get_u_int32_t(packet->payload, 6 + 10 + val) == htonl(0x00010000)
|
||||
|| get_u_int32_t(packet->payload, 6 + 10 + val) == htonl(0x00000001))
|
||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "detected armagetron.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found armagetron\n");
|
||||
ndpi_int_armagetron_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -93,8 +91,7 @@ void ndpi_search_armagetron_udp(struct ndpi_detection_module_struct *ndpi_struct
|
||||
}
|
||||
|
||||
exclude:
|
||||
NDPI_LOG(NDPI_PROTOCOL_ARMAGETRON, ndpi_struct, NDPI_LOG_DEBUG, "exclude armagetron.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_ARMAGETRON);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +107,3 @@ void init_armagetron_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* flash.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* ftp.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -43,6 +43,8 @@ static void ndpi_int_ftp_add_connection(struct ndpi_detection_module_struct *ndp
|
||||
*/
|
||||
#if !defined(WIN32)
|
||||
static inline
|
||||
#elif defined(MINGW_GCC)
|
||||
__mingw_forceinline static
|
||||
#else
|
||||
__forceinline static
|
||||
#endif
|
||||
@@ -78,8 +80,11 @@ u_int8_t ndpi_int_check_possible_ftp_command(const struct ndpi_packet_struct *pa
|
||||
/**
|
||||
* ftp replies are are 3-digit number followed by space or hyphen
|
||||
*/
|
||||
|
||||
#if !defined(WIN32)
|
||||
static inline
|
||||
#elif defined(MINGW_GCC)
|
||||
__mingw_forceinline static
|
||||
#else
|
||||
__forceinline static
|
||||
#endif
|
||||
@@ -108,6 +113,8 @@ u_int8_t ndpi_int_check_possible_ftp_reply(const struct ndpi_packet_struct *pack
|
||||
*/
|
||||
#if !defined(WIN32)
|
||||
static inline
|
||||
#elif defined(MINGW_GCC)
|
||||
__mingw_forceinline static
|
||||
#else
|
||||
__forceinline static
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* manolito.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* popo.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* secondlife.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ayiya.c
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -26,9 +26,11 @@
|
||||
http://tools.ietf.org/html/rfc4891
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_AYIYA
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_AYIYA
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
struct ayiya {
|
||||
u_int8_t flags[3];
|
||||
@@ -42,6 +44,8 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search AYIYA\n");
|
||||
|
||||
if(packet->udp && (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN)) {
|
||||
/* Ayiya is udp based, port 5072 */
|
||||
if ((packet->udp->source == htons(5072) || packet->udp->dest == htons(5072))
|
||||
@@ -51,17 +55,19 @@ void ndpi_search_ayiya(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
/* FINISH */
|
||||
struct ayiya *a = (struct ayiya*)packet->payload;
|
||||
u_int32_t epoch = ntohl(a->epoch), now;
|
||||
u_int32_t fireyears = 86400 * 365 * 5;
|
||||
u_int32_t fiveyears = 86400 * 365 * 5;
|
||||
|
||||
now = flow->packet.tick_timestamp;
|
||||
|
||||
if((epoch >= (now - fireyears)) && (epoch <= (now+86400 /* 1 day */)))
|
||||
if((epoch >= (now - fiveyears)) && (epoch <= (now+86400 /* 1 day */))) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found AYIYA\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AYIYA, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_AYIYA);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,5 +83,3 @@ void init_ayiya_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* battlefield.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,10 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_BATTLEFIELD
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BATTLEFIELD
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
static void ndpi_int_battlefield_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
@@ -53,12 +54,12 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s
|
||||
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_BATTLEFIELD) {
|
||||
if (src != NULL && ((u_int32_t)
|
||||
(packet->tick_timestamp - src->battlefield_ts) < ndpi_struct->battlefield_timeout)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
"battlefield : save src connection packet detected\n");
|
||||
src->battlefield_ts = packet->tick_timestamp;
|
||||
} else if (dst != NULL && ((u_int32_t)
|
||||
(packet->tick_timestamp - dst->battlefield_ts) < ndpi_struct->battlefield_timeout)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
"battlefield : save dst connection packet detected\n");
|
||||
dst->battlefield_ts = packet->tick_timestamp;
|
||||
}
|
||||
@@ -74,8 +75,7 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s
|
||||
}
|
||||
} else if (flow->l4.udp.battlefield_stage == 2 - packet->packet_direction) {
|
||||
if (packet->payload_packet_len > 8 && get_u_int32_t(packet->payload, 0) == flow->l4.udp.battlefield_msg_id) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "Battlefield message and reply detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Battlefield message and reply detected\n");
|
||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -91,28 +91,26 @@ void ndpi_search_battlefield(struct ndpi_detection_module_struct *ndpi_struct, s
|
||||
} else if (flow->l4.udp.battlefield_stage == 4 - packet->packet_direction) {
|
||||
if (packet->payload_packet_len == 7
|
||||
&& (packet->payload[0] == 0x02 || packet->payload[packet->payload_packet_len - 1] == 0xe0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"Battlefield message and reply detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Battlefield message and reply detected\n");
|
||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (packet->payload_packet_len == 18 && memcmp(&packet->payload[5], "battlefield2\x00", 13) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG, "Battlefield 2 hello packet detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Battlefield 2 hello packet detected\n");
|
||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
} else if (packet->payload_packet_len > 10 &&
|
||||
(memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\x50\xb9\x10\x11", 10) == 0
|
||||
|| memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\x30\xb9\x10\x11", 10) == 0
|
||||
|| memcmp(packet->payload, "\x11\x20\x00\x01\x00\x00\xa0\x98\x00\x11", 10) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BATTLEFIELD, ndpi_struct, NDPI_LOG_DEBUG, "Battlefield safe pattern detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Battlefield safe pattern detected\n");
|
||||
ndpi_int_battlefield_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BATTLEFIELD);
|
||||
return;
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -126,5 +124,3 @@ void init_battlefield_dissector(struct ndpi_detection_module_struct *ndpi_struct
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+22
-25
@@ -1,8 +1,7 @@
|
||||
/*
|
||||
* bgp.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2016-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,36 +21,36 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_BGP
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BGP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
static void ndpi_int_bgp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
/* this detection also works asymmetrically */
|
||||
void ndpi_search_bgp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int16_t bgp_port = htons(179);
|
||||
|
||||
if (packet->payload_packet_len > 18 &&
|
||||
get_u_int64_t(packet->payload, 0) == 0xffffffffffffffffULL &&
|
||||
get_u_int64_t(packet->payload, 8) == 0xffffffffffffffffULL &&
|
||||
ntohs(get_u_int16_t(packet->payload, 16)) <= packet->payload_packet_len &&
|
||||
(packet->tcp->dest == htons(179) || packet->tcp->source == htons(179))
|
||||
&& packet->payload[18] < 5) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BGP, ndpi_struct, NDPI_LOG_DEBUG, "BGP detected.\n");
|
||||
ndpi_int_bgp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
NDPI_LOG_DBG(ndpi_struct, "search BGP\n");
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BGP);
|
||||
if(packet->tcp) {
|
||||
if(packet->payload_packet_len > 18
|
||||
&& packet->payload[18] < 5
|
||||
&& ((packet->tcp->dest == bgp_port) || (packet->tcp->source == bgp_port))
|
||||
&& (get_u_int64_t(packet->payload, 0) == 0xffffffffffffffffULL)
|
||||
&& (get_u_int64_t(packet->payload, 8) == 0xffffffffffffffffULL)
|
||||
&& (ntohs(get_u_int16_t(packet->payload, 16)) <= packet->payload_packet_len)) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BGP\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BGP, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,5 +65,3 @@ void init_bgp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+169
-159
@@ -2,7 +2,7 @@
|
||||
* bittorrent.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,17 +23,60 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_BITTORRENT
|
||||
#define NDPI_PROTOCOL_UNSAFE_DETECTION 0
|
||||
#define NDPI_PROTOCOL_SAFE_DETECTION 1
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_PROTOCOL_PLAIN_DETECTION 0
|
||||
#define NDPI_PROTOCOL_WEBSEED_DETECTION 2
|
||||
static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow,
|
||||
const u_int8_t save_detection, const u_int8_t encrypted_connection/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */)
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BITTORRENT
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#define NDPI_PROTOCOL_UNSAFE_DETECTION 0
|
||||
#define NDPI_PROTOCOL_SAFE_DETECTION 1
|
||||
|
||||
#define NDPI_PROTOCOL_PLAIN_DETECTION 0
|
||||
#define NDPI_PROTOCOL_WEBSEED_DETECTION 2
|
||||
|
||||
|
||||
struct ndpi_utp_hdr {
|
||||
u_int8_t h_version:4, h_type:4, next_extension;
|
||||
u_int16_t connection_id;
|
||||
u_int32_t ts_usec, tdiff_usec, window_size;
|
||||
u_int16_t sequence_nr, ack_nr;
|
||||
};
|
||||
|
||||
static u_int8_t is_utp_pkt(const u_int8_t *payload, u_int payload_len) {
|
||||
struct ndpi_utp_hdr *h = (struct ndpi_utp_hdr*)payload;
|
||||
|
||||
if(payload_len < sizeof(struct ndpi_utp_hdr)) return(0);
|
||||
if(h->h_version != 1) return(0);
|
||||
if(h->h_type > 4) return(0);
|
||||
if(h->next_extension > 2) return(0);
|
||||
if(ntohl(h->window_size) > 65565) return(0);
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
static void ndpi_add_connection_as_bittorrent(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
int bt_offset, int check_hash,
|
||||
const u_int8_t save_detection, const u_int8_t encrypted_connection)
|
||||
{
|
||||
if(check_hash) {
|
||||
const char *bt_hash = NULL; /* 20 bytes long */
|
||||
|
||||
if(bt_offset == -1) {
|
||||
const char *bt_magic = ndpi_strnstr((const char *)flow->packet.payload,
|
||||
"BitTorrent protocol", flow->packet.payload_packet_len);
|
||||
|
||||
if(bt_magic)
|
||||
bt_hash = &bt_magic[19];
|
||||
} else
|
||||
bt_hash = (const char*)&flow->packet.payload[28];
|
||||
|
||||
if(!ndpi_struct->disable_metadata_export) {
|
||||
if(bt_hash) memcpy(flow->protos.bittorrent.hash, bt_hash, 20);
|
||||
}
|
||||
}
|
||||
|
||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_BITTORRENT, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
@@ -43,96 +86,82 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int16_t a = 0;
|
||||
|
||||
if (packet->payload_packet_len == 1 && packet->payload[0] == 0x13) {
|
||||
if(packet->payload_packet_len == 1 && packet->payload[0] == 0x13) {
|
||||
/* reset stage back to 0 so we will see the next packet here too */
|
||||
flow->bittorrent_stage = 0;
|
||||
return 0;
|
||||
}
|
||||
if (flow->packet_counter == 2 && packet->payload_packet_len > 20) {
|
||||
|
||||
if (memcmp(&packet->payload[0], "BitTorrent protocol", 19) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
||||
ndpi_struct, NDPI_LOG_TRACE, "BT: plain BitTorrent protocol detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_REAL_PROTOCOL */);
|
||||
if(flow->packet_counter == 2 && packet->payload_packet_len > 20) {
|
||||
if(memcmp(&packet->payload[0], "BitTorrent protocol", 19) == 0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: plain\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, 19, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (packet->payload_packet_len > 20) {
|
||||
if(packet->payload_packet_len > 20) {
|
||||
/* test for match 0x13+"BitTorrent protocol" */
|
||||
if (packet->payload[0] == 0x13) {
|
||||
if (memcmp(&packet->payload[1], "BitTorrent protocol", 19) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
||||
ndpi_struct, NDPI_LOG_TRACE, "BT: plain BitTorrent protocol detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_REAL_PROTOCOL */);
|
||||
if(packet->payload[0] == 0x13) {
|
||||
if(memcmp(&packet->payload[1], "BitTorrent protocol", 19) == 0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: plain\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, 20, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (packet->payload_packet_len > 23 && memcmp(packet->payload, "GET /webseed?info_hash=", 23) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, "BT: plain webseed BitTorrent protocol detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
if(packet->payload_packet_len > 23 && memcmp(packet->payload, "GET /webseed?info_hash=", 23) == 0) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: plain webseed\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
/* seen Azureus as server for webseed, possibly other servers existing, to implement */
|
||||
/* is Server: hypertracker Bittorrent? */
|
||||
/* no asymmetric detection possible for answer of pattern "GET /data?fid=". */
|
||||
if (packet->payload_packet_len > 60
|
||||
if(packet->payload_packet_len > 60
|
||||
&& memcmp(packet->payload, "GET /data?fid=", 14) == 0 && memcmp(&packet->payload[54], "&size=", 6) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, "BT: plain Bitcomet persistent seed protocol detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: plain Bitcomet persistent seed\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
if (packet->payload_packet_len > 90 && (memcmp(packet->payload, "GET ", 4) == 0
|
||||
if(packet->payload_packet_len > 90 && (memcmp(packet->payload, "GET ", 4) == 0
|
||||
|| memcmp(packet->payload, "POST ", 5) == 0)) {
|
||||
const u_int8_t *ptr = &packet->payload[4];
|
||||
u_int16_t len = packet->payload_packet_len - 4;
|
||||
a = 0;
|
||||
|
||||
|
||||
/* parse complete get packet here into line structure elements */
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
/* answer to this pattern is HTTP....Server: hypertracker */
|
||||
if (packet->user_agent_line.ptr != NULL
|
||||
if(packet->user_agent_line.ptr != NULL
|
||||
&& ((packet->user_agent_line.len > 8 && memcmp(packet->user_agent_line.ptr, "Azureus ", 8) == 0)
|
||||
|| (packet->user_agent_line.len >= 10 && memcmp(packet->user_agent_line.ptr, "BitTorrent", 10) == 0)
|
||||
|| (packet->user_agent_line.len >= 11 && memcmp(packet->user_agent_line.ptr, "BTWebClient", 11) == 0))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, "Azureus /Bittorrent user agent line detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: Azureus /Bittorrent user agent\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (packet->user_agent_line.ptr != NULL
|
||||
&& (packet->user_agent_line.len >= 9 && memcmp(packet->user_agent_line.ptr, "Shareaza ", 9) == 0)
|
||||
&& (packet->parsed_lines > 8 && packet->line[8].ptr != 0
|
||||
&& packet->line[8].len >= 9 && memcmp(packet->line[8].ptr, "X-Queue: ", 9) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, "Bittorrent Shareaza detected.\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
if(packet->user_agent_line.ptr != NULL
|
||||
&& (packet->user_agent_line.len >= 9 && memcmp(packet->user_agent_line.ptr, "Shareaza ", 9) == 0)
|
||||
&& (packet->parsed_lines > 8 && packet->line[8].ptr != 0
|
||||
&& packet->line[8].len >= 9 && memcmp(packet->line[8].ptr, "X-Queue: ", 9) == 0)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: Shareaza detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* this is a self built client, not possible to catch asymmetrically */
|
||||
if ((packet->parsed_lines == 10 || (packet->parsed_lines == 11 && packet->line[11].len == 0))
|
||||
if((packet->parsed_lines == 10 || (packet->parsed_lines == 11 && packet->line[11].len == 0))
|
||||
&& packet->user_agent_line.ptr != NULL
|
||||
&& packet->user_agent_line.len > 12
|
||||
&& memcmp(packet->user_agent_line.ptr, "Mozilla/4.0 ",
|
||||
@@ -159,16 +188,14 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
&& packet->line[8].ptr != NULL
|
||||
&& packet->line[8].len > 22 && memcmp(packet->line[8].ptr, "Cache-Control: no-cache", 23) == 0) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "Bitcomet LTS detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: Bitcomet LTS\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* FlashGet pattern */
|
||||
if (packet->parsed_lines == 8
|
||||
if(packet->parsed_lines == 8
|
||||
&& packet->user_agent_line.ptr != NULL
|
||||
&& packet->user_agent_line.len > (sizeof("Mozilla/4.0 (compatible; MSIE 6.0;") - 1)
|
||||
&& memcmp(packet->user_agent_line.ptr, "Mozilla/4.0 (compatible; MSIE 6.0;",
|
||||
@@ -186,14 +213,13 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
&& packet->line[6].ptr != NULL
|
||||
&& packet->line[6].len > 21 && memcmp(packet->line[6].ptr, "Connection: Keep-Alive", 22) == 0) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "FlashGet detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: FlashGet\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
|
||||
}
|
||||
if (packet->parsed_lines == 7
|
||||
|
||||
if(packet->parsed_lines == 7
|
||||
&& packet->user_agent_line.ptr != NULL
|
||||
&& packet->user_agent_line.len > (sizeof("Mozilla/4.0 (compatible; MSIE 6.0;") - 1)
|
||||
&& memcmp(packet->user_agent_line.ptr, "Mozilla/4.0 (compatible; MSIE 6.0;",
|
||||
@@ -208,28 +234,25 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
&& packet->line[5].ptr != NULL
|
||||
&& packet->line[5].len > 21 && memcmp(packet->line[5].ptr, "Connection: Keep-Alive", 22) == 0) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_TRACE, "FlashGet detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: FlashGet\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_UNSAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
/* answer to this pattern is not possible to implement asymmetrically */
|
||||
while (1) {
|
||||
if (len < 50 || ptr[0] == 0x0d) {
|
||||
if(len < 50 || ptr[0] == 0x0d) {
|
||||
goto ndpi_end_bt_tracker_check;
|
||||
}
|
||||
if (memcmp(ptr, "info_hash=", 10) == 0) {
|
||||
if(memcmp(ptr, "info_hash=", 10) == 0) {
|
||||
break;
|
||||
}
|
||||
len--;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, " BT stat: tracker info hash found\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, " BT stat: tracker info hash found\n");
|
||||
|
||||
/* len is > 50, so save operation here */
|
||||
len -= 10;
|
||||
@@ -237,40 +260,40 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
|
||||
/* parse bt hash */
|
||||
for (a = 0; a < 20; a++) {
|
||||
if (len < 3) {
|
||||
if(len < 3) {
|
||||
goto ndpi_end_bt_tracker_check;
|
||||
}
|
||||
if (*ptr == '%') {
|
||||
if(*ptr == '%') {
|
||||
u_int8_t x1 = 0xFF;
|
||||
u_int8_t x2 = 0xFF;
|
||||
|
||||
|
||||
if (ptr[1] >= '0' && ptr[1] <= '9') {
|
||||
if(ptr[1] >= '0' && ptr[1] <= '9') {
|
||||
x1 = ptr[1] - '0';
|
||||
}
|
||||
if (ptr[1] >= 'a' && ptr[1] <= 'f') {
|
||||
if(ptr[1] >= 'a' && ptr[1] <= 'f') {
|
||||
x1 = 10 + ptr[1] - 'a';
|
||||
}
|
||||
if (ptr[1] >= 'A' && ptr[1] <= 'F') {
|
||||
if(ptr[1] >= 'A' && ptr[1] <= 'F') {
|
||||
x1 = 10 + ptr[1] - 'A';
|
||||
}
|
||||
|
||||
if (ptr[2] >= '0' && ptr[2] <= '9') {
|
||||
if(ptr[2] >= '0' && ptr[2] <= '9') {
|
||||
x2 = ptr[2] - '0';
|
||||
}
|
||||
if (ptr[2] >= 'a' && ptr[2] <= 'f') {
|
||||
if(ptr[2] >= 'a' && ptr[2] <= 'f') {
|
||||
x2 = 10 + ptr[2] - 'a';
|
||||
}
|
||||
if (ptr[2] >= 'A' && ptr[2] <= 'F') {
|
||||
if(ptr[2] >= 'A' && ptr[2] <= 'F') {
|
||||
x2 = 10 + ptr[2] - 'A';
|
||||
}
|
||||
|
||||
if (x1 == 0xFF || x2 == 0xFF) {
|
||||
if(x1 == 0xFF || x2 == 0xFF) {
|
||||
goto ndpi_end_bt_tracker_check;
|
||||
}
|
||||
ptr += 3;
|
||||
len -= 3;
|
||||
} else if (*ptr >= 32 && *ptr < 127) {
|
||||
} else if(*ptr >= 32 && *ptr < 127) {
|
||||
ptr++;
|
||||
len--;
|
||||
} else {
|
||||
@@ -278,17 +301,15 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, " BT stat: tracker info hash parsed\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: tracker info hash parsed\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ndpi_end_bt_tracker_check:
|
||||
|
||||
if (packet->payload_packet_len == 80) {
|
||||
if(packet->payload_packet_len == 80) {
|
||||
/* Warez 80 Bytes Packet
|
||||
* +----------------+---------------+-----------------+-----------------+
|
||||
* |20 BytesPattern | 32 Bytes Value| 12 BytesPattern | 16 Bytes Data |
|
||||
@@ -306,30 +327,25 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
};
|
||||
|
||||
/* did not see this pattern anywhere */
|
||||
if ((memcmp(&packet->payload[0], pattern_20_bytes, 20) == 0)
|
||||
if((memcmp(&packet->payload[0], pattern_20_bytes, 20) == 0)
|
||||
&& (memcmp(&packet->payload[52], pattern_12_bytes, 12) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct,
|
||||
NDPI_LOG_TRACE, "BT: Warez - Plain BitTorrent protocol detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_REAL_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: Warez - Plain\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
else if (packet->payload_packet_len > 50) {
|
||||
if (memcmp(packet->payload, "GET", 3) == 0) {
|
||||
else if(packet->payload_packet_len > 50) {
|
||||
if(memcmp(packet->payload, "GET", 3) == 0) {
|
||||
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
/* haven't fount this pattern anywhere */
|
||||
if (packet->host_line.ptr != NULL
|
||||
if(packet->host_line.ptr != NULL
|
||||
&& packet->host_line.len >= 9 && memcmp(packet->host_line.ptr, "ip2p.com:", 9) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
||||
ndpi_struct, NDPI_LOG_TRACE,
|
||||
"BT: Warez - Plain BitTorrent protocol detected due to Host: ip2p.com: pattern\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION/* , */
|
||||
/* NDPI_CORRELATED_PROTOCOL */);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: Warez - Plain Host: ip2p.com: pattern\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_WEBSEED_DETECTION);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -341,24 +357,21 @@ static u_int8_t ndpi_int_search_bittorrent_tcp_zero(struct ndpi_detection_module
|
||||
/*Search for BitTorrent commands*/
|
||||
static void ndpi_int_search_bittorrent_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
if (packet->payload_packet_len == 0) {
|
||||
if(packet->payload_packet_len == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (flow->bittorrent_stage == 0 && packet->payload_packet_len != 0) {
|
||||
if(flow->bittorrent_stage == 0 && packet->payload_packet_len != 0) {
|
||||
/* exclude stage 0 detection from next run */
|
||||
flow->bittorrent_stage = 1;
|
||||
if (ndpi_int_search_bittorrent_tcp_zero(ndpi_struct, flow) != 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"stage 0 has detected something, returning\n");
|
||||
if(ndpi_int_search_bittorrent_tcp_zero(ndpi_struct, flow) != 0) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage 0 has detected something, returning\n");
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"stage 0 has no direct detection, fall through\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "stage 0 has no direct detection, fall through\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -366,22 +379,22 @@ static void ndpi_int_search_bittorrent_tcp(struct ndpi_detection_module_struct *
|
||||
void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
int no_bittorrent = 0;
|
||||
char *bt_proto = NULL;
|
||||
|
||||
/* This is broadcast */
|
||||
if(packet->iph
|
||||
if(packet->iph
|
||||
&& (((packet->iph->saddr == 0xFFFFFFFF) || (packet->iph->daddr == 0xFFFFFFFF))
|
||||
|| (packet->udp
|
||||
|| (packet->udp
|
||||
&& ((ntohs(packet->udp->source) == 3544) /* teredo.c */
|
||||
|| (ntohs(packet->udp->dest) == 3544))))) {
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BITTORRENT);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BITTORRENT) {
|
||||
|
||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BITTORRENT) {
|
||||
/* check for tcp retransmission here */
|
||||
|
||||
if ((packet->tcp != NULL)
|
||||
if((packet->tcp != NULL)
|
||||
&& (packet->tcp_retransmission == 0 || packet->num_retried_bytes)) {
|
||||
ndpi_int_search_bittorrent_tcp(ndpi_struct, flow);
|
||||
}
|
||||
@@ -400,9 +413,8 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
|
||||
if(packet->payload_packet_len >= 23 /* min header size */) {
|
||||
if(strncmp((const char*)packet->payload, bt_search, strlen(bt_search)) == 0) {
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_REAL_PROTOCOL */);
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 1,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return;
|
||||
} else {
|
||||
/* Check if this is protocol v0 */
|
||||
@@ -414,34 +426,32 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
u_int8_t v1_extension = packet->payload[1];
|
||||
u_int32_t v1_window_size = *((u_int32_t*)&packet->payload[12]);
|
||||
|
||||
if((packet->payload[0]== 0x60)
|
||||
if(is_utp_pkt(packet->payload, packet->payload_packet_len))
|
||||
goto bittorrent_found;
|
||||
else if((packet->payload[0]== 0x60)
|
||||
&& (packet->payload[1]== 0x0)
|
||||
&& (packet->payload[2]== 0x0)
|
||||
&& (packet->payload[3]== 0x0)
|
||||
&& (packet->payload[4]== 0x0)) {
|
||||
/* Heuristic */
|
||||
bt_proto = ndpi_strnstr((const char *)&packet->payload[20], "BitTorrent protocol", packet->payload_packet_len-20);
|
||||
goto bittorrent_found;
|
||||
} else if(((v1_version & 0x0f) == 1)
|
||||
/* CSGO/DOTA conflict */
|
||||
} else if(flow->packet_counter > 8 && ((v1_version & 0x0f) == 1)
|
||||
&& ((v1_version >> 4) < 5 /* ST_NUM_STATES */)
|
||||
&& (v1_extension < 3 /* EXT_NUM_EXT */)
|
||||
&& (v1_window_size < 32768 /* 32k */)
|
||||
) {
|
||||
bt_proto = ndpi_strnstr((const char *)&packet->payload[20], "BitTorrent protocol", packet->payload_packet_len-20);
|
||||
goto bittorrent_found;
|
||||
} else if((v0_flags < 6 /* ST_NUM_STATES */)
|
||||
&& (v0_extension < 3 /* EXT_NUM_EXT */)) {
|
||||
} else if((v0_flags < 6 /* ST_NUM_STATES */) && (v0_extension < 3 /* EXT_NUM_EXT */)) {
|
||||
u_int32_t ts = ntohl(*((u_int32_t*)&(packet->payload[4])));
|
||||
u_int32_t now;
|
||||
|
||||
#ifndef __KERNEL__
|
||||
now = (u_int32_t)time(NULL);
|
||||
#else
|
||||
struct timespec t;
|
||||
|
||||
getnstimeofday(&t);
|
||||
now = t.tv_sec;
|
||||
#endif
|
||||
|
||||
if((ts < (now+86400)) && (ts > (now-86400))) {
|
||||
bt_proto = ndpi_strnstr((const char *)&packet->payload[20], "BitTorrent protocol", packet->payload_packet_len-20);
|
||||
goto bittorrent_found;
|
||||
}
|
||||
}
|
||||
@@ -451,29 +461,31 @@ void ndpi_search_bittorrent(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
flow->bittorrent_stage++;
|
||||
|
||||
if(flow->bittorrent_stage < 10) {
|
||||
if(packet->payload_packet_len > 19 /* min size */) {
|
||||
if(ndpi_strnstr((const char *)packet->payload, ":target20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, ":find_node1:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, "d1:ad2:id20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, ":info_hash20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, ":filter64", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, "d1:rd2:id20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, "BitTorrent protocol", packet->payload_packet_len)
|
||||
) {
|
||||
bittorrent_found:
|
||||
NDPI_LOG(NDPI_PROTOCOL_BITTORRENT,
|
||||
ndpi_struct, NDPI_LOG_TRACE, "BT: plain BitTorrent protocol detected\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION/* , */
|
||||
/* NDPI_REAL_PROTOCOL */);
|
||||
return;
|
||||
/* We have detected bittorrent but we need to wait until we get a hash */
|
||||
|
||||
if(packet->payload_packet_len > 19 /* min size */) {
|
||||
if(ndpi_strnstr((const char *)packet->payload, ":target20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, ":find_node1:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, "d1:ad2:id20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, ":info_hash20:", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, ":filter64", packet->payload_packet_len)
|
||||
|| ndpi_strnstr((const char *)packet->payload, "d1:rd2:id20:", packet->payload_packet_len)
|
||||
|| (bt_proto = ndpi_strnstr((const char *)packet->payload, "BitTorrent protocol", packet->payload_packet_len))
|
||||
) {
|
||||
bittorrent_found:
|
||||
if(bt_proto && (packet->payload_packet_len > 47))
|
||||
memcpy(flow->protos.bittorrent.hash, &bt_proto[27], 20);
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found BT: plain\n");
|
||||
ndpi_add_connection_as_bittorrent(ndpi_struct, flow, -1, 0,
|
||||
NDPI_PROTOCOL_SAFE_DETECTION, NDPI_PROTOCOL_PLAIN_DETECTION);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_BITTORRENT);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -489,5 +501,3 @@ void init_bittorrent_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_BJNP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
static void ndpi_int_bjnp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int8_t due_to_correlation) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow,
|
||||
NDPI_PROTOCOL_BJNP, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
|
||||
static void ndpi_check_bjnp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int32_t payload_len = packet->payload_packet_len;
|
||||
|
||||
if(packet->udp != NULL) {
|
||||
if(payload_len > 4) {
|
||||
if((memcmp((const char *)packet->payload, "BJNP", 4) == 0)
|
||||
|| (memcmp((const char *)packet->payload, "BNJB", 4) == 0)
|
||||
|| (memcmp((const char *)packet->payload, "BJNB", 4) == 0)
|
||||
|| (memcmp((const char *)packet->payload, "MFNP", 4) == 0)
|
||||
) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found bjnp\n");
|
||||
ndpi_int_bjnp_add_connection(ndpi_struct, flow, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
void ndpi_search_bjnp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search bjnp\n");
|
||||
|
||||
/* skip marked packets */
|
||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_BJNP) {
|
||||
if (packet->tcp_retransmission == 0) {
|
||||
ndpi_check_bjnp(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_bjnp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("BJNP", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_BJNP,
|
||||
ndpi_search_bjnp,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
+16
-11
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* btlib.c
|
||||
*
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
* Contributed by Vitaly Lavrov <vel21ripn@gmail.com>
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
@@ -22,6 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifndef NDPI_NO_STD_INC
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -29,21 +31,19 @@
|
||||
#include <string.h>
|
||||
#include <strings.h>
|
||||
|
||||
/*
|
||||
typedef unsigned char u_int8_t;
|
||||
typedef unsigned short int u_int16_t;
|
||||
typedef unsigned long long int u_int64_t;
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
typedef signed long long int i_int64_t;
|
||||
|
||||
#include "btlib.h"
|
||||
|
||||
#ifndef __KERNEL__
|
||||
|
||||
int bt_parse_debug = 0;
|
||||
|
||||
static char *printXb(char *s,const u_int8_t *b,int l) {
|
||||
@@ -92,6 +92,7 @@ static char *print_id_ip6_p(char *s,const struct bt_nodes6_data *b) {
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void dump_bt_proto_struct(struct bt_parse_protocol *p) {
|
||||
char b20h[128];
|
||||
int i;
|
||||
@@ -157,7 +158,9 @@ void dump_bt_proto_struct(struct bt_parse_protocol *p) {
|
||||
if(p->interval) printf("\tinterval\t%d\n",p->interval);
|
||||
if(p->min_interval) printf("\tmin interval\t%d\n",p->min_interval);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BTLIB_DEBUG
|
||||
static void _print_safe_str(char *msg,char *k,const u_int8_t *s,size_t l) {
|
||||
static const char *th="0123456789abcdef?";
|
||||
char *buf = (char*)ndpi_malloc((size_t)(l*3+2));
|
||||
@@ -184,9 +187,11 @@ static void print_safe_str(char *msg,bt_parse_data_cb_t *cbd) {
|
||||
_print_safe_str(msg,cbd->buf,cbd->v.s.s,cbd->v.s.l);
|
||||
}
|
||||
#define DEBUG_TRACE(cmd) { if(bt_parse_debug) cmd; }
|
||||
|
||||
#else
|
||||
#define DEBUG_TRACE(cmd,args...)
|
||||
#endif /* __KERNEL */
|
||||
#define DEBUG_TRACE(cmd) ;
|
||||
#endif
|
||||
|
||||
|
||||
#define STREQ(a,b) !strcmp(a,b)
|
||||
|
||||
@@ -401,20 +406,20 @@ void cb_data(bt_parse_data_cb_t *cbd,int *ret) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(cbd->buf[0] == 'e' && !cbd->buf[0]) {
|
||||
if(cbd->buf[0] == 'e') {
|
||||
p->e_msg = s;
|
||||
p->e_len = cbd->v.s.l;
|
||||
return;
|
||||
}
|
||||
// DEBUG_TRACE(print_safe_str("UKNOWN",cbd));
|
||||
// DEBUG_TRACE(print_safe_str("UNKNOWN",cbd));
|
||||
}
|
||||
|
||||
|
||||
const u_int8_t *bt_decode(const u_int8_t *b, size_t *l, int *ret, bt_parse_data_cb_t *cbd) {
|
||||
|
||||
unsigned int n=0,neg=0;
|
||||
i_int64_t d = 0;
|
||||
register u_int8_t c;
|
||||
int64_t d = 0;
|
||||
u_int8_t c;
|
||||
|
||||
if(*l == 0) return NULL;
|
||||
if(cbd->level > BDEC_MAXDEPT) goto bad_data;
|
||||
|
||||
+48
-14
@@ -24,44 +24,81 @@
|
||||
|
||||
#define BDEC_MAXDEPT 8
|
||||
|
||||
#ifdef WIN32
|
||||
#include "ndpi_win32.h"
|
||||
#endif
|
||||
|
||||
typedef struct b_elem_s {
|
||||
const u_int8_t *s;
|
||||
size_t l;
|
||||
} b_elem_s_t;
|
||||
|
||||
struct __attribute__ ((__packed__)) bt_nodes_data {
|
||||
u_int8_t id[20] ;
|
||||
#ifdef WIN32
|
||||
// enable 1 byte packing on Windows
|
||||
#include <pshpack1.h>
|
||||
#endif
|
||||
|
||||
struct
|
||||
#ifndef WIN32
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bt_nodes_data {
|
||||
u_int8_t id[20];
|
||||
u_int32_t ip;
|
||||
u_int16_t port;
|
||||
};
|
||||
|
||||
struct __attribute__ ((__packed__)) bt_ipv4p {
|
||||
struct
|
||||
#ifndef WIN32
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bt_ipv4p {
|
||||
u_int32_t ip;
|
||||
u_int16_t port;
|
||||
};
|
||||
|
||||
struct __attribute__ ((__packed__)) bt_ipv4p2 {
|
||||
struct
|
||||
#ifndef WIN32
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bt_ipv4p2 {
|
||||
struct bt_ipv4p d;
|
||||
u_int8_t pad[2];
|
||||
};
|
||||
|
||||
struct __attribute__ ((__packed__)) bt_nodes6_data {
|
||||
u_int8_t id[20] ;
|
||||
struct
|
||||
#ifndef WIN32
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bt_nodes6_data {
|
||||
u_int8_t id[20];
|
||||
u_int32_t ip[4];
|
||||
u_int16_t port;
|
||||
};
|
||||
|
||||
struct __attribute__ ((__packed__)) bt_ipv6p {
|
||||
struct
|
||||
#ifndef WIN32
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bt_ipv6p {
|
||||
u_int32_t ip[4];
|
||||
u_int16_t port;
|
||||
};
|
||||
|
||||
struct __attribute__ ((__packed__)) bt_ipv6p2 {
|
||||
struct
|
||||
#ifndef WIN32
|
||||
__attribute__((__packed__))
|
||||
#endif
|
||||
bt_ipv6p2 {
|
||||
struct bt_ipv6p d;
|
||||
u_int8_t pad[3];
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
// disable 1 byte packing
|
||||
#include <poppack.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
a.id S r.id S
|
||||
@@ -113,9 +150,9 @@ struct bt_parse_protocol {
|
||||
struct bt_nodes6_data *nodes6;
|
||||
u_int16_t name_len;
|
||||
u_int16_t nn; // nodes num
|
||||
u_int16_t nv; // valuse num
|
||||
u_int16_t nv; // values num
|
||||
u_int16_t nn6; // nodes6 num
|
||||
u_int16_t nv6; // valuse6 num
|
||||
u_int16_t nv6; // values6 num
|
||||
u_int16_t port;
|
||||
u_int16_t t_len;
|
||||
} r;
|
||||
@@ -134,14 +171,11 @@ typedef struct bt_parse_data_cb {
|
||||
int level;
|
||||
int t;
|
||||
union {
|
||||
i_int64_t i;
|
||||
int64_t i;
|
||||
b_elem_s_t s;
|
||||
} v;
|
||||
} bt_parse_data_cb_t;
|
||||
|
||||
#ifndef __KERNEL__
|
||||
extern int bt_parse_debug;
|
||||
void dump_bt_proto_struct(struct bt_parse_protocol *p);
|
||||
#endif
|
||||
const u_int8_t *bt_decode(const u_int8_t *b, size_t *l, int *ret, bt_parse_data_cb_t *cbd);
|
||||
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* checkmk.c
|
||||
*
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CHECKMK
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_checkmk_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CHECKMK, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
|
||||
void ndpi_search_checkmk(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
if (packet->payload_packet_len >= 15) {
|
||||
|
||||
if(packet->payload_packet_len > 128) {
|
||||
/*
|
||||
When we transfer a large data chunk, unless we have observed
|
||||
the initial connection, we need to discard these packets
|
||||
as they are not an indication that this flow is not AFP
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* this will detect the OpenSession command of the Data Stream Interface (DSI) protocol
|
||||
* which is exclusively used by the Apple Filing Protocol (AFP) on TCP/IP networks
|
||||
*/
|
||||
if (packet->payload_packet_len >= 15 && packet->payload_packet_len < 100
|
||||
&& memcmp(packet->payload, "<<<check_mk>>>", 14) == 0) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CHECKMK, ndpi_struct, NDPI_LOG_DEBUG, "Check_MK: Flow detected.\n");
|
||||
ndpi_int_checkmk_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CHECKMK, ndpi_struct, NDPI_LOG_DEBUG, "Check_MK excluded.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CHECKMK);
|
||||
}
|
||||
|
||||
|
||||
void init_checkmk_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("CHECKMK", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_CHECKMK,
|
||||
ndpi_search_checkmk,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
@@ -4,9 +4,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CISCOVPN
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_CISCOVPN
|
||||
|
||||
static void ndpi_int_ciscovpn_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
@@ -20,15 +23,15 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
u_int16_t tdport = 0, tsport = 0;
|
||||
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "search CISCOVPN.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search CISCOVPN\n");
|
||||
|
||||
if(packet->tcp != NULL) {
|
||||
tsport = ntohs(packet->tcp->source), tdport = ntohs(packet->tcp->dest);
|
||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "calculated CISCOVPN over tcp ports.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "calculated CISCOVPN over tcp ports\n");
|
||||
}
|
||||
if(packet->udp != NULL) {
|
||||
usport = ntohs(packet->udp->source), udport = ntohs(packet->udp->dest);
|
||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "calculated CISCOVPN over udp ports.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "calculated CISCOVPN over udp ports\n");
|
||||
}
|
||||
|
||||
if((tdport == 10000 && tsport == 10000) ||
|
||||
@@ -42,8 +45,9 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|
||||
{
|
||||
/* This is a good query 17010000*/
|
||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "found CISCOVPN.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found CISCOVPN\n");
|
||||
ndpi_int_ciscovpn_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
else if(
|
||||
(
|
||||
@@ -59,11 +63,10 @@ void ndpi_search_ciscovpn(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
|
||||
|
||||
/* This is a good query fe577e2b */
|
||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "found CISCOVPN.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found CISCOVPN\n");
|
||||
ndpi_int_ciscovpn_add_connection(ndpi_struct, flow);
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CISCOVPN, ndpi_struct, NDPI_LOG_DEBUG, "exclude CISCOVPN.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CISCOVPN);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,5 +82,3 @@ void init_ciscovpn_dissector(struct ndpi_detection_module_struct *ndpi_struct, u
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+11
-21
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* citrix.c
|
||||
*
|
||||
* Copyright (C) 2012-15 - ntop.org
|
||||
* Copyright (C) 2012-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -21,10 +21,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CITRIX
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_CITRIX
|
||||
|
||||
/* ************************************ */
|
||||
|
||||
@@ -33,14 +35,6 @@ static void ndpi_check_citrix(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int32_t payload_len = packet->payload_packet_len;
|
||||
|
||||
#if 0
|
||||
printf("[len=%u][%02X %02X %02X %02X]\n", payload_len,
|
||||
packet->payload[0] & 0xFF,
|
||||
packet->payload[1] & 0xFF,
|
||||
packet->payload[2] & 0xFF,
|
||||
packet->payload[3] & 0xFF);
|
||||
#endif
|
||||
|
||||
if(packet->tcp != NULL) {
|
||||
flow->l4.tcp.citrix_packet_id++;
|
||||
|
||||
@@ -53,27 +47,25 @@ static void ndpi_check_citrix(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
char citrix_header[] = { 0x07, 0x07, 0x49, 0x43, 0x41, 0x00 };
|
||||
|
||||
if(memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found citrix\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
return;
|
||||
} else if(payload_len > 4) {
|
||||
char citrix_header[] = { 0x1a, 0x43, 0x47, 0x50, 0x2f, 0x30, 0x31 };
|
||||
|
||||
if((memcmp(packet->payload, citrix_header, sizeof(citrix_header)) == 0)
|
||||
|| (ndpi_strnstr((const char *)packet->payload, "Citrix.TcpProxyService", payload_len) != NULL)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "Found citrix.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found citrix\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CITRIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CITRIX);
|
||||
} else if(flow->l4.tcp.citrix_packet_id > 3)
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CITRIX);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
} else if(flow->l4.tcp.citrix_packet_id > 3) {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -83,7 +75,7 @@ void ndpi_search_citrix(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CITRIX, ndpi_struct, NDPI_LOG_DEBUG, "citrix detection...\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search citrix\n");
|
||||
|
||||
/* skip marked packets */
|
||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_CITRIX)
|
||||
@@ -101,5 +93,3 @@ void init_citrix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
/*
|
||||
* coap.c
|
||||
*
|
||||
* Copyright (C) 2016 Sorin Zamfir <sorin.zamfir@yahoo.com>
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_COAP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
#define CON 0
|
||||
#define NO_CON 1
|
||||
#define ACK 2
|
||||
#define RST 3
|
||||
|
||||
struct ndpi_coap_hdr
|
||||
{
|
||||
#if defined(__BIG_ENDIAN__)
|
||||
u_int8_t version:2, type:2, tkl:4;
|
||||
#elif defined(__LITTLE_ENDIAN__)
|
||||
u_int8_t tkl:4, type:2, version:2;
|
||||
#endif
|
||||
u_int8_t code;
|
||||
u_int16_t message_id; //if needed, remember to convert in host number
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
VALUE OF -CODE- FIELD
|
||||
|
||||
[0] = "Empty",
|
||||
[1] = "GET",
|
||||
[2] = "POST",
|
||||
[3] = "PUT",
|
||||
[4] = "DELETE",
|
||||
[65] = "2.01 Created",
|
||||
[66] = "2.02 Deleted",
|
||||
[67] = "2.03 Valid",
|
||||
[68] = "2.04 Changed",
|
||||
[69] = "2.05 Content",
|
||||
[128] = "4.00 Bad Request",
|
||||
[129] = "4.01 Unauthorized",
|
||||
[130] = "4.02 Bad Option",
|
||||
[131] = "4.03 Forbidden",
|
||||
[132] = "4.04 Not Found",
|
||||
[133] = "4.05 Method Not Allowed",
|
||||
[134] = "4.06 Not Acceptable",
|
||||
[140] = "4.12 Precondition Failed",
|
||||
[141] = "4.13 Request Entity Too Large",
|
||||
[143] = "4.15 Unsupported Content-Format",
|
||||
[160] = "5.00 Internal Server Error",
|
||||
[161] = "5.01 Not Implemented",
|
||||
[162] = "5.02 Bad Gateway",
|
||||
[163] = "5.03 Service Unavailable",
|
||||
[164] = "5.04 Gateway Timeout",
|
||||
[165] = "5.05 Proxying Not Supported"
|
||||
**/
|
||||
|
||||
|
||||
/**
|
||||
* Entry point when protocol is identified.
|
||||
*/
|
||||
static void ndpi_int_coap_add_connection (struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct,flow,NDPI_PROTOCOL_COAP,NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the default port is acceptable
|
||||
*
|
||||
* UDP Port 5683 (mandatory)
|
||||
* UDP Ports 61616-61631 compressed 6lowPAN
|
||||
*/
|
||||
static int isCoAPport(u_int16_t port) {
|
||||
if((port == 5683)
|
||||
|| ((port >= 61616) && (port <= 61631)))
|
||||
return(1);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Dissector function that searches CoAP headers
|
||||
*/
|
||||
void ndpi_search_coap (struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
struct ndpi_coap_hdr * h = (struct ndpi_coap_hdr*) packet->payload;
|
||||
|
||||
if(packet->detected_protocol_stack[0] != NDPI_PROTOCOL_UNKNOWN) {
|
||||
return;
|
||||
}
|
||||
|
||||
// search for udp packet
|
||||
if(packet->udp != NULL) {
|
||||
u_int16_t s_port = ntohs(flow->packet.udp->source);
|
||||
u_int16_t d_port = ntohs(flow->packet.udp->dest);
|
||||
|
||||
if((!isCoAPport(s_port) && !isCoAPport(d_port))
|
||||
|| (packet->payload_packet_len < 4) ) { // header too short
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_LOG_DBG2(ndpi_struct, "calculating coap over udp\n");
|
||||
|
||||
// check values in header
|
||||
if(h->version == 1) {
|
||||
if(h->type == CON || h->type == NO_CON || h->type == ACK || h->type == RST ) {
|
||||
if(h->tkl == 0 || h->tkl < 8) {
|
||||
if((h->code >= 0 && h->code <= 5) || (h->code >= 65 && h->code <= 69) ||
|
||||
(h->code >= 128 && h->code <= 134) || (h->code >= 140 && h->code <= 143) ||
|
||||
(h->code >= 160 && h->code <= 165)) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Coap\n");
|
||||
ndpi_int_coap_add_connection(ndpi_struct,flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Entry point for the ndpi library
|
||||
*/
|
||||
void init_coap_dissector (struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection ("COAP", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_COAP,
|
||||
ndpi_search_coap,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK);
|
||||
*id +=1;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* collectd.c
|
||||
*
|
||||
* Copyright (C) 2014 - ntop.org
|
||||
* Copyright (C) 2014-18 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -19,16 +19,19 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_COLLECTD
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_COLLECTD
|
||||
|
||||
void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int len = 0;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "search collectd.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search collectd\n");
|
||||
|
||||
if (packet->udp == NULL) return;
|
||||
|
||||
@@ -43,12 +46,9 @@ void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struct, stru
|
||||
}
|
||||
|
||||
if(len == packet->payload_packet_len) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "found COLLECTD.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found COLLECTD\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_COLLECTD, NDPI_PROTOCOL_UNKNOWN);
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_COLLECTD, ndpi_struct, NDPI_LOG_DEBUG, "exclude COLLECTD.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_COLLECTD);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CORBA
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_CORBA
|
||||
static void ndpi_int_corba_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
@@ -31,18 +33,17 @@ void ndpi_search_corba(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "search for CORBA.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search for CORBA\n");
|
||||
if(packet->tcp != NULL) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "calculating CORBA over tcp.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "calculating CORBA over tcp\n");
|
||||
/* Corba General Inter-ORB Protocol -> GIOP */
|
||||
if ((packet->payload_packet_len >= 24 && packet->payload_packet_len <= 144) &&
|
||||
memcmp(packet->payload, "GIOP", 4) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "found corba.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found corba\n");
|
||||
ndpi_int_corba_add_connection(ndpi_struct, flow);
|
||||
}
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CORBA, ndpi_struct, NDPI_LOG_DEBUG, "exclude CORBA.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CORBA);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,4 +58,3 @@ void init_corba_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* crossfire.c
|
||||
*
|
||||
* Copyright (C) 2012-15 - ntop.org
|
||||
* Copyright (C) 2012-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -21,10 +21,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
/* include files */
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_CROSSFIRE
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CROSSFIRE
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
@@ -37,21 +38,17 @@ static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struc
|
||||
void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "search crossfire.\n");
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search crossfire\n");
|
||||
|
||||
if (packet->udp != 0) {
|
||||
if (packet->payload_packet_len == 25 && get_u_int32_t(packet->payload, 0) == ntohl(0xc7d91999)
|
||||
if (packet->payload_packet_len == 25
|
||||
&& get_u_int32_t(packet->payload, 0) == ntohl(0xc7d91999)
|
||||
&& get_u_int16_t(packet->payload, 4) == ntohs(0x0200)
|
||||
&& get_u_int16_t(packet->payload, 22) == ntohs(0x7d00)
|
||||
) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "Crossfire: found udp packet.\n");
|
||||
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
&& get_u_int16_t(packet->payload, 22) == ntohs(0x7d00)) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Crossfire: udp packet\n");
|
||||
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (packet->tcp != 0) {
|
||||
@@ -67,16 +64,15 @@ void ndpi_search_crossfire_tcp_udp(struct ndpi_detection_module_struct *ndpi_str
|
||||
&& (memcmp(packet->host_line.ptr, "crossfire", 9) == 0
|
||||
|| memcmp(packet->host_line.ptr, "www.crossfire", 13) == 0))
|
||||
) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "Crossfire: found HTTP request.\n");
|
||||
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
NDPI_LOG_DBG(ndpi_struct, "found Crossfire: HTTP request\n");
|
||||
ndpi_int_crossfire_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_CROSSFIRE, ndpi_struct, NDPI_LOG_DEBUG, "exclude crossfire.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_CROSSFIRE);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -90,5 +86,3 @@ void init_crossfire_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* csgo.c
|
||||
*
|
||||
* Copyright (C) 2016-2017 Vitaly Lavrov <vel21ripn@gmail.com>
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_CSGO
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
void ndpi_search_csgo(struct ndpi_detection_module_struct* ndpi_struct, struct ndpi_flow_struct* flow) {
|
||||
struct ndpi_packet_struct* packet = &flow->packet;
|
||||
|
||||
if (packet->udp != NULL) {
|
||||
uint32_t w = htonl(get_u_int32_t(packet->payload, 0));
|
||||
NDPI_LOG_DBG2(ndpi_struct, "CSGO: word %08x\n", w);
|
||||
|
||||
if (!flow->csgo_state && packet->payload_packet_len == 23 && w == 0xfffffffful) {
|
||||
if (!memcmp(packet->payload + 5, "connect0x", 9)) {
|
||||
flow->csgo_state++;
|
||||
memcpy(flow->csgo_strid, packet->payload + 5, 18);
|
||||
NDPI_LOG_DBG2(ndpi_struct, "Found csgo connect0x\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (flow->csgo_state == 1 && packet->payload_packet_len >= 42 && w == 0xfffffffful) {
|
||||
if (!memcmp(packet->payload + 24, flow->csgo_strid, 18)) {
|
||||
flow->csgo_state++;
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo connect0x reply\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (packet->payload_packet_len == 8 && ( w == 0x3a180000 || w == 0x39180000) ) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp 8b\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len >= 36 && w == 0x56533031ul) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len >= 36 && w == 0x01007364) {
|
||||
uint32_t w2 = htonl(get_u_int32_t(packet->payload, 4));
|
||||
if (w2 == 0x70696e67) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp ping\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (flow->csgo_s2 < 3 && (w & 0xffff0000ul) == 0x0d1d0000) {
|
||||
uint32_t w2 = get_u_int32_t(packet->payload, 2);
|
||||
if (packet->payload_packet_len == 13) {
|
||||
if (!flow->csgo_s2) {
|
||||
flow->csgo_id2 = w2;
|
||||
flow->csgo_s2 = 1;
|
||||
NDPI_LOG_DBG2( ndpi_struct, "Found csgo udp 0d1d step1\n");
|
||||
return;
|
||||
}
|
||||
if (flow->csgo_s2 == 1 && flow->csgo_id2 == w2) {
|
||||
NDPI_LOG_DBG2( ndpi_struct, "Found csgo udp 0d1d step1 DUP\n");
|
||||
return;
|
||||
}
|
||||
flow->csgo_s2 = 3;
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 15) {
|
||||
if (flow->csgo_s2 == 1 && flow->csgo_id2 == w2) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo udp 0d1d\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
flow->csgo_s2 = 3;
|
||||
}
|
||||
if (packet->payload_packet_len >= 140 && (w == 0x02124c6c || w == 0x02125c6c) &&
|
||||
!memcmp(&packet->payload[3], "lta\000mob\000tpc\000bhj\000bxd\000tae\000urg\000gkh\000", 32)) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo dictionary udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len >= 33 && packet->iph && packet->iph->daddr == 0xffffffff &&
|
||||
!memcmp(&packet->payload[17], "LanSearch", 9)) {
|
||||
NDPI_LOG_INFO( ndpi_struct, "found csgo LanSearch udp\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CSGO, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (flow->packet_counter > 20)
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
void init_csgo_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("CSGO", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_CSGO,
|
||||
ndpi_search_csgo,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_UDP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
+14
-11
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* dcerpc.c
|
||||
*
|
||||
* Copyright (C) 2011-13 by ntop.org
|
||||
* Copyright (C) 2011-18 by ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -18,13 +18,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DCERPC
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_DCERPC
|
||||
|
||||
static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
|
||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
@@ -35,20 +37,22 @@ static void ndpi_int_dcerpc_add_connection(struct ndpi_detection_module_struct
|
||||
void ndpi_search_dcerpc(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
|
||||
if((packet->tcp != NULL)
|
||||
&& (packet->payload_packet_len > 64)
|
||||
&& ((ntohs(packet->tcp->source) == 135) || (ntohs(packet->tcp->dest) == 135))
|
||||
NDPI_LOG_DBG(ndpi_struct, "search DCERPC\n");
|
||||
|
||||
if((packet->tcp != NULL)
|
||||
&& (packet->payload_packet_len >= 64)
|
||||
&& (packet->payload[0] == 0x05) /* version 5 */
|
||||
&& (packet->payload[2] < 16) /* Packet type */
|
||||
) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DCERPC, ndpi_struct, NDPI_LOG_DEBUG, "DCERPC match\n");
|
||||
&& (((packet->payload[9]<<8) | packet->payload[8]) == packet->payload_packet_len) /* Packet Length */
|
||||
) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DCERPC\n");
|
||||
ndpi_int_dcerpc_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DCERPC);
|
||||
if(packet->payload_packet_len>1)
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,4 +67,3 @@ void init_dcerpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+118
-25
@@ -1,11 +1,7 @@
|
||||
/*
|
||||
* dhcp.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
* Copyright (C) 2016-18 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -19,13 +15,42 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DHCP
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
/* freeradius/src/lib/dhcp.c */
|
||||
#define DHCP_CHADDR_LEN 16
|
||||
#define DHCP_SNAME_LEN 64
|
||||
#define DHCP_FILE_LEN 128
|
||||
#define DHCP_VEND_LEN 308
|
||||
#define DHCP_OPTION_MAGIC_NUMBER 0x63825363
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t msgType;
|
||||
uint8_t htype;
|
||||
uint8_t hlen;
|
||||
uint8_t hops;
|
||||
uint32_t xid;/* 4 */
|
||||
uint16_t secs;/* 8 */
|
||||
uint16_t flags;
|
||||
uint32_t ciaddr;/* 12 */
|
||||
uint32_t yiaddr;/* 16 */
|
||||
uint32_t siaddr;/* 20 */
|
||||
uint32_t giaddr;/* 24 */
|
||||
uint8_t chaddr[DHCP_CHADDR_LEN]; /* 28 */
|
||||
uint8_t sname[DHCP_SNAME_LEN]; /* 44 */
|
||||
uint8_t file[DHCP_FILE_LEN]; /* 108 */
|
||||
uint32_t magic; /* 236 */
|
||||
uint8_t options[DHCP_VEND_LEN];
|
||||
} dhcp_packet_t;
|
||||
|
||||
#ifdef NDPI_PROTOCOL_DHCP
|
||||
|
||||
static void ndpi_int_dhcp_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
@@ -35,27 +60,97 @@ static void ndpi_int_dhcp_add_connection(struct ndpi_detection_module_struct *nd
|
||||
|
||||
void ndpi_search_dhcp_udp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
/* this detection also works for asymmetric dhcp traffic */
|
||||
NDPI_LOG_DBG(ndpi_struct, "search DHCP\n");
|
||||
|
||||
/*check standard DHCP 0.0.0.0:68 -> 255.255.255.255:67 */
|
||||
if (packet->payload_packet_len >= 244 && (packet->udp->source == htons(67)
|
||||
|| packet->udp->source == htons(68))
|
||||
&& (packet->udp->dest == htons(67) || packet->udp->dest == htons(68))
|
||||
&& get_u_int32_t(packet->payload, 236) == htonl(0x63825363)
|
||||
&& get_u_int16_t(packet->payload, 240) == htons(0x3501)) {
|
||||
/* this detection also works for asymmetric dhcp traffic */
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DHCP, ndpi_struct, NDPI_LOG_DEBUG, "DHCP request\n");
|
||||
/*check standard DHCP 0.0.0.0:68 -> 255.255.255.255:67 */
|
||||
if(packet->udp) {
|
||||
dhcp_packet_t *dhcp = (dhcp_packet_t*)packet->payload;
|
||||
|
||||
ndpi_int_dhcp_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
if((packet->payload_packet_len >= 244 /* 244 is the offset of options[0] in dhcp_packet_t */)
|
||||
&& (packet->udp->source == htons(67) || packet->udp->source == htons(68))
|
||||
&& (packet->udp->dest == htons(67) || packet->udp->dest == htons(68))
|
||||
&& (dhcp->magic == htonl(DHCP_OPTION_MAGIC_NUMBER))) {
|
||||
u_int i = 0, foundValidMsgType = 0;
|
||||
|
||||
u_int dhcp_options_size = ndpi_min(DHCP_VEND_LEN /* maximum size of options in dhcp_packet_t */,
|
||||
packet->payload_packet_len - 244);
|
||||
|
||||
while(i + 1 /* for the len */ < dhcp_options_size) {
|
||||
u_int8_t id = dhcp->options[i];
|
||||
|
||||
if(id == 0xFF)
|
||||
break;
|
||||
else {
|
||||
/* Prevent malformed packets to cause out-of-bounds accesses */
|
||||
u_int8_t len = ndpi_min(dhcp->options[i+1] /* len as found in the packet */,
|
||||
dhcp_options_size - (i+2) /* 1 for the type and 1 for the value */);
|
||||
|
||||
if(len == 0) break;
|
||||
|
||||
#ifdef DHCP_DEBUG
|
||||
NDPI_LOG_DBG2(ndpi_struct, "[DHCP] Id=%d [len=%d]\n", id, len);
|
||||
#endif
|
||||
|
||||
if(id == 53 /* DHCP Message Type */) {
|
||||
u_int8_t msg_type = dhcp->options[i+2];
|
||||
|
||||
if(msg_type <= 8) foundValidMsgType = 1;
|
||||
} else if(id == 55 /* Parameter Request List / Fingerprint */) {
|
||||
if(!ndpi_struct->disable_metadata_export) {
|
||||
u_int idx, offset = 0;
|
||||
|
||||
for(idx = 0; idx < len && offset < sizeof(flow->protos.dhcp.fingerprint) - 2; idx++) {
|
||||
snprintf((char*)&flow->protos.dhcp.fingerprint[offset],
|
||||
sizeof(flow->protos.dhcp.fingerprint) - offset,
|
||||
"%02X", dhcp->options[i+2+idx] & 0xFF);
|
||||
offset += 2;
|
||||
}
|
||||
|
||||
flow->protos.dhcp.fingerprint[sizeof(flow->protos.dhcp.fingerprint) - 1] = '\0';
|
||||
}
|
||||
} else if(id == 60 /* Class Identifier */) {
|
||||
if(!ndpi_struct->disable_metadata_export) {
|
||||
char *name = (char*)&dhcp->options[i+2];
|
||||
int j = 0;
|
||||
|
||||
j = ndpi_min(len, sizeof(flow->protos.dhcp.class_ident)-1);
|
||||
strncpy((char*)flow->protos.dhcp.class_ident, name, j);
|
||||
flow->protos.dhcp.class_ident[j] = '\0';
|
||||
}
|
||||
} else if(id == 12 /* Host Name */) {
|
||||
if(!ndpi_struct->disable_metadata_export) {
|
||||
char *name = (char*)&dhcp->options[i+2];
|
||||
int j = 0;
|
||||
|
||||
#ifdef DHCP_DEBUG
|
||||
NDPI_LOG_DBG2(ndpi_struct, "[DHCP] '%.*s'\n",name,len);
|
||||
// while(j < len) { printf( "%c", name[j]); j++; }; printf("\n");
|
||||
#endif
|
||||
j = ndpi_min(len, sizeof(flow->host_server_name)-1);
|
||||
strncpy((char*)flow->host_server_name, name, j);
|
||||
flow->host_server_name[j] = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
i += len + 2;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCP);
|
||||
//get_u_int16_t(packet->payload, 240) == htons(0x3501)) {
|
||||
|
||||
if(foundValidMsgType) {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DHCP\n");
|
||||
ndpi_int_dhcp_add_connection(ndpi_struct, flow);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,5 +164,3 @@ void init_dhcp_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* dhcpv6.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,12 +22,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DHCPV6
|
||||
|
||||
/* include files */
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_DHCPV6
|
||||
|
||||
static void ndpi_int_dhcpv6_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
@@ -40,21 +40,19 @@ void ndpi_search_dhcpv6_udp(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
NDPI_LOG_DBG(ndpi_struct, "search DHCPv6\n");
|
||||
|
||||
if (packet->payload_packet_len >= 4 &&
|
||||
(packet->udp->source == htons(546) || packet->udp->source == htons(547)) &&
|
||||
(packet->udp->dest == htons(546) || packet->udp->dest == htons(547)) &&
|
||||
packet->payload[0] >= 1 && packet->payload[0] <= 13) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DHCPV6, ndpi_struct, NDPI_LOG_DEBUG, "DHCPv6 detected.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DHCPv6\n");
|
||||
ndpi_int_dhcpv6_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DHCPV6, ndpi_struct, NDPI_LOG_DEBUG, "DHCPv6 excluded.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DHCPV6);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,5 +66,3 @@ void init_dhcpv6_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* diameter.c
|
||||
*
|
||||
* Copyright (C) 2018 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Based on code of:
|
||||
* Michele Campus - <campus@ntop.org>
|
||||
*/
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIAMETER
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
// Header Flags possibile values
|
||||
#define DIAMETER_REQUEST 0X80
|
||||
#define DIAMETER_PROXYABLE 0X40
|
||||
#define DIAMETER_ERROR 0X20
|
||||
#define DIAMETER_RETRASM 0X10
|
||||
|
||||
typedef enum {
|
||||
AC = 271,
|
||||
AS = 274,
|
||||
CC = 272,
|
||||
CE = 257,
|
||||
DW = 280,
|
||||
DP = 282,
|
||||
RA = 258,
|
||||
ST = 275
|
||||
} com_type_t;
|
||||
|
||||
#define DIAM_HEADER_LEN 20
|
||||
|
||||
// DIAMETER header
|
||||
struct diameter_header_t
|
||||
{
|
||||
u_int8_t version;
|
||||
u_int8_t length[3];
|
||||
u_int8_t flags;
|
||||
u_int8_t com_code[3];
|
||||
u_int32_t app_id;
|
||||
u_int32_t hop_id;
|
||||
u_int32_t end_id;
|
||||
};
|
||||
|
||||
|
||||
// Check packet
|
||||
int is_diameter(struct ndpi_packet_struct *packet, int size_payload)
|
||||
{
|
||||
// check param
|
||||
if(!packet || size_payload == 0) return -1;
|
||||
|
||||
// cast to diameter header
|
||||
struct diameter_header_t *diameter = (struct diameter_header_t *) packet;
|
||||
|
||||
// check if the packet is diameter
|
||||
if(diameter->version == 0x01 &&
|
||||
(diameter->flags == DIAMETER_REQUEST ||
|
||||
diameter->flags == DIAMETER_PROXYABLE ||
|
||||
diameter->flags == DIAMETER_ERROR ||
|
||||
diameter->flags == DIAMETER_RETRASM)) {
|
||||
|
||||
u_int16_t com_code = diameter->com_code[2] + (diameter->com_code[1] << 8) + (diameter->com_code[0] << 8);
|
||||
|
||||
if(com_code == AC || com_code == AS ||
|
||||
com_code == CC || com_code == CE ||
|
||||
com_code == DW || com_code == DP ||
|
||||
com_code == RA || com_code == ST)
|
||||
return 0; // OK
|
||||
}
|
||||
// wrong packet
|
||||
return -2;
|
||||
}
|
||||
|
||||
|
||||
void ndpi_search_diameter(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// Diameter is on TCP
|
||||
if(packet->tcp) {
|
||||
|
||||
/* Check if it's diameter */
|
||||
int ret = is_diameter(packet, packet->payload_packet_len);
|
||||
if(ret != 0) {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
NDPI_LOG_INFO(ndpi_struct, "found Diameter\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIAMETER, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
}
|
||||
else { // UDP
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_diameter_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||
NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("Diameter", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_DIAMETER, ndpi_search_diameter,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN, ADD_TO_DETECTION_BITMASK);
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* directconnect.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,8 +23,12 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_DIRECTCONNECT
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIRECTCONNECT
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
//#define NDPI_DEBUG_DIRECTCONNECT
|
||||
//#define NDPI_DIRECTCONNECT_PORT_DEBUG
|
||||
@@ -58,9 +62,7 @@ static u_int16_t parse_binf_message(struct ndpi_detection_module_struct
|
||||
if (memcmp(&payload[i], "DCTM", 4) == 0) {
|
||||
if (memcmp(&payload[i + 15], "ADCS", 4) == 0) {
|
||||
ssl_port = ntohs_ndpi_bytestream_to_number(&payload[i + 25], 5, &bytes_read);
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect ssl port parsed %d", ssl_port);
|
||||
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DC ssl port parsed %d\n", ssl_port);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -76,8 +78,7 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
||||
const u_int8_t connection_type)
|
||||
{
|
||||
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
struct ndpi_id_struct *src = flow->src;
|
||||
struct ndpi_id_struct *dst = flow->dst;
|
||||
|
||||
@@ -89,13 +90,11 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
||||
if (packet->tcp != NULL
|
||||
&& flow->setup_packet_direction != packet->packet_direction && src->detected_directconnect_port == 0) {
|
||||
src->detected_directconnect_port = packet->tcp->source;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect tcp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DC tcp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
||||
}
|
||||
if (packet->udp != NULL && src->detected_directconnect_udp_port == 0) {
|
||||
src->detected_directconnect_udp_port = packet->udp->source;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect udp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DC udp PORT %u for src\n", ntohs(src->detected_directconnect_port));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -113,9 +112,9 @@ static void ndpi_int_directconnect_add_connection(struct ndpi_detection_module_s
|
||||
|
||||
/*
|
||||
dst->detected_directconnect_port = packet->tcp->dest;
|
||||
NDPI_LOG (NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect tcp PORT %u for dst\n",
|
||||
ntohs (dst->detected_directconnect_port));
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
"DC tcp PORT %u for dst\n",
|
||||
ntohs (dst->detected_directconnect_port));
|
||||
*/
|
||||
}
|
||||
}
|
||||
@@ -148,14 +147,12 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if (dst != NULL) {
|
||||
dst->detected_directconnect_ssl_port =
|
||||
ntohs_ndpi_bytestream_to_number(&packet->payload[25], 5, &bytes_read);
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect ssl port parsed %d", ntohs(dst->detected_directconnect_ssl_port));
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DC ssl port parsed %d\n", ntohs(dst->detected_directconnect_ssl_port));
|
||||
}
|
||||
if (src != NULL) {
|
||||
src->detected_directconnect_ssl_port =
|
||||
ntohs_ndpi_bytestream_to_number(&packet->payload[25], 5, &bytes_read);
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect ssl port parsed %d", ntohs(src->detected_directconnect_ssl_port));
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DC ssl port parsed %d\n", ntohs(src->detected_directconnect_ssl_port));
|
||||
}
|
||||
|
||||
|
||||
@@ -168,15 +165,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if ((u_int32_t)
|
||||
(packet->tick_timestamp -
|
||||
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
src->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_port));
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(src->detected_directconnect_port));
|
||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
} else {
|
||||
src->detected_directconnect_port = 0;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "resetting src port due to timeout");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "resetting src port due to timeout\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -184,15 +179,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if ((u_int32_t)
|
||||
(packet->tick_timestamp -
|
||||
src->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
src->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(src->detected_directconnect_ssl_port));
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(src->detected_directconnect_ssl_port));
|
||||
ndpi_int_change_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
} else {
|
||||
src->detected_directconnect_ssl_port = 0;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "resetting src port due to timeout");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "resetting src port due to timeout\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -204,15 +197,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if ((u_int32_t)
|
||||
(packet->tick_timestamp -
|
||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_port));
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using port %d\n", ntohs(dst->detected_directconnect_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
} else {
|
||||
dst->detected_directconnect_port = 0;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "resetting dst port due to timeout");
|
||||
NDPI_LOG_DBG(ndpi_struct, "resetting dst port due to timeout\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -220,16 +211,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if ((u_int32_t)
|
||||
(packet->tick_timestamp -
|
||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "marking using dc port\n %d", ntohs(dst->detected_directconnect_ssl_port));
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "found DC using port %d\n", ntohs(dst->detected_directconnect_ssl_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
} else {
|
||||
dst->detected_directconnect_ssl_port = 0;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "resetting dst port due to timeout");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "resetting dst port due to timeout\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -242,8 +230,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if (packet->payload[0] == '$'
|
||||
&& packet->payload[packet->payload_packet_len - 1] == '|'
|
||||
&& (memcmp(&packet->payload[1], "Lock ", 5) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "maybe first dc connect to hub detected\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe first dc connect to hub detected\n");
|
||||
flow->directconnect_stage = 1;
|
||||
return;
|
||||
}
|
||||
@@ -251,8 +238,7 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
&& packet->payload[0] == '$'
|
||||
&& packet->payload[packet->payload_packet_len - 1] == '|'
|
||||
&& (memcmp(&packet->payload[1], "MyNick ", 7) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "maybe first dc connect between peers detected\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe first dc connect between peers detected\n");
|
||||
flow->directconnect_stage = 2;
|
||||
return;
|
||||
}
|
||||
@@ -262,15 +248,13 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
/* did not see this pattern in any trace */
|
||||
if (memcmp(&packet->payload[0], "HSUP ADBAS0", 11) == 0
|
||||
|| memcmp(&packet->payload[0], "HSUP ADBASE", 11) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "found directconnect HSUP ADBAS0 E\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC HSUP ADBAS0 E\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
||||
return;
|
||||
/* did not see this pattern in any trace */
|
||||
} else if (memcmp(&packet->payload[0], "CSUP ADBAS0", 11) == 0 ||
|
||||
memcmp(&packet->payload[0], "CSUP ADBASE", 11) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "found directconnect CSUP ADBAS0 E\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC CSUP ADBAS0 E\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_ADC_PEER);
|
||||
return;
|
||||
|
||||
@@ -283,19 +267,14 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
/* did not see this pattern in any trace */
|
||||
if (memcmp(&packet->payload[0], "HSUP ADBAS0", 11) == 0
|
||||
|| memcmp(&packet->payload[0], "HSUP ADBASE", 11) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "found directconnect HSUP ADBAS E in second packet\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC HSUP ADBAS E in second packet\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
||||
|
||||
return;
|
||||
/* did not see this pattern in any trace */
|
||||
} else if (memcmp(&packet->payload[0], "CSUP ADBAS0", 11) == 0 ||
|
||||
memcmp(&packet->payload[0], "CSUP ADBASE", 11) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "found directconnect HSUP ADBAS0 E in second packet\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC HSUP ADBAS0 E in second packet\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_ADC_PEER);
|
||||
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
@@ -304,12 +283,11 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
if (packet->payload_packet_len > 6) {
|
||||
if ((packet->payload[0] == '$' || packet->payload[0] == '<')
|
||||
&& packet->payload[packet->payload_packet_len - 1] == '|') {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "second dc detected\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC second\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_HUB);
|
||||
|
||||
return;
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "second dc not detected\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "second dc not detected\n");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -317,23 +295,17 @@ static void ndpi_search_directconnect_tcp(struct ndpi_detection_module_struct *n
|
||||
/* get client hello answer or server message */
|
||||
if (packet->payload_packet_len > 6) {
|
||||
if (packet->payload[0] == '$' && packet->payload[packet->payload_packet_len - 1] == '|') {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "second dc between peers detected\n");
|
||||
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC between peers\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
||||
|
||||
return;
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "second dc between peers not detected\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "second dc between peers not detected\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
|
||||
}
|
||||
|
||||
@@ -352,15 +324,13 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
||||
(packet->tick_timestamp -
|
||||
dst->directconnect_last_safe_access_time) < ndpi_struct->directconnect_connection_ip_tick_timeout) {
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "marking using dc udp port\n %d", ntohs(dst->detected_directconnect_udp_port));
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC using udp port %d\n", ntohs(dst->detected_directconnect_udp_port));
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DIRECTCONNECT, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
} else {
|
||||
dst->detected_directconnect_udp_port = 0;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "resetting dst udp port due to timeout");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "resetting dst udp port due to timeout\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -380,20 +350,15 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
||||
if (packet->payload[pos] == '(') {
|
||||
pos = pos - 44;
|
||||
if (pos > 2 && memcmp(&packet->payload[pos], "TTH:", 4) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "dc udp detected\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC udp\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
flow->directconnect_stage++;
|
||||
|
||||
if (flow->directconnect_stage < 3) {
|
||||
|
||||
|
||||
if (flow->directconnect_stage < 3)
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -411,7 +376,7 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
||||
if (packet->payload[pos] == '(') {
|
||||
pos = pos - 44;
|
||||
if (pos > 2 && memcmp(&packet->payload[pos], "TTH:", 4) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG, "dc udp detected\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DC udp\n");
|
||||
ndpi_int_directconnect_add_connection(ndpi_struct, flow, DIRECT_CONNECT_TYPE_PEER);
|
||||
return;
|
||||
}
|
||||
@@ -420,15 +385,11 @@ static void ndpi_search_directconnect_udp(struct ndpi_detection_module_struct
|
||||
flow->directconnect_stage++;
|
||||
if (flow->directconnect_stage < 3)
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
"excluded at stage %d \n", flow->directconnect_stage);
|
||||
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "excluded DC at stage %d \n", flow->directconnect_stage);
|
||||
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECTCONNECT);
|
||||
|
||||
@@ -442,7 +403,7 @@ void ndpi_search_directconnect(struct ndpi_detection_module_struct
|
||||
struct ndpi_id_struct *src = flow->src;
|
||||
struct ndpi_id_struct *dst = flow->dst;
|
||||
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search DC\n");
|
||||
|
||||
if (packet->detected_protocol_stack[0] == NDPI_PROTOCOL_DIRECTCONNECT) {
|
||||
if (src != NULL && ((u_int32_t)
|
||||
@@ -458,8 +419,7 @@ void ndpi_search_directconnect(struct ndpi_detection_module_struct
|
||||
dst->directconnect_last_safe_access_time = packet->tick_timestamp;
|
||||
} else {
|
||||
packet->detected_protocol_stack[0] = NDPI_PROTOCOL_UNKNOWN;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECTCONNECT, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "directconnect: skipping as unknown due to timeout\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "skipping as unknown due to timeout\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -483,5 +443,3 @@ void init_directconnect_dissector(struct ndpi_detection_module_struct *ndpi_stru
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* directdownloadlink.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-14svn - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -23,8 +23,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
#ifdef NDPI_DEBUG_DIRECT_DOWNLOAD_LINK
|
||||
@@ -52,15 +55,12 @@ static void ndpi_int_direct_download_link_add_connection(struct ndpi_detection_m
|
||||
u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
u_int16_t filename_start = 0;
|
||||
u_int8_t i = 1;
|
||||
u_int16_t host_line_len_without_port;
|
||||
|
||||
if (packet->payload_packet_len < 100) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: Packet too small.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: Packet too small\n");
|
||||
goto end_ddl_nothing_found;
|
||||
}
|
||||
|
||||
@@ -68,10 +68,10 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
|
||||
if (memcmp(packet->payload, "POST ", 5) == 0) {
|
||||
filename_start = 5; // POST
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: POST FOUND\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: POST FOUND\n");
|
||||
} else if (memcmp(packet->payload, "GET ", 4) == 0) {
|
||||
filename_start = 4; // GET
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: GET FOUND\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: GET FOUND\n");
|
||||
} else {
|
||||
goto end_ddl_nothing_found;
|
||||
}
|
||||
@@ -79,16 +79,15 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
|
||||
if (packet->host_line.ptr == NULL) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: NO HOST FOUND\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: NO HOST FOUND\n");
|
||||
goto end_ddl_nothing_found;
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: Host: found\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: Host: found\n");
|
||||
|
||||
if (packet->line[0].len < 9 + filename_start
|
||||
|| memcmp(&packet->line[0].ptr[packet->line[0].len - 9], " HTTP/1.", 8) != 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct,
|
||||
NDPI_LOG_DEBUG, "DDL: PACKET NOT HTTP CONFORM.\nXXX%.*sXXX\n",
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: PACKET NOT HTTP CONFORM.\nXXX%.*sXXX\n",
|
||||
8, &packet->line[0].ptr[packet->line[0].len - 9]);
|
||||
goto end_ddl_nothing_found;
|
||||
}
|
||||
@@ -100,11 +99,11 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
i = 2;
|
||||
while (host_line_len_without_port >= i && packet->host_line.ptr[host_line_len_without_port - i] >= '0'
|
||||
&& packet->host_line.ptr[host_line_len_without_port - i] <= '9') {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: number found\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: number found\n");
|
||||
i++;
|
||||
}
|
||||
if (host_line_len_without_port >= i && packet->host_line.ptr[host_line_len_without_port - i] == ':') {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: ':' found\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "DDL: ':' found\n");
|
||||
host_line_len_without_port = host_line_len_without_port - i;
|
||||
}
|
||||
}
|
||||
@@ -694,12 +693,12 @@ u_int8_t search_ddl_domains(struct ndpi_detection_module_struct *ndpi_struct, st
|
||||
*/
|
||||
|
||||
end_ddl_nothing_found:
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG,
|
||||
NDPI_LOG_DBG2(ndpi_struct,
|
||||
"Nothing Found\n");
|
||||
return 0;
|
||||
|
||||
end_ddl_found:
|
||||
NDPI_LOG(NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK, ndpi_struct, NDPI_LOG_DEBUG, "DDL: DIRECT DOWNLOAD LINK FOUND\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DIRECT DOWNLOAD LINK\n");
|
||||
ndpi_int_direct_download_link_add_connection(ndpi_struct, flow);
|
||||
return 1;
|
||||
}
|
||||
@@ -709,28 +708,12 @@ void ndpi_search_direct_download_link_tcp(struct ndpi_detection_module_struct *n
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
#if 0
|
||||
if (ndpi_struct->direct_download_link_counter_callback != NULL) {
|
||||
if (packet->detected_protocol == NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK) {
|
||||
/* skip packets not requests from the client to the server */
|
||||
if (packet->packet_direction == flow->l4.tcp.ddlink_server_direction) {
|
||||
search_ddl_domains(ndpi_struct, flow); // do the detection again in order to get the URL in keep alive streams
|
||||
} else {
|
||||
// just count the packet
|
||||
ndpi_struct->direct_download_link_counter_callback(flow->hash_id_number, packet->l3_packet_len);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// do not detect again if it is already ddl
|
||||
/* do not detect again if it is already ddl */
|
||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK) {
|
||||
if (search_ddl_domains(ndpi_struct, flow) != 0) {
|
||||
return;
|
||||
}
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DIRECT_DOWNLOAD_LINK);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -746,4 +729,4 @@ void init_directdownloadlink_dissector(struct ndpi_detection_module_struct *ndpi
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+162
-226
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* dns.c
|
||||
*
|
||||
* Copyright (C) 2012-15 - ntop.org
|
||||
* Copyright (C) 2012-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -21,10 +21,28 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DNS
|
||||
|
||||
#ifdef NDPI_PROTOCOL_DNS
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
#define FLAGS_MASK 0x8000
|
||||
|
||||
/* #define DNS_DEBUG 1 */
|
||||
|
||||
/* *********************************************** */
|
||||
|
||||
static u_int16_t get16(int *i, const u_int8_t *payload) {
|
||||
u_int16_t v = *(u_int16_t*)&payload[*i];
|
||||
|
||||
(*i) += 2;
|
||||
|
||||
return(ntohs(v));
|
||||
}
|
||||
|
||||
/* *********************************************** */
|
||||
|
||||
static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
||||
if(payload[i] == 0x00)
|
||||
@@ -34,272 +52,192 @@ static u_int getNameLength(u_int i, const u_int8_t *payload, u_int payloadLen) {
|
||||
else {
|
||||
u_int8_t len = payload[i];
|
||||
u_int8_t off = len + 1;
|
||||
|
||||
|
||||
if(off == 0) /* Bad packet */
|
||||
return(0);
|
||||
else
|
||||
return(off + getNameLength(i+off, payload, payloadLen));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* *********************************************** */
|
||||
|
||||
static char* ndpi_intoa_v4(unsigned int addr, char* buf, u_short bufLen) {
|
||||
char *cp, *retStr;
|
||||
uint byte;
|
||||
int n;
|
||||
|
||||
cp = &buf[bufLen];
|
||||
*--cp = '\0';
|
||||
|
||||
n = 4;
|
||||
do {
|
||||
byte = addr & 0xff;
|
||||
*--cp = byte % 10 + '0';
|
||||
byte /= 10;
|
||||
if(byte > 0) {
|
||||
*--cp = byte % 10 + '0';
|
||||
byte /= 10;
|
||||
if(byte > 0)
|
||||
*--cp = byte + '0';
|
||||
}
|
||||
*--cp = '.';
|
||||
addr >>= 8;
|
||||
} while (--n > 0);
|
||||
|
||||
/* Convert the string to lowercase */
|
||||
retStr = (char*)(cp+1);
|
||||
|
||||
return(retStr);
|
||||
}
|
||||
|
||||
/* *********************************************** */
|
||||
|
||||
static u_int16_t get16(int *i, const u_int8_t *payload) {
|
||||
u_int16_t v = *(u_int16_t*)&payload[*i];
|
||||
|
||||
(*i) += 2;
|
||||
|
||||
return(ntohs(v));
|
||||
}
|
||||
|
||||
/* *********************************************** */
|
||||
|
||||
struct dns_packet_header {
|
||||
u_int16_t transaction_id, flags, num_queries, answer_rrs, authority_rrs, additional_rrs;
|
||||
} __attribute__((packed));
|
||||
|
||||
void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int16_t dport = 0, sport = 0;
|
||||
void ndpi_search_dns(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
int x;
|
||||
u_int8_t is_query;
|
||||
u_int16_t s_port = 0, d_port = 0;
|
||||
|
||||
#define NDPI_MAX_DNS_REQUESTS 16
|
||||
NDPI_LOG_DBG(ndpi_struct, "search DNS\n");
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "search DNS.\n");
|
||||
|
||||
if (packet->udp != NULL) {
|
||||
sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "calculated dport over UDP.\n");
|
||||
} else if(packet->tcp != NULL) {
|
||||
sport = ntohs(packet->tcp->source), dport = ntohs(packet->tcp->dest);
|
||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "calculated dport over tcp.\n");
|
||||
if(flow->packet.udp != NULL) {
|
||||
s_port = ntohs(flow->packet.udp->source);
|
||||
d_port = ntohs(flow->packet.udp->dest);
|
||||
x = 0;
|
||||
} else if(flow->packet.tcp != NULL) /* pkt size > 512 bytes */ {
|
||||
s_port = ntohs(flow->packet.tcp->source);
|
||||
d_port = ntohs(flow->packet.tcp->dest);
|
||||
x = 2;
|
||||
} else {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
if(((dport == 53) || (sport == 53) || (dport == 5355))
|
||||
&& (packet->payload_packet_len > sizeof(struct dns_packet_header))) {
|
||||
int i = packet->tcp ? 2 : 0;
|
||||
struct dns_packet_header header, *dns = (struct dns_packet_header*)&packet->payload[i];
|
||||
u_int8_t is_query, ret_code, is_dns = 0;
|
||||
u_int32_t a_record[NDPI_MAX_DNS_REQUESTS] = { 0 }, query_offset, num_a_records = 0;
|
||||
if((s_port == 53 || d_port == 53 || d_port == 5355)
|
||||
&& (flow->packet.payload_packet_len > sizeof(struct ndpi_dns_packet_header)+x)) {
|
||||
struct ndpi_dns_packet_header dns_header;
|
||||
int invalid = 0;
|
||||
|
||||
header.flags = ntohs(dns->flags);
|
||||
header.transaction_id = ntohs(dns->transaction_id);
|
||||
header.num_queries = ntohs(dns->num_queries);
|
||||
header.answer_rrs = ntohs(dns->answer_rrs);
|
||||
header.authority_rrs = ntohs(dns->authority_rrs);
|
||||
header.additional_rrs = ntohs(dns->additional_rrs);
|
||||
is_query = (header.flags & 0x8000) ? 0 : 1;
|
||||
ret_code = is_query ? 0 : (header.flags & 0x0F);
|
||||
i += sizeof(struct dns_packet_header);
|
||||
query_offset = i;
|
||||
memcpy(&dns_header, (struct ndpi_dns_packet_header*) &flow->packet.payload[x], sizeof(struct ndpi_dns_packet_header));
|
||||
dns_header.tr_id = ntohs(dns_header.tr_id);
|
||||
dns_header.flags = ntohs(dns_header.flags);
|
||||
dns_header.num_queries = ntohs(dns_header.num_queries);
|
||||
dns_header.num_answers = ntohs(dns_header.num_answers);
|
||||
dns_header.authority_rrs = ntohs(dns_header.authority_rrs);
|
||||
dns_header.additional_rrs = ntohs(dns_header.additional_rrs);
|
||||
x += sizeof(struct ndpi_dns_packet_header);
|
||||
|
||||
if(is_query) {
|
||||
/* DNS Request */
|
||||
if((header.num_queries > 0) && (header.num_queries <= NDPI_MAX_DNS_REQUESTS)
|
||||
&& (((header.flags & 0x2800) == 0x2800 /* Dynamic DNS Update */)
|
||||
|| ((header.answer_rrs == 0) && (header.authority_rrs == 0)))) {
|
||||
/* This is a good query */
|
||||
is_dns = 1;
|
||||
/* 0x0000 QUERY */
|
||||
if((dns_header.flags & FLAGS_MASK) == 0x0000)
|
||||
is_query = 1;
|
||||
/* 0x8000 RESPONSE */
|
||||
else if((dns_header.flags & FLAGS_MASK) == 0x8000)
|
||||
is_query = 0;
|
||||
else
|
||||
invalid = 1;
|
||||
|
||||
if(header.num_queries > 0) {
|
||||
while(i < packet->payload_packet_len) {
|
||||
if(packet->payload[i] == '\0') {
|
||||
i++;
|
||||
flow->protos.dns.query_type = get16(&i, packet->payload);
|
||||
if(!invalid) {
|
||||
if(is_query) {
|
||||
/* DNS Request */
|
||||
if((dns_header.num_queries > 0) && (dns_header.num_queries <= NDPI_MAX_DNS_REQUESTS)
|
||||
&& (((dns_header.flags & 0x2800) == 0x2800 /* Dynamic DNS Update */)
|
||||
|| ((dns_header.num_answers == 0) && (dns_header.authority_rrs == 0)))) {
|
||||
/* This is a good query */
|
||||
|
||||
if(dns_header.num_queries > 0) {
|
||||
while(x < flow->packet.payload_packet_len) {
|
||||
if(flow->packet.payload[x] == '\0') {
|
||||
x++;
|
||||
flow->protos.dns.query_type = get16(&x, flow->packet.payload);
|
||||
#ifdef DNS_DEBUG
|
||||
NDPI_LOG_DBG2(ndpi_struct, "query_type=%2d\n", flow->protos.dns.query_type);
|
||||
#endif
|
||||
break;
|
||||
} else
|
||||
i++;
|
||||
x++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* DNS Reply */
|
||||
|
||||
flow->server_id = flow->dst;
|
||||
|
||||
if((header.num_queries <= NDPI_MAX_DNS_REQUESTS) /* Don't assume that num_queries must be zero */
|
||||
&& (((header.answer_rrs > 0) && (header.answer_rrs <= NDPI_MAX_DNS_REQUESTS))
|
||||
|| ((header.authority_rrs > 0) && (header.authority_rrs <= NDPI_MAX_DNS_REQUESTS))
|
||||
|| ((header.additional_rrs > 0) && (header.additional_rrs <= NDPI_MAX_DNS_REQUESTS)))
|
||||
) {
|
||||
/* This is a good reply */
|
||||
is_dns = 1;
|
||||
|
||||
i++;
|
||||
|
||||
if(packet->payload[i] != '\0') {
|
||||
while((i < packet->payload_packet_len)
|
||||
&& (packet->payload[i] != '\0')) {
|
||||
i++;
|
||||
}
|
||||
} else
|
||||
invalid = 1;
|
||||
|
||||
} else {
|
||||
/* DNS Reply */
|
||||
|
||||
flow->protos.dns.reply_code = dns_header.flags & 0x0F;
|
||||
|
||||
if((dns_header.num_queries > 0) && (dns_header.num_queries <= NDPI_MAX_DNS_REQUESTS) /* Don't assume that num_queries must be zero */
|
||||
&& (((dns_header.num_answers > 0) && (dns_header.num_answers <= NDPI_MAX_DNS_REQUESTS))
|
||||
|| ((dns_header.authority_rrs > 0) && (dns_header.authority_rrs <= NDPI_MAX_DNS_REQUESTS))
|
||||
|| ((dns_header.additional_rrs > 0) && (dns_header.additional_rrs <= NDPI_MAX_DNS_REQUESTS)))
|
||||
) {
|
||||
/* This is a good reply */
|
||||
if(ndpi_struct->dns_dissect_response) {
|
||||
x++;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
i += 4;
|
||||
|
||||
if(header.answer_rrs > 0) {
|
||||
u_int16_t rsp_type;
|
||||
u_int16_t num;
|
||||
|
||||
for(num = 0; num < header.answer_rrs; num++) {
|
||||
u_int16_t data_len;
|
||||
|
||||
if((i+6) >= packet->payload_packet_len) {
|
||||
break;
|
||||
if(flow->packet.payload[x] != '\0') {
|
||||
while((x < flow->packet.payload_packet_len)
|
||||
&& (flow->packet.payload[x] != '\0')) {
|
||||
x++;
|
||||
}
|
||||
|
||||
x++;
|
||||
}
|
||||
|
||||
if((data_len = getNameLength(i, packet->payload, packet->payload_packet_len)) == 0) {
|
||||
break;
|
||||
} else
|
||||
i += data_len;
|
||||
|
||||
rsp_type = get16(&i, packet->payload);
|
||||
x += 4;
|
||||
|
||||
// Skip past the CLASS (2 octets) and TTL (4 octets) fields.
|
||||
i += 6;
|
||||
data_len = get16(&i, packet->payload);
|
||||
if(dns_header.num_answers > 0) {
|
||||
u_int16_t rsp_type;
|
||||
u_int16_t num;
|
||||
|
||||
if((data_len <= 1) || (data_len > (packet->payload_packet_len-i))) {
|
||||
break;
|
||||
}
|
||||
for(num = 0; num < dns_header.num_answers; num++) {
|
||||
u_int16_t data_len;
|
||||
|
||||
if((x+6) >= flow->packet.payload_packet_len) {
|
||||
break;
|
||||
}
|
||||
|
||||
flow->protos.dns.rsp_type = rsp_type;
|
||||
|
||||
if(rsp_type == 1 /* A */) {
|
||||
if(data_len == 4) {
|
||||
u_int32_t v = ntohl(*((u_int32_t*)&packet->payload[i]));
|
||||
|
||||
if(num_a_records < (NDPI_MAX_DNS_REQUESTS-1))
|
||||
a_record[num_a_records++] = v;
|
||||
else
|
||||
break; /* One record is enough */
|
||||
if((data_len = getNameLength(x, flow->packet.payload, flow->packet.payload_packet_len)) == 0) {
|
||||
break;
|
||||
} else
|
||||
x += data_len;
|
||||
|
||||
rsp_type = get16(&x, flow->packet.payload);
|
||||
flow->protos.dns.rsp_type = rsp_type;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(data_len == 0) {
|
||||
break;
|
||||
}
|
||||
|
||||
i += data_len;
|
||||
} /* for */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if((header.num_queries <= NDPI_MAX_DNS_REQUESTS)
|
||||
&& ((header.answer_rrs == 0)
|
||||
|| (header.authority_rrs == 0)
|
||||
|| (header.additional_rrs == 0))
|
||||
&& (ret_code != 0 /* 0 == OK */)
|
||||
) {
|
||||
/* This is a good reply */
|
||||
is_dns = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(is_dns) {
|
||||
int j = 0;
|
||||
|
||||
flow->protos.dns.num_queries = (u_int8_t)header.num_queries,
|
||||
flow->protos.dns.num_answers = (u_int8_t)(header.answer_rrs+header.authority_rrs+header.additional_rrs),
|
||||
flow->protos.dns.ret_code = ret_code;
|
||||
|
||||
i = query_offset+1;
|
||||
|
||||
while((i < packet->payload_packet_len)
|
||||
&& (j < (sizeof(flow->host_server_name)-1))
|
||||
&& (packet->payload[i] != '\0')) {
|
||||
flow->host_server_name[j] = tolower(packet->payload[i]);
|
||||
if(flow->host_server_name[j] < ' ')
|
||||
flow->host_server_name[j] = '.';
|
||||
j++, i++;
|
||||
if(invalid) {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
if(a_record[0] != 0) {
|
||||
char a_buf[32];
|
||||
int i;
|
||||
/* extract host name server */
|
||||
int j = 0, max_len = sizeof(flow->host_server_name)-1, off = sizeof(struct ndpi_dns_packet_header) + 1;
|
||||
|
||||
for(i=0; i<num_a_records; i++) {
|
||||
j += snprintf((char*)&flow->host_server_name[j], sizeof(flow->host_server_name)-1-j, "%s%s",
|
||||
(i == 0) ? "@" : ";",
|
||||
ndpi_intoa_v4(a_record[i], a_buf, sizeof(a_buf)));
|
||||
}
|
||||
while(off < flow->packet.payload_packet_len && flow->packet.payload[off] != '\0') {
|
||||
flow->host_server_name[j] = flow->packet.payload[off];
|
||||
if(j < max_len) {
|
||||
if(flow->host_server_name[j] < ' ')
|
||||
flow->host_server_name[j] = '.';
|
||||
j++;
|
||||
} else
|
||||
break;
|
||||
|
||||
off++;
|
||||
}
|
||||
|
||||
|
||||
if(is_query && ndpi_struct->dns_dissect_response)
|
||||
return; /* The response will set the verdict */
|
||||
|
||||
flow->host_server_name[j] = '\0';
|
||||
|
||||
flow->protos.dns.num_queries = (u_int8_t)dns_header.num_queries,
|
||||
flow->protos.dns.num_answers = (u_int8_t) (dns_header.num_answers + dns_header.authority_rrs + dns_header.additional_rrs);
|
||||
|
||||
if(j > 0) {
|
||||
#ifdef DEBUG
|
||||
printf("==> %s\n", flow->host_server_name);
|
||||
#endif
|
||||
|
||||
if(ndpi_struct->match_dns_host_names)
|
||||
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
||||
(char *)flow->host_server_name,
|
||||
strlen((const char*)flow->host_server_name),
|
||||
NDPI_PROTOCOL_DNS);
|
||||
ndpi_protocol_match_result ret_match;
|
||||
|
||||
ndpi_match_host_subprotocol(ndpi_struct, flow,
|
||||
(char *)flow->host_server_name,
|
||||
strlen((const char*)flow->host_server_name),
|
||||
&ret_match,
|
||||
NDPI_PROTOCOL_DNS);
|
||||
}
|
||||
|
||||
i++;
|
||||
|
||||
memcpy(&flow->protos.dns.query_type, &packet->payload[i], 2);
|
||||
flow->protos.dns.query_type = ntohs(flow->protos.dns.query_type), i += 2;
|
||||
|
||||
memcpy(&flow->protos.dns.query_class, &packet->payload[i], 2);
|
||||
flow->protos.dns.query_class = ntohs(flow->protos.dns.query_class), i += 2;
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("%s [type=%04X][class=%04X]\n", flow->host_server_name, flow->protos.dns.query_type, flow->protos.dns.query_class);
|
||||
|
||||
#ifdef DNS_DEBUG
|
||||
NDPI_LOG_DBG2(ndpi_struct, "[num_queries=%d][num_answers=%d][reply_code=%u][rsp_type=%u][host_server_name=%s]\n",
|
||||
flow->protos.dns.num_queries, flow->protos.dns.num_answers,
|
||||
flow->protos.dns.reply_code, flow->protos.dns.rsp_type, flow->host_server_name
|
||||
);
|
||||
#endif
|
||||
|
||||
if(packet->detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
||||
/*
|
||||
|
||||
if(flow->packet.detected_protocol_stack[0] == NDPI_PROTOCOL_UNKNOWN) {
|
||||
/**
|
||||
Do not set the protocol with DNS if ndpi_match_host_subprotocol() has
|
||||
matched a subprotocol
|
||||
*/
|
||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "found DNS.\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, (dport == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS, NDPI_PROTOCOL_UNKNOWN);
|
||||
**/
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DNS\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, (d_port == 5355) ? NDPI_PROTOCOL_LLMNR : NDPI_PROTOCOL_DNS, NDPI_PROTOCOL_UNKNOWN);
|
||||
} else {
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
} else {
|
||||
flow->protos.dns.bad_packet = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DNS, ndpi_struct, NDPI_LOG_DEBUG, "exclude DNS.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DNS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void init_dns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("DNS", ndpi_struct, detection_bitmask, *id,
|
||||
@@ -311,5 +249,3 @@ void init_dns_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+47
-55
@@ -2,7 +2,7 @@
|
||||
* dofus.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,76 +22,66 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DOFUS
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_DOFUS
|
||||
|
||||
static void ndpi_dofus_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DOFUS, NDPI_PROTOCOL_UNKNOWN);
|
||||
NDPI_LOG_INFO(ndpi_struct, "found dofus\n");
|
||||
}
|
||||
|
||||
void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search dofus\n");
|
||||
|
||||
/* Dofus v 1.x.x */
|
||||
if (packet->payload_packet_len == 13 && get_u_int16_t(packet->payload, 1) == ntohs(0x0508)
|
||||
&& get_u_int16_t(packet->payload, 5) == ntohs(0x04a0)
|
||||
&& get_u_int16_t(packet->payload, packet->payload_packet_len - 2) == ntohs(0x0194)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len == 3 && memcmp(packet->payload, "HG", 2) == 0
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
||||
flow->l4.tcp.dofus_stage = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
||||
return;
|
||||
if (flow->l4.tcp.dofus_stage == 0) {
|
||||
if (packet->payload_packet_len == 3 && memcmp(packet->payload, "HG", 2) == 0
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||
goto maybe_dofus;
|
||||
|
||||
if (packet->payload_packet_len == 12 && memcmp(packet->payload, "Af", 2) == 0
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||
goto maybe_dofus;
|
||||
|
||||
if (packet->payload_packet_len == 35 && memcmp(packet->payload, "HC", 2) == 0
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||
goto maybe_dofus;
|
||||
|
||||
if (packet->payload_packet_len > 2 && packet->payload[0] == 'A'
|
||||
&& (packet->payload[1] == 'x' || packet->payload[1] == 'X')
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||
goto maybe_dofus;
|
||||
|
||||
if (packet->payload_packet_len > 2 && memcmp(packet->payload, "Ad", 2)
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0)
|
||||
goto maybe_dofus;
|
||||
|
||||
}
|
||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len == 35 && memcmp(packet->payload, "HC", 2) == 0
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
||||
flow->l4.tcp.dofus_stage = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len > 2 && packet->payload[0] == 'A'
|
||||
&& (packet->payload[1] == 'x' || packet->payload[1] == 'X')
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
||||
flow->l4.tcp.dofus_stage = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len == 12 && memcmp(packet->payload, "Af", 2) == 0
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
||||
flow->l4.tcp.dofus_stage = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
||||
return;
|
||||
}
|
||||
if (flow->l4.tcp.dofus_stage == 0 && packet->payload_packet_len > 2 && memcmp(packet->payload, "Ad", 2)
|
||||
&& packet->payload[packet->payload_packet_len - 1] == 0) {
|
||||
flow->l4.tcp.dofus_stage = 1;
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "maybe dofus.\n");
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 11 && memcmp(packet->payload, "AT", 2) == 0 && packet->payload[10] == 0x00) {
|
||||
if (flow->l4.tcp.dofus_stage == 1) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
||||
if (flow->l4.tcp.dofus_stage == 1) {
|
||||
if (packet->payload_packet_len == 11 && memcmp(packet->payload, "AT", 2) == 0
|
||||
&& packet->payload[10] == 0x00) {
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 5
|
||||
&& packet->payload[0] == 'A' && packet->payload[4] == 0x00
|
||||
&& (packet->payload[1] == 'T' || packet->payload[1] == 'k')) {
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (flow->l4.tcp.dofus_stage == 1 && packet->payload_packet_len == 5
|
||||
&& packet->payload[0] == 'A' && packet->payload[4] == 0x00 && (packet->payload[1] == 'T'
|
||||
|| packet->payload[1] == 'k')) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus asym.\n");
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
/* end Dofus 1.x.x */
|
||||
|
||||
@@ -109,7 +99,6 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if (packet->payload_packet_len == 49 && ntohs(get_u_int16_t(packet->payload, 15)) + 17 != packet->payload_packet_len) {
|
||||
goto exclude;
|
||||
}
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -120,7 +109,6 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
goto exclude;
|
||||
len2 = ntohs(get_u_int16_t(packet->payload, 5 + len));
|
||||
if (5 + len + 2 + len2 == packet->payload_packet_len) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -135,16 +123,20 @@ void ndpi_search_dofus(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
if ((12 + len + 2 + len2 + 1) > packet->payload_packet_len)
|
||||
goto exclude;
|
||||
if (12 + len + 2 + len2 + 1 == packet->payload_packet_len && packet->payload[12 + len + 2 + len2] == 0x01) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "found dofus.\n");
|
||||
ndpi_dofus_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
exclude:
|
||||
NDPI_LOG(NDPI_PROTOCOL_DOFUS, ndpi_struct, NDPI_LOG_DEBUG, "exclude dofus.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DOFUS);
|
||||
}
|
||||
exclude:
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
|
||||
maybe_dofus:
|
||||
flow->l4.tcp.dofus_stage = 1;
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe dofus\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void init_dofus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
@@ -157,4 +149,4 @@ void init_dofus_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_in
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* drda.c
|
||||
*
|
||||
* Copyright (C) 2012-18 - ntop.org
|
||||
*
|
||||
* This module is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This module is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License.
|
||||
* If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DRDA
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
struct ndpi_drda_hdr {
|
||||
u_int16_t length;
|
||||
u_int8_t magic;
|
||||
u_int8_t format;
|
||||
u_int16_t correlID;
|
||||
u_int16_t length2;
|
||||
u_int16_t code_pnt;
|
||||
};
|
||||
|
||||
|
||||
void ndpi_search_drda(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct * packet = &flow->packet;
|
||||
u_int16_t payload_len = packet->payload_packet_len;
|
||||
u_int count = 0; // prevent integer overflow
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search DRDA\n");
|
||||
|
||||
if(packet->tcp != NULL) {
|
||||
|
||||
/* check port */
|
||||
if(payload_len >= sizeof(struct ndpi_drda_hdr)) {
|
||||
|
||||
struct ndpi_drda_hdr * drda = (struct ndpi_drda_hdr *) packet->payload;
|
||||
|
||||
u_int16_t len = ntohs(drda->length);
|
||||
|
||||
/* check first header */
|
||||
if(len != ntohs(drda->length2) + 6 ||
|
||||
drda->magic != 0xd0)
|
||||
goto no_drda;
|
||||
|
||||
/* check if there are more drda headers */
|
||||
if(payload_len > len) {
|
||||
|
||||
count = len;
|
||||
|
||||
while(count + sizeof(struct ndpi_drda_hdr) < payload_len)
|
||||
{
|
||||
/* update info */
|
||||
drda = (struct ndpi_drda_hdr *)(packet->payload + count);
|
||||
len = ntohs(drda->length);
|
||||
|
||||
if(len != ntohs(drda->length2) + 6 ||
|
||||
drda->magic != 0xd0)
|
||||
goto no_drda;
|
||||
|
||||
count += len;
|
||||
}
|
||||
if(count != payload_len) goto no_drda;
|
||||
}
|
||||
NDPI_LOG_INFO(ndpi_struct, "found DRDA\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_DRDA, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
no_drda:
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
/* ***************************************************************** */
|
||||
|
||||
|
||||
void init_drda_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||
NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("DRDA", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_DRDA,
|
||||
ndpi_search_drda,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_TCP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
+14
-12
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* dropbox.c
|
||||
*
|
||||
* Copyright (C) 2011-13 by ntop.org
|
||||
* Copyright (C) 2012-18 by ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -21,10 +21,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_DROPBOX
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_DROPBOX
|
||||
|
||||
#define DB_LSP_PORT 17500
|
||||
|
||||
|
||||
static void ndpi_int_dropbox_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow,
|
||||
u_int8_t due_to_correlation)
|
||||
@@ -40,13 +46,14 @@ static void ndpi_check_dropbox(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
u_int32_t payload_len = packet->payload_packet_len;
|
||||
|
||||
if(packet->udp != NULL) {
|
||||
u_int16_t dropbox_port = htons(17500);
|
||||
u_int16_t dropbox_port = htons(DB_LSP_PORT);
|
||||
|
||||
if((packet->udp->source == dropbox_port)
|
||||
&& (packet->udp->dest == dropbox_port)) {
|
||||
if(payload_len > 2) {
|
||||
if(strncmp((const char *)packet->payload, "{\"", 2) == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_DROPBOX, ndpi_struct, NDPI_LOG_DEBUG, "Found dropbox.\n");
|
||||
if(strncmp((const char *)packet->payload, "{\"host_int\"", 11) == 0) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found dropbox\n");
|
||||
ndpi_int_dropbox_add_connection(ndpi_struct, flow, 0);
|
||||
return;
|
||||
}
|
||||
@@ -54,15 +61,14 @@ static void ndpi_check_dropbox(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DROPBOX, ndpi_struct, NDPI_LOG_DEBUG, "exclude dropbox.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_DROPBOX);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
void ndpi_search_dropbox(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_DROPBOX, ndpi_struct, NDPI_LOG_DEBUG, "dropbox detection...\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search dropbox\n");
|
||||
|
||||
/* skip marked packets */
|
||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_DROPBOX) {
|
||||
@@ -83,7 +89,3 @@ void init_dropbox_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+31
-28
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* eaq.c
|
||||
*
|
||||
* Copyright (C) 2015 - ntop.org
|
||||
* Copyright (C) 2015-18 - ntop.org
|
||||
*
|
||||
* This module is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -24,12 +24,16 @@
|
||||
|
||||
http://www.brasilbandalarga.com.br
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EAQ
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#define EAQ_DEFAULT_PORT 6000
|
||||
#define EAQ_DEFAULT_SIZE 16
|
||||
|
||||
#ifdef NDPI_PROTOCOL_EAQ
|
||||
static void ndpi_int_eaq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EAQ, NDPI_PROTOCOL_UNKNOWN);
|
||||
@@ -40,33 +44,34 @@ void ndpi_search_eaq(struct ndpi_detection_module_struct *ndpi_struct, struct nd
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
u_int16_t sport = ntohs(packet->udp->source), dport = ntohs(packet->udp->dest);
|
||||
|
||||
if((packet->payload_packet_len != EAQ_DEFAULT_SIZE)
|
||||
|| ((sport != EAQ_DEFAULT_PORT) && (dport != EAQ_DEFAULT_PORT))) {
|
||||
exclude_eaq:
|
||||
NDPI_LOG(NDPI_PROTOCOL_EAQ, ndpi_struct, NDPI_LOG_DEBUG, "Exclude eaq.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_EAQ);
|
||||
return;
|
||||
}
|
||||
NDPI_LOG_DBG(ndpi_struct, "search eaq\n");
|
||||
|
||||
if(packet->udp != NULL) {
|
||||
u_int32_t seq = (packet->payload[0] * 1000) + (packet->payload[1] * 100) + (packet->payload[2] * 10) + packet->payload[3];
|
||||
|
||||
if(flow->l4.udp.eaq_pkt_id == 0)
|
||||
flow->l4.udp.eaq_sequence = seq;
|
||||
else {
|
||||
if((flow->l4.udp.eaq_sequence == seq) || ((flow->l4.udp.eaq_sequence+1) == seq)) {
|
||||
; /* Looks good */
|
||||
} else
|
||||
goto exclude_eaq;
|
||||
}
|
||||
do {
|
||||
if( (packet->payload_packet_len != EAQ_DEFAULT_SIZE) ||
|
||||
((sport != EAQ_DEFAULT_PORT) && (dport != EAQ_DEFAULT_PORT)) )
|
||||
break;
|
||||
|
||||
if(packet->udp != NULL) {
|
||||
u_int32_t seq = (packet->payload[0] * 1000) + (packet->payload[1] * 100) + (packet->payload[2] * 10) + packet->payload[3];
|
||||
|
||||
if(flow->l4.udp.eaq_pkt_id == 0)
|
||||
flow->l4.udp.eaq_sequence = seq;
|
||||
else {
|
||||
if( (flow->l4.udp.eaq_sequence != seq) &&
|
||||
((flow->l4.udp.eaq_sequence+1) != seq)) break;
|
||||
}
|
||||
|
||||
if(++flow->l4.udp.eaq_pkt_id == 4) {
|
||||
/* We have collected enough packets so we assume it's EAQ */
|
||||
NDPI_LOG(NDPI_PROTOCOL_EAQ, ndpi_struct, NDPI_LOG_DEBUG, "found eaq.\n");
|
||||
ndpi_int_eaq_add_connection(ndpi_struct, flow);
|
||||
if(++flow->l4.udp.eaq_pkt_id == 4) {
|
||||
/* We have collected enough packets so we assume it's EAQ */
|
||||
NDPI_LOG_INFO(ndpi_struct, "found eaq\n");
|
||||
ndpi_int_eaq_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else
|
||||
goto exclude_eaq;
|
||||
} while(0);
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -81,5 +86,3 @@ void init_eaq_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int3
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+11
-10
@@ -23,10 +23,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_EDONKEY
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_EDONKEY
|
||||
|
||||
static void ndpi_int_edonkey_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_EDONKEY, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
@@ -159,24 +162,23 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
/* Break after 20 packets. */
|
||||
if (flow->packet_counter > 20) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "Exclude EDONKEY.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_EDONKEY);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Check if we so far detected the protocol in the request or not. */
|
||||
if (flow->edonkey_stage == 0) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "EDONKEY stage 0: \n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage 0: \n");
|
||||
|
||||
if (ndpi_edonkey_payload_check(packet->payload, payload_len)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "Possible EDONKEY request detected, we will look further for the response...\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "Possible EDONKEY request detected, we will look further for the response\n");
|
||||
|
||||
/* Encode the direction of the packet in the stage, so we will know when we need to look for the response packet. */
|
||||
flow->edonkey_stage = packet->packet_direction + 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "EDONKEY stage %u: \n", flow->edonkey_stage);
|
||||
NDPI_LOG_DBG2(ndpi_struct, "EDONKEY stage %u: \n", flow->edonkey_stage);
|
||||
|
||||
/* At first check, if this is for sure a response packet (in another direction. If not, do nothing now and return. */
|
||||
if ((flow->edonkey_stage - packet->packet_direction) == 1) {
|
||||
@@ -185,10 +187,10 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
/* This is a packet in another direction. Check if we find the proper response. */
|
||||
if ((payload_len == 0) || (ndpi_edonkey_payload_check(packet->payload, payload_len))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "Found EDONKEY.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found EDONKEY\n");
|
||||
ndpi_int_edonkey_add_connection(ndpi_struct, flow);
|
||||
} else {
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "The reply did not seem to belong to EDONKEY, resetting the stage to 0...\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "The reply did not seem to belong to EDONKEY, resetting the stage to 0\n");
|
||||
flow->edonkey_stage = 0;
|
||||
}
|
||||
|
||||
@@ -198,7 +200,7 @@ static void ndpi_check_edonkey(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
void ndpi_search_edonkey(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow) {
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_EDONKEY, ndpi_struct, NDPI_LOG_DEBUG, "EDONKEY detection...\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search EDONKEY\n");
|
||||
|
||||
/* skip marked packets */
|
||||
if (packet->detected_protocol_stack[0] != NDPI_PROTOCOL_EDONKEY) {
|
||||
@@ -221,4 +223,3 @@ void init_edonkey_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* fasttrack.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,11 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
|
||||
#ifdef NDPI_PROTOCOL_FASTTRACK
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FASTTRACK
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_fasttrack_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
@@ -39,11 +39,12 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
NDPI_LOG_DBG(ndpi_struct, "search FASTTRACK\n");
|
||||
|
||||
if (packet->payload_packet_len > 6 && ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "detected 0d0a at the end of the packet.\n");
|
||||
if ( (packet->payload != NULL)
|
||||
&& (packet->payload_packet_len > 6)
|
||||
&& (ntohs(get_u_int16_t(packet->payload, packet->payload_packet_len - 2)) == 0x0d0a)) {
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected 0d0a at the end of the packet\n");
|
||||
|
||||
if (memcmp(packet->payload, "GIVE ", 5) == 0 && packet->payload_packet_len >= 8) {
|
||||
u_int16_t i;
|
||||
@@ -54,20 +55,20 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "FASTTRACK GIVE DETECTED\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found FASTTRACK\n");
|
||||
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
if (packet->payload_packet_len > 50 && memcmp(packet->payload, "GET /", 5) == 0) {
|
||||
u_int8_t a = 0;
|
||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "detected GET /. \n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "detected GET /. \n");
|
||||
ndpi_parse_packet_line_info(ndpi_struct, flow);
|
||||
for (a = 0; a < packet->parsed_lines; a++) {
|
||||
if ((packet->line[a].len > 17 && memcmp(packet->line[a].ptr, "X-Kazaa-Username: ", 18) == 0)
|
||||
|| (packet->line[a].len > 23 && memcmp(packet->line[a].ptr, "User-Agent: PeerEnabler/", 24) == 0)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE,
|
||||
"detected X-Kazaa-Username: || User-Agent: PeerEnabler/\n");
|
||||
NDPI_LOG_INFO(ndpi_struct,
|
||||
"found FASTTRACK X-Kazaa-Username: || User-Agent: PeerEnabler/\n");
|
||||
ndpi_int_fasttrack_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -76,8 +77,7 @@ void ndpi_search_fasttrack_tcp(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
}
|
||||
|
||||
exclude_fasttrack:
|
||||
NDPI_LOG(NDPI_PROTOCOL_FASTTRACK, ndpi_struct, NDPI_LOG_TRACE, "fasttrack/kazaa excluded.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FASTTRACK);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -92,5 +92,3 @@ void init_fasttrack_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* fbzero.c
|
||||
*
|
||||
* Copyright (C) 2018 - ntop.org
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
/* https://code.facebook.com/posts/608854979307125/building-zero-protocol-for-fast-secure-mobile-connections/ */
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FBZERO
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
PACK_ON
|
||||
struct fbzero_tag {
|
||||
char tag[4];
|
||||
u_int32_t tag_offset_len;
|
||||
} PACK_OFF;
|
||||
|
||||
PACK_ON
|
||||
struct fbzero_header {
|
||||
u_int8_t flags;
|
||||
char version[3];
|
||||
u_int8_t unknown;
|
||||
u_int32_t len;
|
||||
char tag[4];
|
||||
u_int16_t tag_number, _pad;
|
||||
} PACK_OFF;
|
||||
|
||||
/* **************************************************************************** */
|
||||
|
||||
void ndpi_search_fbzero(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow) {
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search FacebookZero\n");
|
||||
|
||||
if(packet->payload_packet_len > sizeof(struct fbzero_header)) {
|
||||
struct fbzero_header *h = (struct fbzero_header*)packet->payload;
|
||||
struct fbzero_tag *t;
|
||||
u_int offset = sizeof(struct fbzero_header), i, data_offset, tag_number, data_prev_offset = 0;
|
||||
|
||||
if((h->flags & 0x01) == 0)
|
||||
goto fbzero_not_found;
|
||||
|
||||
if((h->version[0] != 'Q')
|
||||
|| (h->version[1] != 'T')
|
||||
|| (h->version[2] != 'V'))
|
||||
goto fbzero_not_found;
|
||||
|
||||
if(h->unknown != 0x30)
|
||||
goto fbzero_not_found;
|
||||
|
||||
t = (struct fbzero_tag*)&packet->payload[offset];
|
||||
tag_number = h->tag_number;
|
||||
data_offset = offset + tag_number*sizeof(struct fbzero_tag);
|
||||
|
||||
if(strncmp(h->tag, "CHLO", 4))
|
||||
goto fbzero_not_found;
|
||||
|
||||
for(i=0; i<h->tag_number; i++) {
|
||||
#ifdef DEBUG
|
||||
printf("[FBZERO] %u) %c%c%c%c\n", i, t->tag[0], t->tag[1], t->tag[2], t->tag[3]);
|
||||
#endif
|
||||
|
||||
offset += sizeof(struct fbzero_tag);
|
||||
|
||||
if((t->tag[0] == 'S') && (t->tag[1] == 'N')
|
||||
&& (t->tag[2] == 'I') && (t->tag[3] == '\0')) {
|
||||
char *value = (char*)&packet->payload[data_offset + data_prev_offset];
|
||||
u_int tag_len = t->tag_offset_len-data_prev_offset, max_len;
|
||||
ndpi_protocol_match_result ret_match;
|
||||
|
||||
max_len = ndpi_min(tag_len, sizeof(flow->host_server_name)-1);
|
||||
|
||||
strncpy((char*)flow->host_server_name, value, max_len);
|
||||
flow->host_server_name[max_len] = '\0';
|
||||
|
||||
#ifdef DEBUG
|
||||
printf("[FBZERO] SNI [@%u][len: %u][%s]\n", tag_len,
|
||||
t->tag_offset_len-data_prev_offset, flow->host_server_name);
|
||||
#endif
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FBZERO, NDPI_PROTOCOL_UNKNOWN);
|
||||
|
||||
ndpi_match_host_subprotocol(ndpi_struct, flow, (char *)flow->host_server_name,
|
||||
strlen((const char *)flow->host_server_name),
|
||||
&ret_match,
|
||||
NDPI_PROTOCOL_FBZERO);
|
||||
return;
|
||||
}
|
||||
|
||||
data_prev_offset = t->tag_offset_len;
|
||||
t = (struct fbzero_tag*)&packet->payload[offset];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
fbzero_not_found:
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
/* **************************************************************************** */
|
||||
|
||||
void init_fbzero_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id,
|
||||
NDPI_PROTOCOL_BITMASK *detection_bitmask) {
|
||||
ndpi_set_bitmask_protocol_detection("FacebookZero", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_FBZERO,
|
||||
ndpi_search_fbzero,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
+12
-15
@@ -2,7 +2,7 @@
|
||||
* fiesta.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,9 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* include files */
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_FIESTA
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FIESTA
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
@@ -35,18 +37,15 @@ static void ndpi_int_fiesta_add_connection(struct ndpi_detection_module_struct *
|
||||
void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "search fiesta.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search fiesta\n");
|
||||
|
||||
if (flow->l4.tcp.fiesta_stage == 0 && packet->payload_packet_len == 5
|
||||
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0407)
|
||||
&& (packet->payload[2] == 0x08)
|
||||
&& (packet->payload[4] == 0x00 || packet->payload[4] == 0x01)) {
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "maybe fiesta symmetric, first packet.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe fiesta symmetric, first packet\n");
|
||||
flow->l4.tcp.fiesta_stage = 1 + packet->packet_direction;
|
||||
goto maybe_fiesta;
|
||||
}
|
||||
@@ -54,7 +53,7 @@ void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
&& ((packet->payload_packet_len > 1 && packet->payload_packet_len - 1 == packet->payload[0])
|
||||
|| (packet->payload_packet_len > 3 && packet->payload[0] == 0
|
||||
&& get_l16(packet->payload, 1) == packet->payload_packet_len - 3))) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "Maybe fiesta.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "Maybe fiesta\n");
|
||||
goto maybe_fiesta;
|
||||
}
|
||||
if (flow->l4.tcp.fiesta_stage == (1 + packet->packet_direction)) {
|
||||
@@ -79,16 +78,15 @@ void ndpi_search_fiesta(struct ndpi_detection_module_struct *ndpi_struct, struct
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "exclude fiesta.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FIESTA);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
return;
|
||||
|
||||
maybe_fiesta:
|
||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "Stage is set to %d.\n", flow->l4.tcp.fiesta_stage);
|
||||
NDPI_LOG_DBG2(ndpi_struct, "Stage is set to %d\n", flow->l4.tcp.fiesta_stage);
|
||||
return;
|
||||
|
||||
add_fiesta:
|
||||
NDPI_LOG(NDPI_PROTOCOL_FIESTA, ndpi_struct, NDPI_LOG_DEBUG, "detected fiesta.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found fiesta\n");
|
||||
ndpi_int_fiesta_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
@@ -105,4 +103,3 @@ void init_fiesta_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_i
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* filetopia.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_FILETOPIA
|
||||
|
||||
|
||||
static void ndpi_int_filetopia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FILETOPIA, NDPI_PROTOCOL_UNKNOWN);
|
||||
}
|
||||
|
||||
void ndpi_search_filetopia_tcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
if (flow->l4.tcp.filetopia_stage == 0) {
|
||||
if (packet->payload_packet_len >= 50 && packet->payload_packet_len <= 70
|
||||
&& packet->payload[0] == 0x03 && packet->payload[1] == 0x9a
|
||||
&& packet->payload[3] == 0x22 && packet->payload[packet->payload_packet_len - 1] == 0x2b) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FILETOPIA, ndpi_struct, NDPI_LOG_DEBUG, "Filetopia stage 1 detected\n");
|
||||
flow->l4.tcp.filetopia_stage = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (flow->l4.tcp.filetopia_stage == 1) {
|
||||
if (packet->payload_packet_len >= 100 && packet->payload[0] == 0x03
|
||||
&& packet->payload[1] == 0x9a && (packet->payload[3] == 0x22 || packet->payload[3] == 0x23)) {
|
||||
|
||||
int i;
|
||||
for (i = 0; i < 10; i++) { // check 10 bytes for valid ASCII printable characters
|
||||
if (!(packet->payload[5 + i] >= 0x20 && packet->payload[5 + i] <= 0x7e)) {
|
||||
goto end_filetopia_nothing_found;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FILETOPIA, ndpi_struct, NDPI_LOG_DEBUG, "Filetopia stage 2 detected\n");
|
||||
flow->l4.tcp.filetopia_stage = 2;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
} else if (flow->l4.tcp.filetopia_stage == 2) {
|
||||
if (packet->payload_packet_len >= 4 && packet->payload_packet_len <= 100
|
||||
&& packet->payload[0] == 0x03 && packet->payload[1] == 0x9a
|
||||
&& (packet->payload[3] == 0x22 || packet->payload[3] == 0x23)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FILETOPIA, ndpi_struct, NDPI_LOG_DEBUG, "Filetopia detected\n");
|
||||
ndpi_int_filetopia_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
end_filetopia_nothing_found:
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FILETOPIA);
|
||||
}
|
||||
|
||||
|
||||
void init_filetopia_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("Filetopia", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_FILETOPIA,
|
||||
ndpi_search_filetopia_tcp,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD_WITHOUT_RETRANSMISSION,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* fix.c
|
||||
*
|
||||
* Copyright (C) 2017-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
*
|
||||
* nDPI is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* nDPI is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FIX
|
||||
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
void ndpi_search_fix(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search FIX\n");
|
||||
if(packet->tcp) {
|
||||
// 8=
|
||||
if(packet->payload[0] == 0x38 && packet->payload[1] == 0x3d) {
|
||||
// FIX.
|
||||
if(packet->payload[2] == 0x46 &&
|
||||
packet->payload[3] == 0x49 &&
|
||||
packet->payload[4] == 0x58 &&
|
||||
packet->payload[5] == 0x2e) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found FIX\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
// 0. 9=
|
||||
if(packet->payload[2] == 0x4f &&
|
||||
packet->payload[3] == 0x01 &&
|
||||
packet->payload[4] == 0x39 &&
|
||||
packet->payload[5] == 0x3d) {
|
||||
|
||||
NDPI_LOG_INFO(ndpi_struct, "found FIX\n");
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_FIX, NDPI_PROTOCOL_UNKNOWN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
void init_fix_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||
{
|
||||
ndpi_set_bitmask_protocol_detection("FIX", ndpi_struct, detection_bitmask, *id,
|
||||
NDPI_PROTOCOL_FIX,
|
||||
ndpi_search_fix,
|
||||
NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_TCP_WITH_PAYLOAD,
|
||||
SAVE_DETECTION_BITMASK_AS_UNKNOWN,
|
||||
ADD_TO_DETECTION_BITMASK);
|
||||
*id += 1;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* florensia.c
|
||||
*
|
||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
||||
* Copyright (C) 2011-15 - ntop.org
|
||||
* Copyright (C) 2011-18 - ntop.org
|
||||
*
|
||||
* This file is part of nDPI, an open source deep packet inspection
|
||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||
@@ -22,10 +22,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ndpi_protocol_ids.h"
|
||||
|
||||
#define NDPI_CURRENT_PROTO NDPI_PROTOCOL_FLORENSIA
|
||||
|
||||
#include "ndpi_protocols.h"
|
||||
#ifdef NDPI_PROTOCOL_FLORENSIA
|
||||
#include "ndpi_api.h"
|
||||
|
||||
|
||||
static void ndpi_florensia_add_connection(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||
@@ -37,44 +38,40 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
{
|
||||
struct ndpi_packet_struct *packet = &flow->packet;
|
||||
|
||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
||||
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "search florensia.\n");
|
||||
NDPI_LOG_DBG(ndpi_struct, "search florensia\n");
|
||||
|
||||
if (packet->tcp != NULL) {
|
||||
if (packet->payload_packet_len == 5 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||
&& packet->payload[2] == 0x65 && packet->payload[4] == 0xff) {
|
||||
if (flow->florensia_stage == 1) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||
flow->florensia_stage = 1;
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len > 8 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0201) && get_u_int32_t(packet->payload, 4) == htonl(0xFFFFFFFF)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||
flow->florensia_stage = 1;
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 406 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||
&& packet->payload[2] == 0x63) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||
flow->florensia_stage = 1;
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 12 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0301)) {
|
||||
if (flow->florensia_stage == 1) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||
flow->florensia_stage = 1;
|
||||
return;
|
||||
}
|
||||
@@ -82,19 +79,19 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
if (flow->florensia_stage == 1) {
|
||||
if (packet->payload_packet_len == 8 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0302) && get_u_int32_t(packet->payload, 4) == htonl(0xFFFFFFFF)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia asymmetrically.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found florensia asymmetrically\n");
|
||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
if (packet->payload_packet_len == 24 && get_l16(packet->payload, 0) == packet->payload_packet_len
|
||||
&& get_u_int16_t(packet->payload, 2) == htons(0x0202)
|
||||
&& get_u_int32_t(packet->payload, packet->payload_packet_len - 4) == htonl(0xFFFFFFFF)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
if (flow->packet_counter < 10 && get_l16(packet->payload, 0) == packet->payload_packet_len) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -103,20 +100,19 @@ void ndpi_search_florensia(struct ndpi_detection_module_struct *ndpi_struct, str
|
||||
if (packet->udp != NULL) {
|
||||
if (flow->florensia_stage == 0 && packet->payload_packet_len == 6
|
||||
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0503) && get_u_int32_t(packet->payload, 2) == htonl(0xFFFF0000)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "maybe florensia -> stage is set to 1.\n");
|
||||
NDPI_LOG_DBG2(ndpi_struct, "maybe florensia -> stage is set to 1\n");
|
||||
flow->florensia_stage = 1;
|
||||
return;
|
||||
}
|
||||
if (flow->florensia_stage == 1 && packet->payload_packet_len == 8
|
||||
&& get_u_int16_t(packet->payload, 0) == ntohs(0x0500) && get_u_int16_t(packet->payload, 4) == htons(0x4191)) {
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "found florensia.\n");
|
||||
NDPI_LOG_INFO(ndpi_struct, "found florensia\n");
|
||||
ndpi_florensia_add_connection(ndpi_struct, flow);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NDPI_LOG(NDPI_PROTOCOL_FLORENSIA, ndpi_struct, NDPI_LOG_DEBUG, "exclude florensia.\n");
|
||||
NDPI_ADD_PROTOCOL_TO_BITMASK(flow->excluded_protocol_bitmask, NDPI_PROTOCOL_FLORENSIA);
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
|
||||
@@ -131,5 +127,3 @@ void init_florensia_dissector(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
|
||||
*id += 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user