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 Acquire Method - This is the FTP acquire method for APT.
8 ##################################################################### */
13 #include <apt-pkg/strutl.h>
15 #include <sys/types.h>
31 struct addrinfo
*PasvAddr
;
33 // Generic Peer Address
34 struct sockaddr_storage PeerAddr
;
35 socklen_t PeerAddrLen
;
37 // Generic Server Address (us)
38 struct sockaddr_storage ServerAddr
;
39 socklen_t ServerAddrLen
;
41 // Private helper functions
42 bool ReadLine(std::string
&Text
);
49 bool Comp(URI Other
) {return Other
.Host
== ServerName
.Host
&& Other
.Port
== ServerName
.Port
&& Other
.User
== ServerName
.User
&& Other
.Password
== ServerName
.Password
; };
52 bool ReadResp(unsigned int &Ret
,std::string
&Text
);
53 bool WriteMsg(unsigned int &Ret
,std::string
&Text
,const char *Fmt
,...);
56 bool Open(pkgAcqMethod
*Owner
);
62 bool Size(const char *Path
,unsigned long long &Size
);
63 bool ModTime(const char *Path
, time_t &Time
);
64 bool Get(const char *Path
,FileFd
&To
,unsigned long long Resume
,
65 Hashes
&MD5
,bool &Missing
, unsigned long long MaximumSize
,
72 class FtpMethod
: public pkgAcqMethod
74 virtual bool Fetch(FetchItem
*Itm
);
75 virtual bool Configuration(std::string Message
);
79 static std::string FailFile
;
81 static time_t FailTime
;
82 static APT_NORETURN
void SigTerm(int);