{"id":19156856,"url":"https://github.com/bertrandmartel/pcapng-decoder","last_synced_at":"2025-05-07T07:46:34.299Z","repository":{"id":31409286,"uuid":"34972594","full_name":"bertrandmartel/pcapng-decoder","owner":"bertrandmartel","description":"Java PCAPNG decoder library","archived":false,"fork":false,"pushed_at":"2019-08-26T13:59:26.000Z","size":1864,"stargazers_count":26,"open_issues_count":1,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-19T20:17:31.487Z","etag":null,"topics":["java","pcapng","pcapng-decoder"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertrandmartel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-03T03:37:56.000Z","updated_at":"2025-02-02T13:08:27.000Z","dependencies_parsed_at":"2022-09-09T09:40:10.051Z","dependency_job_id":null,"html_url":"https://github.com/bertrandmartel/pcapng-decoder","commit_stats":null,"previous_names":["akinaru/pcapng-decoder"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fpcapng-decoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fpcapng-decoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fpcapng-decoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertrandmartel%2Fpcapng-decoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertrandmartel","download_url":"https://codeload.github.com/bertrandmartel/pcapng-decoder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252838723,"owners_count":21812082,"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","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":["java","pcapng","pcapng-decoder"],"created_at":"2024-11-09T08:36:09.193Z","updated_at":"2025-05-07T07:46:34.278Z","avatar_url":"https://github.com/bertrandmartel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PCAPNG Decoder Library #\n\nhttp://bertrandmartel.github.io/pcapng-decoder/\n\n[![Build Status](https://travis-ci.org/bertrandmartel/pcapng-decoder.svg?branch=master)](https://travis-ci.org/bertrandmartel/pcapng-decoder)\n[ ![Download](https://api.bintray.com/packages/bertrandmartel/maven/pcapng-parser/images/download.svg) ](https://bintray.com/bertrandmartel/maven/pcapng-parser/_latestVersion)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/1188df87489749a48978a5d953662d18)](https://www.codacy.com/app/bertrandmartel/pcapng-decoder?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=bertrandmartel/pcapng-decoder\u0026amp;utm_campaign=Badge_Grade)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/fr.bmartel/pcapngdecoder/badge.svg)](https://maven-badges.herokuapp.com/maven-central/fr.bmartel/pcapngdecoder)\n[![Javadoc](http://javadoc-badge.appspot.com/fr.bmartel/pcapngdecoder.svg?label=javadoc)](http://javadoc-badge.appspot.com/fr.bmartel/pcapngdecoder)\n[![License](http://img.shields.io/:license-mit-blue.svg)](LICENSE.md)\n\nJava PCAPNG file parser library\n\n\u003ca href=\"CHANGELOG.md\"\u003eshow changelog\u003c/a\u003e\n\n## Include in your project\n\n* from gradle \n\n```\ncompile 'fr.bmartel:pcapngdecoder:1.2'\n```\n\n* from release archive\n\nhttps://github.com/bertrandmartel/pcapng-decoder/releases\n\n## Run example\n\n```\n./gradlew run -PappArgs=\"['-f', 'path_to_file/pcapfile/exemple.pcapng'  , '-v' ]\"\n```\n\n|  args            | description                                        |\n|------------------|----------------------------------------------------|\n| -f \u003cfile.pcapng\u003e | input file                                         |\n| -v               | verbose, will show all section parsing content     |\n\nExample source code can be found \u003ca href=\"https://github.com/bertrandmartel/pcapng-decoder/tree/master/examples\"\u003ehere\u003c/a\u003e\n\n## How to use ?\n\n### Decode\n\n* decode from n input file :\n```\nPcapDecoder decoder = new PcapDecoder(\"path/to/file.pcapng\");\ndecoder.decode();\n```\n\n* decode from a byte array :\n```\nbyte[] pcapBa = getPcapBa();\nPcapDecoder decoder = new PcapDecoder(pcapBa);\ndecoder.decode();\n```\n\n### Data access\n\nPcap section list can be accessed via `getSectionList()` :\n\n```\nArrayList\u003cIPcapngType\u003e sectionList = decoder.getSectionList()\n```\n\nAll section type inherit from `IPcapngType`, use reflection to access each type :\n\n```\nfor (int i = 0; i \u003c sectionList.size(); i++) {\n\n    if (sectionList.get(i) instanceof ISectionHeaderBlock) {\n\n        ISectionHeaderBlock section = (ISectionHeaderBlock) sectionList.get(i);\n\n        //do what you want with Section Header Block frame type\n\n    } else if (sectionList.get(i) instanceof IDescriptionBlock) {\n        \n        IDescriptionBlock section = (IDescriptionBlock) sectionList.get(i);\n\n        //do what you want with Description Block frame type \n\n    } else if (sectionList.get(i) instanceof IEnhancedPacketBLock) {\n\n        IEnhancedPacketBLock section = (IEnhancedPacketBLock) sectionList.get(i);\n\n\t\t//do what you want with Enhanced Packet Block frame type \n\n    } else if (sectionList.get(i) instanceof IStatisticsBlock) {\n\n        IStatisticsBlock section = (IStatisticsBlock) sectionList.get(i);\n\n        //do what you want with Statistics Block frame type \n\n    } else if (sectionList.get(i) instanceof INameResolutionBlock) {\n\n        INameResolutionBlock section = (INameResolutionBlock) sectionList.get(i);\n\n        //do what you want with Name Resolution Block frame type\n    }\n}\n```\n\n\u003cb\u003eNote\u003c/b\u003e : packet data in Enhanced Packet Block is left in packet source endianness\n\n## JavaDoc\n\nhttp://javadoc-badge.appspot.com/fr.bmartel/pcapngdecoder\n\n## Example output\n\n```\n##########################################################\nSECTION HEADER BLOCK\nMajor version      : 0\nMinor version      : 1\nOS                 : Linux 3.8.0-19-generic\nuser application   : Dumpcap 1.10.2 (SVN Rev 51934 from /trunk-1.10)\n##########################################################\nSECTION INTERFACE DESCRIPTION BLOCK\nLink type             : LINKTYPE_IEEE802_11_RADIO\nSnap len              : 65535\ninterface name        : wlan0\ntimestamp resolution  : 6\ninterface OS name     : Linux 3.8.0-19-generic\n##########################################################\nSECTION ENHANCED PACKET BLOCK\ninterface id             : 0\ntimestamp in millis      : Sat Apr 18 12:13:41 CEST 2015\ncaptured length          : 185\npacket length            : 185\npacket data              : 00 | 00 | 12 | 00 | 2E | 48 | 00 | 00 | 10 | 02 | A3 | 09 | A0 | 00 | C2 | 07 | 00 | 00 | 80 | 00 | 00 | 00 | FF | FF | FF | FF | FF | FF | 00 | 24 | D4 | 6B | 0C | 5D | 00 | 24 | D4 | 6B | 0C | 5D | 00 | E5 | 60 | 01 | 25 | DE | 32 | 03 | 00 | 00 | 60 | 00 | 01 | 04 | 00 | 08 | 46 | 72 | 65 | 65 | 57 | 69 | 66 | 69 | 01 | 08 | 82 | 84 | 8B | 96 | 2C | 0C | 12 | 18 | 03 | 01 | 0C | 05 | 04 | 00 | 02 | 00 | 00 | 2A | 01 | 04 | 32 | 05 | 24 | 30 | 48 | 60 | 6C | 2D | 1A | 6C | 00 | 03 | FF | FF | FF | 00 | 01 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 01 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 3D | 16 | 0C | 00 | 13 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 7F | 08 | 00 | 00 | 00 | 00 | 00 | 00 | 00 | 40 | DD | 18 | 00 | 50 | F2 | 02 | 01 | 01 | 00 | 00 | 03 | A4 | 00 | 00 | 27 | A4 | 00 | 00 | 42 | 43 | 5E | 00 | 62 | 32 | 2F | 00 | A3 | 26 | 13 | 07\n##########################################################\nSECTION INTERFACE STATISTICS BLOCK\ninterface id             : 0\ntimestamp in millis      : Sat Apr 18 12:16:43 CEST 2015\ncapture start time       : Sat Apr 18 12:13:41 CEST 2015\ncapture end time         : Sat Apr 18 12:16:43 CEST 2015\npacket received count    : 9493\npacket drop count        : 0\n##########################################################\n```\n\n## Compatibility\n\nJRE 1.7 compliant\n\n## Build\n\nGradle using IntelliJ IDEA or Eclipse\n\n## Specifications \n\nhttps://www.winpcap.org/ntar/draft/PCAP-DumpFileFormat.html\n\n## License\n\nThe MIT License (MIT) Copyright (c) 2015-2016 Bertrand Martel\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandmartel%2Fpcapng-decoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertrandmartel%2Fpcapng-decoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertrandmartel%2Fpcapng-decoder/lists"}