Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core][API] Obtaining local interfaces to allow getting connected device name #2989

Draft
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

ethouris
Copy link
Collaborator

@ethouris ethouris commented Jul 26, 2024

This partially restores the recognition facility as provided in #377 and uses it to obtain the device name.

This introduces an internal function GetLocalInterfaces(), which is in use by applications and for internal purposes, and a new API function, srt_getsockdevname, which extracts the device name of the connected socket. This is also in use by a testing application so that the connected status is displayed in Verbose mode.

Note that it doesn't have a guaranteed working in every case. So far it is tested on:

  • Linux: reports the interface name, like e.g. "eth0".
  • Windows/Cygwin: reports a string in the form of {UUID}, also if the device being used is VPN.
  • Windows/WSL: "lo" is reported correctly, as well as conecting locally to the address of "eth0" shows the name correctly. But it reports nothing, if tested against a peer in VPN. Inside tracking shows that the VPN device is not visible among local addresses. The address obtained through srt_getsockname seems to be the VPN-assigned local name, but it is not present in the results of GetLocalInterfaces().

Mikołaj Małecki and others added 30 commits May 9, 2018 13:33
…vention' into dev-add-obtaining-network-id
@ethouris
Copy link
Collaborator Author

Problem: I turned this option on on the C++11/Windows CI workflow and it results in a linker error for this newly introduced function. Strange at least, and likely it needs some Windows linker trick to function.

@ethouris ethouris marked this pull request as ready for review August 15, 2024 09:11
@maxsharabayko maxsharabayko added Type: Enhancement Indicates new feature requests [core] Area: Changes in SRT library core [API] Area: Changes in SRT library API labels Aug 15, 2024
@maxsharabayko maxsharabayko modified the milestones: v1.5.4, v1.6.0 Aug 15, 2024
@ethouris ethouris marked this pull request as draft August 30, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[API] Area: Changes in SRT library API [core] Area: Changes in SRT library core Type: Enhancement Indicates new feature requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants