Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
262 | giacomo | 1 | The Tftp protocol implementation under Shark |
2 | |||
3 | Initialization: |
||
4 | 1. call the tftp_init() routine; |
||
5 | 2. call the tftp_net_start(...) to initialize the network card; the third parameter specify if you wantto initialize |
||
6 | the IP address of the card (1) or if you simply pass an already initialized one (0). |
||
7 | 3. call tftp_open(...) to get a free socket; |
||
8 | 4. call tftp_upload(...) or tftp_download(...) (the last one is not yet implemented) to start the tftp deamons. |
||
9 | |||
10 | The tftp library allocate a new socket for each upload/download connection. |
||
11 | The base port is set to 2000 and the i-th connection uses the [base]+i port address. |
||
12 | |||
13 | To stop uploading use tftp_close(connection, hardness) |
||
14 | hardness could be TFTP_STOP_NOW or TFTP_FLUSH_BUFFER |
||
15 | with TFTP_STOP_NOW you: |
||
16 | - sends immediately a packet with 0 bytes of data (means stop transfer!); |
||
17 | - all data in the buffer are lost; |
||
18 | - deamon stops immediately. |
||
19 | |||
20 | with TFTP_FLUSH_BUFFER you: |
||
21 | - couldn't write no more data in the buffer; |
||
22 | - deamons stay alive to send all data in the buffer to the server; |
||
23 | - then they shut down the service. |
||
24 | |||
25 | To Do: |
||
26 | - Implement the download routines |
||
27 | - Improve the error checking (at now the ACK deamon don't check for the block number) |
||
28 | - Use the [Big-Little]-endian routines provided with Shark instead of the ad-hoc ones. |
||
29 | - Improving the QUEUE library (I'm developing it) and use it in the TFTP library (and provide it to all Shark users). |