aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/buffer.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2011-09-01 09:43:10 +0000
committerGuy Harris <guy@alum.mit.edu>2011-09-01 09:43:10 +0000
commite9fc1b72aabaae01cd6cad613dfc88168d8aed9a (patch)
treec1bdbe16d5579966f05db9cb334a115e011e08ff /wiretap/buffer.c
parent10a3cb6e0f30290ccce97c01d482f05d083915a6 (diff)
Use guint8 rather than guchar for raw octets and pointers to arrays of
same. Add to wiretap/pcap-common.c a routine to fill in the pseudo-header for ATM (by looking at the VPI, VCI, and packet data, and guessing) and Ethernet (setting the FCS length appropriately). Use it for both pcap and pcap-ng files. svn path=/trunk/; revision=38840
Diffstat (limited to 'wiretap/buffer.c')
-rw-r--r--wiretap/buffer.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/wiretap/buffer.c b/wiretap/buffer.c
index eae751cbd7..bd5a94e3a6 100644
--- a/wiretap/buffer.c
+++ b/wiretap/buffer.c
@@ -34,7 +34,7 @@
/* Initializes a buffer with a certain amount of allocated space */
void buffer_init(Buffer* buffer, gsize space)
{
- buffer->data = (guchar*)g_malloc(space);
+ buffer->data = (guint8*)g_malloc(space);
buffer->allocated = space;
buffer->start = 0;
buffer->first_free = 0;
@@ -84,10 +84,10 @@ void buffer_assure_space(Buffer* buffer, gsize space)
/* We'll allocate more space */
buffer->allocated += space + 1024;
- buffer->data = (guchar*)g_realloc(buffer->data, buffer->allocated);
+ buffer->data = (guint8*)g_realloc(buffer->data, buffer->allocated);
}
-void buffer_append(Buffer* buffer, guchar *from, gsize bytes)
+void buffer_append(Buffer* buffer, guint8 *from, gsize bytes)
{
buffer_assure_space(buffer, bytes);
memcpy(buffer->data + buffer->first_free, from, bytes);
@@ -133,14 +133,14 @@ gsize buffer_length(Buffer* buffer)
#endif
#ifndef SOME_FUNCTIONS_ARE_DEFINES
-guchar* buffer_start_ptr(Buffer* buffer)
+guint8* buffer_start_ptr(Buffer* buffer)
{
return buffer->data + buffer->start;
}
#endif
#ifndef SOME_FUNCTIONS_ARE_DEFINES
-guchar* buffer_end_ptr(Buffer* buffer)
+guint8* buffer_end_ptr(Buffer* buffer)
{
return buffer->data + buffer->first_free;
}