FritzConnection. Eine Python-Schnittstelle zur AVM FritzBox. FritzConnection pythoncamp 2013 Klaus Bremer



Similar documents
Managing Ports and System Services using BT NetProtect Plus firewall

Network Configuration Settings

Configuring a Trimble Sps 461 using the Ethernet Connection GETTING THE GPS ON THE NETWORK HTTP PORT. By Bob Glover

Universal plug and play (UPnP) mapping attacks

Quick Guide of HiDDNS Settings (with UPnP)

HREP Series DVR DDNS Configuration Application Note

Installation, Configuration and Operation

Chapter 3 Security and Firewall Protection

Quick Installation Guide

Performing an Air Upgrade of the DECT Handset

Installation, Configuration and Operation. FRITZ!Box

Firewall Defaults, Public Server Rule, and Secondary WAN IP Address

iphone Softphone App for the Opera IP System Installation and user guide

Firewall Defaults and Some Basic Rules

Quick Installation Guide For Mac users

FRITZ!Box 6840 LTE. Configuration and Operation

FRITZ!Box Products Secure high-speed surfing and convenient telephoning over the Internet

How to publish your NAS on the internet ThecusOS 6

Quick Installation Guide-For MAC users

Owner of the content within this article is Written by Marc Grote

Using TestLogServer for Web Security Troubleshooting

Attacking VoIP Networks

BLOOMBERG ANYWHERE FOR MOBILE CUSTOMERS

Quick Installation Guide

FRITZ!Box 6810 LTE. Installation and Operation

VPN Configuration Guide. AVM FRITZ!Box

Virtual Server in SP883

Quick Installation Guide

Quick Set Up Guide. Fritz!Box 7360

Enterprise Security Interests Require SSL with telnet server from outside the LAN

DIGITUS Plug&View IP cameras

Setting up and creating a Local Area Network (LAN) within Windows XP by Buzzons

SIP Phones Compatibility List

Chapter 3 Management. Remote Management

How To Use The Fritz!Box (A Computer)

SNMP Manager User s Manual

FRITZ!WLAN Repeater 300E. Configuring and Operating

Chapter 4 Management. Viewing the Activity Log

Preparing for GO!Enterprise MDM On-Demand Service

PCTV Systems Requirements for using DistanTV mobile

SSC Getting rid of the biggest drag on VoIP!

Gateway Portal Load Balancing

Owner of the content within this article is Written by Marc Grote

SIP Phones Compatibility List

BP9 - Citrix Receiver Optimierung: So verbessern Sie Management und Benutzerkomfort. Systems Engineer, Citrix Systems GmbH

Port forwarding and viewing your IP camera from the internet

Self Help Guide. Please read the following carefully; Synopsis: Requirements: A Computer with a working RJ45 LAN Port All Belkin Modem Routers

UPnP-Based Sensor Network Management Architecture

IP Telefonie mit Cisco CallManager

Hills Professional Series NVRs and Cameras

Konica Minolta s Optimised Print Services (OPS)

Universal Plug and Play and Port Control Protocol: The Advance Features of Dual Stack IPv4 and IPv6 Customer Premises Equipment

ARCSERVE UNIFIED DATA PROTECTION SUPPORT FOR EMC CLOUDARRAY

HRG Performance Series DVR DDNS Support Application Note (DynDNS)

Device Log Export ENGLISH

Installation, configuration and operation. FRITZ!Box. Fon WLAN 7570 vdsl

FRITZ!Box Fon WLAN 7050

DDNS Management System User Manual V1.0

Quick Installation Guide

Basics of Port Forwarding on a Router for Security DVR s

FRITZ!Box Installation and Operation

Quick Guide of Remote Monitoring via PC or Mobile Phone

AP6511 First Time Configuration Procedure

Volume. Instruction Manual

Enhanced Password Security - Phase I

Ethernet I/O System. SNMP manual V1.0

Asterisk und Mediagateways

TI IS-1007 v1.0. TeamConnect. Network and IT configuration

Websense Web Security Gateway: Integrating the Content Gateway component with Third Party Data Loss Prevention Applications

1. Hardware Installation

Amcrest 960H DVR Quick Start Guide

RESIDENTIAL GATEWAY. Model TG784n USER MANUAL

Vega 100G and Vega 200G Gamma Config Guide

OV704WVG Product Specifications

Prerequisites. Creating Profiles

Installation, Configuration and Operation. FRITZ!Box

TENVIS Technology Co., Ltd. User Manual. For H.264 Cameras. Version 2.0.0

Load Balancing BEA WebLogic Servers with F5 Networks BIG-IP

