aboutsummaryrefslogtreecommitdiffstats
path: root/packages/miniupnpd
diff options
context:
space:
mode:
authorRyan Wagoner <rsw686@pfsense.org>2007-02-08 00:25:30 +0000
committerRyan Wagoner <rsw686@pfsense.org>2007-02-08 00:25:30 +0000
commit2faccc851cc94b798869db22a2251ad12830b514 (patch)
tree9a48aa3458df9b24ae6c23482a10421780093fd4 /packages/miniupnpd
parent177fff3b97ef16f85dcdfb28e17982a15256ddd3 (diff)
downloadpfsense-packages-2faccc851cc94b798869db22a2251ad12830b514.tar.gz
pfsense-packages-2faccc851cc94b798869db22a2251ad12830b514.tar.bz2
pfsense-packages-2faccc851cc94b798869db22a2251ad12830b514.zip
miniupnpd version bump 20070208 .. adds uuid, serial number, and version support
Diffstat (limited to 'packages/miniupnpd')
-rw-r--r--packages/miniupnpd/miniupnpd.inc27
-rw-r--r--packages/miniupnpd/miniupnpd.xml2
-rwxr-xr-xpackages/miniupnpd/sbin/miniupnpdbin51744 -> 51851 bytes
3 files changed, 21 insertions, 8 deletions
diff --git a/packages/miniupnpd/miniupnpd.inc b/packages/miniupnpd/miniupnpd.inc
index f57787fb..5cda1ae0 100644
--- a/packages/miniupnpd/miniupnpd.inc
+++ b/packages/miniupnpd/miniupnpd.inc
@@ -18,16 +18,14 @@
function upnp_running () {
if((int)exec("pgrep miniupnpd | wc -l") > 0)
return true;
- else
- return false;
+ return false;
}
function upnp_config ($name) {
global $config;
if($config['installedpackages']['miniupnpd']['config'][0]["{$name}"])
return $config['installedpackages']['miniupnpd']['config'][0]["{$name}"];
- else
- return NULL;
+ return NULL;
}
function upnp_write_config($conf_file, $conf_text) {
@@ -38,7 +36,15 @@
}
fwrite($conf, $conf_text);
fclose($conf);
- }
+ }
+
+ function upnp_uuid() {
+ /* md5 hash of wan mac */
+ $arp = explode(' ',exec('arp -an -i '.get_real_wan_interface()));
+ $uuid = md5($arp[3]);
+ /* put uuid in correct format 8-4-4-4-12 */
+ return substr($uuid,0,8)."-".substr($uuid,9,4)."-".substr($uuid,13,4)."-".substr($uuid,17,4)."-".substr($uuid,21,12);
+ }
function upnp_validate_ip($ip,$check_cdir) {
/* validate cdir */
@@ -128,7 +134,7 @@
global $config;
global $input_errors;
- config_lock();
+ config_lock();
$configtext = "ext_ifname=".get_real_wan_interface()."\n";
$configtext .= "port=2189\n";
@@ -191,11 +197,18 @@
/* set webgui url */
if($config['system']['webgui']['protocol']) {
- $configtext .= "presentation_url=".$config['system']['webgui']['protocol']. "://{$webgui_ip}";
+ $configtext .= "presentation_url=".$config['system']['webgui']['protocol']."://{$webgui_ip}";
if($config['system']['webgui']['port'])
$configtext .= ":".$config['system']['webgui']['port'];
$configtext .= "/\n";
}
+
+ /* set uuid and serial */
+ $configtext .= "uuid=".upnp_uuid()."\n";
+ $configtext .= "serial=".strtoupper(substr(upnp_uuid(),0,8))."\n";
+
+ /* set model number */
+ $configtext .= "model_number=".exec("cat /etc/version")."\n";
/* upnp access restrictions */
for($i=1; $i<=4; $i++) {
diff --git a/packages/miniupnpd/miniupnpd.xml b/packages/miniupnpd/miniupnpd.xml
index 79d56e13..db008b70 100644
--- a/packages/miniupnpd/miniupnpd.xml
+++ b/packages/miniupnpd/miniupnpd.xml
@@ -2,7 +2,7 @@
<packagegui>
<title>Services: MiniUPnPd</title>
<name>miniupnpd</name>
- <version>20070130</version>
+ <version>20070208</version>
<savetext>Change</savetext>
<include_file>/usr/local/pkg/miniupnpd.inc</include_file>
<aftersaveredirect>status_upnp.php</aftersaveredirect>
diff --git a/packages/miniupnpd/sbin/miniupnpd b/packages/miniupnpd/sbin/miniupnpd
index 977bb604..08397b89 100755
--- a/packages/miniupnpd/sbin/miniupnpd
+++ b/packages/miniupnpd/sbin/miniupnpd
Binary files differ