| | |
| | | #ifndef _GNU_SOURCE |
| | | #define _GNU_SOURCE /* To get defns of NI_MAXSERV and NI_MAXHOST */ |
| | | #endif |
| | | #include <arpa/inet.h> |
| | | #include <sys/socket.h> |
| | | #include <netdb.h> |
| | |
| | | #include <sys/ioctl.h> |
| | | #include <sys/stat.h> |
| | | #include "../os.h" |
| | | #include "../../base/public-key.h" |
| | | #include "public-key.h" |
| | | |
| | | #include <openssl/evp.h> |
| | | #include <openssl/bio.h> |
| | |
| | | |
| | | #include <dbus-1.0/dbus/dbus.h> |
| | | #include <sys/utsname.h> |
| | | |
| | | |
| | | static int ifname_position(char *ifnames, char * ifname, int ifnames_max) { |
| | | int i, position; |
| | |
| | | |
| | | } |
| | | |
| | | FUNCTION_RETURN getAdapterInfos(AdapterInfo * adapterInfos, |
| | | FUNCTION_RETURN getAdapterInfos(OsAdapterInfo * adapterInfos, |
| | | size_t * adapter_info_size) { |
| | | |
| | | FUNCTION_RETURN f_return = FUNC_RET_OK; |
| | |
| | | } |
| | | |
| | | if (adapterInfos != NULL) { |
| | | memset(adapterInfos, 0, (*adapter_info_size) * sizeof(AdapterInfo)); |
| | | memset(adapterInfos, 0, (*adapter_info_size) * sizeof(OsAdapterInfo)); |
| | | } |
| | | |
| | | /* count the maximum number of interfaces */ |
| | |
| | | sizeof(struct sockaddr_in) : |
| | | sizeof(struct sockaddr_in6), host, NI_MAXHOST, |
| | | NULL, 0, NI_NUMERICHOST); |
| | | */ |
| | | |
| | | #ifdef _DEBUG |
| | | s = getnameinfo(ifa->ifa_addr, sizeof(struct sockaddr_in), host, |
| | | NI_MAXHOST, |
| | |
| | | } |
| | | printf("\t\taddress: <%s>\n", host); |
| | | #endif |
| | | |
| | | */ |
| | | if (adapterInfos != NULL && if_name_position < *adapter_info_size) { |
| | | struct sockaddr_in *s1 = (struct sockaddr_in*) ifa->ifa_addr; |
| | | in_addr_t iaddr = s1->sin_addr.s_addr; |