nDPI icon indicating copy to clipboard operation
nDPI copied to clipboard

Discussion for custom ip range

Open u8906250 opened this issue 10 years ago • 8 comments

for now , it doesn't support ip range

ip:213.75.170.0/24@CustomProtocol

could add this feature?

u8906250 avatar Dec 29 '15 04:12 u8906250

Well, what is the service or protocol related to this ip range ?

kYroL01 avatar Dec 29 '15 10:12 kYroL01

for example, LINE service http://at.line.me/en/

LINE Corporation 119.235.224.0/20 119.235.235.0/24

u8906250 avatar Dec 30 '15 02:12 u8906250

Actually the ip range associated to a service is well supported by nDPI. If you see https://github.com/ntop/nDPI/blob/dev/src/lib/ndpi_content_match.c.inc this feature is well implemented.

kYroL01 avatar Dec 30 '15 09:12 kYroL01

yes, but I think the custom proto file is not support this feature.

I trace ndpi_load_protocols_file() -> ndpi_handle_rule() -> ndpi_add_host_ip_subprotocol() , and found it just call inet_pton() to convert one ip address text to binary.

u8906250 avatar Dec 30 '15 09:12 u8906250

Now I understand what you mean. Yes, that feature is not provided, because nDPI can just load protos passing tcp or udp ports related to a protocol (i.e. tcp:80,tcp:3128@HTTP). This is a good point to implement for the future!

kYroL01 avatar Dec 30 '15 11:12 kYroL01

thank you! and I try to add this feature (it's easy, haha) and already tested, see patch.txt

patch.txt

u8906250 avatar Dec 31 '15 08:12 u8906250

I'm trying and testing! I'll let you know, thanks!

kYroL01 avatar Dec 31 '15 12:12 kYroL01

fix by 5336aecde7e6f40e22810538dba9dd6601291145

kYroL01 avatar Dec 31 '15 16:12 kYroL01