我需要知道如何编写一个获取目标 IP 地址的程序,将它们与表中的条目进行比较,并从路由表中识别正确的下一跳地址(将结果存储在物理文件中,例如 txt)。
任何指针?
谢谢
The routing table is maintained inside the kernel, as part of the TCP/IP stack. A userland C program just has no access to it.
为路由表条目创建链接列表并使用结构
struct routeTable
{
struct routeTable *next_Entry;
int ipAddress;
int interface;
};
有点像这样,您需要创建结构并创建链接列表。