Rizin
unix-like reverse engineering framework and cli tools
|
#include "uv/android-ifaddrs.h"
#include "uv-common.h"
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#include <netinet/in.h>
#include <linux/netlink.h>
#include <linux/rtnetlink.h>
#include <linux/if_packet.h>
Go to the source code of this file.
Classes | |
struct | NetlinkList |
Typedefs | |
typedef struct NetlinkList | NetlinkList |
Functions | |
static int | netlink_socket (pid_t *p_pid) |
static int | netlink_send (int p_socket, int p_request) |
static int | netlink_recv (int p_socket, void *p_buffer, size_t p_len) |
static struct nlmsghdr * | getNetlinkResponse (int p_socket, pid_t p_pid, int *p_size, int *p_done) |
static NetlinkList * | newListItem (struct nlmsghdr *p_data, unsigned int p_size) |
static void | freeResultList (NetlinkList *p_list) |
static NetlinkList * | getResultList (int p_socket, int p_request, pid_t p_pid) |
static size_t | maxSize (size_t a, size_t b) |
static size_t | calcAddrLen (sa_family_t p_family, int p_dataSize) |
static void | makeSockaddr (sa_family_t p_family, struct sockaddr *p_dest, void *p_data, size_t p_size) |
static void | addToEnd (struct ifaddrs **p_resultList, struct ifaddrs *p_entry) |
static int | interpretLink (struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList) |
static struct ifaddrs * | findInterface (int p_index, struct ifaddrs **p_links, int p_numLinks) |
static int | interpretAddr (struct nlmsghdr *p_hdr, struct ifaddrs **p_resultList, int p_numLinks) |
static int | interpretLinks (int p_socket, pid_t p_pid, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList) |
static int | interpretAddrs (int p_socket, pid_t p_pid, NetlinkList *p_netlinkList, struct ifaddrs **p_resultList, int p_numLinks) |
int | getifaddrs (struct ifaddrs **ifap) |
void | freeifaddrs (struct ifaddrs *ifa) |
typedef struct NetlinkList NetlinkList |
Definition at line 307 of file android-ifaddrs.c.
References ifaddrs::ifa_next.
Referenced by interpretAddr(), and interpretLink().
|
static |
Definition at line 271 of file android-ifaddrs.c.
References AF_INET, AF_INET6, AF_PACKET, maxSize(), and offsetof.
Referenced by interpretAddr(), and interpretLink().
|
static |
Definition at line 424 of file android-ifaddrs.c.
References ifaddrs::ifa_next, memcpy(), and NULL.
Referenced by interpretAddr().
void freeifaddrs | ( | struct ifaddrs * | ifa | ) |
Definition at line 704 of file android-ifaddrs.c.
References ifaddrs::ifa_next, and uv__free().
Referenced by uv_interface_addresses().
|
static |
Definition at line 207 of file android-ifaddrs.c.
References NetlinkList::m_data, NetlinkList::m_next, and uv__free().
Referenced by getifaddrs(), and getResultList().
Definition at line 655 of file android-ifaddrs.c.
References close, freeResultList(), getResultList(), interpretAddrs(), interpretLinks(), netlink_socket(), and NULL.
Referenced by uv_interface_addresses().
|
static |
Definition at line 141 of file android-ifaddrs.c.
References int, netlink_recv(), NULL, uv__free(), and uv__malloc().
Referenced by getResultList().
|
static |
Definition at line 219 of file android-ifaddrs.c.
References freeResultList(), getNetlinkResponse(), NetlinkList::m_next, netlink_send(), newListItem(), and NULL.
Referenced by getifaddrs().
|
static |
Definition at line 444 of file android-ifaddrs.c.
References addToEnd(), AF_INET, AF_INET6, AF_PACKET, calcAddrLen(), findInterface(), i, ifaddrs::ifa_addr, ifaddrs::ifa_dstaddr, ifaddrs::ifa_flags, ifaddrs::ifa_name, ifaddrs::ifa_netmask, makeSockaddr(), memset(), NULL, and uv__malloc().
Referenced by interpretAddrs().
|
static |
Definition at line 625 of file android-ifaddrs.c.
References int, interpretAddr(), NetlinkList::m_data, NetlinkList::m_next, and NetlinkList::m_size.
Referenced by getifaddrs().
Definition at line 324 of file android-ifaddrs.c.
References addToEnd(), AF_PACKET, calcAddrLen(), ifaddrs::ifa_addr, ifaddrs::ifa_data, ifaddrs::ifa_flags, ifaddrs::ifa_name, int, makeSockaddr(), memcpy(), memset(), NULL, and uv__malloc().
Referenced by interpretLinks().
|
static |
Definition at line 592 of file android-ifaddrs.c.
References int, interpretLink(), NetlinkList::m_data, NetlinkList::m_next, and NetlinkList::m_size.
Referenced by getifaddrs().
|
static |
Definition at line 286 of file android-ifaddrs.c.
References AF_INET, AF_INET6, AF_PACKET, memcpy(), and sockaddr_in6::sin6_addr.
Referenced by interpretAddr(), and interpretLink().
Definition at line 102 of file android-ifaddrs.c.
References EINTR, msghdr::msg_control, msghdr::msg_controllen, msghdr::msg_flags, msghdr::msg_iov, msghdr::msg_iovlen, msghdr::msg_name, msghdr::msg_namelen, and NULL.
Referenced by getNetlinkResponse().
Definition at line 77 of file android-ifaddrs.c.
References AF_NETLINK, AF_UNSPEC, memset(), and sendto.
Referenced by getResultList().
Definition at line 47 of file android-ifaddrs.c.
References AF_NETLINK, bind, close, memset(), PF_NETLINK, SOCK_RAW, and socket.
Referenced by getifaddrs().
|
static |
Definition at line 193 of file android-ifaddrs.c.
References NetlinkList::m_data, NetlinkList::m_next, NetlinkList::m_size, NULL, and uv__malloc().
Referenced by getResultList().