SNMP Web card. User s Manual. Management Software for Uninterruptible Power Supply Systems

Enhanced Password Security - Phase I

FortiVoice. Version 7.00 VoIP Configuration Guide

TW100-BRF114 Firewall Router. User's Guide. Cable/DSL Internet Access. 4-Port Switching Hub

FRITZ!Box Fon WLAN 7140

FRITZ!Box Fon ata. 2 FRITZ!Box Fon ata. AVM GmbH All rights reserved. Documentation release 06/2005

A Beginner s guide to send data to Device Cloud from a ZigBee Network

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

End of Sale/End of Life Report Tool Usage Notes for CiscoWorks NCM 1.6

Quick Installation Guide

D-LINK DPH-140S SIP PHONE INSTALLATION GUIDE

User Manual Network Interface

How to add your Weebly website to a TotalCloud hosted Server

Update to V10. Automic Support: Best Practices Josef Scharl. Please ask your questions here Event code 6262

DHCP Server Port-Based Address Allocation

NPort. Copyright 2008 Moxa Inc. Released on July 15, 2008

KNX IP Interface 730 KNX IP Router 750 KNX IP LineMaster 760 KNX IP BAOS 770 KNX IP BAOS 771 KNX IP BAOS 772 KNX IP BAOS 777

Upgrading User-ID. Tech Note PAN-OS , Palo Alto Networks, Inc.

LICENSE4J LICENSE ACTIVATION AND VALIDATION PROXY SERVER USER GUIDE

Transcription:

FritzConnection Eine Python-Schnittstelle zur AVM FritzBox 1

Detailinformationen von AVM: http://www.avm.de/de/news/artikel/schnittstellen_und_entwicklungen.php Per Navigation auf www.avm.de (für mich) unauffindbar. 2

FritzConnection FritzTools FritzStatus FritzMonitor https://bitbucket.org/kbr/fritzconnection fritzconnection: fritzstatus: fritzmonitor: Schnittstelle zur FritzBox FritzBox-Statusinformationen GUI-Aktivitätsmonitor (TkInter) 3

FritzBox liefert Schnittstellenbeschreibung via xml-dateien: igddesc.xml tr64desc.xml Zugriff per http: IP: 169.254.1.1 Port: 49000 4

TR-064: basierend auf UPnP (Universal Plug and Play) Informationen TR-064: http://www.broadband-forum.org/technical/download/tr-064.pdf http://www.avm.de/de/extern/files/tr-064/avm_technical_note_- _Konfiguration_ueber_TR-064.pdf http://www.avm.de/de/extern/files/tr-064/avm_tr-064_first_steps.pdf Informationen UPnP: http://upnp.org/ https://developer.gnome.org/gupnp/unstable/server-tutorial.html 5

igddesc.xml (Internet Gateway Device Description) <service> <servicetype>urn:schemas-upnp-org:service:wancommoninterfaceconfig:1</servicetype> <serviceid>urn:upnp-org:serviceid:wancommonifc1</serviceid> <controlurl>/upnp/control/wancommonifc1</controlurl> <eventsuburl>/upnp/control/wancommonifc1</eventsuburl> <SCPDURL>/igdicfgSCPD.xml</SCPDURL> </service> Service Control Protocol Document 6

igdicfgscpd.xml (Internet Gateway Device Internal Configuration Service Control Protocol Document) <action> <name>gettotalbytesreceived</name> <argumentlist> <argument> <name>newtotalbytesreceived</name> <direction>out</direction> <relatedstatevariable>totalbytesreceived</relatedstatevariable> </argument> </argumentlist> </action>... <statevariable sendevents="no"> <name>totalbytesreceived</name> <datatype>ui4</datatype> </statevariable> 7

FritzConnection: Anwendungsbeispiel if name == ' main ': print('fritzconnection:') fc = FritzConnection() print(fc.modelname) print(fc.actionnames) print(fc.get_action_arguments('getstatusinfo')) print(fc.call_action('getstatusinfo')) print(fc.call_action('gettotalbytessent')) print(fc.call_action('gettotalbytesreceived')) print(fc.call_action('getexternalipaddress')) print(fc.call_action('getcommonlinkproperties')) 8

