Freeciv-3.2
|
#include <freeciv_config.h>
#include "ioz.h"
#include "net_types.h"
#include "support.h"
#include "speclist.h"
Go to the source code of this file.
Data Structures | |
union | fc_sockaddr |
Typedefs | |
typedef int | socklen_t |
typedef struct timeval | fc_timeval |
Functions | |
int | fc_connect (int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) |
int | fc_select (int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, fc_timeval *timeout) |
int | fc_readsocket (int sock, void *buf, size_t size) |
int | fc_writesocket (int sock, const void *buf, size_t size) |
void | fc_closesocket (int sock) |
void | fc_nonblock (int sockfd) |
struct fc_sockaddr_list * | net_lookup_service (const char *name, int port, enum fc_addr_family family) |
bool | fc_inet_aton (const char *cp, struct in_addr *inp, bool addr_none_ok) |
fz_FILE * | fc_querysocket (int sock, void *buf, size_t size) |
int | find_next_free_port (int starting_port, int highest_port, enum fc_addr_family family, char *net_interface, bool not_avail_ok) |
void | sockaddr_debug (union fc_sockaddr *addr, enum log_level lvl) |
int | sockaddr_size (union fc_sockaddr *addr) |
bool | sockaddr_ipv6 (union fc_sockaddr *addr) |
#define FC_IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP |
#define fc_sockaddr_list_iterate | ( | sockaddrlist, | |
paddr | |||
) | TYPED_LIST_ITERATE(union fc_sockaddr, sockaddrlist, paddr) |
#define fc_sockaddr_list_iterate_end LIST_ITERATE_END |
#define SPECLIST_TAG fc_sockaddr |
#define SPECLIST_TYPE union fc_sockaddr |
Close a socket.
Definition at line 186 of file netintf.c.
Referenced by begin_lanserver_scan(), close_connections_and_socket(), connection_common_close(), fc_querysocket(), find_next_free_port(), send_lanserver_response(), server_accept_connection(), server_make_connection(), server_open_socket(), server_scan_finish(), and try_to_connect().
Connect a socket to an address
Definition at line 107 of file netintf.c.
Referenced by try_to_connect().
Convert internet IPv4 host address to binary form and store it to inp. Return FALSE on failure if possible, i.e., FALSE is guarantee that it failed but TRUE is not guarantee that it succeeded.
Definition at line 466 of file netintf.c.
Referenced by begin_lanserver_scan(), find_next_free_port(), net_lookup_service(), and server_open_socket().
Set socket to non-blocking.
Definition at line 227 of file netintf.c.
Referenced by begin_lanserver_scan(), server_make_connection(), and server_open_socket().
Read from a socket.
Definition at line 144 of file netintf.c.
Referenced by fc_querysocket(), and read_socket_data().
int fc_select | ( | int | n, |
fd_set * | readfds, | ||
fd_set * | writefds, | ||
fd_set * | exceptfds, | ||
fc_timeval * | timeout | ||
) |
Wait for a number of sockets to change status
Definition at line 125 of file netintf.c.
Referenced by fc_usleep(), flush_packets(), get_lanserver_announcement(), gui_event_loop(), gui_event_loop(), read_from_connection(), server_sniff_all_input(), and write_socket_data().
Write to a socket.
Definition at line 163 of file netintf.c.
Referenced by fc_querysocket(), and write_socket_data().
int find_next_free_port | ( | int | starting_port, |
int | highest_port, | ||
enum fc_addr_family | family, | ||
char * | net_interface, | ||
bool | not_avail_ok | ||
) |
Finds the next (lowest) free port.
Definition at line 560 of file netintf.c.
Referenced by client_start_server().
struct fc_sockaddr_list * net_lookup_service | ( | const char * | name, |
int | port, | ||
enum fc_addr_family | family | ||
) |
Look up the service at hostname:port.
Definition at line 411 of file netintf.c.
Referenced by get_server_address(), and server_open_socket().
void sockaddr_debug | ( | union fc_sockaddr * | addr, |
enum log_level | lvl | ||
) |
Write information about sockaddr to debug log.
Definition at line 269 of file netintf.c.
Referenced by server_open_socket().
bool sockaddr_ipv6 | ( | union fc_sockaddr * | addr | ) |
int sockaddr_size | ( | union fc_sockaddr * | addr | ) |
Gets size of address to fc_sockaddr. IPv6/IPv4 must be selected before calling this.
Definition at line 305 of file netintf.c.
Referenced by begin_lanserver_scan(), find_next_free_port(), send_lanserver_response(), server_open_socket(), and try_to_connect().