gpt4 book ai didi

c - 如何在内核模式驱动程序中使用 Winsock 内核 (WSK) 发送原始套接字数据包?

转载 作者:可可西里 更新时间:2023-11-01 10:19:55 39 4
gpt4 key购买 nike

我正在为 Win7 及更高版本开发一个内核模式驱动程序。我想在驱动程序中发送自定义 IP 数据包(我想为 IP 层指定所有字段)。我找到了 Winsock Kernel (WSK) 技术,但它只说明了如何发送和接收 TCP 和 UDP 数据包。我知道在用户模式下,WinSock API 中有原始套接字。所以我想知道是否也有用于Winsock 内核的原始套接字接口(interface)?谢谢。

最佳答案

WskSocket 支持 TCPUDP 和自定义 IP 包的“原始套接字”:https://msdn.microsoft.com/en-us/library/windows/hardware/ff571149%28v=vs.85%29.aspx

SocketType [in]

The type of socket that is being created. The following socket types are supported:

SOCK_STREAM

Supports reliable connection-oriented byte stream communication.
SOCK_DGRAM

Supports unreliable connectionless datagram communication.
SOCK_RAW

Supports raw access to the transport protocol.

关于c - 如何在内核模式驱动程序中使用 Winsock 内核 (WSK) 发送原始套接字数据包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31557005/

39 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com