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

Add UPnP and NAT-PMP support #1539

Closed
wants to merge 9 commits into from
Closed

Conversation

Ansa89
Copy link
Contributor

@Ansa89 Ansa89 commented Mar 6, 2016

This supersedes #1537 and is partially a rebase of #969.

@Ansa89
Copy link
Contributor Author

Ansa89 commented Mar 8, 2016

TOX_TRAVERSAL_TYPE should be defined directly into toxcore/tox.h.
This is a bad error, I will try to fix it ASAP.

@Ansa89
Copy link
Contributor Author

Ansa89 commented Mar 22, 2016

TOX_TRAVERSAL_TYPE should be defined directly into toxcore/tox.h.
This is a bad error, I will try to fix it ASAP.

Done.

@alexbakker
Copy link
Contributor

Just tested this and it seems to work.

It would be nice if this UPnP functionality could also map options.tcp_port to make it easier for users to host TCP relays without changing settings in their router.

@Ansa89
Copy link
Contributor Author

Ansa89 commented Mar 25, 2016

It would be nice if this UPnP functionality could also map options.tcp_port to make it easier for users to host TCP relays without changing settings in their router.

Done.

LOGGER_INFO("A valid IGD has been found.");

char portstr[10];
snprintf(portstr, sizeof(portstr), "%d", port);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting the following warning on make:

  CC       ../toxcore/libtoxcore_la-nat_traversal.lo
../toxcore/nat_traversal.c: In function 'upnp_map_port':
../toxcore/nat_traversal.c:70:13: warning: incompatible implicit declaration of built-in function 'snprintf'
             snprintf(portstr, sizeof(portstr), "%d", port);
             ^

@cebe
Copy link

cebe commented Mar 26, 2016

Compiled this with uTox and UPNP works as expected. Code looks also good to me, except the warning as commented above. My router does not support NAT-PMP so I could not test that.

@Ansa89
Copy link
Contributor Author

Ansa89 commented Mar 27, 2016

@cebe: should be fixed now. Please test again.

@GrayHatter
Copy link
Collaborator

I'll test this some time this week!

@alexbakker
Copy link
Contributor

@GrayHatter any news?

@GrayHatter
Copy link
Collaborator

No, haven't had the time. Don't let that discourage you from bumping this
PR.
On Apr 10, 2016 4:22 AM, "Impyy" notifications@github.com wrote:

@GrayHatter https://github.com/GrayHatter any news?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#1539 (comment)

@GrayHatter
Copy link
Collaborator

Is there a way to disable UPnP at runtime?

Eg if I'm on a network I don't want to open ports on?

@cebe
Copy link

cebe commented Apr 12, 2016

@GrayHatter set traversal_type option, when creating a new tox object: https://github.com/irungentoo/toxcore/pull/1539/files#diff-6ed9b859959c69656a6ec2bf5ba110adR421

So this can be a dropdown in connection settings of the client.

@Ansa89
Copy link
Contributor Author

Ansa89 commented Apr 12, 2016

What @cebe said is correct, but the correct link to the code is https://github.com/irungentoo/toxcore/pull/1539/files#diff-a58028aec4211a18b170732935eba2e3R445 (tox.in.h vs tox.h).

@GrayHatter
Copy link
Collaborator

this is now merged into new

Thanks @Ansa89

@GrayHatter GrayHatter closed this Jun 4, 2016
@Ansa89
Copy link
Contributor Author

Ansa89 commented Jun 5, 2016

Nice, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants