mirror of
https://github.com/nmap/nmap.git
synced 2026-01-18 20:29:02 +00:00
Add a forward declaration for shutdown_sockets.
This commit is contained in:
@@ -146,6 +146,7 @@ static int read_stdin(void);
|
||||
static int read_socket(int recv_fd);
|
||||
static void post_handle_connection(struct fdinfo sinfo);
|
||||
static void read_and_broadcast(int recv_socket);
|
||||
static void shutdown_sockets(int how);
|
||||
static int chat_announce_connect(int fd, const union sockaddr_u *su);
|
||||
static int chat_announce_disconnect(int fd);
|
||||
static char *chat_filter(char *buf, size_t size, int fd, int *nwritten);
|
||||
@@ -517,20 +518,6 @@ int read_stdin(void)
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
void shutdown_sockets(int how)
|
||||
{
|
||||
struct fdinfo *fdn;
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= broadcast_fdlist.fdmax; i++) {
|
||||
if (!FD_ISSET(i, &master_broadcastfds))
|
||||
continue;
|
||||
|
||||
fdn = get_fdinfo(&broadcast_fdlist, i);
|
||||
shutdown(fdn->fd, how);
|
||||
}
|
||||
}
|
||||
|
||||
/* Read from a client socket and write to stdout. Return the number of bytes
|
||||
read from the socket, or -1 on error. */
|
||||
int read_socket(int recv_fd)
|
||||
@@ -938,6 +925,20 @@ static void read_and_broadcast(int recv_fd)
|
||||
} while (pending);
|
||||
}
|
||||
|
||||
static void shutdown_sockets(int how)
|
||||
{
|
||||
struct fdinfo *fdn;
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= broadcast_fdlist.fdmax; i++) {
|
||||
if (!FD_ISSET(i, &master_broadcastfds))
|
||||
continue;
|
||||
|
||||
fdn = get_fdinfo(&broadcast_fdlist, i);
|
||||
shutdown(fdn->fd, how);
|
||||
}
|
||||
}
|
||||
|
||||
/* Announce the new connection and who is already connected. */
|
||||
static int chat_announce_connect(int fd, const union sockaddr_u *su)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user