1 /**************************************************************************
2 * Copyright (C) 2005 by Achal Dhir *
3 * achaldhir@gmail.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #define MYBYTE unsigned char
22 #define MYWORD unsigned short
23 #define MYDWORD unsigned int
26 #define strcasecmp _stricmp
27 #define _CRT_SECURE_NO_WARNINGS
28 #pragma comment(lib, "ws2_32.lib")
29 #pragma comment(lib, "iphlpapi.lib")
33 #define my_inet_addr inet_addr
53 struct acknowledgement
69 char errormessage
[512];
106 socklen_t clientsize
;
109 tftperror serverError
;
111 acknowledgement acout
;
115 tftperror clientError
;
117 acknowledgement acin
;
127 tftpConnType tftpConn
[MAX_SERVERS
];
128 MYDWORD allServers
[MAX_SERVERS
];
129 MYDWORD staticServers
[MAX_SERVERS
];
130 MYDWORD listenServers
[MAX_SERVERS
];
131 MYWORD listenPorts
[MAX_SERVERS
];
141 home homes
[MAX_SERVERS
];
146 data12 hostRanges
[32];
152 MYDWORD failureCount
;
170 void getInterfaces(data1
*);
172 void processRequest(LPVOID lpParam
);
173 char* myGetToken(char*, MYBYTE
);
174 char* myTrim(char*, char*);
176 bool cleanReq(request
*);
177 bool addServer(MYDWORD
*, MYDWORD
);
178 FILE* openSection(const char*, MYBYTE
, char*);
179 char* readSection(char*, FILE*);
180 bool getSection(const char*, char*, MYBYTE
, char*);
182 char* myLower(char*);
183 char* myUpper(char*);
184 char* IP2String(char*, MYDWORD
);
185 MYDWORD
* findServer(MYDWORD
*, MYDWORD
);
186 void printWindowsError();
187 void logMess(request
*, MYBYTE
);
188 void logMess(char*, MYBYTE
);