diff options
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/poll.c | 82 | ||||
-rw-r--r-- | network_io/unix/sendrecv.c | 47 | ||||
-rw-r--r-- | network_io/unix/sockaddr.c | 72 | ||||
-rw-r--r-- | network_io/unix/sockets.c | 85 | ||||
-rw-r--r-- | network_io/unix/sockopt.c | 32 | ||||
-rw-r--r-- | network_io/win32/sockaddr.c | 70 |
6 files changed, 0 insertions, 388 deletions
diff --git a/network_io/unix/poll.c b/network_io/unix/poll.c index 270a841be..b0f67d608 100644 --- a/network_io/unix/poll.c +++ b/network_io/unix/poll.c @@ -56,14 +56,6 @@ #ifdef HAVE_POLL /* We can just use poll to do our socket polling. */ -/* ***APRDOC******************************************************** - * ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, - * ap_context_t *cont) - * Setup the memory required for poll to operate properly. - * arg 1) The poll structure to be used. - * arg 2) The number of socket descriptors to be polled. - * arg 3) The context to operate on. - */ ap_status_t ap_setup_poll(ap_pollfd_t **new, ap_int32_t num, ap_context_t *cont) { (*new) = (ap_pollfd_t *)ap_palloc(cont, sizeof(ap_pollfd_t)); @@ -119,17 +111,6 @@ ap_int16_t get_revent(ap_int16_t event) return rv; } -/* ***APRDOC******************************************************** - * ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, - * ap_int16_t event) - * Add a socket to the poll structure. - * arg 1) The poll structure we will be using. - * arg 2) The socket to add to the current poll structure. - * arg 3) The events to look for when we do the poll. One of: - * APR_POLLIN -- signal if read will not block - * APR_POLLPRI -- signal if prioirty data is availble to be read - * APR_POLLOUT -- signal if write will not block - */ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t event) { @@ -147,19 +128,6 @@ ap_status_t ap_add_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, - * ap_int32_t timeout) - * Poll the sockets in the poll structure. This is a blocking call, - * and it will not return until either a socket has been signalled, or - * the timeout has expired. - * arg 1) The poll structure we will be using. - * arg 2) The number of sockets we are polling. - * arg 3) The amount of time in seconds to wait. This is a maximum, not - * a minimum. If a socket is signalled, we will wake up before this - * time. A negative number means wait until a socket is signalled. - * NOTE: The number of sockets signalled is returned in the second argument. - */ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) { int i; @@ -191,21 +159,6 @@ ap_status_t ap_poll(ap_pollfd_t *aprset, ap_int32_t *nsds, ap_int32_t timeout) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_revents(ap_int_16_t *event, ap_socket_t *sock, - * ap_pollfd_t *aprset) - * Get the return events for the specified socket. - * arg 1) The returned events for the socket. One of: - * APR_POLLIN -- Data is available to be read - * APR_POLLPRI -- Prioirty data is availble to be read - * APR_POLLOUT -- Write will succeed - * APR_POLLERR -- An error occurred on the socket - * APR_POLLHUP -- The connection has been terminated - * APR_POLLNVAL -- This is an invalid socket to poll on. - * Socket not open. - * arg 2) The socket we wish to get information about. - * arg 3) The poll structure we will be using. - */ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *aprset) { int i = 0; @@ -220,17 +173,6 @@ ap_status_t ap_get_revents(ap_int16_t *event, ap_socket_t *sock, ap_pollfd_t *ap return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, - * ap_int16_t events) - * Add a socket to the poll structure. - * arg 1) The poll structure we will be using. - * arg 2) The socket to remove from the current poll structure. - * arg 3) The events to stop looking for during the poll. One of: - * APR_POLLIN -- signal if read will not block - * APR_POLLPRI -- signal if prioirty data is availble to be read - * APR_POLLOUT -- signal if write will not block - */ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, ap_socket_t *sock, ap_int16_t events) { @@ -251,15 +193,6 @@ ap_status_t ap_remove_poll_socket(ap_pollfd_t *aprset, return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) - * Remove all sockets from the poll structure. - * arg 1) The poll structure we will be using. - * arg 2) The events to clear from all sockets. One of: - * APR_POLLIN -- signal if read will not block - * APR_POLLPRI -- signal if prioirty data is availble to be read - * APR_POLLOUT -- signal if write will not block - */ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t events) { int i = 0; @@ -420,13 +353,6 @@ ap_status_t ap_clear_poll_sockets(ap_pollfd_t *aprset, ap_int16_t event) #endif -/* ***APRDOC******************************************************** - * ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) - * Return the context associated with the current poll. - * arg 1) The currently open pollfd. - * arg 2) The key to use for retreiving data associated with a poll struct. - * arg 3) The user data associated with the pollfd. - */ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) { if (pollfd != NULL) { @@ -438,14 +364,6 @@ ap_status_t ap_get_polldata(ap_pollfd_t *pollfd, char *key, void *data) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, - ap_status_t (*cleanup) (void *)) - * Return the context associated with the current poll. - * arg 1) The currently open pollfd. - * arg 2) The user data to associate with the pollfd. - - */ ap_status_t ap_set_polldata(ap_pollfd_t *pollfd, void *data, char *key, ap_status_t (*cleanup) (void *)) { diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c index c44dfa753..0b6b1241b 100644 --- a/network_io/unix/sendrecv.c +++ b/network_io/unix/sendrecv.c @@ -94,16 +94,6 @@ static ap_status_t wait_for_io_or_timeout(ap_socket_t *sock, int for_read) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) - * Send data over a network. - * arg 1) The socket to send the data over. - * arg 2) The buffer which contains the data to be sent. - * arg 3) The maximum number of bytes to send - * NOTE: This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - * The number of bytes actually sent is stored in argument 3. - */ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) { ssize_t rv; @@ -134,16 +124,6 @@ ap_status_t ap_send(ap_socket_t *sock, const char *buf, ap_ssize_t *len) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) - * Read data from a network. - * arg 1) The socket to read the data from. - * arg 2) The buffer to store the data in. - * arg 3) The maximum number of bytes to read - * NOTE: This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - * The number of bytes actually sent is stored in argument 3. - */ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) { ssize_t rv; @@ -174,18 +154,6 @@ ap_status_t ap_recv(ap_socket_t *sock, char *buf, ap_ssize_t *len) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_sendv(ap_socket_t *sock, const struct iovec *vec, - ap_int32_t nvec, ap_int32_t *len) - * Send multiple packets of data over a network. - * arg 1) The socket to send the data over. - * arg 2) The array of iovec structs containing the data to send - * arg 3) The number of iovec structs in the array - * arg 4) Receives the number of bytes actually written - * NOTE: This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - * The number of bytes actually sent is stored in argument 3. - */ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, ap_int32_t nvec, ap_int32_t *len) { @@ -218,21 +186,6 @@ ap_status_t ap_sendv(ap_socket_t * sock, const struct iovec *vec, } #if defined(HAVE_SENDFILE) -/* ***APRDOC******************************************************** - * ap_status_t ap_sendfile(ap_socket_t *sock, ap_file_t *file, ap_hdtr_t *hdtr, - * ap_off_t *offset, ap_size_t *len, ap_int32_t flags) - * Send a file from an open file descriptor to a socket, along with - * optional headers and trailers - * arg 1) The socket to which we're writing - * arg 2) The open file from which to read - * arg 3) A structure containing the headers and trailers to send - * arg 4) Offset into the file where we should begin writing - * arg 5) Number of bytes to send - * arg 6) OS-specific flags to pass to sendfile() - * NOTE: This functions acts like a blocking write by default. To change - * this behavior, use ap_setsocketopt with the APR_SO_TIMEOUT option. - * The number of bytes actually sent is stored in argument 5. - */ /* TODO: Verify that all platforms handle the fd the same way * (i.e. not moving current file pointer) diff --git a/network_io/unix/sockaddr.c b/network_io/unix/sockaddr.c index 909044617..a95fa8f03 100644 --- a/network_io/unix/sockaddr.c +++ b/network_io/unix/sockaddr.c @@ -54,15 +54,6 @@ #include "networkio.h" -/* ***APRDOC******************************************************** - * ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) - * Assocaite a local port with a socket. - * arg 1) The socket to set - * arg 2) The local port this socket will be dealing with. - * NOTE: This does not bind the two together, it is just telling apr - * that this socket is going to use this port if possible. If - * the port is already used, we won't find out about it here. - */ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) { sock->local_addr->sin_port = htons((short)port); @@ -71,14 +62,6 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -/* ***APRDOC******************************************************** - * ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) - * Assocaite a remote port with a socket. - * arg 1) The socket to enquire about. - * arg 2) The local port this socket will be dealing with. - * NOTE: This does not make a connection to the remote port, it is just - * telling apr which port ap_connect() should attempt to connect to. - */ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); @@ -87,12 +70,6 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) - * Return the local port with a socket. - * arg 1) The local port this socket is associated with. - * arg 2) The socket to enquire about. - */ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) { *port = ntohs(sock->local_addr->sin_port); @@ -101,12 +78,6 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) - * Return the remote port associated with a socket. - * arg 1) The remote port this socket is associated with. - * arg 2) The socket to enquire about. - */ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); @@ -115,15 +86,6 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -/* ***APRDOC******************************************************** - * ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, cont char *addr) - * Assocaite a local socket addr with an apr socket. - * arg 1) The socket to use - * arg 2) The IP address to attach to the socket. - * Use APR_ANYADDR to use any IP addr on the machine. - * NOTE: This does not bind the two together, it is just telling apr - * that this socket is going to use this address if possible. - */ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -145,14 +107,6 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) -/* ***APRDOC******************************************************** - * ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, cont char *addr) - * Assocaite a remote socket addr with an apr socket. - * arg 1) The socket to use - * arg 2) The IP address to attach to the socket. - * NOTE: This does not make a connection to the remote address, it is just - * telling apr which address ap_connect() should attempt to connect to. - */ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -174,12 +128,6 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) - * Return the local IP address associated with an apr socket. - * arg 1) The local IP address associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); @@ -188,12 +136,6 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) - * Return the remote IP address associated with an apr socket. - * arg 1) The remote IP address associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); @@ -203,13 +145,6 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) #if HAVE_NETINET_IN_H -/* ***APRDOC******************************************************** - * ap_status_t ap_get_local_name(struct sockaddr_in **name, - * const ap_socket_t *sock) - * Return the local socket name as a BSD style struct sockaddr_in. - * arg 1) The local name associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) { *name = sock->local_addr; @@ -218,13 +153,6 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_name(struct sockaddr_in **name, - * const ap_socket_t *sock) - * Return the remote socket name as a BSD style struct sockaddr_in. - * arg 1) The remote name associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) { *name = sock->remote_addr; diff --git a/network_io/unix/sockets.c b/network_io/unix/sockets.c index 51c59e446..685780b87 100644 --- a/network_io/unix/sockets.c +++ b/network_io/unix/sockets.c @@ -67,12 +67,6 @@ static ap_status_t socket_cleanup(void *sock) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont) - * Create a socket for tcp communication. - * arg 1) The new socket that has been setup. - * arg 2) The context to use - */ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont) { (*new) = (ap_socket_t *)ap_palloc(cont, sizeof(ap_socket_t)); @@ -106,17 +100,6 @@ ap_status_t ap_create_tcp_socket(ap_socket_t **new, ap_context_t *cont) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) - * Shutdown either reading, writing, or both sides of a tcp socket. - * arg 1) The socket to close - * arg 2) How to shutdown the socket. One of: - * APR_SHUTDOWN_READ -- no longer allow read requests - * APR_SHUTDOWN_WRITE -- no longer allow write requests - * APR_SHUTDOWN_READWRITE -- no longer allow read or write requests - * NOTE: This does not actually close the socket descriptor, it just - * controls which calls are still valid on the socket. - */ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) { if (shutdown(thesocket->socketdes, how) == 0) { @@ -127,24 +110,12 @@ ap_status_t ap_shutdown(ap_socket_t *thesocket, ap_shutdown_how_e how) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_close_socket(ap_socket_t *thesocket) - * Close a tcp socket. - * arg 1) The socket to close - */ ap_status_t ap_close_socket(ap_socket_t *thesocket) { ap_kill_cleanup(thesocket->cntxt, thesocket, socket_cleanup); return socket_cleanup(thesocket); } -/* ***APRDOC******************************************************** - * ap_status_t ap_bind(ap_socket_t *sock) - * Bind the socket to it's assocaited port - * arg 1) The socket to bind - * NOTE: This is where we will find out if there is any other process - * using the selected port. - */ ap_status_t ap_bind(ap_socket_t *sock) { if (bind(sock->socketdes, (struct sockaddr *)sock->local_addr, sock->addr_len) == -1) @@ -153,14 +124,6 @@ ap_status_t ap_bind(ap_socket_t *sock) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) - * Listen to a bound socketi for connections. - * arg 1) The socket to listen on - * arg 2) The number of outstanding connections allowed in the sockets - * listen queue. If this value is less than zero, the listen - * queue size is set to zero. - */ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) { if (listen(sock->socketdes, backlog) == -1) @@ -169,16 +132,6 @@ ap_status_t ap_listen(ap_socket_t *sock, ap_int32_t backlog) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_accept(ap_socket_t **new, ap_socket_t *sock, - ap_context_t *connection_context) - * Accept a new connection request - * arg 1) A copy of the socket that is connected to the socket that - * made the connection request. This is the socket which should - * be used for all future communication. - * arg 2) The socket we are listening on. - * arg 3) The context for the new socket. - */ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_context_t *connection_context) { (*new) = (ap_socket_t *)ap_palloc(connection_context, @@ -212,15 +165,6 @@ ap_status_t ap_accept(ap_socket_t **new, const ap_socket_t *sock, ap_context_t * return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_connect(ap_socket_t *sock, char *hostname) - * Issue a connection request to a socket either on the same machine - * or a different one. - * arg 1) The socket we wish to use for our side of the connection - * arg 2) The hostname of the machine we wish to connect to. If NULL, - * APR assumes that the sockaddr_in in the apr_socket is completely - * filled out. - */ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) { struct hostent *hp; @@ -254,12 +198,6 @@ ap_status_t ap_connect(ap_socket_t *sock, char *hostname) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) - * Return the context associated with the current socket. - * arg 1) The currently open socket. - * arg 2) The user data associated with the socket. - */ ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) { if (sock != NULL) { @@ -271,15 +209,6 @@ ap_status_t ap_get_socketdata(void **data, char *key, ap_socket_t *sock) } } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, - ap_status_t (*cleanup) (void *)) - * Set the context associated with the current socket. - * arg 1) The currently open socket. - * arg 2) The user data to associate with the socket. - * arg 3) The key to associate with the data. - * arg 4) The cleanup to call when the socket is destroyed. - */ ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, ap_status_t (*cleanup) (void *)) { @@ -292,12 +221,6 @@ ap_status_t ap_set_socketdata(ap_socket_t *sock, void *data, char *key, } } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) - * Convert the socket from an apr type to an OS specific socket - * arg 1) The socket to convert. - * arg 2) The os specifc equivelant of the apr socket.. - */ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) { if (sock == NULL) { @@ -307,14 +230,6 @@ ap_status_t ap_get_os_sock(ap_os_sock_t *thesock, ap_socket_t *sock) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_socket_t *thesock, - * ap_context_t *cont) - * Convert a socket from the os specific type to the apr type - * arg 1) The context to use. - * arg 2) The socket to convert to. - * arg 3) The socket we are converting to an apr type. - */ ap_status_t ap_put_os_sock(ap_socket_t **sock, ap_os_sock_t *thesock, ap_context_t *cont) { diff --git a/network_io/unix/sockopt.c b/network_io/unix/sockopt.c index ff73b5539..eb7a0d2af 100644 --- a/network_io/unix/sockopt.c +++ b/network_io/unix/sockopt.c @@ -96,24 +96,6 @@ static ap_status_t sononblock(int sd) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) - * Setup socket options for the specified socket - * arg 1) The socket to set up. - * arg 2) The option we would like to configure. One of: - * APR_SO_DEBUG -- turn on debugging information - * APR_SO_KEEPALIVE -- keep connections active - * APR_SO_LINGER -- lingers on close if data is present - * APR_SO_NONBLOCK -- Turns blocking on/off for socket - * APR_SO_REUSEADDR -- The rules used in validating addresses - * supplied to bind should allow reuse - * of local addresses. - * APR_SO_TIMEOUT -- Set the timeout value in seconds. - * values < 0 mean wait forever. 0 means - * don't wait at all. - * APR_SO_SNDBUF -- Set the SendBufferSize - * arg 3) Are we turning the option on or off. - */ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) { int one; @@ -171,14 +153,6 @@ ap_status_t ap_setsocketopt(ap_socket_t *sock, ap_int32_t opt, ap_int32_t on) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont) - * Get name of the current machine - * arg 1) A buffer to store the hostname in. - * arg 2) The maximum length of the hostname that can be stored in the - * buffer provided. - * arg 3) The context to use. - */ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont) { if (gethostname(buf, len) == -1) @@ -187,12 +161,6 @@ ap_status_t ap_gethostname(char *buf, ap_int32_t len, ap_context_t *cont) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) - * Get name of the machine we are currently connected to. - * arg 1) A buffer to store the hostname in. - * arg 2) The socket to examine. - */ ap_status_t ap_get_remote_hostname(char **name, ap_socket_t *sock) { struct hostent *hptr; diff --git a/network_io/win32/sockaddr.c b/network_io/win32/sockaddr.c index c75532c1a..7010539fb 100644 --- a/network_io/win32/sockaddr.c +++ b/network_io/win32/sockaddr.c @@ -59,15 +59,6 @@ #include <string.h> -/* ***APRDOC******************************************************** - * ap_status_t ap_set_local_port(ap_socket_t *socket, ap_uint32_t port) - * Assocaite a local port with a socket. - * arg 1) The socket to set - * arg 2) The local port this socket will be dealing with. - * NOTE: This does not bind the two together, it is just telling apr - * that this socket is going to use this port if possible. If - * the port is already used, we won't find out about it here. - */ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) { sock->local_addr->sin_port = htons((short)port); @@ -76,14 +67,6 @@ ap_status_t ap_set_local_port(ap_socket_t *sock, ap_uint32_t port) -/* ***APRDOC******************************************************** - * ap_status_t ap_set_remote_port(ap_socket_t *socket, ap_uint32_t port) - * Assocaite a remote port with a socket. - * arg 1) The socket to enquire about. - * arg 2) The local port this socket will be dealing with. - * NOTE: This does not make a connection to the remote port, it is just - * telling apr which port ap_connect() should attempt to connect to. - */ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) { sock->remote_addr->sin_port = htons((short)port); @@ -92,12 +75,6 @@ ap_status_t ap_set_remote_port(ap_socket_t *sock, ap_uint32_t port) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *socket) - * Return the local port with a socket. - * arg 1) The local port this socket is associated with. - * arg 2) The socket to enquire about. - */ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) { *port = ntohs(sock->local_addr->sin_port); @@ -106,12 +83,6 @@ ap_status_t ap_get_local_port(ap_uint32_t *port, ap_socket_t *sock) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *socket) - * Return the remote port associated with a socket. - * arg 1) The remote port this socket is associated with. - * arg 2) The socket to enquire about. - */ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) { *port = ntohs(sock->remote_addr->sin_port); @@ -120,15 +91,6 @@ ap_status_t ap_get_remote_port(ap_uint32_t *port, ap_socket_t *sock) -/* ***APRDOC******************************************************** - * ap_status_t ap_set_local_ipaddr(ap_socket_t *socket, cont char *addr) - * Assocaite a local socket addr with an apr socket. - * arg 1) The socket to use - * arg 2) The IP address to attach to the socket. - * Use APR_ANYADDR to use any IP addr on the machine. - * NOTE: This does not bind the two together, it is just telling apr - * that this socket is going to use this address if possible. - */ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -148,14 +110,6 @@ ap_status_t ap_set_local_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_set_remote_ipaddr(ap_socket_t *socket, cont char *addr) - * Assocaite a remote socket addr with an apr socket. - * arg 1) The socket to use - * arg 2) The IP address to attach to the socket. - * NOTE: This does not make a connection to the remote address, it is just - * telling apr which address ap_connect() should attempt to connect to. - */ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) { u_long ipaddr; @@ -175,12 +129,6 @@ ap_status_t ap_set_remote_ipaddr(ap_socket_t *sock, const char *addr) return APR_SUCCESS; } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *socket) - * Return the local IP address associated with an apr socket. - * arg 1) The local IP address associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->local_addr->sin_addr)); @@ -189,12 +137,6 @@ ap_status_t ap_get_local_ipaddr(char **addr, const ap_socket_t *sock) -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *socket) - * Return the remote IP address associated with an apr socket. - * arg 1) The remote IP address associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) { *addr = ap_pstrdup(sock->cntxt, inet_ntoa(sock->remote_addr->sin_addr)); @@ -202,12 +144,6 @@ ap_status_t ap_get_remote_ipaddr(char **addr, const ap_socket_t *sock) } -/* ***APRDOC******************************************************** - * ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *socket) - * Return the local socket name as a BSD style struct sockaddr_in. - * arg 1) The local name associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock) { *name = sock->local_addr; @@ -216,12 +152,6 @@ ap_status_t ap_get_local_name(struct sockaddr_in **name, const ap_socket_t *sock -/* ***APRDOC******************************************************** - * ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *socket) - * Return the remote socket name as a BSD style struct sockaddr_in. - * arg 1) The remote name associated with the socket. - * arg 2) The socket to use - */ ap_status_t ap_get_remote_name(struct sockaddr_in **name, const ap_socket_t *sock) { *name = sock->remote_addr; |