X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet.h;h=d2a60bcf685c858ef079f59b8d1b76305b609722;hb=fe1a9111456a73a6e690927e90d8bfa1e1d0ad22;hp=524a52e646946f586121bacfb13d2ecdd527c495;hpb=a42b1de9411a578f6af6fc0e9fe04b5781a0bd60;p=meshlink diff --git a/src/net.h b/src/net.h index 524a52e6..d2a60bcf 100644 --- a/src/net.h +++ b/src/net.h @@ -17,8 +17,8 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __TINC_NET_H__ -#define __TINC_NET_H__ +#ifndef __MESHLINK_NET_H__ +#define __MESHLINK_NET_H__ #include "event.h" #include "sockaddr.h" @@ -66,6 +66,7 @@ typedef struct outgoing_t { struct addrinfo *ai; struct addrinfo *aip; timeout_t ev; + struct meshlink_handle *mesh; } outgoing_t; extern int maxoutbufsize; @@ -75,40 +76,38 @@ extern unsigned replaywin; extern int keylifetime; extern int max_connection_burst; extern bool do_prune; -extern int autoconnect; /* Yes, very strange placement indeed, but otherwise the typedefs get all tangled up */ #include "connection.h" #include "node.h" -extern void retry_outgoing(outgoing_t *); +extern void retry_outgoing(struct meshlink_handle *mesh, outgoing_t *); extern void handle_incoming_vpn_data(struct event_loop_t *loop, void *, int); -extern void finish_connecting(struct connection_t *); -extern bool do_outgoing_connection(struct outgoing_t *); +extern void finish_connecting(struct meshlink_handle *mesh, struct connection_t *); +extern bool do_outgoing_connection(struct meshlink_handle *mesh, struct outgoing_t *); extern void handle_new_meta_connection(struct event_loop_t *loop, void *, int); extern int setup_listen_socket(const sockaddr_t *); -extern int setup_vpn_in_socket(const sockaddr_t *); -extern bool send_sptps_data(void *handle, uint8_t type, const char *data, size_t len); -extern bool receive_sptps_record(void *handle, uint8_t type, const char *data, uint16_t len); -extern void send_packet(struct node_t *, struct vpn_packet_t *); -extern void receive_tcppacket(struct connection_t *, const char *, int); -extern void broadcast_packet(const struct node_t *, struct vpn_packet_t *); +extern int setup_vpn_in_socket(struct meshlink_handle *mesh, const sockaddr_t *); +extern bool send_sptps_data(void *handle, uint8_t type, const void *data, size_t len); +extern bool receive_sptps_record(void *handle, uint8_t type, const void *data, uint16_t len); +extern void send_packet(struct meshlink_handle *mesh, struct node_t *, struct vpn_packet_t *); +extern void receive_tcppacket(struct meshlink_handle *mesh, struct connection_t *, const char *, int); +extern void broadcast_packet(struct meshlink_handle *mesh, const struct node_t *, struct vpn_packet_t *); extern char *get_name(struct meshlink_handle *mesh); +extern void load_all_nodes(struct meshlink_handle *mesh); extern bool setup_myself_reloadable(struct meshlink_handle *mesh); extern bool setup_network(struct meshlink_handle *mesh); -extern void setup_outgoing_connection(struct outgoing_t *); -extern void try_outgoing_connections(void); -extern void close_network_connections(void); -extern int main_loop(void); -extern void terminate_connection(struct connection_t *, bool); +extern void setup_outgoing_connection(struct meshlink_handle *mesh, struct outgoing_t *); +extern void try_outgoing_connections(struct meshlink_handle *mesh); +extern void close_network_connections(struct meshlink_handle *mesh); +extern int main_loop(struct meshlink_handle *mesh); +extern void terminate_connection(struct meshlink_handle *mesh, struct connection_t *, bool); extern bool node_read_ecdsa_public_key(struct meshlink_handle *mesh, struct node_t *); extern bool read_ecdsa_public_key(struct meshlink_handle *mesh, struct connection_t *); -extern void send_mtu_probe(struct node_t *); -extern void handle_meta_connection_data(struct connection_t *); -extern void regenerate_key(void); -extern void purge(void); -extern void retry(void); -extern int reload_configuration(void); +extern bool read_ecdsa_private_key(struct meshlink_handle *mesh); +extern void send_mtu_probe(struct meshlink_handle *mesh, struct node_t *); +extern void handle_meta_connection_data(struct meshlink_handle *mesh, struct connection_t *); +extern void retry(struct meshlink_handle *mesh); #ifndef HAVE_MINGW #define closesocket(s) close(s) @@ -116,4 +115,4 @@ extern int reload_configuration(void); extern CRITICAL_SECTION mutex; #endif -#endif /* __TINC_NET_H__ */ +#endif /* __MESHLINK_NET_H__ */