Coder Social home page Coder Social logo

tftpgui's Introduction

TFTPgui Version : 2.2
Date 20110908

This program is a TFTP server.

It is intended to run as a user initiated program, rather than a service daemon,
and displays a gui interface allowing the user to stop and start the tftp server.

It provides a simple tftp server for engineers to download and upload
configuration files from equipment such as routers and switches.


Installation

Download the tar file tftpgui_2_2.tar : Untar it into a directory of your
choice, and running "python tftpgui.py" will run the program.

Or if using Windows: download tftpgui_2_2.zip, unzip it and run
'python tftpgui.pyw'

The full command is run:

python tftpgui.py [options] <configuration-file>

The command line options are:

--nogui : in which case the tftp server is run, but no GUI is created.
--version : prints the version number and exits
--help : prints a usage message and exits

<configuration-file> : The optional location of a configuration file.

Windows users may need to replace the 'python' with the path to their Python
interpreter, i.e. C:\Python27\python tftpgui.pyw

It would also be possible to associate the .pyw extension with the python
interpreter, in which case merely double clicking on the tftpgui.pyw file
will run the program.

This version of tftpgui requires python 2.5 to 2.7 to be installed, and also the
python tk modules.

On Ubuntu/Debian this is package python-tk, on Widows it is built into
Python and does not need to be separately installed.

(A version 3 of TFTPgui exists which works with Python 3)


Usage

The program presents you with a graphical window, with start, stop,
setup and exit buttons.

Start - will start the server, which will then listen for file
        transfers from remote tftp clients.

Stop - will stop the server.

Setup - will open a window giving various options described below.

Exit - will close the program.


Setup Options

TFTP ROOT Folder: set the folder where files will be sent and received

TFTP LOGS Folder: During transmission, the program writes log entries,
these are held in this folder, which you can set.

Allow access from any remote IP Address, or just a specified subnet:

If any remote address is allowed, then any client can call this server.

If a subnet is specified, then you may input the subnet and mask, and
the server will only accept calls from clients within this subnet.
If you wish to limit remote access from a single device, set the subnet
to the remote device IP address, and the mask to 32.

PORT: The port which the tftp server listens on, as standard this is 69

It should be noted that on Linux, to set up a server listening on any
port below 1000 requires root permission, therefore you will need
to be root (or use sudo) to run this program on port 69.

APPLY - Save and implement the options.

CANCEL - Discard any option changes you have done.

DEFAULT - Set options to the initial defaults.


Configuration file

Under normal use, the hidden file .tftpgui.cfg is automatically created
in the users home directory (on Linux, or the equivalent per user
application directory on Windows).  This file is initially created
with default values and changed whenever the user sets changes on
the graphical interface. The file is subsequently read on startup,
so the users changes are persistent.

Most users need never look at, or edit the file, however a configuration
file location can be specified on the command line, which may be
useful if the program is to be started without a GUI.

Typical contents of configuration file:

---------------------------------------------------
[IPsetup]
clientmask = 16
listenport = 69
anyclient = 1
listenipaddress = 0.0.0.0
clientipaddress = 192.168.0.0

[Folders]
tftprootfolder = /home/bernie/tftpgui/tftproot
logfolder = /home/bernie/tftpgui/tftplogs
----------------------------------------------------

The value 'anyclient' is set to 1 to indicate any client can contact
the server, or zero if only a client with an ip address in the given
subnet will be accepted.

The folder locations will be set to appropriate locations on your
own PC the first time you run the program.

The configuration file has one option not set via the GUI. This
is 'listenipaddress' which is normally set to 0.0.0.0 - meaning
the server will listen on any ip address. If however you have a
machine with multiple IP addresses and you want the tftp service
to only listen on one, you can set the IP address here. 


version 2.2 changes:

Refactored, to make the code more flexible.
The configuration file now created in the users home as an hidden
file.


New in version 2:

Using the --nogui option on the command line allows the server to be
run without a graphical environment, in which case the configuration
file is the only form of controlling the server. In this case, a
configuration file location can be set on the command line.

tftpgui's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nojux-official

tftpgui's Issues

socket error

