(self, externalPort, internalPort, internalClient, protocol, description, leaseDuration = 0, enabled = 1)
| 113 | self.upnp_schema = service.childNodes[0].data.split(':')[-2] |
| 114 | |
| 115 | def AddPortMapping(self, externalPort, internalPort, internalClient, protocol, description, leaseDuration = 0, enabled = 1): |
| 116 | from debug import logger |
| 117 | resp = self.soapRequest(self.upnp_schema + ':1', 'AddPortMapping', [ |
| 118 | ('NewRemoteHost', ''), |
| 119 | ('NewExternalPort', str(externalPort)), |
| 120 | ('NewProtocol', protocol), |
| 121 | ('NewInternalPort', str(internalPort)), |
| 122 | ('NewInternalClient', internalClient), |
| 123 | ('NewEnabled', str(enabled)), |
| 124 | ('NewPortMappingDescription', str(description)), |
| 125 | ('NewLeaseDuration', str(leaseDuration)) |
| 126 | ]) |
| 127 | self.extPort = externalPort |
| 128 | logger.info("Successfully established UPnP mapping for %s:%i on external port %i", internalClient, internalPort, externalPort) |
| 129 | return resp |
| 130 | |
| 131 | def DeletePortMapping(self, externalPort, protocol): |
| 132 | from debug import logger |
no test coverage detected