Skip to content

Commit b6021d8

Browse files
authored
Merge branch 'dev' into refactor/sized-copy-data
2 parents dd21f8a + 6b84492 commit b6021d8

5 files changed

Lines changed: 671 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
PcapPlusPlus enables decoding and forging capabilities for a large variety of network protocols. It also provides easy to use C++ wrappers for the most popular packet processing engines such as [libpcap](https://www.tcpdump.org/), [WinPcap](https://www.winpcap.org/), [Npcap](https://nmap.org/npcap/), [DPDK](https://www.dpdk.org/), [eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html), [WinDivert](https://reqrypt.org/windivert.html) and [PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/).
2020

21-
Translations: English · [正體中文](./translation/README-zh-tw.md) · [한국어](./translation/README-kor.md)
21+
Translations: English · [正體中文](./translation/README-zh-tw.md) · [한국어](./translation/README-kor.md) · [日本語](./translation/README-ja.md) · [Русский](./translation/README-rus.md)
2222

2323
## Table Of Contents
2424

translation/README-ja.md

Lines changed: 334 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,334 @@
1+
> ⚠️ **注意:** この翻訳は AI を使用して維持・同期されており、最新の英語版と差異がある可能性があります。誤りを見つけられた場合は、GitHub の Issue を作成するか、PR を提出してください。
2+
3+
<div align="center">
4+
5+
[![PcapPlusPlus ロゴ](https://pcapplusplus.github.io/img/logo/logo_color.png)](https://pcapplusplus.github.io)
6+
7+
[![GitHub Workflow ステータス](https://img.shields.io/github/actions/workflow/status/seladb/PcapPlusPlus/build_and_test.yml?branch=master&label=Actions&logo=github&style=flat)](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22Build+and+test%22)
8+
[![GitHub Workflow ステータス](https://img.shields.io/github/actions/workflow/status/seladb/PcapPlusPlus/codeql.yml?branch=master&label=CodeQL&logo=github&style=flat)](https://github.com/seladb/PcapPlusPlus/actions?query=workflow%3A%22CodeQL%22)
9+
[![Codecov](https://img.shields.io/codecov/c/github/seladb/PcapPlusPlus?logo=codecov&logoColor=white)](https://app.codecov.io/github/seladb/PcapPlusPlus)
10+
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/seladb/PcapPlusPlus/badge)](https://scorecard.dev/viewer/?uri=github.com/seladb/PcapPlusPlus)
11+
[![GitHub コントリビューター](https://img.shields.io/github/contributors/seladb/PcapPlusPlus?style=flat&label=Contributors&logo=github)](https://github.com/seladb/PcapPlusPlus/graphs/contributors)
12+
13+
[![X フォロー](https://img.shields.io/badge/follow-%40seladb-1DA1F2?logo=x&style=social)](https://x.com/intent/follow?screen_name=seladb)
14+
[![GitHub Repo スター](https://img.shields.io/github/stars/seladb/PcapPlusPlus?style=social)]()
15+
16+
</div>
17+
18+
[PcapPlusPlus](https://pcapplusplus.github.io/) は、ネットワークパケットのキャプチャ、解析、生成を行うためのマルチプラットフォーム C++ ライブラリです。効率的かつ強力で、使いやすく設計されています。
19+
20+
PcapPlusPlus は、多種多様なネットワークプロトコルのデコードと生成機能を提供します。また、[libpcap](https://www.tcpdump.org/)[WinPcap](https://www.winpcap.org/)[Npcap](https://nmap.org/npcap/)[DPDK](https://www.dpdk.org/)[eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html)[WinDivert](https://reqrypt.org/windivert.html)[PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) など、最も人気のあるパケット処理エンジンに対する使いやすい C++ ラッパーも提供します。
21+
22+
翻訳: [English](../README.md) · [正體中文](./README-zh-tw.md) · [한국어](./README-kor.md) · 日本語 · [Русский](./README-rus.md)
23+
24+
## 目次
25+
26+
- [目次](#目次)
27+
- [ダウンロード](#ダウンロード)
28+
- [GitHub リリースページ](#github-リリースページ)
29+
- [Homebrew](#homebrew)
30+
- [Vcpkg](#vcpkg)
31+
- [Conan](#conan)
32+
- [自分でビルドする](#自分でビルドする)
33+
- [パッケージの検証](#パッケージの検証)
34+
- [機能概要](#機能概要)
35+
- [はじめに](#はじめに)
36+
- [API ドキュメント](#api-ドキュメント)
37+
- [マルチプラットフォーム対応](#マルチプラットフォーム対応)
38+
- [サポートされるネットワークプロトコル](#サポートされるネットワークプロトコル)
39+
- [データリンク層 (L2)](#データリンク層-l2)
40+
- [ネットワーク層 (L3)](#ネットワーク層-l3)
41+
- [トランスポート層 (L4)](#トランスポート層-l4)
42+
- [セッション層 (L5)](#セッション層-l5)
43+
- [プレゼンテーション層 (L6)](#プレゼンテーション層-l6)
44+
- [アプリケーション層 (L7)](#アプリケーション層-l7)
45+
- [DPDK と PF_RING のサポート](#dpdk-と-pf_ring-のサポート)
46+
- [ベンチマーク](#ベンチマーク)
47+
- [フィードバックの提供](#フィードバックの提供)
48+
- [コントリビューション](#コントリビューション)
49+
- [ライセンス](#ライセンス)
50+
51+
## ダウンロード
52+
53+
GitHub のリリースページからダウンロードするか、パッケージマネージャーを使用するか、PcapPlusPlus を自分でビルドすることができます。詳細については、PcapPlusPlus ウェブサイトの [ダウンロード](https://pcapplusplus.github.io/docs/install) ページをご覧ください。
54+
55+
[![GitHub 全リリースのダウンロード数](https://img.shields.io/github/downloads/seladb/PcapPlusPlus/total?style=flat&label=Downloads&logo=github)](https://tooomm.github.io/github-release-stats/?username=seladb&repository=PcapPlusPlus)
56+
57+
### GitHub リリースページ
58+
59+
<https://github.com/seladb/PcapPlusPlus/releases/latest>
60+
61+
### Homebrew
62+
63+
```shell
64+
brew install pcapplusplus
65+
```
66+
67+
Homebrew formulae: <https://formulae.brew.sh/formula/pcapplusplus>
68+
69+
### Vcpkg
70+
71+
Windows:
72+
73+
```text
74+
.\vcpkg install pcapplusplus
75+
```
76+
77+
MacOS/Linux:
78+
79+
```text
80+
vcpkg install pcapplusplus
81+
```
82+
83+
Vcpkg ポート: <https://github.com/microsoft/vcpkg/tree/master/ports/pcapplusplus>
84+
85+
### Conan
86+
87+
```text
88+
conan install "pcapplusplus/[>0]@" -u
89+
```
90+
91+
ConanCenter のパッケージ: <https://conan.io/center/pcapplusplus>
92+
93+
### 自分でビルドする
94+
95+
git リポジトリをクローンします:
96+
97+
```shell
98+
git clone https://github.com/seladb/PcapPlusPlus.git
99+
```
100+
101+
PcapPlusPlus ウェブサイトの [ソースからビルド](https://pcapplusplus.github.io/docs/install#build-from-source) ページで、お使いのプラットフォームに応じたビルド手順に従ってください。
102+
103+
### パッケージの検証
104+
105+
v23.09 より新しい PcapPlusPlus のリリースは、GitHub の attestation で署名されています。すべての attestation は [こちら](https://github.com/seladb/PcapPlusPlus/attestations) で確認できます。GitHub CLI を使ってこれらのパッケージの attestation を検証できます。パッケージを検証するには、[gh attestation verify](https://cli.github.com/manual/gh_attestation_verify) の最新の手順に従ってください。シンプルな手順としては、次のコマンドを使用できます:
106+
107+
```shell
108+
gh attestation verify <path-to-package-file> --repository seladb/PcapPlusPlus
109+
```
110+
111+
ターミナルに次の出力が表示されるはずです:
112+
113+
```shell
114+
✓ Verification succeeded!
115+
```
116+
117+
## 機能概要
118+
119+
- __パケットキャプチャ__: [libpcap](https://www.tcpdump.org/)[WinPcap](https://www.winpcap.org/)[Npcap](https://nmap.org/npcap/)[Intel DPDK](https://www.dpdk.org/)[eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html)[WinDivert](https://reqrypt.org/windivert.html)[ntop の PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/)[raw socket](https://en.wikipedia.org/wiki/Network_socket#Raw_socket) といった人気のパケットキャプチャエンジンに対する、使いやすい C++ ラッパーによるパケットキャプチャ [[詳細](https://pcapplusplus.github.io/docs/features#packet-capture)]
120+
- __パケット解析と生成__: 幅広い [ネットワークプロトコル](https://pcapplusplus.github.io/docs/features#supported-network-protocols) について、プロトコルとレイヤーの詳細な解析、パケット生成、パケット編集を含みます [[詳細](https://pcapplusplus.github.io/docs/features#packet-parsing-and-crafting)]
121+
- __ファイルからのパケットの読み書き__: __PCAP____PCAPNG__ の両形式をサポート [[詳細](https://pcapplusplus.github.io/docs/features#read-and-write-packets-fromto-files)]
122+
- __ラインレートでのパケット処理__: [DPDK](https://www.dpdk.org/)[eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html)[PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) に対する効率的で使いやすい C++ ラッパー [[詳細](https://pcapplusplus.github.io/docs/features#dpdk-support)]
123+
- __マルチプラットフォーム対応__: PcapPlusPlus は Linux、MacOS、Windows、Android、FreeBSD で完全にサポートされています
124+
- __パケット再構成__: TCP の再送、順序が乱れた TCP パケット、欠落した TCP データを扱う独自の __TCP 再構成__ 実装、および IPv4 と IPv6 のフラグメントを生成・再構成する __IP フラグメント化・デフラグメント化__ [[詳細](https://pcapplusplus.github.io/docs/features#packet-reassembly)]
125+
- __パケットフィルタリング__: libpcap の BPF フィルタを非常に使いやすくします [[詳細](https://pcapplusplus.github.io/docs/features#packet-filtering)]
126+
- __TLS フィンガープリンティング__: [JA3 と JA3S](https://github.com/salesforce/ja3) の TLS フィンガープリンティングの C++ 実装 [[詳細](https://pcapplusplus.github.io/docs/features#tls-fingerprinting)]
127+
128+
## はじめに
129+
130+
PcapPlusPlus でアプリケーションを書くことは非常に簡単で直感的です。以下は、PCAP ファイルからパケットを読み込んで解析する方法を示す簡単なアプリケーションです:
131+
132+
```cpp
133+
#include <iostream>
134+
#include "IPv4Layer.h"
135+
#include "Packet.h"
136+
#include "PcapFileDevice.h"
137+
138+
int main(int argc, char* argv[])
139+
{
140+
// 読み取り用に pcap ファイルを開く
141+
pcpp::PcapFileReaderDevice reader("1_packet.pcap");
142+
if (!reader.open())
143+
{
144+
std::cerr << "pcap ファイルを開く際にエラーが発生しました" << std::endl;
145+
return 1;
146+
}
147+
148+
// ファイルから最初の(かつ唯一の)パケットを読み込む
149+
pcpp::RawPacket rawPacket;
150+
if (!reader.getNextPacket(rawPacket))
151+
{
152+
std::cerr << "ファイル内の最初のパケットを読み込めませんでした" << std::endl;
153+
return 1;
154+
}
155+
156+
// raw パケットを解析済みパケットに変換する
157+
pcpp::Packet parsedPacket(&rawPacket);
158+
159+
// パケットが IPv4 であることを確認する
160+
if (parsedPacket.isPacketOfType(pcpp::IPv4))
161+
{
162+
// 送信元 IP と宛先 IP を抽出する
163+
pcpp::IPv4Address srcIP = parsedPacket.getLayerOfType<pcpp::IPv4Layer>()->getSrcIPv4Address();
164+
pcpp::IPv4Address destIP = parsedPacket.getLayerOfType<pcpp::IPv4Layer>()->getDstIPv4Address();
165+
166+
// 送信元 IP と宛先 IP を出力する
167+
std::cout << "送信元 IP: '" << srcIP << "'; 宛先 IP: '" << destIP << "'" << std::endl;
168+
}
169+
170+
// ファイルを閉じる
171+
reader.close();
172+
173+
return 0;
174+
}
175+
```
176+
177+
詳細は PcapPlusPlus ウェブサイトの [はじめに](https://pcapplusplus.github.io/docs/quickstart) ページで確認できます。このページでは、いくつかの簡単なステップを通じて、アプリケーションを起動するまでの流れを案内します。
178+
179+
## API ドキュメント
180+
181+
PcapPlusPlus は 3 つのライブラリで構成されています:
182+
183+
1. __Packet++__ - ネットワークパケットを解析・生成・編集するためのライブラリ
184+
2. __Pcap++__ - パケットの傍受と送信、ネットワークと NIC の情報、統計情報などを提供するライブラリ。実体は libpcap、WinPcap、Npcap、DPDK、AF_XDP、WinDivert、PF_RING といったパケットキャプチャエンジンの C++ ラッパーです
185+
3. __Common++__ - Packet++ と Pcap++ の両方で使用される共通のコードユーティリティを含むライブラリ
186+
187+
PcapPlusPlus ウェブサイトの [API ドキュメントセクション](https://pcapplusplus.github.io/docs/api) で詳細な API ドキュメントを確認できます。
188+
不足しているデータがあれば、[ご連絡ください](#フィードバックの提供)。
189+
190+
## マルチプラットフォーム対応
191+
192+
PcapPlusPlus は現在
193+
__Windows__
194+
<picture>
195+
<img src="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-windows.png" alt="" width="16" height="16"/>
196+
</picture>、
197+
__Linux__
198+
<picture>
199+
<img src="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-linux.png" alt="" width="16" height="16"/>
200+
</picture>、
201+
__MacOS__
202+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-apple-dark.png"/>
203+
<img src="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-apple.png" alt="" width="16" height="16"/>
204+
</picture>、
205+
__Android__
206+
<picture>
207+
<img src="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-android.png" alt="" width="16" height="16"/>
208+
</picture>、そして
209+
__FreeBSD__
210+
<picture>
211+
<img src="https://github.com/PcapPlusPlus/pcapplusplus.github.io/raw/master/static/img/os-logos/logo-freebsd.png" alt="" width="16" height="16"/>
212+
</picture>
213+
でサポートされています。
214+
PcapPlusPlus ウェブサイトで [サポートされているすべてのプラットフォーム](https://pcapplusplus.github.io/docs/platforms) を確認し、[ダウンロード](#ダウンロード) セクションを参照してお使いのプラットフォームで PcapPlusPlus を使い始めてください。
215+
216+
## サポートされるネットワークプロトコル
217+
218+
PcapPlusPlus は現在、以下のプロトコルのパケットの解析、編集、生成をサポートしています:
219+
220+
### データリンク層 (L2)
221+
222+
1. Cisco HDLC
223+
2. Ethernet II
224+
3. IEEE 802.3 Ethernet
225+
4. LLC (BPDU のみサポート)
226+
5. Null/Loopback
227+
6. Packet trailer (footer または padding とも呼ばれる)
228+
7. PPPoE
229+
8. SLL (Linux cooked capture)
230+
9. SLL2 (Linux cooked capture v2)
231+
10. STP
232+
11. VLAN
233+
12. VXLAN
234+
13. Wake on LAN (WoL)
235+
14. NFLOG (Linux Netfilter NFLOG) - 解析のみ (編集機能なし)
236+
237+
238+
### ネットワーク層 (L3)
239+
240+
15. ARP
241+
16. GRE
242+
17. ICMP
243+
18. ICMPv6
244+
19. IGMP (IGMPv1、IGMPv2、IGMPv3 をサポート)
245+
20. IPv4
246+
21. IPv6
247+
22. MPLS
248+
23. NDP
249+
24. Raw IP (IPv4 と IPv6)
250+
25. VRRP (IPv4 と IPv6)
251+
26. WireGuard
252+
253+
### トランスポート層 (L4)
254+
255+
27. COTP
256+
28. GTP (v1 と v2)
257+
29. IPSec AH と ESP - 解析のみ (編集機能なし)
258+
30. TCP
259+
31. TPKT
260+
32. UDP
261+
262+
### セッション層 (L5)
263+
264+
33. SDP
265+
34. SIP
266+
267+
### プレゼンテーション層 (L6)
268+
269+
35. SSL/TLS - 解析のみ (編集機能なし)
270+
271+
### アプリケーション層 (L7)
272+
273+
36. ASN.1 デコーダおよびエンコーダ
274+
37. BGP (v4)
275+
38. 暗号鍵デコーダ
276+
39. DHCP
277+
40. DHCPv6
278+
41. DNS
279+
42. DoIP
280+
43. FTP
281+
44. HTTP ヘッダ (リクエストとレスポンス)
282+
45. LDAP
283+
46. Modbus
284+
47. MySQL - 解析のみ (編集機能なし)
285+
48. NTP (v3, v4)
286+
49. PEM デコーダおよびエンコーダ
287+
50. PostgreSQL Wire Protocol (PGWire) - 解析のみ (編集機能なし)
288+
51. Radius
289+
52. S7 Communication (S7comm)
290+
53. SMTP
291+
54. SOME/IP
292+
55. SSH - 解析のみ (編集機能なし)
293+
56. Telnet - 解析のみ (編集機能なし)
294+
57. X509 証明書 - 解析のみ (編集機能なし)
295+
58. 汎用ペイロード
296+
297+
## DPDK と PF_RING のサポート
298+
299+
[The Data Plane Development Kit (DPDK)](https://www.dpdk.org/) は、高速パケット処理のためのデータプレーンライブラリとネットワークインターフェースコントローラドライバ群です。
300+
301+
[PF_RING™](https://www.ntop.org/products/packet-capture/pf_ring/) は、パケットキャプチャ速度を劇的に向上させる新しいタイプのネットワークソケットです。
302+
303+
どちらのフレームワークも非常に高速なパケット処理 (ラインスピードまで) を提供し、ルーター、ファイアウォール、ロードバランサーなど多くのネットワークアプリケーションで使用されています。
304+
PcapPlusPlus は DPDK と PF_RING の上に C++ の抽象化レイヤーを提供します。この抽象化レイヤーは、これらのフレームワークを利用する際に発生する多くのボイラープレートを取り除き、使いやすいインターフェースを提供します。詳細は、PcapPlusPlus ウェブサイトの [DPDK](https://pcapplusplus.github.io/docs/dpdk) と [PF_RING](https://pcapplusplus.github.io/docs/features#pf_ring-support) のサポートページで確認できます。
305+
306+
## ベンチマーク
307+
308+
PcapPlusPlus と他の類似 C++ ライブラリ (`libtins` や `libcrafter` など) のパフォーマンスを比較するために、Matias Fontanini 氏の [packet-capture-benchmarks](https://github.com/mfontanini/packet-capture-benchmarks) プロジェクトを使用しました。
309+
310+
結果は PcapPlusPlus ウェブサイトの [ベンチマーク](https://pcapplusplus.github.io/docs/benchmark) ページで確認できます。
311+
312+
## フィードバックの提供
313+
314+
フィードバックを大歓迎いたします。以下のいずれかの方法でお気軽にご連絡ください:
315+
316+
- GitHub の Issue を作成する
317+
- PcapPlusPlus の Google グループにメッセージを投稿する: <https://groups.google.com/d/forum/pcapplusplus-support>
318+
- Stack Overflow で質問する: <https://stackoverflow.com/questions/tagged/pcapplusplus>
319+
- メールを送る: <pcapplusplus@gmail.com>
320+
- X でフォローする: <https://x.com/seladb>
321+
322+
このプロジェクトを気に入っていただけたら、__GitHub でスターをお願いします — 大きな助けになります!__ :star: :star:
323+
324+
詳細は [PcapPlusPlus ウェブサイト](https://pcapplusplus.github.io/community) をご覧ください。
325+
326+
## コントリビューション
327+
328+
このプロジェクトへの貢献を心より歓迎します。貢献にご興味があれば、PcapPlusPlus ウェブサイトの [コントリビューションページ](https://pcapplusplus.github.io/community#contribute) をご覧ください。
329+
330+
## ライセンス
331+
332+
PcapPlusPlus は [Unlicense ライセンス](https://choosealicense.com/licenses/unlicense/) の下で公開されています。
333+
334+
[![GitHub](https://img.shields.io/github/license/seladb/PcapPlusPlus?style=flat&color=blue&logo=unlicense)](https://choosealicense.com/licenses/unlicense/)

0 commit comments

Comments
 (0)