Changes between Initial Version and Version 1 of Ticket #12377, comment 8


Ignore:
Timestamp:
Feb 24, 2015, 6:59:52 PM (4 years ago)
Author:
yawning
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #12377, comment 8

    initial v1  
    1111
    1212A brief description of how the linux solution would work:
    13  1. Open a `RT_NETLINK` socket (AF_NETLINK, PF_ROUTE).
     13 1. Open a rtnetlink socket (AF_NETLINK, PF_ROUTE).
    1414 2. Query the entire routing table with `RTM_GETROUTE`, and find the default route and it's associated interface index (RTA_IIF, RTA_OIF).
    1515 3. Query the list of interfaces to get the address `RTM_GETADDR`.  You may be able to get away with looking at the RTA_SRC attribute in the response from 2, it's been a while so I don't remember off the top of my head.