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));