Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
libnetfilter_queue ライブラリを使用しています。しかし、コールバック関数でポート番号を抽出する方法がわかりませんでした。私は少し新しいです。詳細なヘルプは非常に高く評価されます!
これは、コールバック関数で次の方法で実行できます。
len = nfq_get_payload(nfa, &buffer); src_port = *((unsigned short*) (buffer + 20)); dst_port = *((unsigned short*) (buffer + 22));