Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A nDPI wrapper by golang based on CGO

License

NotificationsYou must be signed in to change notification settings

fs714/go-ndpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Introduction

This project is anDPI wrapper by golang based on CGO. You can use nDPI by golang to do packet inspection.

It is based on ndpi 4.4.0 release currently.

2. How to use this lib

2.1 Install nDPI Lib

Clang lib nDPI should be installed firstly. Ubuntu 22.04 is used in follow guide.

  • Install Package Repository for Ubuntu 22.04 LTS
apt-get install software-properties-common wgetadd-apt-repository universewget https://packages.ntop.org/apt-stable/22.04/all/apt-ntop-stable.debapt install ./apt-ntop-stable.deb
  • Install nDPI
apt-get install ndpi-devldconfig -p | grep -i ndpifind /usr/lib/ | grep -i ndpifind /usr/include/ | grep -i ndpi
  • Install required libs
    • Libpcap is used for packet capture
    • Maxminddb is enabled in 'libndpi' from apt-get. If you are using 'libndpi' which is installed by apt, 'libmaxminddb' is also required
apt-get install libpcap-dev libmaxminddb-devldconfig -p | grep -i maxmindfind /usr/lib/ | grep -i maxmindfind /usr/include/ | grep -i maxmind

2.2 Use this lib

There is a simple usage in in folderexample which could be a good start.

2.3 More information of compile and link in CGO

You can see follow codes inndpi.go

  • Linux lib path is/usr/include/, you can adapt it according to your ENV
  • Lib ndpi is static link while others are dynamic link
#cgo CFLAGS: -I/usr/include/#cgo LDFLAGS: -Wl,-Bstatic -lndpi -lmaxminddb -Wl,-Bdynamic -lpcap -lm -pthread

About

A nDPI wrapper by golang based on CGO

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp