diff options
author | Ryan Wagoner <rsw686@pfsense.org> | 2007-02-08 00:25:30 +0000 |
---|---|---|
committer | Ryan Wagoner <rsw686@pfsense.org> | 2007-02-08 00:25:30 +0000 |
commit | 2faccc851cc94b798869db22a2251ad12830b514 (patch) | |
tree | 9a48aa3458df9b24ae6c23482a10421780093fd4 | |
parent | 177fff3b97ef16f85dcdfb28e17982a15256ddd3 (diff) | |
download | pfsense-packages-2faccc851cc94b798869db22a2251ad12830b514.tar.gz pfsense-packages-2faccc851cc94b798869db22a2251ad12830b514.tar.bz2 pfsense-packages-2faccc851cc94b798869db22a2251ad12830b514.zip |
miniupnpd version bump 20070208 .. adds uuid, serial number, and version support
-rw-r--r-- | packages/miniupnpd/miniupnpd.inc | 27 | ||||
-rw-r--r-- | packages/miniupnpd/miniupnpd.xml | 2 | ||||
-rwxr-xr-x | packages/miniupnpd/sbin/miniupnpd | bin | 51744 -> 51851 bytes | |||
-rw-r--r-- | pkg_config.xml | 2 |
4 files changed, 22 insertions, 9 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 Binary files differindex 977bb604..08397b89 100755 --- a/packages/miniupnpd/sbin/miniupnpd +++ b/packages/miniupnpd/sbin/miniupnpd diff --git a/pkg_config.xml b/pkg_config.xml index 74c20849..3cdb026c 100644 --- a/pkg_config.xml +++ b/pkg_config.xml @@ -160,7 +160,7 @@ <website>http://miniupnp.free.fr/</website> <category>Network Management</category> <maintainer>seth.mos@xs4all.nl ryan@wgnrs.dynu.com</maintainer> - <version>20070130</version> + <version>20070208</version> <required_version>1.0</required_version> <status>Stable</status> <config_file>http://www.pfsense.com/packages/config/miniupnpd/miniupnpd.xml</config_file> |