Skip to content
Snippets Groups Projects
Select Git revision
  • 7c70c3b6e42c7558c8e5ac5c8c145e224f10acf7
  • master default protected
  • fix_Makefile.mingw#2
  • update_Makefile.mingw
  • fix_Makefile.mingw
  • fix_API_for_C_apps
  • fix_procinfo_mac
  • boinccmd_gpu_mode_always_until_sigterm
  • fgrp_osx_hotfix
  • fix_boinc_master@f8250782
  • eah_wrapper_improvements
  • diagnostics_win-hotfix
  • diagnostics_win-hotfix-old
  • current_fgrp_apps
  • testing_gw_apps
  • gw_app_darwin_15
  • current_brp_apps
  • current_brp_apps_android10
  • current_gfx_apps
  • current_server
  • current_gw_apps
  • previous_fgrp_apps
  • previous_gw_apps
  • testing_brp_apps
  • apps_FGRP3_1.07
  • apps_FGRP3_1.08
26 results

hostinfo_network.cpp

Blame
  • hostinfo_network.cpp 3.31 KiB
    // This file is part of BOINC.
    // http://boinc.berkeley.edu
    // Copyright (C) 2008 University of California
    //
    // BOINC is free software; you can redistribute it and/or modify it
    // under the terms of the GNU Lesser General Public License
    // as published by the Free Software Foundation,
    // either version 3 of the License, or (at your option) any later version.
    //
    // BOINC 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 Lesser General Public License for more details.
    //
    // You should have received a copy of the GNU Lesser General Public License
    // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
    
    #ifdef _WIN32
    #include "boinc_win.h"
    
    #else 
    
    #include "config.h"
    #include <cstdio>
    #include <cstring>
    
    #if HAVE_UNISTD_H
    #include <unistd.h>
    #endif
    #if HAVE_NETDB_H
    #include <netdb.h>
    #endif
    #if HAVE_ARPA_INET_H
    #include <arpa/inet.h>
    #endif
    #if HAVE_SYS_TYPES_H
    #include <sys/types.h>
    #endif
    #if HAVE_NETINET_IN_H
    #include <netinet/in.h>
    #endif
    #endif
    
    #ifdef __APPLE__
    #include <Carbon/Carbon.h>
    #endif
    
    #include "str_util.h"
    #include "str_replace.h"
    #include "parse.h"
    #include "util.h"
    #include "file_names.h"
    #include "client_msgs.h"
    #include "error_numbers.h"
    #include "mac_address.h"
    
    #include "hostinfo.h"
    
    // get domain name and IP address of this host
    //
    int HOST_INFO::get_local_network_info() {
        struct in_addr addr;
        struct hostent* he;
        
        strcpy(domain_name, "");
        strcpy(ip_addr, "");
    
        // it seems like we should use getdomainname() instead of gethostname(),
        // but on FC6 it returns "(none)".
        //