如何在 C++ 中创建 RAW TCP/IP 数据包?

2021-12-28 00:00:00 sockets networking tcp c c++

我是 C++ 初学者/网络管理员,但我想如果有人为我指出正确的方向,我可以学习如何做到这一点.大多数教程都是使用由于某种原因不再起作用的旧代码进行演示的.

I'm a beginning C++ programmer / network admin, but I figure I can learn how to do this if someone points me in the right direction. Most of the tutorials are demonstrated using old code that no longer works for some reason.

因为我使用的是 Linux,所以我需要的只是关于如何编写原始 Berkeley 套接字的说明.有人可以快速介绍一下吗?

Since I'm on Linux, all I need is an explanation on how to write raw Berkeley sockets. Can someone give me a quick run down?

推荐答案

首先阅读 Beej 的套接字编程指南 .它将带您快速了解如何开始编写网络代码.之后,您应该能够从阅读手册页中获取越来越多的信息.

Start by reading Beej's guide on socket programming . It will bring you up to speed on how to start writing network code. After that you should be able to pick up more and more information from reading the man pages.

其中大部分内容包括阅读您最喜欢的库的文档,以及对手册页的基本了解.

Most of it will consist of reading the documentation for your favourite library, and a basic understanding of man pages.

相关文章