Output: FritzConnection: FRITZ!Box Fon WLAN 7390 ['AddPortMapping', 'DeletePortMapping', 'ForceTermination', 'GetATMEncapsulation', 'GetAddonInfos', 'GetAutoConfig', 'GetCommonLinkProperties', 'GetConnectionTypeInfo', 'GetDSLLinkInfo', 'GetDestinationAddress', 'GetExternalIPAddress', 'GetFCSPreserved', 'GetGenericPortMappingEntry', 'GetModulationType', 'GetNATRSIPStatus', 'GetSpecificPortMappingEntry', 'GetStatusInfo', 'GetTotalBytesReceived', 'GetTotalBytesSent', 'GetTotalPacketsReceived', 'GetTotalPacketsSent', 'RequestConnection', 'SetATMEncapsulation', 'SetConnectionType', 'SetDSLLinkType', 'SetDestinationAddress', 'SetFCSPreserved'] [('NewUptime', 'out', 'ui4'), ('NewLastConnectionError', 'out', 'string'), ('NewConnectionStatus', 'out', 'string')] {'NewConnectionStatus': u'connected', 'NewLastConnectionError': u'error_none', 'NewUptime': 50301} {'NewTotalBytesSent': 181458037} {'NewTotalBytesReceived': 873834710} {'NewExternalIPAddress': u'93.223.160.68'} {'NewWANAccessType': u'dsl', 'NewLayer1DownstreamMaxBitRate': 51376000, 'NewPhysicalLinkStatus': u'up', 'NewLayer1UpstreamMaxBitRate': 10048000} 9

IO: if name == ' main ': print('fritzconnection:') fc = FritzConnection() -- print(fc.modelname) FritzConnection: FRITZ!Box Fon WLAN 7390 10

IO: if name == ' main ':... print(fc.actionnames) -- ['AddPortMapping', 'DeletePortMapping', 'ForceTermination', 'GetATMEncapsulation', 'GetAddonInfos', 'GetAutoConfig', 'GetCommonLinkProperties', 'GetConnectionTypeInfo', 'GetDSLLinkInfo', 'GetDestinationAddress', 'GetExternalIPAddress', 'GetFCSPreserved', 'GetGenericPortMappingEntry', 'GetModulationType', 'GetNATRSIPStatus', 'GetSpecificPortMappingEntry', 'GetStatusInfo', 'GetTotalBytesReceived', 'GetTotalBytesSent', 'GetTotalPacketsReceived', 'GetTotalPacketsSent', 'RequestConnection', 'SetATMEncapsulation', 'SetConnectionType', 'SetDSLLinkType', 'SetDestinationAddress', 'SetFCSPreserved'] 11

IO: if name == ' main ':... print(fc.get_action_arguments('getstatusinfo')) print(fc.call_action('getstatusinfo')) -- [('NewUptime', 'out', 'ui4'), ('NewLastConnectionError', 'out', 'string'), ('NewConnectionStatus', 'out', 'string')] {'NewConnectionStatus': u'connected', 'NewLastConnectionError': u'error_none', 'NewUptime': 50301} 12

IO: if name == ' main ':... print(fc.call_action('gettotalbytessent')) print(fc.call_action('gettotalbytesreceived')) print(fc.call_action('getexternalipaddress')) print(fc.call_action('getcommonlinkproperties')) -- {'NewTotalBytesSent': 181458037} {'NewTotalBytesReceived': 873834710} {'NewExternalIPAddress': u'93.223.160.68'} {'NewWANAccessType': u'dsl', 'NewLayer1DownstreamMaxBitRate': 51376000, 'NewPhysicalLinkStatus': u'up', 'NewLayer1UpstreamMaxBitRate': 10048000} 13

FritzStatus: class FritzStatus(object): """ Class for requsting status-informations: """ @property def modelname(self): return self.fc.modelname @property def is_linked(self): """Returns True if the FritzBox is physically linked to the provider.""" status = self.fc.call_action('getcommonlinkproperties') return status['newphysicallinkstatus'] == 'Up' @property def is_connected(self): """ Returns True if the FritzBox has established an internet-connection. """ status = self.fc.call_action('getstatusinfo') return status['newconnectionstatus'] == 'Connected' 14

FritzStatus: if name == ' main ': fs = FritzStatus() print(fs.modelname) print(fs.bytes_sent) print(fs.bytes_received) print(fs.is_linked) print(fs.is_connected) print(fs.external_ip) print(fs.uptime) print(fs.str_uptime) print(fs.max_bit_rate) print(fs.max_byte_rate) print(fs.str_max_bit_rate) FRITZ!Box Fon WLAN 7390 89822389 245330020 True True 93.223.161.238 73175 20:19:35 (10048000, 51376000) (1256000, 6422000) ('9.0 MBit/s', '48.0 MBit/s') 15

FritzMonitor: 16

https://bitbucket.org/kbr/fritzconnection http://www.bremer-media.de/extras/fritzconnection.html 17