简体   繁体   English

通过 C++ 编码的客户端和服务器在 TCP/IP 网络通信中读取、创建和操作全帧

[英]Reading, Creating, and Manipulating full Frame in TCP/IP network communication via C++ coded client and server

I would like to code my own client and server in C++ (which I have found plenty of tutorials on) and access to all information about the headers and all the fields in a frame that is going to be sent across a network.我想在 C++ 中编写我自己的客户端和服务器(我已经找到了很多教程),并访问有关将通过网络发送的帧中的标头和所有字段的所有信息。

I need it to be able to edit and/or manipulate information in all the header fields before sending the frame across the network.在通过网络发送帧之前,我需要它能够编辑和/或操作所有 header 字段中的信息。 What's more, it needs to be able to receive a frame and read/manipulate all the header fields from layer 2 to up layer.更重要的是,它需要能够接收帧并读取/操作从第 2 层到上层的所有 header 字段。

I just want to know what library in C++ I need to use or is there any information on how I can code something to accomplish this via C++ that I can be directed to?我只想知道我需要使用 C++ 中的哪个库,或者是否有任何关于我如何通过 C++ 编写代码来完成此任务的信息,我可以被定向到?

If you want to construct a client/server, it's easy.如果你想构建一个客户端/服务器,这很容易。 But if you want to build a packet from MAC to Transport Layer, then you need to use the Linux kernel.但是如果你想构建一个从 MAC 到传输层的数据包,那么你需要使用 Linux kernel。 You need to have some knowledge about how the packets are sent and received.您需要了解数据包的发送和接收方式。 What's more, we always use C to realise it.更重要的是,我们总是使用 C 来实现它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM