Rizin
unix-like reverse engineering framework and cli tools
main.c
Go to the documentation of this file.
1 #include <stdio.h>
2 #include <uv.h>
3 
4 int main() {
5  char buf[512];
7  int count, i;
8 
10  i = count;
11 
12  printf("Number of interfaces: %d\n", count);
13  while (i--) {
14  uv_interface_address_t interface = info[i];
15 
16  printf("Name: %s\n", interface.name);
17  printf("Internal? %s\n", interface.is_internal ? "Yes" : "No");
18 
19  if (interface.address.address4.sin_family == AF_INET) {
20  uv_ip4_name(&interface.address.address4, buf, sizeof(buf));
21  printf("IPv4 address: %s\n", buf);
22  }
23  else if (interface.address.address4.sin_family == AF_INET6) {
24  uv_ip6_name(&interface.address.address6, buf, sizeof(buf));
25  printf("IPv6 address: %s\n", buf);
26  }
27 
28  printf("\n");
29  }
30 
32  return 0;
33 }
lzma_index ** i
Definition: index.h:629
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition: cs_driver.c:93
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
Definition: sflib.h:98
voidpf void * buf
Definition: ioapi.h:138
int main(int argc, const char **argv)
Definition: main.c:340
#define AF_INET
Definition: sftypes.h:287
#define AF_INET6
Definition: sftypes.h:295
UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t *addresses, int count)
Definition: aix.c:1268
UV_EXTERN int uv_interface_addresses(uv_interface_address_t **addresses, int *count)
Definition: aix.c:1100
UV_EXTERN int uv_ip4_name(const struct sockaddr_in *src, char *dst, size_t size)
Definition: uv-common.c:267
UV_EXTERN int uv_ip6_name(const struct sockaddr_in6 *src, char *dst, size_t size)
Definition: uv-common.c:272