Home > OS >  How to implement the IP route get code
How to implement the IP route get code

Time:11-13

I want to implement a function in your code, similar to the function of the IP route get, to get to go to the local IP export, as shown in figure:


I check it on the website it seems netlink can achieve, but haven't found relevant example, under the great god can help you?

CodePudding user response:

Recent research for a long time, the use of netlink way or no progress, it's better if which under the guidance of a great god can;

But I found a way that other can barely:
1, the use of ICMP ping way, at the time of receiving the response, dstAddr is the end of the SRC exports;
2, use socket hook (hook)
  • Related