|
Monero
|
#include "config.h"#include <stdio.h>#include <string.h>#include <syslog.h>#include <unistd.h>#include <fcntl.h>#include <time.h>#include <sys/types.h>#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include <errno.h>#include "upnputils.h"#include "upnpglobalvars.h"
Functions | |
| int | sockaddr_to_string (const struct sockaddr *addr, char *str, size_t size) |
| int | set_non_blocking (int fd) |
| struct lan_addr_s * | get_lan_for_peer (const struct sockaddr *peer) |
| time_t | upnp_time (void) |
| time_t | upnp_get_uptime (void) |
| int | upnp_gettimeofday (struct timeval *tv) |
| struct lan_addr_s * get_lan_for_peer | ( | const struct sockaddr * | peer | ) |
get the LAN which the peer belongs to
| int set_non_blocking | ( | int | fd | ) |
set the file description as non blocking return 0 in case of failure, 1 in case of success
| int sockaddr_to_string | ( | const struct sockaddr * | addr, |
| char * | str, | ||
| size_t | size ) |
convert a struct sockaddr to a human readable string. [ipv6]:port or ipv4:port return the number of characters used (as snprintf)
| time_t upnp_get_uptime | ( | void | ) |
return either the machine or the daemon uptime
| int upnp_gettimeofday | ( | struct timeval * | tv | ) |
get the time for upnp Similar to a monotonic gettimeofday(tv, NULL)
| time_t upnp_time | ( | void | ) |
get the time for upnp (release expiration, etc.) Similar to a monotonic time(NULL)