Skip to content

Commit

Permalink
GUI: Port Forwarding: UPnP IGD & PCP/NAT-PMP: improve wording
Browse files Browse the repository at this point in the history
- Remove note about custom configuration requirements
- Add `PCP` as supported and use `UPnP IGD` as described in more detail
  • Loading branch information
Self-Hosting-Group committed Jun 28, 2024
1 parent bb0d5b4 commit a0b604f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion release/src-rt-6.x.4708/router/config/Config
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ config CONFIG_PPP
default y

config CONFIG_UPNP
bool "UPnP IGD server"
bool "UPnP IGD & PCP/NAT-PMP daemon"
depends on CONFIG_NETCONF && CONFIG_NVRAM && CONFIG_SHARED && CONFIG_NAT
default y

Expand Down
2 changes: 1 addition & 1 deletion release/src-rt-6.x.4708/router/rc/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -1825,7 +1825,7 @@ void start_upnp(void)
"upnp_nat_postrouting_chain=pupnp\n"
"notify_interval=%d\n"
"system_uptime=yes\n"
"friendly_name=FreshTomato UPnP daemon\n"
"friendly_name=FreshTomato UPnP IGD daemon\n"
"model_name=%s\n"
"model_url=https://freshtomato.org/\n"
"manufacturer_name=FreshTomato Firmware\n"
Expand Down
32 changes: 16 additions & 16 deletions release/src-rt-6.x.4708/router/www/forward-upnp.asp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta name="robots" content="noindex,nofollow">
<title>[<% ident(); %>] Forwarding: UPnP / NAT-PMP</title>
<title>[<% ident(); %>] Forwarding: UPnP IGD &amp; PCP/NAT-PMP</title>
<link rel="stylesheet" type="text/css" href="tomato.css?rel=<% version(); %>">
<% css(); %>
<script src="isup.jsz?rel=<% version(); %>"></script>
Expand Down Expand Up @@ -49,11 +49,11 @@ function upnpNvramAdd() {
return;
E('_f_enable_upnp').disabled = 1;
E('_f_enable_natpmp').disabled = 1;
E('_f_enable_pcp_pmp').disabled = 1;
if ((sb = E('save-button')) != null) sb.disabled = 1;
if ((cb = E('cancel-button')) != null) cb.disabled = 1;
if (!confirm("Add UPNP to nvram?"))
if (!confirm("Enable UPnP IGD & PCP… by adding UPNP to nvram?"))
return;
if (xob)
Expand All @@ -76,7 +76,7 @@ function upnpNvramAdd() {
setTimeout(
function() {
E('_f_enable_upnp').disabled = 0;
E('_f_enable_natpmp').disabled = 0;
E('_f_enable_pcp_pmp').disabled = 0;
if (sb) sb.disabled = 0;
if (cb) cb.disabled = 0;
if (msg) msg.style.display = 'none';
Expand Down Expand Up @@ -192,7 +192,7 @@ ug.onClick = function(cell) {
}
function verifyFields(focused, quiet) {
var enable = (E('_f_enable_upnp').checked || E('_f_enable_natpmp').checked);
var enable = (E('_f_enable_upnp').checked || E('_f_enable_pcp_pmp').checked);
var bc = E('_f_upnp_clean').checked;
E('_f_upnp_clean').disabled = (enable == 0);
Expand Down Expand Up @@ -232,9 +232,9 @@ function verifyFields(focused, quiet) {
E('_f_upnp_lan3').checked = 0;
if ((enable) && (!E('_f_upnp_lan').checked) && (!E('_f_upnp_lan1').checked) && (!E('_f_upnp_lan2').checked) && (!E('_f_upnp_lan3').checked)) {
if ((E('_f_enable_natpmp').checked) || (E('_f_enable_upnp').checked)) {
var m = 'NAT-PMP or UPnP should be enabled on at least one LAN bridge. You can continue, but be sure to configure access to the UPnP service in Custom Configuration, otherwise miniupnpd will not run';
ferror.set('_f_enable_natpmp', m, quiet);
if ((E('_f_enable_pcp_pmp').checked) || (E('_f_enable_upnp').checked)) {
var m = 'UPnP IGD & PCP… should be enabled on at least one LAN bridge.';
ferror.set('_f_enable_pcp_pmp', m, quiet);
ferror.set('_f_enable_upnp', m, 1);
ferror.set('_f_upnp_lan', m, 1);
ferror.set('_f_upnp_lan1', m, 1);
Expand All @@ -244,7 +244,7 @@ function verifyFields(focused, quiet) {
return 1;
}
else {
ferror.clear('_f_enable_natpmp');
ferror.clear('_f_enable_pcp_pmp');
ferror.clear('_f_enable_upnp');
ferror.clear('_f_upnp_lan');
ferror.clear('_f_upnp_lan1');
Expand All @@ -264,7 +264,7 @@ function save() {
fom.upnp_enable.value = 0;
if (fom.f_enable_upnp.checked)
fom.upnp_enable.value = 1;
if (fom.f_enable_natpmp.checked)
if (fom.f_enable_pcp_pmp.checked)
fom.upnp_enable.value |= 2;
fom.upnp_mnp.value = fom._f_upnp_mnp.checked ? 1 : 0;
Expand Down Expand Up @@ -335,24 +335,24 @@ function init() {

<!-- / / / -->

<div class="section-title">UPnP / NAT-PMP Settings</div>
<div class="section-title">UPnP IGD &amp; PCP/NAT-PMP Settings</div>
<div class="section">
<script>
createFieldTable('', [
{ title: 'Enable UPnP', name: 'f_enable_upnp', type: 'checkbox', value: (nvram.upnp_enable & 1) },
{ title: 'Enable NAT-PMP', name: 'f_enable_natpmp', type: 'checkbox', value: (nvram.upnp_enable & 2) },
{ title: 'Enable UPnP IGD', name: 'f_enable_upnp', type: 'checkbox', value: (nvram.upnp_enable & 1) },
{ title: 'Enable PCP/NAT-PMP', name: 'f_enable_pcp_pmp', type: 'checkbox', value: (nvram.upnp_enable & 2) },
{ title: 'Inactive Rules Cleaning', name: 'f_upnp_clean', type: 'checkbox', value: (nvram.upnp_clean == '1') },
{ title: 'Cleaning Interval', indent: 2, name: 'upnp_clean_interval', type: 'text', maxlen: 5, size: 7, suffix: ' <small>seconds<\/small>', value: nvram.upnp_clean_interval },
{ title: 'Cleaning Threshold', indent: 2, name: 'upnp_clean_threshold', type: 'text', maxlen: 4, size: 7, suffix: ' <small>redirections<\/small>', value: nvram.upnp_clean_threshold },
{ title: 'Secure Mode', name: 'f_upnp_secure', type: 'checkbox', suffix: ' <small>when enabled, UPnP clients are allowed to add mappings only to their IP<\/small>', value: (nvram.upnp_secure == '1') },
{ title: 'Cleaning Threshold', indent: 2, name: 'upnp_clean_threshold', type: 'text', maxlen: 4, size: 7, suffix: ' <small>port forwards<\/small>', value: nvram.upnp_clean_threshold },
{ title: 'Secure Mode', name: 'f_upnp_secure', type: 'checkbox', suffix: ' <small>when enabled, UPnP IGD clients are allowed to add mappings only to their IP<\/small>', value: (nvram.upnp_secure == '1') },
{ title: 'Enabled on' },
{ title: 'LAN0', indent: 2, name: 'f_upnp_lan', type: 'checkbox', value: (nvram.upnp_lan == '1') },
{ title: 'LAN1', indent: 2, name: 'f_upnp_lan1', type: 'checkbox', value: (nvram.upnp_lan1 == '1') },
{ title: 'LAN2', indent: 2, name: 'f_upnp_lan2', type: 'checkbox', value: (nvram.upnp_lan2 == '1') },
{ title: 'LAN3', indent: 2, name: 'f_upnp_lan3', type: 'checkbox', value: (nvram.upnp_lan3 == '1') },
{ title: 'Show In My Network Places', name: 'f_upnp_mnp', type: 'checkbox', value: (nvram.upnp_mnp == '1')},
null,
{ title: 'Miniupnpd<\/a><br>Custom configuration', name: 'upnp_custom', type: 'textarea', value: nvram.upnp_custom }
{ title: 'Custom configuration', name: 'upnp_custom', type: 'textarea', value: nvram.upnp_custom }
]);
</script>
</div>
Expand Down
2 changes: 1 addition & 1 deletion release/src-rt-6.x.4708/router/www/tomato.js
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@ function navi() {
/* IPV6-END */
['DMZ', 'dmz.asp'],
['Triggered', 'triggered.asp'],
['UPnP/NAT-PMP', 'upnp.asp'] ] ],
['UPnP IGD & PCP', 'upnp.asp'] ] ],
['Access Restriction', 'restrict.asp'],
['QoS', 'qos', 0, [
['Basic Settings', 'settings.asp'],
Expand Down

0 comments on commit a0b604f

Please sign in to comment.