-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed the ip tests since these were against the addr.cpp/h and now …
…we use libaddr instead. Retired the add.cpp/h from libsnapwebsites as we use libaddr instead. Removed a copy of snap_listen_thread.cpp, we don't use these because we have snap_communicator now.
- Loading branch information
1 parent
d56ba6d
commit 750cd14
Showing
6 changed files
with
1,411 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# File: | ||
# libsnapwebsites/tests/ip/CMakeLists.txt | ||
# | ||
# Description: | ||
# | ||
# Documentation: | ||
# See the CMake documentation. | ||
# | ||
# License: | ||
# Copyright (c) 2011-2018 Made to Order Software Corp. All Rights Reserved | ||
# | ||
# https://snapwebsites.org/ | ||
# contact@m2osw.com | ||
# | ||
# This program is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, write to the Free Software | ||
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
# | ||
|
||
project(ip_test) | ||
|
||
include_directories( | ||
SYSTEM | ||
${MAGIC_INCLUDE_DIRS} | ||
${LOG4CPLUS_INCLUDE_DIRS} | ||
${LIBPROCPS_INCLUDE_DIRS} | ||
${OPENSSL_INCLUDE_DIR} | ||
) | ||
|
||
include_directories( | ||
${LIBTLD_INCLUDE_DIRS} | ||
${snapwebsites_SOURCE_DIR} | ||
) | ||
|
||
add_executable( ${PROJECT_NAME} | ||
ip_test.cpp | ||
) | ||
|
||
target_link_libraries( ${PROJECT_NAME} | ||
${ADVGETOPT_LIBRARIES} | ||
${LIBEXCEPT_LIBRARIES} | ||
${LIBTLD_LIBRARIES} | ||
${LOG4CPLUS_LIBRARIES} | ||
${QT_LIBRARIES} | ||
${AS2JS_LIBRARIES} | ||
${QTSERIALIZATION_LIBRARIES} | ||
${MAGIC_LIBRARIES} | ||
${LIBPROCPS_LIBRARIES} | ||
${OPENSSL_LIBRARIES} | ||
${UUID} | ||
pthread | ||
dl | ||
snapwebsites | ||
libdbproxy | ||
) | ||
|
||
# vim: ts=4 sw=4 et nocindent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
IP / Address related Tests | ||
========================== | ||
|
||
The tests defined in this folder will test objects related to IP or address | ||
handling. | ||
|
||
|
||
IP Test | ||
======= | ||
|
||
This test prints out the list of local addresses as returned by: | ||
|
||
addr::get_local_addresses(); | ||
|
||
It is not an automatic test in that it prints out the results which you | ||
have to verify by hand. | ||
|
||
|
||
|
||
# Bugs | ||
|
||
Submit bug reports and patches on | ||
[github](https://github.com/m2osw/snapwebsites/issues). | ||
|
||
|
||
_This file is part of the [snapcpp project](https://snapwebsites.org/)._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Snap Websites Server -- manage the snapbackend settings | ||
// Copyright (c) 2016-2018 Made to Order Software Corp. All Rights Reserved | ||
// | ||
// This program is free software; you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation; either version 2 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with this program; if not, write to the Free Software | ||
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
#include "snapwebsites/addr.h" | ||
#include "snapwebsites/not_used.h" | ||
|
||
#include <iostream> | ||
|
||
using namespace snap; | ||
using namespace snap_addr; | ||
using namespace std; | ||
|
||
int main( int argc, char *argv[] ) | ||
{ | ||
NOTUSED(argc); | ||
NOTUSED(argv); | ||
|
||
try | ||
{ | ||
addr::vector_t address_list( addr::get_local_addresses() ); | ||
|
||
for( const auto& addr : address_list ) | ||
{ | ||
cout << "Interface name: " << addr.get_iface_name() << endl; | ||
|
||
cout << "Network type: "; | ||
switch( addr.get_network_type() ) | ||
{ | ||
case addr::network_type_t::NETWORK_TYPE_UNDEFINED : cout << "Undefined"; break; | ||
case addr::network_type_t::NETWORK_TYPE_PRIVATE : cout << "Private"; break; | ||
case addr::network_type_t::NETWORK_TYPE_CARRIER : cout << "Carrier"; break; | ||
case addr::network_type_t::NETWORK_TYPE_LINK_LOCAL : cout << "Local Link"; break; | ||
case addr::network_type_t::NETWORK_TYPE_MULTICAST : cout << "Multicast"; break; | ||
case addr::network_type_t::NETWORK_TYPE_LOOPBACK : cout << "Loopback"; break; | ||
case addr::network_type_t::NETWORK_TYPE_ANY : cout << "Any"; break; | ||
case addr::network_type_t::NETWORK_TYPE_UNKNOWN : cout << "Unknown"; break; | ||
} | ||
cout << endl; | ||
|
||
std::string const ip_string( addr.get_ipv4or6_string() ); | ||
cout << "IP address: " << ip_string; | ||
|
||
if( addr.is_ipv4() ) | ||
{ | ||
cout << " (ipv4)"; | ||
} | ||
else | ||
{ | ||
cout << " (ipv6)"; | ||
} | ||
cout << endl << endl; | ||
} | ||
|
||
return 0; | ||
} | ||
catch(snap::snap_exception const & e) | ||
{ | ||
std::cerr << "error: a Snap! exception occurred. " << e.what() << std::endl; | ||
} | ||
|
||
return 1; | ||
} | ||
|
||
// vim: ts=4 sw=4 et |
111 changes: 0 additions & 111 deletions
111
archive/snapwebsites/libsnapwebsites/src/snap_listen_thread.cpp
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.