extern.h revision 190828
11592Srgrimes/*-
21592Srgrimes * Copyright (c) 1992, 1993
31592Srgrimes *	The Regents of the University of California.  All rights reserved.
41592Srgrimes *
51592Srgrimes * Redistribution and use in source and binary forms, with or without
61592Srgrimes * modification, are permitted provided that the following conditions
71592Srgrimes * are met:
81592Srgrimes * 1. Redistributions of source code must retain the above copyright
91592Srgrimes *    notice, this list of conditions and the following disclaimer.
101592Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111592Srgrimes *    notice, this list of conditions and the following disclaimer in the
121592Srgrimes *    documentation and/or other materials provided with the distribution.
131592Srgrimes * 3. All advertising materials mentioning features or use of this software
141592Srgrimes *    must display the following acknowledgement:
151592Srgrimes *	This product includes software developed by the University of
161592Srgrimes *	California, Berkeley and its contributors.
171592Srgrimes * 4. Neither the name of the University nor the names of its contributors
181592Srgrimes *    may be used to endorse or promote products derived from this software
191592Srgrimes *    without specific prior written permission.
201592Srgrimes *
211592Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
221592Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
231592Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
241592Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
251592Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
261592Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
271592Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
281592Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
291592Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
301592Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
311592Srgrimes * SUCH DAMAGE.
321592Srgrimes *
331592Srgrimes *	@(#)extern.h	8.2 (Berkeley) 4/4/94
3450476Speter * $FreeBSD: head/libexec/ftpd/extern.h 190828 2009-04-07 20:34:34Z obrien $
351592Srgrimes */
361592Srgrimes
3789920Sume#include <sys/types.h>
3889920Sume#include <sys/socket.h>
3989920Sume
4090148Simpvoid	blkfree(char **);
4190148Simpchar  **copyblk(char **);
4290148Simpvoid	cwd(char *);
4390148Simpvoid	delete(char *);
4490148Simpvoid	dologout(int);
4590148Simpvoid	fatalerror(char *);
4690148Simpvoid    ftpd_logwtmp(char *, char *, struct sockaddr *addr);
4790148Simpint	ftpd_pclose(FILE *);
4890148SimpFILE   *ftpd_popen(char *, char *);
49186405Scpercivaint	getline(char *, int, FILE *);
5090158Skrisvoid	lreply(int, const char *, ...) __printflike(2, 3);
5190148Simpvoid	makedir(char *);
5290148Simpvoid	nack(char *);
5390148Simpvoid	pass(char *);
5490148Simpvoid	passive(void);
5590148Simpvoid	long_passive(char *, int);
5690148Simpvoid	perror_reply(int, char *);
5790148Simpvoid	pwd(void);
5890148Simpvoid	removedir(char *);
5990148Simpvoid	renamecmd(char *, char *);
6090148Simpchar   *renamefrom(char *);
6190158Skrisvoid	reply(int, const char *, ...) __printflike(2, 3);
6290148Simpvoid	retrieve(char *, char *);
6390148Simpvoid	send_file_list(char *);
6413139Speter#ifdef OLD_SETPROCTITLE
6590148Simpvoid	setproctitle(const char *, ...);
6613139Speter#endif
6790148Simpvoid	statcmd(void);
6890148Simpvoid	statfilecmd(char *);
6990148Simpvoid	store(char *, char *, int);
7090148Simpvoid	upper(char *);
7190148Simpvoid	user(char *);
7290148Simpvoid	yyerror(char *);
7390148Simpint	yyparse(void);
7490148Simpint	ls_main(int, char **);
7556668Sshin
76190828Sobrienextern	int assumeutf8;
77190828Sobrienextern	char cbuf[];
78190828Sobrienextern	union sockunion data_dest;
79190828Sobrienextern	int epsvall;
80190828Sobrienextern	int form;
81190828Sobrienextern	int ftpdebug;
82190828Sobrienextern	int guest;
83190828Sobrienextern	union sockunion his_addr;
84190828Sobrienextern	char *homedir;
85190828Sobrienextern	int hostinfo;
86190828Sobrienextern	char *hostname;
87190828Sobrienextern	int maxtimeout;
88190828Sobrienextern	int logged_in;
89190828Sobrienextern	int logging;
90190828Sobrienextern	int noepsv;
91190828Sobrienextern	int noguestretr;
92190828Sobrienextern	int noretr;
93190828Sobrienextern	int paranoid;
94190828Sobrienextern	struct passwd *pw;
95190828Sobrienextern	int pdata;
96190828Sobrienextern	char proctitle[];
97190828Sobrienextern	int readonly;
98190828Sobrienextern	off_t restart_point;
99190828Sobrienextern	int timeout;
100190828Sobrienextern  char tmpline[];
101190828Sobrienextern	int type;
102190828Sobrienextern	char *typenames[]; /* defined in <arpa/ftp.h> included from ftpd.c */
103190828Sobrienextern	int usedefault;
104190828Sobrien
10556668Sshinstruct sockaddr_in;
10656668Sshinstruct sockaddr_in6;
10756668Sshinunion sockunion {
10856668Sshin	struct sockinet {
10956668Sshin		u_char	si_len;
11056668Sshin		u_char	si_family;
11156668Sshin		u_short	si_port;
11256668Sshin	} su_si;
11356668Sshin	struct	sockaddr_in  su_sin;
11456668Sshin	struct	sockaddr_in6 su_sin6;
11556668Sshin};
11656668Sshin#define	su_len		su_si.si_len
11756668Sshin#define	su_family	su_si.si_family
11856668Sshin#define	su_port		su_si.si_port
119