text: // Copyright (c) 2009-2012, Andre Caron (andre.l.caron@gmail.com)
  // 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.
  //
  // 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
  // HOLDER 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.
  
  #include <w32.net.hpp>
  #include <w32.hpp>
  #include <algorithm>
  #include <iostream>
  
  namespace {
  
      void print ( const wchar_t * value )
      {
          std::wcout << "Alias: " << value << std::endl;
      }
  
  }
  
  #include <w32/app/console-program.hpp>
  
  namespace {
  
      int run ( int argc, wchar_t ** argv )
      {
       const w32::net::Context _;
          
          w32::string name = w32::computername();
          if ( argc > 1 ) {
              name = argv[1];
          }
          w32::net::Host host(name);
          //std::cout << host.name() << std::endl;
          w32::net::Host::Aliases aliases(host);
          std::for_each(aliases.begin(),aliases.end(),&print);
          const std::size_t count = host.addresses();
          for ( std::size_t i = 0; (i < count); ++i )
          {
              std::cout
                  << "IPv6: " << host.address<w32::net::ipv6::Address>(i)
                  << std::endl;
          }
          return (0);
      }
  
  }
  
  #include <w32/app/console-program.cpp>
  