Interface IP Address

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
MatthewLundberg Offline
Junior Member
Posts: 45
Joined: Apr 2017
Reputation: 0
Post: #1
In order to lock a network tuner, I need to get the IP address of an interface on the machine. The tuner is a HDHomeRun by SiliconDust, but that shouldn't matter for what I'm trying to do.

Of course this can be gotten with BSD socket calls. Or Win32 API calls. But Kodi seems to know its own IP address, so there should be an API call for this.

I found this in searching: http://forum.kodi.tv/showthread.php?tid=...pid2508152 but that is using the output of the "ifconfig" command. I don't think that will work for Windows.

What's the proper way to get this information out of Kodi itself?
find quote
Wimpie Offline
Senior Member
Posts: 223
Joined: Nov 2012
Reputation: 6
Post: #2
Did you try the infolabels, more specifically the network infolabels?

InfoLabels#Network_labels (wiki)

Add-on : Bluray iso utils Rewrite of BR_iso_enhancements
Add-on : BR_iso_Enhancements Give theatrical & directors cut from the same bluray iso each their own library entry, use bluray iso's of tv shows as if they are already ripped.
find quote
MatthewLundberg Offline
Junior Member
Posts: 45
Joined: Apr 2017
Reputation: 0
Post: #3
The required headers don't seem to be in the tree for the PVR build, and I couldn't figure out how to add them (or even if it is possible).

However, I found that the SiliconDust library supports getting all of the system IP addresses and netmasks. I can use that to find the local interface used for the HDR tuner. Since the tuner must be on a local Ethernet subnet (not routed), this should work for all users, regardless of how many NICs are configured in the Kodi machine.
find quote