I'm trying to run tftpgui under Gentoo Linux 2.6.20
This is a normal modern desktop system i`m running on my laptop.
When I start the program i get the flowing error:

python tftpgui.py
Traceback (most recent call last):
  File "tftpgui.py", line 487, in ?
    ServerFrame=TftpGui(MainWindow)
  File "tftpgui.py", line 93, in __init__
    self.textAddress=socket.gethostbyname(socket.gethostname())
socket.gaierror: (-2, 'Name or service not known')


Original issue reported on code.google.com by [email protected] on 25 Sep 2007 at 5:20

Success report and a wish

Your tftp server also works on Mac OSX.

One of the items to enhance it would be to make it accept multiple connections 
at the same time 
(multithreaded).

Original issue reported on code.google.com by [email protected] on 25 Apr 2007 at 7:34

ImportError: No module named configparser

What steps will reproduce the problem?
1. Install Ubuntu 12.04 (32bit if it matters)
2. Install python 3.2
3.

What is the expected output? What do you see instead?
Expect the gui to load, but instead the following is returned:
user@vmubuntu:/usr/lib/python3.2$ sudo python ~/Downloads/tftpgui/tftpgui.py
Traceback (most recent call last):
  File "/home/user/Downloads/tftpgui/tftpgui.py", line 78, in <module>
    from tftp_package import tftpcfg, tftp_engine
  File "/home/user/Downloads/tftpgui/tftp_package/tftpcfg.py", line 46, in <module>
    import configparser
ImportError: No module named configparser


What version of the product are you using? On what operating system?
tftpgui 3.1
32bit Ubuntu 12.04

Please provide any additional information below.
Seems like an Ubuntu problem, but I thought I start here.

Configparser appears to be part of the package python3.2-minimal:
user@vmubuntu:~/Downloads$ apt-file search configparser.py
python-mapnik2: 
/usr/lib/python2.7/dist-packages/mapnik2/ogcserver/configparser.py
python-mapnik2: /usr/share/pyshared/mapnik2/ogcserver/configparser.py
python-quantum: 
/usr/lib/python2.7/dist-packages/quantum/plugins/cisco/common/cisco_configparser
.py
python-quantum: 
/usr/lib/python2.7/dist-packages/quantum/plugins/linuxbridge/common/configparser
.py
python-quantum: 
/usr/share/pyshared/quantum/plugins/cisco/common/cisco_configparser.py
python-quantum: 
/usr/share/pyshared/quantum/plugins/linuxbridge/common/configparser.py
python3.2-minimal: /usr/lib/python3.2/configparser.py
turnin-ng: /usr/share/turnin-ng/turninng/configparser.py

However this package is installed:
user@vmubuntu:~/Downloads$ sudo apt-get install python3.2-minimal
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3.2-minimal is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

And the file configparser.py exists and appears to be in the right location:
user@vmubuntu:~/Downloads$ ls -lh /usr/lib/python3.2/configparser.py
-rw-r--r-- 1 root root 48K Apr 12 16:55 /usr/lib/python3.2/configparser.py

Suggestions?


Original issue reported on code.google.com by [email protected] on 10 May 2012 at 1:40

cannot retrieve a file in a subdirectory

What steps will reproduce the problem?
1. mkdir -p A
2. touch A/B
3. start tftp server pointing at directory with A as root dir
4. request file /A/B

What is the expected output? What do you see instead?

I expect to see file B returned. Instead my TFTP client times out. No TFTP 
error codes are returned.


What version of the product are you using? On what operating system?

v3.1 on Linux (Ubuntu 13.04 \n \l)


Please provide any additional information below.

The problem is located in tftp_engine.py at lines 621-628 where the filename is 
checked for valid characters. Unfortunately, '/' is not considered a valid 
character and this is why the filename is silently rejected.

Add this before the test to _escape_ the '/' character.

        temp_filename=temp_filename.replace("/", "x")


Original issue reported on code.google.com by [email protected] on 17 Sep 2013 at 12:15

Parsing TFTP options

tftpgui implements the original TFTP protocol. It would be very nice if tftp 
could handle TFTP options, sich as "tsize" and "blksize".

Original issue reported on code.google.com by [email protected] on 22 Dec 2010 at 12:44

Fails to send error codes

What version of the product are you using? On what operating system?
1.1 on Windows XP

Please provide any additional information below.

I believe this program is failing to send out error codes, specifically
when a file is not found (error 1) a client is forced to wait for timeout
rather than having a quick reply. This is to a disadvantage with such
things as PXELINUX, which will search for multiple pxelinux.cfg files
before it gets to default. On another tftp server which is sending error 1,
this search is almost instant. On TFTPgui it takes around five minutes as
pxelinux waits to timeout.

Original issue reported on code.google.com by [email protected] on 7 May 2008 at 12:39

error in module call ubuntu 11.10

What steps will reproduce the problem?
1.did> tftpgui.py 
2.
3.

What is the expected output? What do you see instead?
Traceback (most recent call last):
  File "tftpgui.py", line 78, in <module>
    from tftp_package import tftpcfg, tftp_engine
  File "/home/ox/Downloads/router/tftpgui/tftp_package/tftpcfg.py", line 46, in <module>
    import configparser
ImportError: No module named configparser

What version of the product are you using? On what operating system?


Please provide any additional information below.
Thanks for doing this project.

Original issue reported on code.google.com by [email protected] on 7 May 2012 at 9:20

can't start tftp server Centos 5

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

everything loaded up ok, but when hit start i'm getting:Unable to start tftp 
server in the gui window.  



Original issue reported on code.google.com by [email protected] on 15 Jun 2010 at 11:06

For (very) small files, EOF is not detected properly

To reproduce the problem:
1. Create a file in the tftproot directory that is less than 512 bytes
2. Start tftpgui
3. Use a TFTP client (on a different machine) to get that file

tftpgui will write the first block, then get the ACK for that block, and then 
continue to send the _second_ block. But there is no more data. So it sends an 
empty block to the client (which has already completed the transfer).

Original issue reported on code.google.com by [email protected] on 22 Dec 2010 at 12:41

Unable to start TFTP server

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

it should run but i get this error:

2008-08-13 17:15:29,850 ERROR Unable to start server




What version of the product are you using? On what operating system?


I am using the tar file posted here on goole. My os is Ubuntu Hardy (the
desktop version)


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 13 Aug 2008 at 9:19

Need help to use TFTP Server

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.
Hello,

You program it's really good.
But i search start this TFTP Server in my programs without GUI 
initialization.
I have try this :
tftphq.startserver("C:\Program Files\TFTPgui\tftpgui.cfg")
Traceback (most recent call last):
  File "<pyshell#6>", line 1, in <module>
    tftphq.startserver("C:\Program Files\TFTPgui\tftpgui.cfg")
  File "C:\Python25\lib\tftphq.py", line 161, in startserver
    start_logging(setupdict)
  File "C:\Python25\lib\tftphq.py", line 586, in start_logging
    logfile=os.path.join(setupdict["logfolder"],"tftplog")
TypeError: string indices must be integers

But what is the type of the variable named "setupdict" ?
Can you help me?
Thanks in advance.

Original issue reported on code.google.com by [email protected] on 24 Apr 2008 at 3:37

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.