{"id":19952652,"url":"https://github.com/qxip/ndpi-lua","last_synced_at":"2025-09-08T07:36:53.124Z","repository":{"id":36258876,"uuid":"40563300","full_name":"QXIP/nDPI-lua","owner":"QXIP","description":"nDPI Lua bindings for Deep Packet Inspection","archived":false,"fork":false,"pushed_at":"2015-08-30T11:00:49.000Z","size":756,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T15:16:43.749Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://ntop.org","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QXIP.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-11T20:21:09.000Z","updated_at":"2022-02-18T18:39:31.000Z","dependencies_parsed_at":"2022-09-10T07:01:52.588Z","dependency_job_id":null,"html_url":"https://github.com/QXIP/nDPI-lua","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/QXIP/nDPI-lua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FnDPI-lua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FnDPI-lua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FnDPI-lua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FnDPI-lua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QXIP","download_url":"https://codeload.github.com/QXIP/nDPI-lua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QXIP%2FnDPI-lua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274152541,"owners_count":25231291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-13T01:13:59.371Z","updated_at":"2025-09-08T07:36:53.073Z","avatar_url":"https://github.com/QXIP.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"http://www.ntop.org/wp-content/uploads/2015/05/ntop.png\" alt=\"NTOP\"\u003e\n\u003c/p\u003e\n\n# nDPI-lua\n\nProof-of-Concept lua binding based on ndpireader and nDPI from [NTOP](http://ntop.org)\n\nThis library is aimed to be used from a Lua program.\n\nThe ```main.lua``` file reads a pcap file and inspects each packet. For each successfully associated packet and action is triggered. The actions are defined as Lua functions and follows this template:\n\n```lua\nfunction f(id, packet)\n\nend\n```\n\nWhere:\n\n   * *id*, is the protocol ID.\n   * *packet*, is a pcap packet (```const uint8_t *packet```).\n\nDependencies\n------------\n\nThis program depends on libndpi 1.x. nDPI is a Deep Packet Inspection library, programmed in C.\n\nHeaders of nDPI are at ```include/```, and an already build library is at ```lib/```.\n\nCompile\n-------\n\n* Make libndpilua.so\n\n```bash\n$ make\n```\n\nBuilds libndpilua.so and places it at src/\n\nUsage\n---\n\n\n```bash\nluajit main.lua /path/to/file.pcap\n```\n\n\n\nRun Test\n---\n\n* Type `run`\n\n```bash\nrun\n```\n\n\nTest Output\n---\n```\nnDPI Memory statistics:\n\tnDPI Memory (once):      91.02 KB     \n\tFlow Memory (per flow):  1.92 KB      \n\tActual Memory:           1.75 MB      \n\tPeak Memory:             1.75 MB      \n\nTraffic statistics:\n\tEthernet bytes:        210941        (includes ethernet CRC/IFC/trailer)\n\tDiscarded bytes:       22728        \n\tIP packets:            465           of 871 packets total\n\tIP bytes:              199781        (avg pkt size 229 bytes)\n\tUnique flows:          86           \n\tTCP Packets:           406          \n\tUDP Packets:           58           \n\tVLAN Packets:          0            \n\tMPLS Packets:          0            \n\tPPPoE Packets:         0            \n\tFragmented Packets:    0            \n\tMax Packet size:       1480         \n\tPacket Len \u003c 64:       259          \n\tPacket Len 64-128:     34           \n\tPacket Len 128-256:    22           \n\tPacket Len 256-1024:   55           \n\tPacket Len 1024-1500:  95           \n\tPacket Len \u003e 1500:     0            \n\tnDPI throughput:       68.68 K pps / 237.68 Mb/sec\n\tTraffic throughput:    8.67 pps / 30.71 Kb/sec\n\tTraffic duration:      53.663 sec\n\tGuessed flow protos:   22           \n\n\nDetected protocols:\n\tUnknown              packets: 39            bytes: 2578          flows: 25           \n\tDNS                  packets: 17            bytes: 2365          flows: 10           \n\tHTTP                 packets: 138           bytes: 51961         flows: 12           \n\tNTP                  packets: 10            bytes: 900           flows: 5            \n\tDHCP                 packets: 3             bytes: 1038          flows: 3            \n\tIMAPS                packets: 33            bytes: 10093         flows: 2            \n\tICMP                 packets: 1             bytes: 300           flows: 1            \n\tSSL                  packets: 132           bytes: 51325         flows: 14           \n\tTwitter              packets: 2             bytes: 324           flows: 1            \n\tDropBox              packets: 10            bytes: 5103          flows: 3            \n\tYouTube              packets: 2             bytes: 984           flows: 2            \n\tGoogle               packets: 74            bytes: 72304         flows: 7            \n\tSpotify              packets: 4             bytes: 506           flows: 1            \n\n\nProtocol statistics:\n\tSafe                         61418 bytes\n\tAcceptable                  134295 bytes\n\tFun                           1490 bytes\n\tUnrated                       2578 bytes\nTotal packets: 871\n\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Fndpi-lua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqxip%2Fndpi-lua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqxip%2Fndpi-lua/lists"}