IP、TCP 和 VLAN 结构
我最近继承了一个近 7 年历史的代码库,其中包括一个带有公共标头的库,其中包含 IP、TCP、VLAN 结构的定义和一大堆定义(例如 #define TCP_NODELAY 1
)。
我试图寻找这些结构的头文件,但我找不到任何东西(这在 Linux 上是主要的,但也有各种 BSD 变体)。当然已经有这个的标题了吗?
我认为 net/ethernet.h
对所有定义都有帮助。
编辑:找到了我正在寻找的大部分结构:netinet/tcp.h
中的struct tcphdr
netinet/udp.h
中的struct udphdr
netinet/ip.h
中的 struct ip
有谁知道带有 vlan-header 的结构吗? (以太 VLAN 标头?)
I've recently inherited an almost 7 year old codebase, including a library with public headers with definitions of IP-, TCP, VLAN-structs and a shitload of defines (like #define TCP_NODELAY 1
).
I tried to look for headers with these structs but I couldn't find anything (this is primary on linux, but also various BSD-variants). Surely there must be headers for this already?
I think net/ethernet.h
helped with all the defines.
EDIT: Found most of the structs I'm looking for:struct tcphdr
in netinet/tcp.h
struct udphdr
in netinet/udp.h
struct ip
in netinet/ip.h
Does anyone have any clue about a struct with the vlan-header? (ether_vlan_header?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
其中
TCP_NODELAY
是您要查找的符号。您可以通过将所有符号写入文件(每行一个)并使用 grep -f FILE 来同时查找所有符号。
Try
where
TCP_NODELAY
is the symbol you're looking for.You can look for all symbols at the same time by writing them to a file (one per line), and using
grep -f FILE
.