2004-01-18 20:12:18 +01:00
|
|
|
/*
|
|
|
|
|
|
|
|
Copyright (c) 2003, Arvid Norberg
|
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without
|
|
|
|
modification, are permitted provided that the following conditions
|
|
|
|
are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above copyright
|
|
|
|
notice, this list of conditions and the following disclaimer in
|
|
|
|
the documentation and/or other materials provided with the distribution.
|
|
|
|
* Neither the name of the author nor the names of its
|
|
|
|
contributors may be used to endorse or promote products derived
|
|
|
|
from this software without specific prior written permission.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TORRENT_ALERT_TYPES_HPP_INCLUDED
|
|
|
|
#define TORRENT_ALERT_TYPES_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "libtorrent/alert.hpp"
|
|
|
|
#include "libtorrent/torrent_handle.hpp"
|
2004-03-08 13:36:03 +01:00
|
|
|
#include "libtorrent/socket.hpp"
|
|
|
|
#include "libtorrent/peer_connection.hpp"
|
2005-11-01 19:30:39 +01:00
|
|
|
#include "libtorrent/config.hpp"
|
2007-09-10 08:12:41 +02:00
|
|
|
#include "libtorrent/assert.hpp"
|
2004-01-18 20:12:18 +01:00
|
|
|
|
|
|
|
namespace libtorrent
|
|
|
|
{
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT torrent_alert: alert
|
|
|
|
{
|
|
|
|
torrent_alert(torrent_handle const& h, alert::severity_t s
|
|
|
|
, std::string const& msg)
|
|
|
|
: alert(s, msg)
|
|
|
|
, handle(h)
|
|
|
|
{}
|
|
|
|
|
|
|
|
torrent_handle handle;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TORRENT_EXPORT tracker_alert: torrent_alert
|
2004-01-18 20:12:18 +01:00
|
|
|
{
|
2005-06-06 12:33:44 +02:00
|
|
|
tracker_alert(torrent_handle const& h
|
2008-04-23 03:54:21 +02:00
|
|
|
, std::string const& url_
|
|
|
|
, alert::severity_t s
|
|
|
|
, std::string const& msg)
|
|
|
|
: torrent_alert(h, s, msg)
|
|
|
|
, url(url_)
|
|
|
|
{}
|
|
|
|
|
|
|
|
std::string url;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TORRENT_EXPORT tracker_error_alert: tracker_alert
|
|
|
|
{
|
|
|
|
tracker_error_alert(torrent_handle const& h
|
2004-09-12 12:12:16 +02:00
|
|
|
, int times
|
2005-04-21 01:00:27 +02:00
|
|
|
, int status
|
2008-04-23 03:54:21 +02:00
|
|
|
, std::string const& url
|
2005-06-06 12:33:44 +02:00
|
|
|
, std::string const& msg)
|
2008-04-23 03:54:21 +02:00
|
|
|
: tracker_alert(h, url, alert::warning, msg)
|
2004-09-12 12:12:16 +02:00
|
|
|
, times_in_row(times)
|
2005-04-21 01:00:27 +02:00
|
|
|
, status_code(status)
|
2005-08-11 01:32:39 +02:00
|
|
|
{}
|
2004-01-18 20:12:18 +01:00
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
2008-04-23 03:54:21 +02:00
|
|
|
{ return std::auto_ptr<alert>(new tracker_error_alert(*this)); }
|
2004-01-18 20:12:18 +01:00
|
|
|
|
2004-09-12 12:12:16 +02:00
|
|
|
int times_in_row;
|
2005-04-21 01:00:27 +02:00
|
|
|
int status_code;
|
2004-01-18 20:12:18 +01:00
|
|
|
};
|
|
|
|
|
2008-04-23 03:54:21 +02:00
|
|
|
struct TORRENT_EXPORT tracker_warning_alert: tracker_alert
|
2005-08-11 01:32:39 +02:00
|
|
|
{
|
|
|
|
tracker_warning_alert(torrent_handle const& h
|
2008-04-23 03:54:21 +02:00
|
|
|
, std::string const& url
|
2005-08-11 01:32:39 +02:00
|
|
|
, std::string const& msg)
|
2008-04-23 03:54:21 +02:00
|
|
|
: tracker_alert(h, url, alert::warning, msg)
|
2005-08-11 01:32:39 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new tracker_warning_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2008-04-23 03:54:21 +02:00
|
|
|
struct TORRENT_EXPORT scrape_reply_alert: tracker_alert
|
2007-11-20 23:46:27 +01:00
|
|
|
{
|
|
|
|
scrape_reply_alert(torrent_handle const& h
|
|
|
|
, int incomplete_
|
|
|
|
, int complete_
|
2008-04-23 03:54:21 +02:00
|
|
|
, std::string const& url
|
2007-11-20 23:46:27 +01:00
|
|
|
, std::string const& msg)
|
2008-04-23 03:54:21 +02:00
|
|
|
: tracker_alert(h, url, alert::info, msg)
|
2007-11-20 23:46:27 +01:00
|
|
|
, incomplete(incomplete_)
|
|
|
|
, complete(complete_)
|
|
|
|
{}
|
|
|
|
|
|
|
|
int incomplete;
|
|
|
|
int complete;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new scrape_reply_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2008-04-23 03:54:21 +02:00
|
|
|
struct TORRENT_EXPORT scrape_failed_alert: tracker_alert
|
2007-11-20 23:46:27 +01:00
|
|
|
{
|
|
|
|
scrape_failed_alert(torrent_handle const& h
|
2008-04-23 03:54:21 +02:00
|
|
|
, std::string const& url
|
2007-11-20 23:46:27 +01:00
|
|
|
, std::string const& msg)
|
2008-04-23 03:54:21 +02:00
|
|
|
: tracker_alert(h, url, alert::warning, msg)
|
2007-11-20 23:46:27 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new scrape_failed_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2008-04-23 03:54:21 +02:00
|
|
|
struct TORRENT_EXPORT tracker_reply_alert: tracker_alert
|
2005-03-10 10:59:12 +01:00
|
|
|
{
|
2005-06-06 12:33:44 +02:00
|
|
|
tracker_reply_alert(torrent_handle const& h
|
2007-02-01 08:33:04 +01:00
|
|
|
, int np
|
2008-04-23 03:54:21 +02:00
|
|
|
, std::string const& url
|
2005-06-06 12:33:44 +02:00
|
|
|
, std::string const& msg)
|
2008-04-23 03:54:21 +02:00
|
|
|
: tracker_alert(h, url, alert::info, msg)
|
2007-02-01 08:33:04 +01:00
|
|
|
, num_peers(np)
|
2005-08-11 01:32:39 +02:00
|
|
|
{}
|
2005-03-10 10:59:12 +01:00
|
|
|
|
2007-02-01 08:33:04 +01:00
|
|
|
int num_peers;
|
|
|
|
|
2005-03-10 10:59:12 +01:00
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new tracker_reply_alert(*this)); }
|
|
|
|
};
|
2005-06-06 12:33:44 +02:00
|
|
|
|
2008-04-23 03:54:21 +02:00
|
|
|
struct TORRENT_EXPORT tracker_announce_alert: tracker_alert
|
2005-06-06 12:33:44 +02:00
|
|
|
{
|
2008-04-23 03:54:21 +02:00
|
|
|
tracker_announce_alert(torrent_handle const& h
|
|
|
|
, std::string const& url
|
|
|
|
, std::string const& msg)
|
|
|
|
: tracker_alert(h, url, alert::info, msg)
|
2005-08-11 01:32:39 +02:00
|
|
|
{}
|
2005-06-06 12:33:44 +02:00
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new tracker_announce_alert(*this)); }
|
|
|
|
};
|
2005-03-10 10:59:12 +01:00
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT hash_failed_alert: torrent_alert
|
2004-01-18 20:12:18 +01:00
|
|
|
{
|
|
|
|
hash_failed_alert(
|
2005-06-06 12:33:44 +02:00
|
|
|
torrent_handle const& h
|
2004-01-18 20:12:18 +01:00
|
|
|
, int index
|
2005-06-06 12:33:44 +02:00
|
|
|
, std::string const& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::info, msg)
|
2004-01-18 20:12:18 +01:00
|
|
|
, piece_index(index)
|
2007-10-05 02:30:00 +02:00
|
|
|
{ TORRENT_ASSERT(index >= 0);}
|
2004-01-18 20:12:18 +01:00
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new hash_failed_alert(*this)); }
|
|
|
|
|
|
|
|
int piece_index;
|
|
|
|
};
|
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT peer_ban_alert: torrent_alert
|
2004-03-21 03:03:37 +01:00
|
|
|
{
|
2006-04-25 23:04:48 +02:00
|
|
|
peer_ban_alert(tcp::endpoint const& pip, torrent_handle h, std::string const& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::info, msg)
|
2004-03-21 03:03:37 +01:00
|
|
|
, ip(pip)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new peer_ban_alert(*this)); }
|
|
|
|
|
2006-04-25 23:04:48 +02:00
|
|
|
tcp::endpoint ip;
|
2004-03-21 03:03:37 +01:00
|
|
|
};
|
|
|
|
|
2005-11-01 19:30:39 +01:00
|
|
|
struct TORRENT_EXPORT peer_error_alert: alert
|
2004-01-18 20:12:18 +01:00
|
|
|
{
|
2006-04-25 23:04:48 +02:00
|
|
|
peer_error_alert(tcp::endpoint const& pip, peer_id const& pid_, std::string const& msg)
|
2008-05-12 08:05:13 +02:00
|
|
|
: alert(alert::info, msg)
|
2004-01-31 11:20:19 +01:00
|
|
|
, ip(pip)
|
2006-04-25 23:04:48 +02:00
|
|
|
, pid(pid_)
|
2004-01-18 20:12:18 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new peer_error_alert(*this)); }
|
|
|
|
|
2006-04-25 23:04:48 +02:00
|
|
|
tcp::endpoint ip;
|
|
|
|
peer_id pid;
|
2004-01-18 20:12:18 +01:00
|
|
|
};
|
|
|
|
|
2008-05-12 08:05:13 +02:00
|
|
|
struct TORRENT_EXPORT peer_disconnected_alert: alert
|
|
|
|
{
|
|
|
|
peer_disconnected_alert(tcp::endpoint const& pip, peer_id const& pid_, std::string const& msg)
|
|
|
|
: alert(alert::debug, msg)
|
|
|
|
, ip(pip)
|
|
|
|
, pid(pid_)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new peer_disconnected_alert(*this)); }
|
|
|
|
|
|
|
|
tcp::endpoint ip;
|
|
|
|
peer_id pid;
|
|
|
|
};
|
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT invalid_request_alert: torrent_alert
|
2004-01-18 20:12:18 +01:00
|
|
|
{
|
|
|
|
invalid_request_alert(
|
2004-03-28 19:45:37 +02:00
|
|
|
peer_request const& r
|
|
|
|
, torrent_handle const& h
|
2006-04-25 23:04:48 +02:00
|
|
|
, tcp::endpoint const& sender
|
|
|
|
, peer_id const& pid_
|
2004-03-28 19:45:37 +02:00
|
|
|
, std::string const& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::debug, msg)
|
2004-01-31 11:20:19 +01:00
|
|
|
, ip(sender)
|
2004-01-18 20:12:18 +01:00
|
|
|
, request(r)
|
2006-04-25 23:04:48 +02:00
|
|
|
, pid(pid_)
|
2004-01-18 20:12:18 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new invalid_request_alert(*this)); }
|
|
|
|
|
2006-04-25 23:04:48 +02:00
|
|
|
tcp::endpoint ip;
|
2004-01-18 20:12:18 +01:00
|
|
|
peer_request request;
|
2006-04-25 23:04:48 +02:00
|
|
|
peer_id pid;
|
2004-01-18 20:12:18 +01:00
|
|
|
};
|
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT torrent_finished_alert: torrent_alert
|
2004-01-18 20:12:18 +01:00
|
|
|
{
|
|
|
|
torrent_finished_alert(
|
|
|
|
const torrent_handle& h
|
|
|
|
, const std::string& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::warning, msg)
|
2004-01-18 20:12:18 +01:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new torrent_finished_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-08-01 08:14:16 +02:00
|
|
|
struct TORRENT_EXPORT piece_finished_alert: torrent_alert
|
|
|
|
{
|
|
|
|
piece_finished_alert(
|
|
|
|
const torrent_handle& h
|
|
|
|
, int piece_num
|
|
|
|
, const std::string& msg)
|
2007-10-04 01:15:13 +02:00
|
|
|
: torrent_alert(h, alert::debug, msg)
|
2007-08-01 08:14:16 +02:00
|
|
|
, piece_index(piece_num)
|
2007-10-05 02:30:00 +02:00
|
|
|
{ TORRENT_ASSERT(piece_index >= 0);}
|
2007-08-01 08:14:16 +02:00
|
|
|
|
|
|
|
int piece_index;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new piece_finished_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TORRENT_EXPORT block_finished_alert: torrent_alert
|
|
|
|
{
|
|
|
|
block_finished_alert(
|
|
|
|
const torrent_handle& h
|
|
|
|
, int block_num
|
|
|
|
, int piece_num
|
|
|
|
, const std::string& msg)
|
2007-10-04 00:53:52 +02:00
|
|
|
: torrent_alert(h, alert::debug, msg)
|
2007-08-01 08:14:16 +02:00
|
|
|
, block_index(block_num)
|
|
|
|
, piece_index(piece_num)
|
2007-10-05 02:30:00 +02:00
|
|
|
{ TORRENT_ASSERT(block_index >= 0 && piece_index >= 0);}
|
2007-08-01 08:14:16 +02:00
|
|
|
|
|
|
|
int block_index;
|
|
|
|
int piece_index;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new block_finished_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TORRENT_EXPORT block_downloading_alert: torrent_alert
|
|
|
|
{
|
|
|
|
block_downloading_alert(
|
|
|
|
const torrent_handle& h
|
2007-09-06 20:30:46 +02:00
|
|
|
, char const* speedmsg
|
2007-08-01 08:14:16 +02:00
|
|
|
, int block_num
|
|
|
|
, int piece_num
|
|
|
|
, const std::string& msg)
|
2007-10-04 00:53:52 +02:00
|
|
|
: torrent_alert(h, alert::debug, msg)
|
2007-08-01 08:14:16 +02:00
|
|
|
, peer_speedmsg(speedmsg)
|
|
|
|
, block_index(block_num)
|
|
|
|
, piece_index(piece_num)
|
2007-10-05 02:30:00 +02:00
|
|
|
{ TORRENT_ASSERT(block_index >= 0 && piece_index >= 0);}
|
2007-08-01 08:14:16 +02:00
|
|
|
|
|
|
|
std::string peer_speedmsg;
|
|
|
|
int block_index;
|
|
|
|
int piece_index;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new block_downloading_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-06-11 23:24:14 +02:00
|
|
|
struct TORRENT_EXPORT storage_moved_alert: torrent_alert
|
|
|
|
{
|
|
|
|
storage_moved_alert(torrent_handle const& h, std::string const& path)
|
|
|
|
: torrent_alert(h, alert::warning, path)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new storage_moved_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-10-13 05:33:33 +02:00
|
|
|
struct TORRENT_EXPORT torrent_deleted_alert: torrent_alert
|
|
|
|
{
|
|
|
|
torrent_deleted_alert(torrent_handle const& h, std::string const& msg)
|
|
|
|
: torrent_alert(h, alert::warning, msg)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new torrent_deleted_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2008-04-13 20:54:36 +02:00
|
|
|
struct TORRENT_EXPORT save_resume_data_alert: torrent_alert
|
|
|
|
{
|
|
|
|
save_resume_data_alert(boost::shared_ptr<entry> const& rd
|
|
|
|
, torrent_handle const& h, std::string const& msg)
|
|
|
|
: torrent_alert(h, alert::warning, msg)
|
|
|
|
, resume_data(rd)
|
|
|
|
{}
|
|
|
|
|
|
|
|
boost::shared_ptr<entry> resume_data;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new save_resume_data_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-06-11 23:24:14 +02:00
|
|
|
struct TORRENT_EXPORT torrent_paused_alert: torrent_alert
|
|
|
|
{
|
|
|
|
torrent_paused_alert(torrent_handle const& h, std::string const& msg)
|
|
|
|
: torrent_alert(h, alert::warning, msg)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new torrent_paused_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-08-16 21:41:28 +02:00
|
|
|
struct TORRENT_EXPORT torrent_checked_alert: torrent_alert
|
|
|
|
{
|
|
|
|
torrent_checked_alert(torrent_handle const& h, std::string const& msg)
|
|
|
|
: torrent_alert(h, alert::info, msg)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new torrent_checked_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT url_seed_alert: torrent_alert
|
2006-04-25 23:04:48 +02:00
|
|
|
{
|
|
|
|
url_seed_alert(
|
2007-01-16 06:05:52 +01:00
|
|
|
torrent_handle const& h
|
|
|
|
, const std::string& url_
|
2006-04-25 23:04:48 +02:00
|
|
|
, const std::string& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::warning, msg)
|
2006-04-25 23:04:48 +02:00
|
|
|
, url(url_)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new url_seed_alert(*this)); }
|
|
|
|
|
|
|
|
std::string url;
|
|
|
|
};
|
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT file_error_alert: torrent_alert
|
2004-01-26 02:08:59 +01:00
|
|
|
{
|
|
|
|
file_error_alert(
|
2008-04-13 00:08:07 +02:00
|
|
|
std::string const& f
|
|
|
|
, const torrent_handle& h
|
2004-01-26 02:08:59 +01:00
|
|
|
, const std::string& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::fatal, msg)
|
2008-04-13 00:08:07 +02:00
|
|
|
, file(f)
|
2004-01-26 02:08:59 +01:00
|
|
|
{}
|
|
|
|
|
2008-04-13 00:08:07 +02:00
|
|
|
std::string file;
|
|
|
|
|
2004-01-26 02:08:59 +01:00
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new file_error_alert(*this)); }
|
|
|
|
};
|
2004-01-26 11:29:00 +01:00
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT metadata_failed_alert: torrent_alert
|
2005-10-17 15:45:53 +02:00
|
|
|
{
|
|
|
|
metadata_failed_alert(
|
|
|
|
const torrent_handle& h
|
|
|
|
, const std::string& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::info, msg)
|
2005-10-17 15:45:53 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new metadata_failed_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-01-16 06:05:52 +01:00
|
|
|
struct TORRENT_EXPORT metadata_received_alert: torrent_alert
|
2004-09-10 02:47:30 +02:00
|
|
|
{
|
|
|
|
metadata_received_alert(
|
|
|
|
const torrent_handle& h
|
|
|
|
, const std::string& msg)
|
2007-01-16 06:05:52 +01:00
|
|
|
: torrent_alert(h, alert::info, msg)
|
2004-09-10 02:47:30 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new metadata_received_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2008-03-25 05:46:18 +01:00
|
|
|
struct TORRENT_EXPORT udp_error_alert: alert
|
|
|
|
{
|
|
|
|
udp_error_alert(
|
|
|
|
udp::endpoint const& ep
|
|
|
|
, std::string const& msg)
|
|
|
|
: alert(alert::info, msg)
|
|
|
|
, endpoint(ep)
|
|
|
|
{}
|
|
|
|
|
|
|
|
udp::endpoint endpoint;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new udp_error_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2008-03-29 23:45:55 +01:00
|
|
|
struct TORRENT_EXPORT external_ip_alert: alert
|
|
|
|
{
|
|
|
|
external_ip_alert(
|
|
|
|
address const& ip
|
|
|
|
, std::string const& msg)
|
|
|
|
: alert(alert::info, msg)
|
|
|
|
, external_address(ip)
|
|
|
|
{}
|
|
|
|
|
|
|
|
address external_address;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new external_ip_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2005-11-01 19:30:39 +01:00
|
|
|
struct TORRENT_EXPORT listen_failed_alert: alert
|
2004-01-26 11:29:00 +01:00
|
|
|
{
|
|
|
|
listen_failed_alert(
|
2007-09-22 18:27:29 +02:00
|
|
|
tcp::endpoint const& ep
|
|
|
|
, std::string const& msg)
|
2004-01-26 11:29:00 +01:00
|
|
|
: alert(alert::fatal, msg)
|
2007-09-22 18:27:29 +02:00
|
|
|
, endpoint(ep)
|
2004-01-26 11:29:00 +01:00
|
|
|
{}
|
|
|
|
|
2007-09-22 18:27:29 +02:00
|
|
|
tcp::endpoint endpoint;
|
|
|
|
|
2004-01-26 11:29:00 +01:00
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new listen_failed_alert(*this)); }
|
|
|
|
};
|
2005-06-16 17:41:04 +02:00
|
|
|
|
2007-09-22 18:27:29 +02:00
|
|
|
struct TORRENT_EXPORT listen_succeeded_alert: alert
|
|
|
|
{
|
|
|
|
listen_succeeded_alert(
|
|
|
|
tcp::endpoint const& ep
|
|
|
|
, std::string const& msg)
|
|
|
|
: alert(alert::fatal, msg)
|
|
|
|
, endpoint(ep)
|
|
|
|
{}
|
|
|
|
|
|
|
|
tcp::endpoint endpoint;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new listen_succeeded_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-03-16 09:25:08 +01:00
|
|
|
struct TORRENT_EXPORT portmap_error_alert: alert
|
|
|
|
{
|
2008-04-07 01:18:35 +02:00
|
|
|
portmap_error_alert(int i, int t, const std::string& msg)
|
|
|
|
: alert(alert::warning, msg), mapping(i), type(t)
|
2007-03-16 09:25:08 +01:00
|
|
|
{}
|
|
|
|
|
2008-04-06 21:17:58 +02:00
|
|
|
int mapping;
|
2008-04-07 01:18:35 +02:00
|
|
|
int type;
|
2008-04-06 21:17:58 +02:00
|
|
|
|
2007-03-16 09:25:08 +01:00
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new portmap_error_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct TORRENT_EXPORT portmap_alert: alert
|
|
|
|
{
|
2008-04-07 01:18:35 +02:00
|
|
|
portmap_alert(int i, int port, int t, const std::string& msg)
|
|
|
|
: alert(alert::info, msg), mapping(i), external_port(port), type(t)
|
2007-03-16 09:25:08 +01:00
|
|
|
{}
|
|
|
|
|
2008-04-06 21:17:58 +02:00
|
|
|
int mapping;
|
|
|
|
int external_port;
|
2008-04-07 01:18:35 +02:00
|
|
|
int type;
|
2008-04-06 21:17:58 +02:00
|
|
|
|
2007-03-16 09:25:08 +01:00
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new portmap_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-03-16 08:59:04 +01:00
|
|
|
struct TORRENT_EXPORT fastresume_rejected_alert: torrent_alert
|
2005-06-16 17:41:04 +02:00
|
|
|
{
|
|
|
|
fastresume_rejected_alert(torrent_handle const& h
|
|
|
|
, std::string const& msg)
|
2007-03-16 08:59:04 +01:00
|
|
|
: torrent_alert(h, alert::warning, msg)
|
2005-08-11 01:32:39 +02:00
|
|
|
{}
|
2005-06-16 17:41:04 +02:00
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new fastresume_rejected_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2007-04-17 07:56:43 +02:00
|
|
|
struct TORRENT_EXPORT peer_blocked_alert: alert
|
|
|
|
{
|
|
|
|
peer_blocked_alert(address const& ip_
|
|
|
|
, std::string const& msg)
|
|
|
|
: alert(alert::info, msg)
|
|
|
|
, ip(ip_)
|
|
|
|
{}
|
|
|
|
|
|
|
|
address ip;
|
|
|
|
|
|
|
|
virtual std::auto_ptr<alert> clone() const
|
|
|
|
{ return std::auto_ptr<alert>(new peer_blocked_alert(*this)); }
|
|
|
|
};
|
|
|
|
|
2004-01-18 20:12:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|