我需要安装什么软件包才能使用路由套接字? [英] What package do i need to install for using routing sockets?
问题描述
我正在尝试 Richard Stevens 在 Unix Network Programming 中给出的代码.但我无法编译代码.
i am trying code given in Unix Network Programming by Richard Stevens. but i am not able to get the code to compile.
这里是源代码.http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15213-f00/unpv12e/libroute/
我没有头文件 net/if_dl.h 并且 net/route.h 头文件不包含代码使用的常量和结构.
i don't have the header file net/if_dl.h and the net/route.h header file does not include the constants and structures that the code uses.
推荐答案
这是BSD特有的API,linux不支持.这等效功能(不兼容源)由netlink 套接字系列.man 7 netlink"应该让你开始,但是你可能需要做一些移植工作.
That is a BSD-specific API, and linux doesn't support it. The equivalent functionality (not source-compatible) is provided by the netlink socket family. "man 7 netlink" should get you started, but you're likely going to need to do some porting work.
这篇关于我需要安装什么软件包才能使用路由套接字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!