summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-06-04 11:09:58 -0700
committerGuy Harris <guy@alum.mit.edu>2016-06-04 11:09:58 -0700
commit5eee24af45b82f1b0b1eb861e9bad612288840b9 (patch)
tree1f7784a05278136e5add6707d7fe755d259f2379
parent94cabd50c3010fa74f79296a4df561d52e68d800 (diff)
downloadlibpcap-5eee24af45b82f1b0b1eb861e9bad612288840b9.tar.gz
Update variable names and comments to reflect the previous change.
The last argument to pcap_oid_get_request() and pcap_oid_set_request() is a pointer to the length, not the length itself, so call it lenp rather than len. Update comments to speak of "*lenp" rather than "len" being the length.
-rw-r--r--pcap-tc.c8
-rw-r--r--pcap-win32.c24
-rw-r--r--pcap.c12
-rw-r--r--savefile.c4
4 files changed, 24 insertions, 24 deletions
diff --git a/pcap-tc.c b/pcap-tc.c
index 557a96e5..b7246943 100644
--- a/pcap-tc.c
+++ b/pcap-tc.c
@@ -133,8 +133,8 @@ static int TcSetBuff(pcap_t *p, int dim);
static int TcSetMode(pcap_t *p, int mode);
static int TcSetMinToCopy(pcap_t *p, int size);
static HANDLE TcGetReceiveWaitHandle(pcap_t *p);
-static int TcOidGetRequest(pcap_t *p, bpf_u_int32 oid, void *data, size_t *len);
-static int TcOidSetRequest(pcap_t *p, bpf_u_int32 oid, const void *data, size_t *len);
+static int TcOidGetRequest(pcap_t *p, bpf_u_int32 oid, void *data, size_t *lenp);
+static int TcOidSetRequest(pcap_t *p, bpf_u_int32 oid, const void *data, size_t *lenp);
static u_int TcSendqueueTransmit(pcap_t *p, pcap_send_queue *queue, int sync);
static int TcSetUserBuffer(pcap_t *p, int size);
static int TcLiveDump(pcap_t *p, char *filename, int maxsize, int maxpacks);
@@ -1228,7 +1228,7 @@ TcGetReceiveWaitHandle(pcap_t *p)
}
static int
-TcOidGetRequest(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_, size_t *len _U_)
+TcOidGetRequest(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_, size_t *lenp _U_)
{
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"An OID get request cannot be performed on a TurboCap device");
@@ -1237,7 +1237,7 @@ TcOidGetRequest(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_, size_t *len _U_)
static int
TcOidSetRequest(pcap_t *p, bpf_u_int32 oid _U_, const void *data _U_,
- size_t *len _U_)
+ size_t *lenp _U_)
{
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"An OID set request cannot be performed on a TurboCap device");
diff --git a/pcap-win32.c b/pcap-win32.c
index dd3cfcc0..ad62236b 100644
--- a/pcap-win32.c
+++ b/pcap-win32.c
@@ -254,19 +254,19 @@ pcap_getevent_win32(pcap_t *p)
}
static int
-pcap_oid_get_request_win32(pcap_t *p, bpf_u_int32 oid, void *data, size_t *len)
+pcap_oid_get_request_win32(pcap_t *p, bpf_u_int32 oid, void *data, size_t *lenp)
{
PACKET_OID_DATA *oid_data_arg;
char errbuf[PCAP_ERRBUF_SIZE+1];
/*
* Allocate a PACKET_OID_DATA structure to hand to PacketRequest().
- * It should be big enough to hold "len" bytes of data; it
+ * It should be big enough to hold "*lenp" bytes of data; it
* will actually be slightly larger, as PACKET_OID_DATA has a
* 1-byte data array at the end, standing in for the variable-length
* data that's actually there.
*/
- oid_data_arg = malloc(sizeof (PACKET_OID_DATA) + *len);
+ oid_data_arg = malloc(sizeof (PACKET_OID_DATA) + *lenp);
if (oid_data_arg == NULL) {
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"Couldn't allocate argument buffer for PacketRequest");
@@ -277,7 +277,7 @@ pcap_oid_get_request_win32(pcap_t *p, bpf_u_int32 oid, void *data, size_t *len)
* No need to copy the data - we're doing a fetch.
*/
oid_data_arg->Oid = oid;
- oid_data_arg->Length = (ULONG)(*len); /* XXX - check for ridiculously large value? */
+ oid_data_arg->Length = (ULONG)(*lenp); /* XXX - check for ridiculously large value? */
if (!PacketRequest(p->adapter, FALSE, oid_data_arg)) {
pcap_win32_err_to_str(GetLastError(), errbuf);
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
@@ -289,31 +289,31 @@ pcap_oid_get_request_win32(pcap_t *p, bpf_u_int32 oid, void *data, size_t *len)
/*
* Get the length actually supplied.
*/
- *len = oid_data_arg->Length;
+ *lenp = oid_data_arg->Length;
/*
* Copy back the data we fetched.
*/
- memcpy(data, oid_data_arg->Data, *len);
+ memcpy(data, oid_data_arg->Data, *lenp);
free(oid_data_arg);
return (0);
}
static int
pcap_oid_set_request_win32(pcap_t *p, bpf_u_int32 oid, const void *data,
- size_t *len)
+ size_t *lenp)
{
PACKET_OID_DATA *oid_data_arg;
char errbuf[PCAP_ERRBUF_SIZE+1];
/*
* Allocate a PACKET_OID_DATA structure to hand to PacketRequest().
- * It should be big enough to hold "len" bytes of data; it
+ * It should be big enough to hold "*lenp" bytes of data; it
* will actually be slightly larger, as PACKET_OID_DATA has a
* 1-byte data array at the end, standing in for the variable-length
* data that's actually there.
*/
- oid_data_arg = malloc(sizeof (PACKET_OID_DATA) + *len);
+ oid_data_arg = malloc(sizeof (PACKET_OID_DATA) + *lenp);
if (oid_data_arg == NULL) {
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"Couldn't allocate argument buffer for PacketRequest");
@@ -321,8 +321,8 @@ pcap_oid_set_request_win32(pcap_t *p, bpf_u_int32 oid, const void *data,
}
oid_data_arg->Oid = oid;
- oid_data_arg->Length = (ULONG)(*len); /* XXX - check for ridiculously large value? */
- memcpy(oid_data_arg->Data, data, *len);
+ oid_data_arg->Length = (ULONG)(*lenp); /* XXX - check for ridiculously large value? */
+ memcpy(oid_data_arg->Data, data, *lenp);
if (!PacketRequest(p->adapter, TRUE, oid_data_arg)) {
pcap_win32_err_to_str(GetLastError(), errbuf);
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
@@ -334,7 +334,7 @@ pcap_oid_set_request_win32(pcap_t *p, bpf_u_int32 oid, const void *data,
/*
* Get the length actually copied.
*/
- *len = oid_data_arg->Length;
+ *lenp = oid_data_arg->Length;
/*
* No need to copy the data - we're doing a set.
diff --git a/pcap.c b/pcap.c
index 3fabf4ad..1e9e54b1 100644
--- a/pcap.c
+++ b/pcap.c
@@ -1726,14 +1726,14 @@ pcap_getevent_dead(pcap_t *p)
}
int
-pcap_oid_get_request(pcap_t *p, bpf_u_int32 oid, void *data, size_t *len)
+pcap_oid_get_request(pcap_t *p, bpf_u_int32 oid, void *data, size_t *lenp)
{
- return (p->oid_get_request_op(p, oid, data, len));
+ return (p->oid_get_request_op(p, oid, data, lenp));
}
static int
pcap_oid_get_request_dead(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_,
- size_t *len _U_)
+ size_t *lenp _U_)
{
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"An OID get request cannot be performed on a pcap_open_dead pcap_t");
@@ -1741,14 +1741,14 @@ pcap_oid_get_request_dead(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_,
}
int
-pcap_oid_set_request(pcap_t *p, bpf_u_int32 oid, const void *data, size_t *len)
+pcap_oid_set_request(pcap_t *p, bpf_u_int32 oid, const void *data, size_t *lenp)
{
- return (p->oid_set_request_op(p, oid, data, len));
+ return (p->oid_set_request_op(p, oid, data, lenp));
}
static int
pcap_oid_set_request_dead(pcap_t *p, bpf_u_int32 oid _U_, const void *data _U_,
- size_t *len _U_)
+ size_t *lenp _U_)
{
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"An OID set request cannot be performed on a pcap_open_dead pcap_t");
diff --git a/savefile.c b/savefile.c
index 2d2c75a2..521f484b 100644
--- a/savefile.c
+++ b/savefile.c
@@ -169,7 +169,7 @@ sf_getevent(pcap_t *pcap)
static int
sf_oid_get_request(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_,
- size_t *len _U_)
+ size_t *lenp _U_)
{
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"An OID get request cannot be performed on a file");
@@ -178,7 +178,7 @@ sf_oid_get_request(pcap_t *p, bpf_u_int32 oid _U_, void *data _U_,
static int
sf_oid_set_request(pcap_t *p, bpf_u_int32 oid _U_, const void *data _U_,
- size_t *len _U_)
+ size_t *lenp _U_)
{
pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE,
"An OID set request cannot be performed on a file");