-2

我需要知道如何编写一个获取目标 IP 地址的程序,将它们与表中的条目进行比较,并从路由表中识别正确的下一跳地址(将结果存储在物理文件中,例如 txt)。

任何指针?

谢谢

4

2 回答 2

0

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.

于 2013-02-24T03:37:00.733 回答
0

为路由表条目创建链接列表并使用结构

struct routeTable
{
    struct routeTable *next_Entry;
    int ipAddress;
    int interface;
};

有点像这样,您需要创建结构并创建链接列表。

于 2013-02-23T16:42:20.297 回答