1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/// $Id: ftp.h,v 1.4 2001/03/06 07:15:29 jgg Exp $
3 // $Id: ftp.h,v 1.4 2001/03/06 07:15:29 jgg Exp $
4 /* ######################################################################
6 FTP Aquire Method - This is the FTP aquire method for APT.
8 ##################################################################### */
25 struct addrinfo
*PasvAddr
;
27 // Generic Peer Address
28 struct sockaddr_storage PeerAddr
;
29 socklen_t PeerAddrLen
;
31 // Generic Server Address (us)
32 struct sockaddr_storage ServerAddr
;
33 socklen_t ServerAddrLen
;
35 // Private helper functions
36 bool ReadLine(string
&Text
);
43 bool Comp(URI Other
) {return Other
.Host
== ServerName
.Host
&& Other
.Port
== ServerName
.Port
&& Other
.User
== ServerName
.User
&& Other
.Password
== ServerName
.Password
; };
46 bool ReadResp(unsigned int &Ret
,string
&Text
);
47 bool WriteMsg(unsigned int &Ret
,string
&Text
,const char *Fmt
,...);
50 bool Open(pkgAcqMethod
*Owner
);
56 bool Size(const char *Path
,unsigned long long &Size
);
57 bool ModTime(const char *Path
, time_t &Time
);
58 bool Get(const char *Path
,FileFd
&To
,unsigned long long Resume
,
59 Hashes
&MD5
,bool &Missing
);
65 class FtpMethod
: public pkgAcqMethod
67 virtual bool Fetch(FetchItem
*Itm
);
68 virtual bool Configuration(string Message
);
72 static string FailFile
;
74 static time_t FailTime
;
75 static void SigTerm(int);