1 |
hedin |
62 |
/*********************************************************************
|
2 |
|
|
*
|
3 |
|
|
* FTP Server Defs for Microchip TCP/IP Stack
|
4 |
|
|
*
|
5 |
|
|
*********************************************************************
|
6 |
|
|
* FileName: ftp.h
|
7 |
|
|
* Dependencies: StackTsk.h
|
8 |
|
|
* tcp.h
|
9 |
|
|
* Processor: PIC18
|
10 |
|
|
* Complier: MCC18 v1.00.50 or higher
|
11 |
|
|
* HITECH PICC-18 V8.10PL1 or higher
|
12 |
|
|
* Company: Microchip Technology, Inc.
|
13 |
|
|
*
|
14 |
|
|
* Software License Agreement
|
15 |
|
|
*
|
16 |
|
|
* The software supplied herewith by Microchip Technology Incorporated
|
17 |
|
|
* (the “Company”) for its PICmicro® Microcontroller is intended and
|
18 |
|
|
* supplied to you, the Company’s customer, for use solely and
|
19 |
|
|
* exclusively on Microchip PICmicro Microcontroller products. The
|
20 |
|
|
* software is owned by the Company and/or its supplier, and is
|
21 |
|
|
* protected under applicable copyright laws. All rights are reserved.
|
22 |
|
|
* Any use in violation of the foregoing restrictions may subject the
|
23 |
|
|
* user to criminal sanctions under applicable laws, as well as to
|
24 |
|
|
* civil liability for the breach of the terms and conditions of this
|
25 |
|
|
* license.
|
26 |
|
|
*
|
27 |
|
|
* THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES,
|
28 |
|
|
* WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
|
29 |
|
|
* TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
30 |
|
|
* PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
|
31 |
|
|
* IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
|
32 |
|
|
* CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
|
33 |
|
|
*
|
34 |
|
|
* Author Date Comment
|
35 |
|
|
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
36 |
|
|
* Nilesh Rajbharti 4/23/01 Original (Rev 1.0)
|
37 |
|
|
********************************************************************/
|
38 |
|
|
|
39 |
|
|
#ifndef FTP_H
|
40 |
|
|
#define FTP_H
|
41 |
|
|
|
42 |
|
|
|
43 |
|
|
#include "stacktsk.h"
|
44 |
|
|
|
45 |
|
|
#define FTP_USER_NAME_LEN (10)
|
46 |
|
|
|
47 |
|
|
|
48 |
|
|
/*********************************************************************
|
49 |
|
|
* Function: BOOL FTPVerify(char *login, char *password)
|
50 |
|
|
*
|
51 |
|
|
* PreCondition: None
|
52 |
|
|
*
|
53 |
|
|
* Input: login - Telnet User login name
|
54 |
|
|
* password - Telnet User password
|
55 |
|
|
*
|
56 |
|
|
* Output: TRUE if login and password verfies
|
57 |
|
|
* FALSE if login and password does not match.
|
58 |
|
|
*
|
59 |
|
|
* Side Effects: None
|
60 |
|
|
*
|
61 |
|
|
* Overview: Compare given login and password with internal
|
62 |
|
|
* values and return TRUE or FALSE.
|
63 |
|
|
*
|
64 |
|
|
* Note: This is a callback from Telnet Server to
|
65 |
|
|
* user application. User application must
|
66 |
|
|
* implement this function in his/her source file
|
67 |
|
|
* return correct response based on internal
|
68 |
|
|
* login and password information.
|
69 |
|
|
********************************************************************/
|
70 |
|
|
#ifdef THIS_IS_FTP
|
71 |
|
|
extern BOOL FTPVerify(char *login, char *password);
|
72 |
|
|
#endif
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
/*********************************************************************
|
76 |
|
|
* Function: void FTPInit(void)
|
77 |
|
|
*
|
78 |
|
|
* PreCondition: TCP module is already initialized.
|
79 |
|
|
*
|
80 |
|
|
* Input: None
|
81 |
|
|
*
|
82 |
|
|
* Output: None
|
83 |
|
|
*
|
84 |
|
|
* Side Effects: None
|
85 |
|
|
*
|
86 |
|
|
* Overview: Initializes internal variables of Telnet
|
87 |
|
|
*
|
88 |
|
|
* Note:
|
89 |
|
|
********************************************************************/
|
90 |
|
|
void FTPInit(void);
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
/*********************************************************************
|
94 |
|
|
* Function: void FTPServer(void)
|
95 |
|
|
*
|
96 |
|
|
* PreCondition: FTPInit() must already be called.
|
97 |
|
|
*
|
98 |
|
|
* Input: None
|
99 |
|
|
*
|
100 |
|
|
* Output: Opened Telnet connections are served.
|
101 |
|
|
*
|
102 |
|
|
* Side Effects: None
|
103 |
|
|
*
|
104 |
|
|
* Overview:
|
105 |
|
|
*
|
106 |
|
|
* Note: This function acts as a task (similar to one in
|
107 |
|
|
* RTOS). This function performs its task in
|
108 |
|
|
* co-operative manner. Main application must call
|
109 |
|
|
* this function repeatdly to ensure all open
|
110 |
|
|
* or new connections are served on time.
|
111 |
|
|
********************************************************************/
|
112 |
|
|
BOOL FTPServer(void);
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
#endif
|