diff --git a/source/bungie_net/common/message_header.h b/source/bungie_net/common/message_header.h index d2bc6266..52fff013 100644 --- a/source/bungie_net/common/message_header.h +++ b/source/bungie_net/common/message_header.h @@ -38,6 +38,8 @@ enum message_type /* ---------- structures */ +typedef word message_header; + /* ---------- prototypes/MESSAGE_HEADER.C */ void build_message_header(word *msg, word length, byte type, byte flags); diff --git a/source/bungie_net/network/transport_endpoint_winsock.h b/source/bungie_net/network/transport_endpoint_winsock.h index c9ab055d..e5610c24 100644 --- a/source/bungie_net/network/transport_endpoint_winsock.h +++ b/source/bungie_net/network/transport_endpoint_winsock.h @@ -15,13 +15,76 @@ header included in hcex build. /* ---------- structures */ struct transport_endpoint; +struct transport_endpoint_set; +struct transport_address; /* ---------- prototypes/TRANSPORT_ENDPOINT_WINSOCK.C */ +struct transport_endpoint *create_transport_endpoint( + long type); +struct transport_endpoint_set *create_endpoint_set( + long maximum_endpoints); +long read_endpoint( + struct transport_endpoint *endpoint, + void *buffer, + long size); +long read_from_endpoint( + struct transport_endpoint *endpoint, + void *buffer, + long size, + struct transport_address *source_address); long write_endpoint( struct transport_endpoint *endpoint, void const *buffer, long size); +boolean endpoint_readable( + struct transport_endpoint *endpoint, + long timeout); +long endpoint_connected( + struct transport_endpoint const *endpoint); +short get_endpoint_address( + struct transport_endpoint *endpoint, + struct transport_address *address); +short connect_endpoint( + struct transport_endpoint *endpoint, + struct transport_address const *address); +short connect_endpoint_async( + struct transport_endpoint *endpoint, + struct transport_address const *address, + void *process_reference); +short set_endpoint_blocking( + struct transport_endpoint *endpoint, + boolean blocking); +short bind_endpoint( + struct transport_endpoint *endpoint, + struct transport_address *address); +short listen_endpoint( + struct transport_endpoint *endpoint); +struct transport_endpoint *accept_endpoint( + struct transport_endpoint *listening_endpoint); +short reject_endpoint( + struct transport_endpoint *listening_endpoint); +void disconnect_endpoint( + struct transport_endpoint *endpoint); +short poll_endpoint_set( + struct transport_endpoint_set *set, + long timeout); +void rewind_endpoint_set( + struct transport_endpoint_set *set); +struct transport_endpoint *get_next_endpoint_from_set( + struct transport_endpoint_set *set); +long count_endpoints_in_set( + struct transport_endpoint_set *set); +short add_endpoint_to_set( + struct transport_endpoint *endpoint, + struct transport_endpoint_set *set); +short remove_endpoint_from_set( + struct transport_endpoint *endpoint, + struct transport_endpoint_set *set); +void delete_endpoint_set( + struct transport_endpoint_set *set); +void delete_transport_endpoint( + struct transport_endpoint *endpoint); /* ---------- globals */ diff --git a/source/networking/network_connection.h b/source/networking/network_connection.h index 709aef81..47cde450 100644 --- a/source/networking/network_connection.h +++ b/source/networking/network_connection.h @@ -20,11 +20,37 @@ enum /* ---------- structures */ struct network_connection; +struct transport_address; -/* ---------- prototypes/EXAMPLE.C */ +/* ---------- prototypes/NETWORK_CONNECTION.C */ void network_connection_initialize( void); +long network_connection_connected( + struct network_connection *connection); +void network_connection_get_address( + struct network_connection *connection, + struct transport_address *reliable_address, + struct transport_address *unreliable_address); +boolean network_connection_connect( + struct network_connection *connection, + struct transport_address const *remote_address, + void *process_reference); +struct network_connection *network_connection_new( + unsigned long flags, + word well_known_port); +boolean network_connection_read( + struct network_connection *connection, + void *buffer, + word *buffer_size, + struct transport_address *source_address); +boolean network_connection_disconnect( + struct network_connection *connection); +boolean network_server_close_client_connection( + struct network_connection *server_connection, + struct network_connection *client_connection); +void network_connection_delete( + struct network_connection *connection); void network_connection_set_connection_rejection_procedure( struct network_connection *connection, void *connection_rejection_procedure); @@ -34,6 +60,9 @@ boolean network_connection_going_stale( struct network_connection *connection); void network_connection_keep_alive( struct network_connection *connection); +boolean network_connection_server_accept_client_connection( + struct network_connection *server_connection, + struct network_connection *client_connection); void network_server_allow_client_connections( struct network_connection *server_connection, boolean allow_client_connections);