error_address.h

00001 /***************************************************************************
00002  *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003  *   rvinyard@cs.nmsu.edu                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation version 2.1.                *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Lesser General Public      *
00015  *   License along with this library; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018  ***************************************************************************/
00019 #ifndef CONEXUSADDRESS_ERROR_H
00020 #define CONEXUSADDRESS_ERROR_H
00021 
00022 #include <conexus/error.h>
00023 #include <netdb.h>
00024 
00025 namespace Conexus
00026   {
00027 
00033     class address_error: public conexus_error
00034       {
00035       public:
00036       address_error(int e=0): conexus_error("Unknown address error.", e,"address")
00037         { }
00038       address_error(const std::string s, int e=0): conexus_error(s, e,"address")
00039         { }
00040       }
00041     ;
00042 
00043   namespace error
00044   {
00045 
00046   namespace address
00047       {
00048 
00054       class bad_string: public address_error
00055         {
00056         public:
00057           bad_string(): address_error("Address string is improperly formed.")
00058           { }
00059         }
00060       ;
00061 
00067        class bad_netmask: public address_error
00068        {
00069           public:
00070           bad_netmask(): address_error("The provided value is not a valid netmask."){ }
00071        };
00072 
00079        class again: public address_error
00080        {
00081          public:
00082            again(): address_error("The name could not be resolved at this time. Try again later.", EAI_AGAIN) { }
00083        };
00084 
00091        class bad_flags: public address_error
00092        {
00093          public:
00094            bad_flags(): address_error("The flags parameter has an invalid value.", EAI_BADFLAGS) { }
00095        };
00096 
00103        class fail: public address_error
00104        {
00105          public:
00106            fail(): address_error("A non-recoverable error occurred.", EAI_FAIL) { }
00107        };
00108 
00115        class memory: public address_error
00116        {
00117          public:
00118            memory(): address_error("Out of memory.", EAI_MEMORY) { }
00119        };
00120 
00121        
00130        class no_name: public address_error
00131        {
00132          public:
00133            no_name(): address_error("The  name  does  not  resolve for the supplied parameters.", EAI_NONAME) { }
00134        };
00135 
00142        class system: public address_error
00143        {
00144          public:
00145            system(): address_error("A system error occurred.", EAI_SYSTEM) { }
00146        };
00147 
00154        class family: public address_error
00155        {
00156          public:
00157            family(): address_error("The requested address family is not supported at all.", EAI_FAMILY) { }
00158        };
00159 
00166        class socket_type: public address_error
00167        {
00168          public:
00169            socket_type(): address_error("The requested socket type is not supported at all.", EAI_SOCKTYPE) { }
00170        };
00171 
00179        class service: public address_error
00180        {
00181          public:
00182            service(): address_error("The requested service is not available for the requested socket type.", EAI_SERVICE) { }
00183        };
00184 
00191        class address_family: public address_error
00192        {
00193          public:
00194            address_family(): address_error("The specified network host does not have any network addresses in the requested address family.", EAI_ADDRFAMILY) { }
00195        };
00196 
00197 
00204        class no_data: public address_error
00205        {
00206          public:
00207            no_data(): address_error("The specified network host exists, but does not have any network addresses defined.", EAI_NODATA) { }
00208        };
00209 
00215        class ipv6_not_ipv4_compatible: public address_error
00216        {
00217          public:
00218            ipv6_not_ipv4_compatible(): address_error("Converting IPv6 address to IPv4 when address is not IPv4 compatible.") { }
00219        };
00220 
00221 
00222       }
00223 
00224   }
00225 
00226 }
00227 
00228 #endif // CONEXUSBIND_ERROR_H

Generated on Sat Aug 26 17:34:53 2006 by  doxygen 1.4.6