libdnspacketDNS 数据包解析和构建库
libdnspacket 是一个仅一个单 .hpp 文件,引入即可实现对 DNS 数据包的解析和构建的库,十分的轻量,无任何外部依赖,无平台依赖。
特点:
-
便于使用
-
没有外部依赖
-
解析 DNS 数据包
-
构建 DNS 数据包
-
DNS 主机名压缩
-
支持多种 DNS 记录类型
使用方式十分简单,只需要将源码文件dns.hpp放入你的项目中,inclue之后通过调用Parse或Build方法就可以对DNS数据包进行解析或构建了,不用担心什么副作用。
示例:
- 解析原始DNS数据包为消息
/
// Parameters:
// buf: point to the raw DNS packet
// bufSize: indicate the size of [buf]
// Return:
// <bool, DnsMessage>
// #1: indicate whether the packet was parsed successfully or not
// #2: when #1 value is true, this is the final structured DNS message
//
std::tuple<bool, DnsMessage> dns::Parse(const uint8_t* buf, size_t bufSize);
- 构建DNS消息为原始数据包
/
// Parameters:
// message: the structured DNS message
// Return:
// The byte buffer of raw DNS packet
//
std::vector<std::byte> Build(const DnsMessage& message);
评论
node_pcap解析数据包
node_pcap是从libpcap到Node.js的绑定集,提供有用的库来解码,打印和解析数据包。node_pcap虽然很有用,但是并不是理解所有的协议。示例:var pcap = require(
node_pcap解析数据包
0
SGMLReaderHTML 和 SGML 解析库
SgmlReader 是一个敏捷的 C# .NET 库,通过 XmlReader API 解析 HT
SGMLReaderHTML 和 SGML 解析库
0
SGMLReaderHTML 和 SGML 解析库
SgmlReader是一个敏捷的C#.NET库,通过XmlReaderAPI解析HTML和SGML文件。同时提供一个命令行工具可以对这些内容进行格式化输出到XML结果。示例代码:XmlDocument
SGMLReaderHTML 和 SGML 解析库
0