1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Refactor get_hostaddr_string to get_peeraddr_string.

All the information passed as arguments is present in an iod, and we
only call this with members of one iod. Change it to accept just an iod
as an argument.
This commit is contained in:
david
2012-11-12 20:44:49 +00:00
parent f5ac3e9f4e
commit 7b371609a3
5 changed files with 33 additions and 38 deletions

View File

@@ -57,6 +57,7 @@
#include "nsock.h"
#include "nsock_internal.h"
#include "netutils.h"
#include <nbase.h>
#include <stdarg.h>
@@ -113,7 +114,7 @@ nsock_event_id nsock_sendto(nsock_pool ms_pool, nsock_iod ms_iod, nsock_ev_handl
}
nsock_trace(nsp, "Sendto request for %d bytes to IOD #%li EID %li [%s]%s",
datalen, nsi->id, nse->id,
get_hostaddr_string(&nse->writeinfo.dest, nse->writeinfo.destlen, port),
get_peeraddr_string(nse->iod),
displaystr);
}
@@ -152,7 +153,7 @@ nsock_event_id nsock_write(nsock_pool ms_pool, nsock_iod ms_iod,
} else displaystr[0] = '\0';
if (nsi->peerlen > 0)
nsock_trace(nsp, "Write request for %d bytes to IOD #%li EID %li [%s]%s", datalen, nsi->id,
nse->id, get_hostaddr_string(&nsi->peer, nsi->peerlen, (unsigned short)nsi_peerport(nsi)),
nse->id, get_peeraddr_string(nsi),
displaystr);
else
nsock_trace(nsp, "Write request for %d bytes to IOD #%li EID %li (peer unspecified)%s", datalen,
@@ -226,7 +227,7 @@ nsock_event_id nsock_printf(nsock_pool ms_pool, nsock_iod ms_iod,
}
if (nsi->peerlen > 0)
nsock_trace(nsp, "Write request for %d bytes to IOD #%li EID %li [%s]%s", strlength, nsi->id,
nse->id, get_hostaddr_string(&nsi->peer, nsi->peerlen, (unsigned short)nsi_peerport(nsi)),
nse->id, get_peeraddr_string(nsi),
displaystr);
else
nsock_trace(nsp, "Write request for %d bytes to IOD #%li EID %li (peer unspecified)%s", strlength,