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];
6
uv_interface_address_t
*
info
;
7
int
count
,
i
;
8
9
uv_interface_addresses
(&
info
, &
count
);
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
31
uv_free_interface_addresses
(
info
,
count
);
32
return
0;
33
}
i
lzma_index ** i
Definition:
index.h:629
info
RzBinInfo * info(RzBinFile *bf)
Definition:
bin_ne.c:86
printf
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
Definition:
cs_driver.c:93
count
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
buf
voidpf void * buf
Definition:
ioapi.h:138
main
int main(int argc, const char **argv)
Definition:
main.c:340
AF_INET
#define AF_INET
Definition:
sftypes.h:287
AF_INET6
#define AF_INET6
Definition:
sftypes.h:295
uv_interface_address_s
Definition:
uv.h:1096
uv.h
uv_free_interface_addresses
UV_EXTERN void uv_free_interface_addresses(uv_interface_address_t *addresses, int count)
Definition:
aix.c:1268
uv_interface_addresses
UV_EXTERN int uv_interface_addresses(uv_interface_address_t **addresses, int *count)
Definition:
aix.c:1100
uv_ip4_name
UV_EXTERN int uv_ip4_name(const struct sockaddr_in *src, char *dst, size_t size)
Definition:
uv-common.c:267
uv_ip6_name
UV_EXTERN int uv_ip6_name(const struct sockaddr_in6 *src, char *dst, size_t size)
Definition:
uv-common.c:272
subprojects
libuv-v1.40.0
docs
code
interfaces
main.c
Generated by
1.9.1