summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/net.cc
Commit message (Collapse)AuthorAgeFilesLines
* * (fhandler_socket::getsockname): Fix length returned for unboundCorinna Vinschen2009-08-141-4/+0
| | | | | | | | AF_LOCAL sockets. (fhandler_socket::getpeername): Ditto. * net.cc (socketpair): Don't set sun_path and peer_sun_path to make sure getsockname and getpeername return the correct values for AF_LOCAL sockets.
* * fhandler.h (class fhandler_socket): Add peer_sun_path member.Corinna Vinschen2009-08-131-0/+2
| | | | | | | | | | | | | | | | | | | (fhandler_socket::set_peer_sun_path): New method. (fhandler_socket::get_peer_sun_path): New method. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Initialize peer_sun_path to NULL. (fhandler_socket::~fhandler_socket): Free peer_sun_path if necessary. (fhandler_socket::dup): Duplicate peer_sun_path. (fhandler_socket::accept): Ditto. Return fake unbound peer content and len in case of AF_LOCAL sockets. (fhandler_socket::getsockname): Always use local sockaddr_storage to store socket address and copy over to incoming address. Handle every namelen correctly per POSIX. (fhandler_socket::getpeername): Ditto. Add code path to return correct value for AF_LOCAL sockets. (fhandler_socket::set_peer_sun_path): New method. * net.cc (socketpair): Set peer_sun_path to empty string, just like sun_path.
* * net.cc (cygwin_getnameinfo): Force setting NI_NUMERICSERV onlyCorinna Vinschen2009-08-061-12/+19
| | | | | on Windows 2003 and earlier, only if the port number doesn't resolve to a well-known service. Change comment accordingly.
* * fhandler_socket.cc (fhandler_socket::send_internal): Just use wmem size ifChristopher Faylor2009-08-041-2/+2
| | | | | | | | the length exceeds it. * net.cc (fdsock): Use 65535 as window size, just like the comment says or we run into problems with DuplicateHandle. * path.cc (patch_conv::check): Use set_path to set invalid filename. * path.h (path_conv::path_conv): Ditto.
* * net.cc (get_xp_ifs): Fix typo in comment.Corinna Vinschen2009-07-011-1/+1
|
* * fhandler.h (class fhandler_socket): Add class members and methodsCorinna Vinschen2009-07-011-13/+29
| | | | | | | | | | | | | | | | to store and retrieve the SO_RCVBUF and SO_SNDBUF sizes. * fhandler_socket.cc (fhandler_socket::dup): Duplicate new members. (fhandler_socket::send_internal): Check for SO_SNDBUF size and restrict send to 1 byte less per KB 823764. Leave loop immediately if WSASendMsg has been used. * net.cc (fdsock): Change comment again. Set buffer sizes to 65536. Store values in fhandler_socket. (cygwin_setsockopt): Store SO_RCVBUF and SO_SNDBUF sizes in fhandler_socket. (cygwin_sendto): Drop call to sig_dispatch_pending. (cygwin_recvfrom): Ditto. (cygwin_recvmsg): Ditto. (cygwin_sendmsg): Ditto.
* * net.cc (fdsock): Set default socket buffer sizes to 65520. ChangeCorinna Vinschen2009-06-301-12/+9
| | | | | | comment accordingly. * fhandler_socket.cc (fhandler_socket::send_internal): Set maximum send size to 65520 as well.
* * net.cc (get_flags): New static function to generate interface flagsCorinna Vinschen2009-06-151-115/+287
| | | | | | | | | | | | value. (get_ipv4fromreg_ipcnt): New static function to fetch number of configured IPv4 addresses for a given NIC from registry. (get_ipv4fromreg): New static function to fetch configured IPv4 addresses for a given NIC from registry. (get_friendlyname): New static function to generate friendly name. (get_hwaddr): New static function to copy hardware address. (get_xp_ifs): Restructure slightly. Add code to generate IPv4 entries entries for interfaces which are disconnected.
* * path.cc (cwdstuff::set): Avoid removing a nonexistent trailing slash.Christopher Faylor2009-05-281-2/+0
|
* * net.cc (gethostby_helper): Use correct signedness.Christopher Faylor2009-05-201-35/+36
|
* * net.cc: Undefine NOERROR and DELETE to avoid compiler warnings.Christopher Faylor2009-04-051-0/+6
| | | | | | * shared_info.h (CURR_SHARED_MAGIC): Update. * spawn.cc (spawn_guts): Avoid copying one line command line argument if it hasn't been filled out.
* * net.cc (inet_ntop6): Convert to lowercase hex digits on the fly.Corinna Vinschen2009-03-271-1/+6
|
* * net.cc (cygwin_getaddrinfo): Check hints for non-NULL beforeCorinna Vinschen2009-03-271-0/+1
| | | | checking its content.
* * gethostby_helper: Fix typos in DEBUGGING case.Corinna Vinschen2009-03-121-4/+4
|
* * cygwin.din: Export gethostbyname2.Corinna Vinschen2009-03-061-13/+309
| | | | | | | | | | | | | | | | * net.cc: define _CYGWIN_IN_H and include resolv.h. (realloc_ent): New function. (dup_ent): Call realloc_ent. (memcpy4to6): New function. (dn_length1): New function. (gethostby_helper): New function. (gethostbyname2): New function. * posix.sgml: Add gethostbyname2. * include/cygwin/version.h: Bump API minor number. * libc/minires.c (get_options): Look for "inet6" and apply bounds to "retry" and "retrans". (res_ninit): Set the default options at the beginning. (dn_expand): Fix "off by one".
* * net.cc: Include asm/byteorder.h.Corinna Vinschen2009-03-031-33/+39
| | | | | | | | | (htonl): Move to end of file. Add comment to explain why. Align definition to POSIX. Use related macro from asm/byteorder.h. (ntohl): Ditto. (htons): Ditto. (ntohs): Ditto. * include/asm/byteorder.h: Revert previous patch.
* * cygtls.h (unionent): Move from net.cc.Christopher Faylor2008-09-161-39/+36
| | | | | | | | | | | | | | | | | (unionent::struct_type): Move enum here. (_local_storage::hostent_buf): Define as unionent. (_local_storage::protoent_buf): Ditto. (_local_storage::servent_buf): Ditto. * net.cc (unionent): Move to cygtls.h. (struct_type): Ditto. (dup_ent): Define one function per {host,proto,serv}ent type. (cygwin_getprotobyname): Simplify dup_ent call. Removed now-unneeded return type coercion. (cygwin_getprotobynumber): Ditto. (cygwin_getservbyname): Ditto. (cygwin_getservbyport): Ditto. (cygwin_gethostbyname): Ditto. (cygwin_gethostbyaddr): Ditto. tlsoffsets.h: Regenerate.
* * net.cc (in6addr_any, in6addr_loopback): Add appropriate number of bracesChristopher Faylor2008-09-111-8/+8
| | | | | | | | | | around initializer. (dup_ent): Try harder to coerce the first argument to deal with more stringent compiler. (get_2k_ifs): Remove extraneous typedef. (get_2k_ifs): Reorganize expression to avoid a compiler warning. (get_xp_ifs): Ditto. (get_nt_ifs): Ditto.
* * autoload.cc (GetExtendedTcpTable): Define.Corinna Vinschen2008-07-141-1/+1
| | | | | | | | | * fhandler_socket.cc (address_in_use): Take const struct sockaddr pointer as argument. Implement additional AF_INET6 table check. (fhandler_socket::bind): Drop AF_INET test before calling address_in_use. * net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if called with unsupported af_family.
* * fhandler_socket.cc (fhandler_socket::bind): Don't run explicitCorinna Vinschen2008-07-081-2/+10
| | | | | | | | | | local socket test in SO_REUSEADDR case on systems supporting enhanced socket security. Explain why. Only call address_in_use for AF_INET sockets. * net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR on systems supporting enhanced socket security. Add comment. * wincap.h (wincaps::has_enhanced_socket_security): New element. * wincap.cc: Implement above element throughout.
* * net.cc (ipv6_inited): Make NO_COPY.Corinna Vinschen2008-07-081-1/+1
|
* * net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport.Corinna Vinschen2008-06-241-2/+2
|
* * net.cc (if_nametoindex): Fix typo in call to get_adapters_addresses.Corinna Vinschen2008-06-101-1/+22
| | | | | | (if_indextoname): Prefer IPv6 loopback device name over IPv4 loopback device name on pre-Vista systems. (if_nameindex): Ditto.
* * fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather thanCorinna Vinschen2008-06-101-4/+4
| | | | | | | | __small_sprintf. * net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for consistency with /proc/net/if_inet6. (if_indextoname): Ditto. (if_nameindex): Ditto.
* * fhandler.h (-struct wsa_event): Move to wsa_event.h. IncludeCorinna Vinschen2008-04-181-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wsa_event.h instead. * fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h. (wsa_events): Move from DLL shared area to cygwin_shared shared memory. Accommodate throughout. (socket_serial_number): Ditto. * fhandler_tape.cc (mt): Ditto. (mtinfo_init): Remove. (mt): Define as cygwin_shared->mt. * flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove. (FLOCK_INODE_DIR_ACCESS): Move up in file. (FLOCK_MUTANT_ACCESS): Ditto. (FLOCK_EVENT_ACCESS): Ditto. (get_lock_parent_dir): Remove. (inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle. Add a "flock-" prefix to file's lock directory name for clarity. * mtinfo.h (mtinfo_init): Drop declaration. * net.cc (last_used_bindresvport): Move from DLL shared area to cygwin_shared shared memory. (cygwin_bindresvport_sa): Accommodate above change. * sec_helper.cc (_everyone_sd): Move here from flock.cc. * security.h (SD_MIN_SIZE): Ditto. (everyone_sd): Ditto. * shared.cc (cygwin_shared_area): Remove. (cygwin_shared_h): New handle. (get_shared_parent_dir): New static function. (shared_name): Drop session_local argument. Call get_shared_parent_dir here. Add cygwin-shared subdir to object name. (offsets): Reinstantiate SH_CYGWIN_SHARED member. (open_shared): Revert change from 2007-03-29 for systems supporting SeCreateGlobalPrivilege. (shared_info::initialize): Call mtinfo's initialize here. (memory_init): Drop call to mtinfo_init. * shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info. (CURR_SHARED_MAGIC): Ditto. (class shared_info): Add members for global socket and tape info sharing. (enum shared_locations): Reinstantiate SH_CYGWIN_SHARED. (get_shared_parent_dir): Declare. (shared_name): Drop session_local argument from declaration. * wsa_event.h: New file. Move definitions of NUM_SOCKS and struct wsa_event here.
* Remove unneeded header files from source files throughout.Christopher Faylor2008-04-071-4/+0
|
* Add miscfuncs.h to files as needed throughout.Christopher Faylor2008-04-071-0/+1
| | | | | | | | | | | | * mount.cc: New file. * path.cc: Move mount-specific stuff into mount.cc. Move common stuff into miscfuncs.cc. Remove unneeded includes. * miscfuncs.cc: Move some common path functions here. * miscfuncs.h: New file. * winsup.h: Move miscelleneous functions to miscfuncs.h. * dcrt0.cc: Remove unneeded includes. * Makefile.in (DLL_OFILES): Add mount.o. * include/cygwin/config.h: Fix a minor typo.
* Cleanup.Corinna Vinschen2008-04-031-20/+13
| | | | | | | | | | | | | | | | * exceptions.cc (windows_system_directory): Make static. Convert to WCHAR. (_cygtls::inside_kernel): Accommodate above change. Check module path name for leading \\?\ and skip, if so. (try_to_debug): Call GetEnvironmentStringsW and convert evaluation to WCHAR to avoid truncated environment problem. (has_visible_window_station): Call GetUserObjectInformationW. (events_init): Accommodate above conversion of windows_system_directory. * init.cc (respawn_wow64_process): Use WCHAR functions to start new process. * net.cc (__dup_ent): Drop Windows 9x consideration. (load_ipv6_funcs): Use WCHAR functions to load IPv6 libs. * syscalls.cc (syscalls.cc): Remove call to GetDiskFreeSpace.
* * net.cc (load_ipv6_funcs): Use MAX_PATH instead of CYG_MAX_PATH.Corinna Vinschen2007-10-311-86/+84
| | | | | (cygwin_getaddrinfo): Simplify formatting. (cygwin_getnameinfo): Ditto.
* * fork.cc: White space.Christopher Faylor2007-07-071-11/+11
| | | | | * net.cc: Ditto. * posix_ipc.cc: Ditto.
* * autoload.cc (WSAIoctl): Remove.Corinna Vinschen2007-06-211-447/+544
| | | | | | | | | | | | | | | | | | | | | | | | * cygwin.din: Export freeifaddrs, getifaddrs. * fhandler_socket.cc (fhandler_socket::ioctl): Drop SOCKET parameter from get_ifconf. * net.cc: Include ifaddrs.h. (in_are_prefix_equal): Match addresses in network byte order. (ip_addr_prefix): Convert address into host byte order before testing with IN_LOOPBACK. (struct ifall): Define. (get_xp_ifs): Replace get_xp_ifconf. Return struct ifall array. (get_2k_ifs): Ditto, replace get_2k_ifconf. (get_nt_ifs): Ditto, replace get_nt_ifconf. (getifaddrs): New function. (freeifaddrs): New function. (get_ifconf): Call matching get_XX_ifs function and create ifc content from here. Drop lo fake since it's now in get_nt_ifs. * posix.sgml: Add freeifaddrs and getifaddrs to list of implemented BSD functions. * wincap.h (wincapc::has_broken_if_oper_status): New element. * wincap.cc: Implement above element throughout. * include/ifaddrs.h: New file. * include/cygwin/version.h: Bump API minor number.
* * autoload.cc (GetIpForwardTable): Define.Corinna Vinschen2007-06-141-0/+45
| | | | | | | | | | | | | | | * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFDSTADDR. * net.cc (get_routedst): New static function to get destination address of point-to-point interfaces. (get_xp_ifconf): Handle SIOCGIFDSTADDR. (get_2k_ifconf): Ditto. (get_nt_ifconf): Ditto. (get_ifconf): Ditto. * include/asm/socket.h (SIOCGIFDSTADDR): Define. * include/cygwin/if.h (struct ifreq): Add ifru_dstaddr member. (ifr_dstaddr): Define. * include/cygwin/in.h: Cast ipv4 addresses correctly to in_addr_t in definitions.
* * fhandler_registry.cc (registry_listing): Drop name of HKEY_DYN_DATA.Corinna Vinschen2007-02-261-1/+1
| | | | | | (registry_keys): Drop HKEY_DYN_DATA. * net.cc: Fix comment. * syslog.cc: Ditto.
* * fhandler.cc (fhandler_base::set_no_inheritance): Always useCorinna Vinschen2007-02-221-10/+0
| | | | | | | | | | | | | | | | | SetHandleInformation. * fhandler_disk_file.cc (fhandler_disk_file::lock): Always use UnlockFileEx/LockFileEx functions. * net.cc (fdsock): Don't bother to duplicate socket for inheritance. * sysconf.cc (get_nproc_values): Take NT for granted. (get_avphys): Ditto. * syslog.cc (WIN95_EVENT_LOG_PATH): Remove define. (get_win95_event_log_path): Remove. (vsyslog): Fix formatting. Take NT for granted. * wincap.cc: Remove has_lock_file_ex, has_signal_object_and_wait, has_eventlog, has_set_handle_information, has_set_handle_information_on_console_handles and supports_smp throughout. * wincap.h: Ditto.
* * Makefile.in (DLL_IMPORTS): Add libntdll.a.Corinna Vinschen2007-02-221-190/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * autoload.cc: Remove all symbols from advapi32.dll, kernel32.dll and ntdll.dll available on all platforms since NT4. Throughout remove all usage of wincap.is_winnt. * dcrt0.cc (dll_crt0_0): Remove call to mmap_init. * fhandler.h (class fhandler_base): Remove has_changed flag. (fhandler_disk_file::touch_ctime): Remove declaration. (fhandler_disk_file::readdir_9x): Ditto. (fhandler_disk_file::touch_ctime): Remove. (fhandler_disk_file::readdir_9x): Remove. (fhandler_disk_file::closedir): Call NtClose instead of CloseHandle. * mmap.cc: Throughout call CreateMapping and MapView directly. (VirtualProt9x): Remove. (VirtualProtNT): Remove. (VirtualProtEx9x): Remove. (VirtualProtExNT): Remove. (VirtualProtect): Remove define. (VirtualProtectEx): Remove define. (CreateMapping9x): Remove. (CreateMappingNT): Rename to CreateMapping. (MapView9x): Remove. (MapViewNT): Rename to MapView. (struct mmap_func_t): Remove definition. (mmap_funcs_9x): Remove. (mmap_funcs_nt): Remove. (mmap_func): Remove. (mmap_init): Remove. * net.cc (getdomainname): Drop comment. Use NT4 registry key only. (get_95_ifconf): Remove. * pinfo.cc (winpids::enumNT): Rename to winpids::enum_processes. (winpids::enum9x): Remove. (winpids::set): Just call enum_processes directly. (winpids::enum_init): Ditto. * pinfo.h (class winpids): Drop enum_processes pointer. Rename enumNT to enum_processes. Drop enum9x declaration. Drop initialization of enum_processes throughout. * registry.cc (get_registry_hive_path): Just create NT key. (load_registry_hive): Only load NT specific file. * syscalls.cc (unlink_9x): Remove. (unlink): Just call unlink_nt. * wincap.cc: Remove is_winnt flag throughout. * wincap.h: Ditto. * winsup.h: Remove mmap_init declaration.
* Remove extraneous whitespace.Christopher Faylor2007-02-201-44/+44
| | | | | | * pinfo.cc (commune_process): Use default argument to lock_process. * sigproc.cc: Update copyright. * select.cc: Ditto.
* * net.cc (ga_dup): New function, taken from ga_clone with v4-in-v6Corinna Vinschen2007-02-011-19/+130
| | | | | | | | | | | | | | | | | mapping addition. (ga_clone): Just call ga_dup from here. (ga_duplist): New function to duplicate list of struct addrinfo. (ga_echeck): Don't check a_flags, it already happened in cygwin_getaddrinfo. (cygwin_freeaddrinfo): Always call ipv4_freeaddrinfo. (cygwin_getaddrinfo): Use new wincap.supports_all_posix_ai_flags flag rather than wincap.has_gaa_on_link_prefix. Always duplicate WinSock's addrinfo list to a self-allocated list. Handle AI_V4MAPPED for pre-Vista platforms supporting getaddrinfo. * wincap.h (wincapc::supports_all_posix_ai_flags): New element. * wincap.cc: Implement above element throughout. * include/netdb.h: Note how AI_ADDRCONFIG is not supported pre-Vista. Remove superfluous comment.
* * net.cc (cygwin_getaddrinfo): Fix thinko in AI_ADDRCONFIG handling.Corinna Vinschen2007-01-311-2/+1
|
* * net.cc (cygwin_getaddrinfo): Check ai_flags for valid values.Corinna Vinschen2007-01-311-1/+34
| | | | | Handle AI_NUMERICSERV. Handle AI_ADDRCONFIG behaviour on Vista. * include/netdb.h (AI_NUMERICSERV): Add missing flag.
* * net.cc (if_nametoindex): This time, really free IP_ADAPTER_ADDRESSESCorinna Vinschen2007-01-241-7/+7
| | | | | memory. (if_indextoname): Ditto.
* * net.cc (gai_errmap): Add EAI_OVERFLOW entry. Fix formatting.Corinna Vinschen2007-01-231-15/+16
| | | | | | (cygwin_gai_strerror): Drop using EAI_MAX. (w32_to_gai_err): Ditto. * include/netdb.h: Define EAI_OVERFLOW. Remove EAI_MAX.
* * net.cc (if_nametoindex): Free IP_ADAPTER_ADDRESSES memory.Corinna Vinschen2007-01-231-19/+34
| | | | | (if_indextoname): Ditto. (if_nameindex): Ditto. Remove duplicate indexed entries in result.
* * autoload.cc (WSAIoctl): Define.Corinna Vinschen2007-01-211-6/+497
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (SendARP): Define. * cygwin.din: Export if_freenameindex, if_indextoname, if_nameindex and if_nametoindex. * fhandler_procnet.cc: Drop including wchar.h. Drop definitions of GAA_FLAG_INCLUDE_ALL_INTERFACES, IP_ADAPTER_UNICAST_ADDRESS_VISTA. (fhandler_procnet::exists): Check for has_gaa_prefixes. Call get_adapters_addresses here. (fhandler_procnet::readdir): Ditto. (prefix): Move to net.cc. (fhandler_procnet::fill_filebuf): Call get_adapters_addresses here. Simplify allocation. Use AdapterName rather than FriendlyName as interface name. Use IfIndex if available, Ipv6IfIndex otherwise. (in6_are_prefix_equal): Move to net.cc. * fhandler_socket.cc: Define old SIOCGxxx values. (CONV_OLD_TO_NEW_SIO): Convert old SIOCGxxx value to new one. (struct __old_ifreq): Define old struct ifreq. (fhandler_socket::ioctl): Handle old SIOCGxxx values. Handle new SIOCGIFFRNDLYNAM command. Simplify copying ifreq data to user space. Call get_ifconf with additional SOCKET parameter. * net.cc (IP_ADAPTER_UNICAST_ADDRESS_LH): Define. (IP_ADAPTER_ADDRESSES_LH): Define. (SIO_GET_INTERFACE_LIST): Define. (sockaddr_in6_old): Define. (sockaddr_gen): Define. (INTERFACE_INFO): Define. (IN_LOOPBACK): Define. (in_are_prefix_equal): New static function. (ip_addr_prefix): New function, replaces prefix function, add AF_INET handling. (GAA_FLAG_INCLUDE_ALL_INTERFACES): Define. (get_adapters_addresses): New function. (WS_IFF_xxx): Define Winsock interface flag values. (convert_ifr_flags): New function to convert Winsock interface flag values to Cygwin interface flag values. (get_xp_ifconf): New get_ifconf implementation for XP SP1 and above. (get_2k_ifconf): Fix interface index. Fix formatting. (get_nt_ifconf): Fix formatting. (get_95_ifconf): Ditto. (get_ifconf): Take additional SOCKET parameter. Call get_xp_ifconf on XP SP1 and above. (if_nametoindex): New function. (if_indextoname): New function. (if_nameindex): New function. (if_freenameindex): New function. (in6_are_prefix_equal): Moved here from fhandler_procnet.cc. * wincap.cc (wincap_xp): Define has_gaa_prefixes as true by default. (wincapc::init): Assume has_osversioninfoex by default. Call GetVersionEx with OSVERSIONINFOEX first. Call with OSVERSIONINFO only if that fails. Simplify NT4 case and try to avoid strcmp. Check XP Service Pack using version.wServicePackMajor to avoid strcmp. * include/asm/socket.h (SIOCGIFFRNDLYNAM): Define. * include/cygwin/if.h: Fix formatting. (IFF_POINTTOPOINT): Define. (IFF_NOARP): Define. (IFF_LOWER_UP): Define. (IFF_DORMANT): Define. (struct if_nameindex): Define. (IFRF_FRIENDLYNAMESIZ): Define. (struct ifreq_frndlyname): Define. (IFNAMSIZ): Redefine as 44. (IF_NAMESIZE): Define. (struct ifreq): Redefine ifru_flags as int. Define ifru_data. Pad size to sizeof sockaddr_in6 for further extensions. (ifr_data): Define. (ifr_frndlyname): Define. (if_nametoindex): Declare. (if_indextoname): Declare. (if_nameindex): Declare. (if_freenameindex): Declare. * include/cygwin/version.h: Bump API minor number. (CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ): Define check for old vs. new ifreq structure.
* * fhandler_socket.cc (fhandler_socket::ioctl): Handle SIOCGIFINDEX.Corinna Vinschen2007-01-161-0/+15
| | | | | | | | | | | * net.cc (get_2k_ifconf): Ditto. (get_nt_ifconf): Fake SIOCGIFINDEX. (get_95_ifconf): Ditto. (get_ifconf): Handle SIOCGIFINDEX. Fake it for loopback on systems not supporting IP Helper Lib. * include/asm/socket.h (SIOCGIFINDEX): Define. * include/cygwin/if.h (struct ifreq): Add member for interface index. (ifr_ifindex): Define.
* (get_ifconf): Set MTU for loopback to more correct value.Corinna Vinschen2007-01-041-2/+2
|
* * fhandler_socket.cc (fhandler_socket::ioctl): Don't fake resultsCorinna Vinschen2007-01-041-107/+106
| | | | | | | | | | for SIOCGIFFLAGS here. Call get_ifconf instead. * net.cc (get_2k_ifconf): Clean up code to generate interface name. Handle SIOCGIFFLAGS here. (get_nt_ifconf): Fake SIOCGIFFLAGS here. (get_95_ifconf): Ditto. (get_ifconf): Don't fake loopback on systems with IP Helper Lib. Set MTU for loopback to a more "modern" value.
* * net.cc (get_ipv6_funcs): Fix formatting.Corinna Vinschen2006-11-231-3/+3
|
* * net.cc (cygwin_getnameinfo): Fix typo in comment.Corinna Vinschen2006-10-201-1/+1
|
* * fhandler_socket.cc (fhandler_socket::recvmsg): Remove unused totCorinna Vinschen2006-07-271-2/+3
| | | | | | | | | | argument. All callers changed. (fhandler_socket::sendmsg): Likewise. * net.cc (cygwin_recvmsg): Likewise. (cygwin_sendmsg): Likewise, and prevent calling sendmsg whith an invalid iovec. * fhandler.h (fhandler_socket::recvmsg): Adjust prototype. (fhandler_socket::sendmsg): Likewise.
* * fhandler.h (class fhandler_socket): Remove prot_info_ptr.Corinna Vinschen2006-07-271-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | (fhandler_socket::fixup_before_fork_exec): Remove. (fhandler_socket::fixup_after_exec): Remove. (fhandler_socket::need_fixup_before): Remove. * fhandler_socket.cc (fhandler_socket::fhandler_socket): Drop initializing prot_info_ptr. Remove unused code. (fhandler_socket::~fhandler_socket): Drop free'ing prot_info_ptr. (struct wsa_event): Rename connect_errorcode to errorcode. (fhandler_socket::evaluate_events): Handle FD_CLOSE error condition as FD_CONNECT error condition, except, never reset an FD_CLOSE error condition. Always set FD_WRITE after successfully recorded FD_CONNECT. (fhandler_socket::fixup_before_fork_exec): Remove. (fhandler_socket::fixup_after_fork): Revert to using handle duplication. (fhandler_socket::fixup_after_exec): Remove. (fhandler_socket::dup): Revert to using handle duplication. (fhandler_socket::send_internal): Only call wait_for_events in case of WSAEWOULDBLOCK condition. (fhandler_socket::set_close_on_exec): Call fhandler_base::set_close_on_exec. * net.cc (fdsock): Just set socket to inheritable on non-NT. Don't call inc_need_fixup_before. * select.cc (peek_socket): Don't set except_ready on every FD_CLOSE, just on error.