开发者

Layered Service Provider in C#

I开发者_运维百科'm looking to write a LSP in C# to capture and re-direct UDP packets..

I have little experience with LSP's but I've heard they can do this sort of thing, please correct me if I'm wrong, but is this possible?

I would love some example code but I will take any information or advice anyone can give on the topic. :)


You can view example of code (c#) for LSP at https://github.com/SOLON7/HTTPSniffer. It is used for 32 Windows OS, but you can port it easely to 64 (set LspCatalog64Only during installation)

And you should remember, that you have to generate new GUID for your provider in a case of collisions with another LSP providers.


have a look at komodia there is an article + example about LSP, unfortunaltly in C++.

But it should not be impossible to convert it.


You need build an LSP for this, and then access it through P/Invoke. Take a look at WS SPI spec : ftp://ftp.microsoft.com/bussys/Winsock/Winsock2/WSSPI22.DOC


Do you definitely want to write your own?

WinPCap does an excellent job of capturing packets. SharpPcap does an equally excellent job of letting you use WinPCap from C#. Both are free and, I think, open-source.

(I'm not sure if WinPCap uses LSP under the hood, but the final result is that you can inspect packets, so might be just the thing you want)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