Created
March 20, 2018 16:13
-
-
Save rfht/74ca9b700e692467636401f807e6edd8 to your computer and use it in GitHub Desktop.
networking-posix.c on various stages of openbsd build WITHOUT downstream patch
This file contains hidden or 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
| /** | |
| * \file | |
| * Modern posix networking code | |
| * | |
| * Author: | |
| * Rodrigo Kumpera ([email protected]) | |
| * | |
| * (C) 2015 Xamarin | |
| */ | |
| #include <config.h> | |
| #include <glib.h> | |
| #ifdef HAVE_NETDB_H | |
| #include <netdb.h> | |
| #endif | |
| #ifdef HAVE_SYS_IOCTL_H | |
| #include <sys/ioctl.h> | |
| #endif | |
| #ifdef HAVE_NET_IF_H | |
| #include <net/if.h> | |
| #endif | |
| #ifdef HAVE_UNISTD_H | |
| #include <unistd.h> | |
| #endif | |
| #ifdef HAVE_GETIFADDRS | |
| #include <ifaddrs.h> | |
| #endif | |
| #include <mono/utils/networking.h> | |
| #include <mono/utils/mono-threads-coop.h> | |
| static void* | |
| get_address_from_sockaddr (struct sockaddr *sa) | |
| { | |
| switch (sa->sa_family) { | |
| case AF_INET: | |
| return &((struct sockaddr_in*)sa)->sin_addr; | |
| case AF_INET6: | |
| return &((struct sockaddr_in6*)sa)->sin6_addr; | |
| } | |
| return NULL; | |
| } |
This file contains hidden or 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
| /** | |
| * \file | |
| * Modern posix networking code | |
| * | |
| * Author: | |
| * Rodrigo Kumpera ([email protected]) | |
| * | |
| * (C) 2015 Xamarin | |
| */ | |
| #include <config.h> | |
| #include <glib.h> | |
| #ifdef HAVE_NETDB_H | |
| #include <netdb.h> | |
| #endif | |
| #ifdef HAVE_SYS_IOCTL_H | |
| #include <sys/ioctl.h> | |
| #endif | |
| #ifdef HAVE_NET_IF_H | |
| #include <net/if.h> | |
| #endif | |
| #ifdef HAVE_UNISTD_H | |
| #include <unistd.h> | |
| #endif | |
| #ifdef HAVE_GETIFADDRS | |
| #include <ifaddrs.h> | |
| #endif | |
| #include <mono/utils/networking.h> | |
| #include <mono/utils/mono-threads-coop.h> | |
| static void* | |
| get_address_from_sockaddr (struct sockaddr *sa) | |
| { | |
| switch (sa->sa_family) { | |
| case AF_INET: | |
| return &((struct sockaddr_in*)sa)->sin_addr; | |
| case AF_INET6: | |
| return &((struct sockaddr_in6*)sa)->sin6_addr; | |
| } | |
| return NULL; | |
| } |
This file contains hidden or 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
| /** | |
| * \file | |
| * Modern posix networking code | |
| * | |
| * Author: | |
| * Rodrigo Kumpera ([email protected]) | |
| * | |
| * (C) 2015 Xamarin | |
| */ | |
| #include <config.h> | |
| #include <glib.h> | |
| #ifdef HAVE_NETDB_H | |
| #include <netdb.h> | |
| #endif | |
| #ifdef HAVE_SYS_IOCTL_H | |
| #include <sys/ioctl.h> | |
| #endif | |
| #ifdef HAVE_NET_IF_H | |
| #include <net/if.h> | |
| #endif | |
| #ifdef HAVE_UNISTD_H | |
| #include <unistd.h> | |
| #endif | |
| #ifdef HAVE_GETIFADDRS | |
| #include <ifaddrs.h> | |
| #endif | |
| #include <mono/utils/networking.h> | |
| #include <mono/utils/mono-threads-coop.h> | |
| static void* | |
| get_address_from_sockaddr (struct sockaddr *sa) | |
| { | |
| switch (sa->sa_family) { | |
| case AF_INET: | |
| return &((struct sockaddr_in*)sa)->sin_addr; | |
| case AF_INET6: | |
| return &((struct sockaddr_in6*)sa)->sin6_addr; | |
| } | |
| return NULL; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment