--- gvpe/src/sockinfo.h 2005/03/03 16:54:34 1.9 +++ gvpe/src/sockinfo.h 2005/06/03 05:07:31 1.13 @@ -16,11 +16,11 @@ You should have received a copy of the GNU General Public License along with gvpe; if not, write to the Free Software - Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef VPE_SOCKINFO_H__ -#define VPE_SOCKINFO_H__ +#ifndef GVPE_SOCKINFO_H__ +#define GVPE_SOCKINFO_H__ #include "netcompat.h" @@ -47,24 +47,31 @@ const sockaddr *sav4 () const; const socklen_t salenv4 () const - { return sizeof (sockaddr_in); } + { + return sizeof (sockaddr_in); + } const char *ntoa () const; bool valid () const - { return prot != 0 && host != 0; } + { + return prot != 0 && host != 0; + } sockinfo() { prot = 0; } - sockinfo(const sockaddr_in &sa, u8 prot) - { set (&sa, prot); } - - sockinfo(const conf_node *conf, u8 prot) - { set (conf, prot); } + sockinfo(const char *hostname, u16 port, u8 prot) { set (hostname, port, prot); } + sockinfo(const sockaddr_in &sa, u8 prot) { set (&sa, prot); } + sockinfo(const conf_node *conf, u8 prot) { set (conf, prot); } }; bool operator == (const sockinfo &a, const sockinfo &b); -bool operator < (const sockinfo &a, const sockinfo &b); +bool operator < (const sockinfo &a, const sockinfo &b); + +inline bool operator != (const sockinfo &a, const sockinfo &b) +{ + return !(a == b); +} #endif