if ($dev_nodebase == "") { SHELL_debug($SHELL_FILE, "Can not to get the runtime node path of IGD!"); exit; } $act_name = query($ACTION_NODEBASE . "/action_name"); $svc_type = query($dev_nodebase . "/devdesc/device/deviceList/device:1/deviceList/device:1/serviceList/service:2/serviceType"); $WID = 1; /* WAN port ID */ $errorCode = 401; $SOAP_BODY = ""; if ($act_name == "AddPortMapping" || $act_name == "DeletePortMapping" || $act_name == "GetConnectionTypeInfo" || $act_name == "GetExternalIPAddress" || $act_name == "GetGenericPortMappingEntry" || $act_name == "GetNATRSIPStatus" || $act_name == "GetSpecificPortMappingEntry" || $act_name == "GetStatusInfo" || $act_name == "RequestConnection" || $act_name == "ForceTermination" || $act_name == "SetConnectionType") { dophp("load", "/htdocs/upnpinc/ACTION.DO." . $act_name . ".php"); } /* 200 OK */ if ($errorCode == 200) { SOAP_act_resp_200(query($rtpath_base . "/server"), $svc_type, $act_name, $SOAP_BODY); exit; } /* ERROR */ if ($errorCode == 401) { SOAP_act_resp_500("401", "Invalid Action"); } else { if ($errorCode == 402) { SOAP_act_resp_500("402", "Invalid Args"); } else { if ($errorCode == 501) { SOAP_act_resp_500("501", "Action Failed"); } else { if ($errorCode == 704) { SOAP_act_resp_500("704", "ConnectionSetupFailed"); } else {
<?php /* vi: set sw=4 ts=4: */ include "/htdocs/phplib/upnp.php"; include "/htdocs/upnpinc/gvar.php"; include "/htdocs/upnpinc/soap.php"; fwrite("w", $SHELL_FILE, "#!/bin/sh\n"); $dev_nodebase = UPNP_getdevpathbytype($INF_UID, $G_IGD); if ($dev_nodebase == "") { SHELL_debug($SHELL_FILE, "Can not to get the runtime node path of IGD!"); exit; } $act_name = query($ACTION_NODEBASE . "/action_name"); $svc_type = query($dev_nodebase . "/devdesc/device/serviceList/service:2/serviceType"); if ($ACTION_NAME == $act_name) { if ($act_name == "GetDefaultConnectionService") { SOAP_act_resp_200(query($dev_nodebase . "/server"), $svc_type, $act_name, "ACTION." . $act_name . ".php"); } else { if ($act_name == "SetDefaultConnectionService") { SOAP_act_resp_500("501", "Action Failed"); } } } else { SOAP_act_resp_500("401", "Invalid Action"); }
<?php /* vi: set sw=4 ts=4: */ include "/htdocs/phplib/upnp.php"; include "/htdocs/upnpinc/gvar.php"; include "/htdocs/upnpinc/soap.php"; fwrite("w", $SHELL_FILE, "#!/bin/sh\n"); $dev_nodebase = UPNP_getdevpathbytype($INF_UID, $G_IGD); if ($dev_nodebase == "") { SHELL_debug($SHELL_FILE, "Can not to get the runtime node path of IGD!"); exit; } $act_name = query($ACTION_NODEBASE . "/action_name"); $svc_type = query($dev_nodebase . "/devdesc/device/serviceList/service:1/serviceType"); if ($ACTION_NAME == $act_name && $act_name == "MagicOn") { SOAP_act_resp_200(query($dev_nodebase . "/server"), $svc_type, $act_name, ""); } else { SOAP_act_resp_500("401", "Invalid Action"); }