Documentation

Generated on Thu Aug 31 00:02:27 2006

 

babyftpd.h

Go to the documentation of this file.
00001 
00002 // $Id: babyftpd.h,v 1.58 2005/08/23 19:34:02 klas Exp $
00003 //
00004 // Usage: main function, commandline parsing and function that
00005 //        on the main socket.
00006 //
00007 //  A part of babyftpd, licensed under the GNU GPL, see the file
00008 //    LICENSE for complete information.
00010 
00011 #ifndef BABYFTPD_H
00012 #define BABYFTPD_H
00013 
00014 #ifdef BABYFTPD_CPP
00015 #include "generic.h"
00016 #include "Utilities.h"
00017 #include "Configuration.h"
00018 #include "Log.h"
00019 #include "Connection.h"
00020 #include "User.h"
00021 #include "Data.h"
00022 #include "Handler.h"
00023 #include "Commands.h"
00024 #ifdef USE_TLS
00025 #include "tls.cpp"
00026 #endif // USE_TLS
00027 #endif // BABYFTPD_CPP
00028 
00029 static void *user_wrapper(void*) __attribute__ ((noreturn));
00030 static void *log_wrapper(void*) __attribute__ ((noreturn));
00031 bool listener(void);
00032 void sig_handler(int);
00033 void exit_baby(int, enum exits);
00034 void lifebeat(void);
00035 
00036 // thread specific storage..
00037 pthread_key_t my_user = 0;
00038 pthread_key_t my_data = 0;
00039 
00040 pthread_rwlock_t user_list_lock;
00041 sem_t cleanup_list_lock;
00042 pthread_t main_thread; // for managing on shutdown and signal handling.
00043 pthread_t logging_thread; // so we can join it.
00044 vector<User*> user_list;
00045 vector<pthread_t> cleanup_list;
00046 
00047 const int LISTEN_LIMIT = 5;
00048 
00049 #ifdef USE_TLS
00050 gnutls_certificate_credentials x509_cred;
00051 static gnutls_dh_params dh_params;
00052 time_t dh_time;
00053 int tls_db_store(void*, gnutls_datum, gnutls_datum);
00054 gnutls_datum tls_db_fetch(void*, gnutls_datum);
00055 int tls_db_delete(void*, gnutls_datum);
00056 
00057 struct cache
00058 {
00059   gnutls_datum key;
00060   gnutls_datum data;
00061 };
00062 
00063 vector<cache*> cache_db;
00064 pthread_rwlock_t cache_lock;
00065 #endif // USE_TLS
00066 
00067 #endif